ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
drotLcsIf.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_DROT_IF_HPP
11 #define FCF_DEVMGR_DEVICE_DROT_IF_HPP
12 
13 #include <unordered_map>
14 
15 #include <yaml-cpp/yaml.h>
19 
20 namespace fcf::devmgr::drot {
21 
30  public:
32  virtual ~DrotControllerData();
33 
34 
35  void SetData(const DrotControllerData& data);
36 
37  inline virtual std::string GetErrorText() const;
38  inline virtual std::string GetSubstateStr() const;
39 
40  inline short GetTrackingMode() const;
41  inline void SetTrackingMode(short mode);
42 
43  inline double GetAlpha() const;
44  inline void SetAlpha(double alpha);
45 
46  inline double GetDelta() const;
47  inline void SetDelta(double delta);
48 
49  inline double GetAngleOnSky() const;
50  inline void SetAngleOnSky(double angle);
51 
52  protected:
54  double m_alpha;
55  double m_delta;
57  };
58 
59 
60 
74  template<typename TOPIC_TYPE>
75  class DrotLcsIf : public fcf::devmgr::motor::MotorLcsIf<TOPIC_TYPE> {
76 
77  // enumerations for Drot status
78  enum {
79  STAT_LOCAL = 100,
80  STAT_ERROR = 101,
81  STAT_STATE = 102,
82  STAT_SUBSTATE = 103,
83  STAT_TRACK_MODE = 104,
84  STAT_ALPHA = 105,
85  STAT_DELTA = 106,
86  STAT_ANGLE_ON_SKY = 107
87  };
88 
89  public:
97  DrotLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
99  bool initialise = true);
100 
101 
105  virtual ~DrotLcsIf() {};
106 
112  void MoveAngle(double angle);
113 
118  bool IsTracking();
119 
129  void StartTrack(short mode, double angle);
130 
134  void StopTrack();
135 
147  void Listener(fcf::common::VectorVariant& params);
148 
154  virtual std::string GetRpcError(const short error_code) const;
155 
156 
157  void ReadStatus(DrotControllerData& status);
158 
159  private:
160 
172  void StoreAttribute(const std::string key,
173  const fcf::common::Variant& value,
174  bool publish,
175  int attribute);
176 
184  void PublishPosition(const fcf::common::Variant& value,
185  int attribute);
186 
187 
188 
189  protected:
190 
191 
192  private:
193 
194 
195  };
196 
197 }
198 
199 #include "drotLcsIf.ipp"
200 
201 #endif //FCF_DEVMGR_DEVICE_DROT_IF_HPP
double m_alpha
Definition: drotLcsIf.hpp:54
virtual std::string GetRpcError(const short error_code) const
bool IsTracking()
Check if drot is tracking.
short m_tracking_mode
Definition: drotLcsIf.hpp:53
ShutterLcsIf class header file.
DrotLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx, bool initialise=true)
drotLcsIf constructor.
virtual std::string GetErrorText() const
virtual ~DrotLcsIf()
Default destructor.
Definition: drotLcsIf.hpp:105
void SetData(const DrotControllerData &data)
Definition: drotLcsIf.cpp:32
DrotConfig class header file.
void StartTrack(short mode, double angle)
Start derotator tracking.
virtual ~DrotControllerData()
Definition: drotLcsIf.cpp:29
void ReadStatus(DrotControllerData &status)
virtual std::string GetSubstateStr() const
Motor Local Control System (LCS) Interface (IF) class.
Definition: motorLcsIf.hpp:116
void StopTrack()
Stop derotator tracking.
double m_delta
Definition: drotLcsIf.hpp:55
DrotControllerData()
Definition: drotLcsIf.cpp:21
DataContext class header file.
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34
Definition: dataContext.hpp:81
void Listener(fcf::common::VectorVariant &params)
Callback to manage changes on the monitored items.
void MoveAngle(double angle)
Move drot to a position angle.
The drotControllerData struct.
Definition: drotLcsIf.hpp:29
double m_angle_on_sky
Definition: drotLcsIf.hpp:56
Drot Local Control System (LCS) Interface (IF) class.
Definition: drotLcsIf.hpp:75