ifw-fcf  3.0.0
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 
184  DrotConfig(const std::string name);
185 
189  virtual ~DrotConfig();
190 
194  void InitConfig();
195 
196  protected:
197 
198  };
199  }
200  }
201 }
202 
203 #endif //FCF_DEVMGR_DEVICE_DROT_CONFIG_H
fcf::devmgr::motor::SUBSTATE_OP_MOVING_STR
constexpr auto SUBSTATE_OP_MOVING_STR
Definition: motorConfig.hpp:123
fcf::devmgr::drot::CI_LONGITUDE
constexpr auto CI_LONGITUDE
Definition: drotConfig.hpp:40
fcf::devmgr::drot::CI_STAT_ALPHA
constexpr auto CI_STAT_ALPHA
Definition: drotConfig.hpp:104
dataContext.hpp
DataContext class header file.
fcf::devmgr::drot::TRK_MODE_SKY_STR
constexpr auto TRK_MODE_SKY_STR
Definition: drotConfig.hpp:91
fcf::devmgr::drot::CI_TRK_THRESHOLD
constexpr auto CI_TRK_THRESHOLD
Definition: drotConfig.hpp:42
fcf::devmgr::drot::RPC_MOVE_ANGLE
constexpr auto RPC_MOVE_ANGLE
Definition: drotConfig.hpp:46
fcf::devmgr::drot::CI_STAT_SKY
constexpr auto CI_STAT_SKY
Definition: drotConfig.hpp:32
fcf::devmgr::drot::SUBSTATE_RESETTING
constexpr int SUBSTATE_RESETTING
Definition: drotConfig.hpp:53
fcf::devmgr::drot::CI_STAT_REF
constexpr auto CI_STAT_REF
Definition: drotConfig.hpp:31
fcf::devmgr::common::CI_STAT_ERROR_CODE
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
fcf::devmgr::drot::CI_DIR_SIGN
constexpr auto CI_DIR_SIGN
Definition: drotConfig.hpp:30
fcf::devmgr::drot::DrotConfig::DrotConfig
DrotConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: drotConfig.cpp:25
fcf::devmgr::drot::TRK_MODE_ELEV
constexpr short TRK_MODE_ELEV
Definition: drotConfig.hpp:86
fcf::devmgr::common::SUBSTATE_OP_DISABLING_STR
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: deviceConfig.hpp:95
drotRpcErrors.hpp
DrotRpcErrors header file.
fcf::devmgr::drot::TRK_MODE_STAT_STR
constexpr auto TRK_MODE_STAT_STR
Definition: drotConfig.hpp:90
fcf::devmgr::drot::CI_USER_PAR2
constexpr auto CI_USER_PAR2
Definition: drotConfig.hpp:36
fcf::devmgr::motor::SUBSTATE_OP_MOVING
constexpr int SUBSTATE_OP_MOVING
Definition: motorConfig.hpp:116
fcf::devmgr::drot::CI_USER_PAR3
constexpr auto CI_USER_PAR3
Definition: drotConfig.hpp:37
fcf::devmgr::common::CI_STAT_STATE
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
fcf::devmgr::common::CI_STAT_LOCAL
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
fcf::devmgr::drot::CI_STAT_USER
constexpr auto CI_STAT_USER
Definition: drotConfig.hpp:34
fcf::devmgr::motor::CI_STAT_TARGET_POS
constexpr auto CI_STAT_TARGET_POS
Definition: motorConfig.hpp:145
fcf::devmgr::drot::rpcMapping
const std::vector< std::string > rpcMapping
Definition: drotConfig.hpp:126
fcf::devmgr::motor::SUBSTATE_ABORTING
constexpr int SUBSTATE_ABORTING
Definition: motorConfig.hpp:114
fcf::devmgr::drot::TRK_MODE_USER_STR
constexpr auto TRK_MODE_USER_STR
Definition: drotConfig.hpp:93
fcf::devmgr::drot::RPC_START_TRACK
constexpr auto RPC_START_TRACK
Definition: drotConfig.hpp:47
fcf::devmgr::drot::CI_USER_PAR4
constexpr auto CI_USER_PAR4
Definition: drotConfig.hpp:38
fcf::devmgr::motor::CI_STAT_SCALE_FACTOR
constexpr auto CI_STAT_SCALE_FACTOR
Definition: motorConfig.hpp:150
fcf::devmgr::drot::SUBSTATE_RESETTING_STR
constexpr auto SUBSTATE_RESETTING_STR
Definition: drotConfig.hpp:59
fcf::devmgr::common::RPC_STOP
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
fcf::devmgr::motor::SUBSTATE_OP_STANDSTILL_STR
constexpr auto SUBSTATE_OP_STANDSTILL_STR
Definition: motorConfig.hpp:122
fcf::devmgr::drot::TRK_MODE_USER
constexpr short TRK_MODE_USER
Definition: drotConfig.hpp:87
fcf::devmgr::common::RPC_DISABLE
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
fcf::devmgr::drot::CI_TRK_PERIOD
constexpr auto CI_TRK_PERIOD
Definition: drotConfig.hpp:41
fcf::devmgr::drot::SUBSTATE_OP_PRESETTING
constexpr int SUBSTATE_OP_PRESETTING
Definition: drotConfig.hpp:57
fcf::devmgr::drot::SUBSTATE_ENABLING_STR
constexpr auto SUBSTATE_ENABLING_STR
Definition: drotConfig.hpp:60
fcf::devmgr::drot::CI_LATITUDE
constexpr auto CI_LATITUDE
Definition: drotConfig.hpp:39
fcf::devmgr::common::SUBSTATE_OP_DISABLING
constexpr int SUBSTATE_OP_DISABLING
Definition: deviceConfig.hpp:92
fcf::devmgr::drot::TrkModeMap
const std::unordered_map< short, std::string > TrkModeMap
Definition: drotConfig.hpp:95
fcf::devmgr::common::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
fcf
Definition: actionMgr.cpp:29
configSet.hpp
configSet class header file.
fcf::devmgr::common::SUBSTATE_INITIALISING_STR
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
fcf::devmgr::drot::SUBSTATE_ENABLING
constexpr int SUBSTATE_ENABLING
Definition: drotConfig.hpp:54
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
fcf::devmgr::drot::TRK_MODE_ENG_STR
constexpr auto TRK_MODE_ENG_STR
Definition: drotConfig.hpp:89
fcf::devmgr::motor::CI_STAT_ACTUAL_POS
constexpr auto CI_STAT_ACTUAL_POS
Definition: motorConfig.hpp:146
fcf::devmgr::motor::CI_STAT_ACTUAL_VEL
constexpr auto CI_STAT_ACTUAL_VEL
Definition: motorConfig.hpp:148
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
fcf::devmgr::drot::SUBSTATE_OP_PRESETTING_STR
constexpr auto SUBSTATE_OP_PRESETTING_STR
Definition: drotConfig.hpp:62
fcf::devmgr::drot::CI_FOCUS_SIGN
constexpr auto CI_FOCUS_SIGN
Definition: drotConfig.hpp:29
fcf::devmgr::drot::CI_STAT_ELEV
constexpr auto CI_STAT_ELEV
Definition: drotConfig.hpp:33
fcf::devmgr::common::RPC_ENABLE
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
fcf::devmgr::drot::CI_STAT_ANGLE_ON_SKY
constexpr auto CI_STAT_ANGLE_ON_SKY
Definition: drotConfig.hpp:106
fcf::devmgr::common::SUBSTATE_OP_ERROR
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
fcf::devmgr::drot::DrotConfig::InitConfig
void InitConfig()
Define configuration parameters for drot device.
Definition: drotConfig.cpp:46
fcf::devmgr::drot::RPC_STOP_TRACK
constexpr auto RPC_STOP_TRACK
Definition: drotConfig.hpp:48
fcf::devmgr::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
fcf::devmgr::drot::CI_STAT_TRACK_MODE
constexpr auto CI_STAT_TRACK_MODE
Definition: drotConfig.hpp:103
fcf::devmgr::drot::CI_USER_PAR1
constexpr auto CI_USER_PAR1
Definition: drotConfig.hpp:35
fcf::devmgr::drot::TRK_MODE_ELEV_STR
constexpr auto TRK_MODE_ELEV_STR
Definition: drotConfig.hpp:92
fcf::devmgr::motor::MotorConfig::END_ENUM_MOTOR
@ END_ENUM_MOTOR
Definition: motorConfig.hpp:346
fcf::devmgr::drot::CI_STAT_DELTA
constexpr auto CI_STAT_DELTA
Definition: drotConfig.hpp:105
fcf::devmgr::common::CI_STAT_SUBSTATE
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
fcf::devmgr::common::SUBSTATE_ERROR
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
fcf::devmgr::drot::TRK_MODE_SKY
constexpr short TRK_MODE_SKY
Definition: drotConfig.hpp:85
fcf::devmgr::drot::statMapping
const std::vector< std::string > statMapping
Definition: drotConfig.hpp:111
fcf::devmgr::common::RPC_INIT
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
fcf::devmgr::motor::SUBSTATE_ABORTING_STR
constexpr auto SUBSTATE_ABORTING_STR
Definition: motorConfig.hpp:121
fcf::devmgr::motor::MotorConfig
Motor Configuration class.
Definition: motorConfig.hpp:315
fcf::devmgr::drot::cfgMapping
const std::vector< std::string > cfgMapping
Definition: drotConfig.hpp:108
fcf::devmgr::common::SUBSTATE_READY_STR
constexpr auto SUBSTATE_READY_STR
Definition: deviceConfig.hpp:89
fcf::devmgr::common::SUBSTATE_READY
constexpr int SUBSTATE_READY
Definition: deviceConfig.hpp:83
fcf::devmgr::drot::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: drotConfig.hpp:66
drotHwErrors.hpp
DrotHwErrors header file.
fcf::devmgr::drot::SUBSTATE_OP_TRACKING
constexpr int SUBSTATE_OP_TRACKING
Definition: drotConfig.hpp:56
fcf::devmgr::drot::DrotConfig::~DrotConfig
virtual ~DrotConfig()
DeviceConfig destructor.
Definition: drotConfig.cpp:41
fcf::devmgr::motor::SUBSTATE_OP_STOPPING
constexpr int SUBSTATE_OP_STOPPING
Definition: motorConfig.hpp:118
fcf::devmgr::motor::SUBSTATE_OP_STOPPING_STR
constexpr auto SUBSTATE_OP_STOPPING_STR
Definition: motorConfig.hpp:125
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
motorConfig.hpp
MotorConfig class header file.
fcf::devmgr::drot::TRK_MODE_ENG
constexpr short TRK_MODE_ENG
Definition: drotConfig.hpp:83
fcf::devmgr::drot::DrotConfig
drot Configuration class
Definition: drotConfig.hpp:145
fcf::devmgr::motor::SUBSTATE_OP_STANDSTILL
constexpr int SUBSTATE_OP_STANDSTILL
Definition: motorConfig.hpp:115
fcf::devmgr::drot::SUBSTATE_OP_TRACKING_STR
constexpr auto SUBSTATE_OP_TRACKING_STR
Definition: drotConfig.hpp:61
fcf::devmgr::drot::TRK_MODE_STAT
constexpr short TRK_MODE_STAT
Definition: drotConfig.hpp:84
fcf::devmgr::common::RPC_RESET
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47