ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
drotConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_DROT_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_DROT_CONFIG_HPP
12 
13 #include <string>
14 #include <yaml-cpp/yaml.h>
15 #include "fcf/common/iComm.hpp"
16 
22 
23 namespace fcf {
24  namespace devmgr {
25  namespace drot {
26 
27  // Constants for internal mapping
28  // Specifics Drot status values
29  constexpr auto CI_FOCUS_SIGN = "focus_sign";
30  constexpr auto CI_DIR_SIGN = "dir_sign";
31  constexpr auto CI_STAT_REF = "stat_ref";
32  constexpr auto CI_STAT_SKY = "sky_ref";
33  constexpr auto CI_STAT_ELEV = "elev_ref";
34  constexpr auto CI_STAT_USER = "user_ref";
35  constexpr auto CI_USER_PAR1 = "user_par1";
36  constexpr auto CI_USER_PAR2 = "user_par2";
37  constexpr auto CI_USER_PAR3 = "user_par3";
38  constexpr auto CI_USER_PAR4 = "user_par4";
39  constexpr auto CI_LATITUDE = "latitude";
40  constexpr auto CI_LONGITUDE = "longitude";
41  constexpr auto CI_TRK_PERIOD = "trk_period";
42  constexpr auto CI_TRK_THRESHOLD = "trk_threshold";
43 
44 
45  // Specific Drot RPC
46  constexpr auto RPC_MOVE_ANGLE = "rpcMoveAngle";
47  constexpr auto RPC_START_TRACK = "rpcStartTrack";
48  constexpr auto RPC_STOP_TRACK = "rpcStopTrack";
49 
50 
51  // Specific constant values for Drot device state/substate
52  // The other state/substate values are the same as the motor device.
53  constexpr int SUBSTATE_RESETTING = 109;
54  constexpr int SUBSTATE_ENABLING = 110;
55 
56  constexpr int SUBSTATE_OP_TRACKING = 220;
57  constexpr int SUBSTATE_OP_PRESETTING = 221;
58 
59  constexpr auto SUBSTATE_RESETTING_STR = "Resetting";
60  constexpr auto SUBSTATE_ENABLING_STR = "Enabling";
61  constexpr auto SUBSTATE_OP_TRACKING_STR = "Tracking";
62  constexpr auto SUBSTATE_OP_PRESETTING_STR = "Presetting";
63 
64 
65 
66  const std::unordered_map<short, std::string> SubstateMap = {
81  };
82 
83  constexpr short TRK_MODE_ENG = 0;
84  constexpr short TRK_MODE_STAT = 1;
85  constexpr short TRK_MODE_SKY = 2;
86  constexpr short TRK_MODE_ELEV = 3;
87  constexpr short TRK_MODE_USER = 4;
88 
89  constexpr auto TRK_MODE_ENG_STR = "eng";
90  constexpr auto TRK_MODE_STAT_STR = "stat";
91  constexpr auto TRK_MODE_SKY_STR = "sky";
92  constexpr auto TRK_MODE_ELEV_STR = "elev";
93  constexpr auto TRK_MODE_USER_STR = "user";
94 
95  const std::unordered_map<short, std::string> TrkModeMap = {
101  };
102 
103  constexpr auto CI_STAT_TRACK_MODE = "track_mode";
104  constexpr auto CI_STAT_ALPHA = "alpha";
105  constexpr auto CI_STAT_DELTA = "delta";
106  constexpr auto CI_STAT_ANGLE_ON_SKY = "angle_on_sky";
107 
108  const std::vector<std::string> cfgMapping = {
109  };
110 
111  const std::vector<std::string> statMapping = {
124  };
125 
126  const std::vector<std::string> rpcMapping = {
135  };
136 
145  {
146 
147  // Enumerations of configuration paramters:
148  // C++ doesn not allow inheritance of enums so we are using the last
149  // enum of the parent class to continue with the enumerations and thus
150  // avoid the collission.
151  enum {
153  CFG_DIRSIGN,
154  CFG_STATREF,
155  CFG_SKYREF,
156  CFG_ELEVREF,
157  CFG_USERREF,
158  CFG_USERPAR1,
159  CFG_USERPAR2,
160  CFG_USERPAR3,
161  CFG_USERPAR4,
162  CFG_LATITUDE,
163  CFG_LONGITUDE,
164  CFG_TRK_PERIOD,
165  CFG_TRK_THRESHOLD,
166  END_ENUM_DROT // WARNING: This should be always last enumerator.
167  };
168 
169 
170  public:
171 
177  DrotConfig(const std::string filename,
178  const std::string name);
179 
183  virtual ~DrotConfig();
184 
185 
186  protected:
187 
188  };
189  }
190  }
191 }
192 
193 #endif //FCF_DEVMGR_DEVICE_DROT_CONFIG_H
constexpr auto SUBSTATE_OP_TRACKING_STR
Definition: drotConfig.hpp:61
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
constexpr auto TRK_MODE_STAT_STR
Definition: drotConfig.hpp:90
constexpr auto CI_STAT_ALPHA
Definition: drotConfig.hpp:104
constexpr auto SUBSTATE_OP_PRESETTING_STR
Definition: drotConfig.hpp:62
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
constexpr auto CI_STAT_TRACK_MODE
Definition: drotConfig.hpp:103
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
constexpr auto CI_TRK_THRESHOLD
Definition: drotConfig.hpp:42
constexpr auto SUBSTATE_OP_STOPPING_STR
Definition: motorConfig.hpp:125
constexpr auto CI_USER_PAR1
Definition: drotConfig.hpp:35
constexpr auto CI_USER_PAR3
Definition: drotConfig.hpp:37
constexpr auto CI_STAT_USER
Definition: drotConfig.hpp:34
DrotConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: drotConfig.cpp:25
const std::vector< std::string > statMapping
Definition: drotConfig.hpp:111
constexpr auto CI_STAT_TARGET_POS
Definition: motorConfig.hpp:145
DrotRpcErrors header file.
constexpr auto TRK_MODE_ENG_STR
Definition: drotConfig.hpp:89
constexpr auto CI_USER_PAR4
Definition: drotConfig.hpp:38
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: deviceConfig.hpp:95
constexpr int SUBSTATE_OP_STANDSTILL
Definition: motorConfig.hpp:115
const std::vector< std::string > cfgMapping
Definition: drotConfig.hpp:108
constexpr auto CI_STAT_SCALE_FACTOR
Definition: motorConfig.hpp:150
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
constexpr auto RPC_MOVE_ANGLE
Definition: drotConfig.hpp:46
constexpr int SUBSTATE_OP_DISABLING
Definition: deviceConfig.hpp:92
constexpr short TRK_MODE_ENG
Definition: drotConfig.hpp:83
constexpr int SUBSTATE_OP_STOPPING
Definition: motorConfig.hpp:118
constexpr auto TRK_MODE_USER_STR
Definition: drotConfig.hpp:93
constexpr int SUBSTATE_OP_MOVING
Definition: motorConfig.hpp:116
constexpr auto RPC_START_TRACK
Definition: drotConfig.hpp:47
constexpr short TRK_MODE_STAT
Definition: drotConfig.hpp:84
constexpr auto CI_STAT_REF
Definition: drotConfig.hpp:31
constexpr auto CI_DIR_SIGN
Definition: drotConfig.hpp:30
const std::unordered_map< short, std::string > SubstateMap
Definition: drotConfig.hpp:66
constexpr int SUBSTATE_OP_PRESETTING
Definition: drotConfig.hpp:57
constexpr auto RPC_STOP_TRACK
Definition: drotConfig.hpp:48
constexpr auto SUBSTATE_RESETTING_STR
Definition: drotConfig.hpp:59
constexpr auto CI_TRK_PERIOD
Definition: drotConfig.hpp:41
drot Configuration class
Definition: drotConfig.hpp:144
constexpr auto CI_STAT_ANGLE_ON_SKY
Definition: drotConfig.hpp:106
configSet class header file.
const std::unordered_map< short, std::string > TrkModeMap
Definition: drotConfig.hpp:95
constexpr int SUBSTATE_ABORTING
Definition: motorConfig.hpp:114
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
constexpr int SUBSTATE_RESETTING
Definition: drotConfig.hpp:53
constexpr auto CI_STAT_SKY
Definition: drotConfig.hpp:32
constexpr auto CI_FOCUS_SIGN
Definition: drotConfig.hpp:29
Motor Configuration class.
Definition: motorConfig.hpp:314
constexpr auto CI_STAT_ELEV
Definition: drotConfig.hpp:33
constexpr auto TRK_MODE_SKY_STR
Definition: drotConfig.hpp:91
constexpr auto CI_STAT_ACTUAL_VEL
Definition: motorConfig.hpp:148
constexpr auto SUBSTATE_OP_MOVING_STR
Definition: motorConfig.hpp:123
DataContext class header file.
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
constexpr auto CI_STAT_ACTUAL_POS
Definition: motorConfig.hpp:146
constexpr auto CI_USER_PAR2
Definition: drotConfig.hpp:36
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
constexpr auto SUBSTATE_ENABLING_STR
Definition: drotConfig.hpp:60
constexpr short TRK_MODE_SKY
Definition: drotConfig.hpp:85
constexpr auto SUBSTATE_READY_STR
Definition: deviceConfig.hpp:89
constexpr auto CI_LATITUDE
Definition: drotConfig.hpp:39
constexpr int SUBSTATE_ENABLING
Definition: drotConfig.hpp:54
constexpr auto SUBSTATE_OP_STANDSTILL_STR
Definition: motorConfig.hpp:122
const std::vector< std::string > rpcMapping
Definition: drotConfig.hpp:126
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
constexpr short TRK_MODE_USER
Definition: drotConfig.hpp:87
constexpr short TRK_MODE_ELEV
Definition: drotConfig.hpp:86
virtual ~DrotConfig()
DeviceConfig destructor.
Definition: drotConfig.cpp:62
constexpr int SUBSTATE_OP_TRACKING
Definition: drotConfig.hpp:56
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
constexpr auto CI_STAT_DELTA
Definition: drotConfig.hpp:105
MotorConfig class header file.
constexpr auto TRK_MODE_ELEV_STR
Definition: drotConfig.hpp:92
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
DrotHwErrors header file.
constexpr auto SUBSTATE_ABORTING_STR
Definition: motorConfig.hpp:121
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
constexpr auto CI_LONGITUDE
Definition: drotConfig.hpp:40
constexpr int SUBSTATE_READY
Definition: deviceConfig.hpp:83