ifw-fcf 7.1.4
Loading...
Searching...
No Matches
matrkConfig.hpp
Go to the documentation of this file.
1
8#ifndef FCF_DEVMGR_DEVICE_MATRK_CONFIG_HPP
9#define FCF_DEVMGR_DEVICE_MATRK_CONFIG_HPP
10
11#include <string>
12#include <yaml-cpp/yaml.h>
13
14#include <ifw/core/utils/bat/logger.hpp>
19
20
22
23 constexpr auto LOGGER_NAME = "matrk";
24
25 // Constants for internal mapping
26 constexpr auto CI_AXES = "motors";
27 constexpr auto CI_FOCUS_SIGN = "focus_sign";
28 constexpr auto CI_DIR_SIGN = "dir_sign";
29 constexpr auto CI_STAT_REF = "off_ref";
30 constexpr auto CI_STAT_AUTO = "auto_ref";
31 constexpr auto CI_MODES = "modes";
32
33 constexpr auto CI_LATITUDE = "latitude";
34 constexpr auto CI_LONGITUDE = "longitude";
35 constexpr auto CI_TRK_PERIOD = "trk_period";
36 constexpr auto CI_TRK_THRESHOLD = "trk_threshold";
37
38 // Specific MAtrk RPC
39 constexpr auto RPC_MOVE_ANGLE = "rpcMoveAngle";
40 constexpr auto RPC_MOVE_USER = "rpcMoveUser";
41 constexpr auto RPC_START_TRACK = "rpcStartTrack";
42 constexpr auto RPC_STOP_TRACK = "rpcStopTrack";
43 constexpr auto RPC_TRACK_OFFSET = "rpcTrackOffset";
44
45
46 // Specific constant values for MAtrk device state/substate
47
48 constexpr int SUBSTATE_RESETTING = 109;
49 constexpr int SUBSTATE_ENABLING = 110;
50
51 constexpr int SUBSTATE_OP_TRACKING = 220;
52 constexpr int SUBSTATE_OP_PRESETTING = 221;
53
54 constexpr auto SUBSTATE_RESETTING_STR = "Resetting";
55 constexpr auto SUBSTATE_ENABLING_STR = "Enabling";
56 constexpr auto SUBSTATE_OP_TRACKING_STR = "Tracking";
57 constexpr auto SUBSTATE_OP_PRESETTING_STR = "Presetting";
58
59
60
77
78 constexpr short TRK_MODE_ENG = 0;
79 constexpr short TRK_MODE_OFF = 1;
80 constexpr short TRK_MODE_AUTO = 2;
81
82
83 constexpr auto TRK_MODE_ENG_STR = "eng";
84 constexpr auto TRK_MODE_OFF_STR = "off";
85 constexpr auto TRK_MODE_AUTO_STR = "auto";
86
87
88 const std::unordered_map<short, std::string> TRK_MODE_MAP = {
92 };
93
94 constexpr auto CI_STAT_TRACK_MODE = "track_mode";
95
104
105 public:
106
107
113 MAtrkConfig(const std::string filename,
114 const std::string name);
115
120 MAtrkConfig(const std::string name);
121
125 virtual ~MAtrkConfig() = default;
126
127 std::optional<short> GetModeIndex(const std::string& name) const;
128 std::optional<std::string> GetModeStr(const short& mode) const;
129 bool FindMode(const std::string& name) const;
130
131
132 private:
133 log4cplus::Logger m_logger;
134 };
135
136} //namespace
137
138#endif //FCF_DEVMGR_DEVICE_MATRK_CONFIG_H
adc Configuration class
Definition matrkConfig.hpp:103
MAtrkConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition matrkConfig.cpp:24
bool FindMode(const std::string &name) const
Definition matrkConfig.cpp:64
std::optional< short > GetModeIndex(const std::string &name) const
Definition matrkConfig.cpp:37
std::optional< std::string > GetModeStr(const short &mode) const
Definition matrkConfig.cpp:51
virtual ~MAtrkConfig()=default
DeviceConfig destructor.
adc Configuration class
Definition maxisConfig.hpp:71
constexpr int SUBSTATE_ERROR
Definition deviceConfig.hpp:97
constexpr int SUBSTATE_OP_DISABLING
Definition deviceConfig.hpp:104
constexpr auto SUBSTATE_INITIALISING_STR
Definition deviceConfig.hpp:100
constexpr int SUBSTATE_READY
Definition deviceConfig.hpp:95
constexpr auto SUBSTATE_ERROR_STR
Definition deviceConfig.hpp:102
constexpr int SUBSTATE_INITIALISING
Definition deviceConfig.hpp:96
constexpr auto SUBSTATE_NOTREADY_STR
Definition deviceConfig.hpp:99
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition deviceConfig.hpp:107
constexpr auto SUBSTATE_READY_STR
Definition deviceConfig.hpp:101
constexpr int SUBSTATE_OP_ERROR
Definition deviceConfig.hpp:105
constexpr int SUBSTATE_NOTREADY
Definition deviceConfig.hpp:94
constexpr auto SUBSTATE_OP_ERROR_STR
Definition deviceConfig.hpp:108
MAtrk class header file.
Definition matrk.hpp:18
constexpr int SUBSTATE_ENABLING
Definition matrkConfig.hpp:49
constexpr auto CI_AXES
Definition matrkConfig.hpp:26
constexpr auto RPC_MOVE_ANGLE
Definition matrkConfig.hpp:39
constexpr auto RPC_START_TRACK
Definition matrkConfig.hpp:41
constexpr auto SUBSTATE_OP_TRACKING_STR
Definition matrkConfig.hpp:56
constexpr auto CI_STAT_AUTO
Definition matrkConfig.hpp:30
constexpr auto SUBSTATE_ENABLING_STR
Definition matrkConfig.hpp:55
const std::unordered_map< short, std::string > SUBSTATE_MAP
Definition matrkConfig.hpp:61
constexpr auto LOGGER_NAME
Definition matrkConfig.hpp:23
constexpr auto TRK_MODE_AUTO_STR
Definition matrkConfig.hpp:85
constexpr short TRK_MODE_ENG
Definition matrkConfig.hpp:78
constexpr auto TRK_MODE_OFF_STR
Definition matrkConfig.hpp:84
constexpr int SUBSTATE_RESETTING
Definition matrkConfig.hpp:48
constexpr auto CI_FOCUS_SIGN
Definition matrkConfig.hpp:27
constexpr auto CI_TRK_THRESHOLD
Definition matrkConfig.hpp:36
constexpr auto SUBSTATE_OP_PRESETTING_STR
Definition matrkConfig.hpp:57
constexpr auto CI_STAT_TRACK_MODE
Definition matrkConfig.hpp:94
constexpr auto SUBSTATE_RESETTING_STR
Definition matrkConfig.hpp:54
constexpr short TRK_MODE_OFF
Definition matrkConfig.hpp:79
constexpr auto CI_MODES
Definition matrkConfig.hpp:31
constexpr auto RPC_TRACK_OFFSET
Definition matrkConfig.hpp:43
constexpr int SUBSTATE_OP_TRACKING
Definition matrkConfig.hpp:51
constexpr auto CI_TRK_PERIOD
Definition matrkConfig.hpp:35
constexpr auto CI_STAT_REF
Definition matrkConfig.hpp:29
constexpr auto RPC_STOP_TRACK
Definition matrkConfig.hpp:42
constexpr auto CI_LONGITUDE
Definition matrkConfig.hpp:34
const std::unordered_map< short, std::string > TRK_MODE_MAP
Definition matrkConfig.hpp:88
constexpr auto TRK_MODE_ENG_STR
Definition matrkConfig.hpp:83
constexpr short TRK_MODE_AUTO
Definition matrkConfig.hpp:80
constexpr auto CI_DIR_SIGN
Definition matrkConfig.hpp:28
constexpr int SUBSTATE_OP_PRESETTING
Definition matrkConfig.hpp:52
constexpr auto RPC_MOVE_USER
Definition matrkConfig.hpp:40
constexpr auto CI_LATITUDE
Definition matrkConfig.hpp:33
constexpr auto SUBSTATE_OP_STANDSTILL_STR
Definition motorBaseConfig.hpp:58
constexpr auto SUBSTATE_ABORTING_STR
Definition motorBaseConfig.hpp:57
constexpr int SUBSTATE_OP_STOPPING
Definition motorBaseConfig.hpp:54
constexpr auto SUBSTATE_OP_MOVING_STR
Definition motorBaseConfig.hpp:59
constexpr auto SUBSTATE_OP_STOPPING_STR
Definition motorBaseConfig.hpp:61
constexpr int SUBSTATE_OP_STANDSTILL
Definition motorBaseConfig.hpp:51
constexpr int SUBSTATE_ABORTING
Definition motorBaseConfig.hpp:50
constexpr int SUBSTATE_OP_MOVING
Definition motorBaseConfig.hpp:52