ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
adc.h
Go to the documentation of this file.
1 
9 #ifndef ADC_WDG_H
10 #define ADC_WDG_H
11 
12 #include "fcf/gui/wdglib/device.h"
13 #include <QWidget>
14 #include <QObject>
15 #include <rad/mal/subscriber.hpp>
16 #include <rad/mal/utils.hpp>
17 
18 class QLabel;
19 class QCheckBox;
20 class QComboBox;
21 class QSpinBox;
22 class QPalette;
23 
24 namespace Ui {
25  class AdcWdg;
26 }
27 
28 class AdcWdg : public DeviceWdg {
29  Q_OBJECT
30 
31 public:
32  explicit AdcWdg(QWidget *parent = 0,
33  std::string name = "undefined",
34  std::string filename = "undefined_file",
35  std::string server_id = "undefined",
36  int cmd_timeout = 60000
37  );
38  virtual ~AdcWdg();
39 
40  virtual void StartSubscription();
41  void GetMessage(std::shared_ptr<::elt::mal::Mal> mal,
42  std::vector<std::shared_ptr<::fcfif::FcsUnion>>& setup_buffer,
43  bool ignoreChecked = false);
44 
45  virtual void GetSubordinatedDevices(QStringList& dev_list);
46  virtual void UpdateData(QList<QVariant>& data_list);
47  virtual std::vector<std::string> GetDbAttributes(std::string server_id);
48  virtual void SetEnable(bool flag);
49 
50 signals:
51 
52 
53 public slots:
54  void SetActive(int index);
55  void SetActive(double value);
56 
57  void UpdateSubstate(int substate);
58  void UpdateSpinner(int substate);
59  void UpdateTrackMode(int mode);
60  void UpdatePosition(QString motor, double position);
61  void UpdateEncoders(QString motor, double encoders);
62  void UpdatePosition(int motor, double position);
63  void UpdateEncoders(int motor, double encoders);
64  void UpdateAlpha(double position);
65  void UpdateDelta(double position);
66  void UpdateOptions(int mode);
67  void UpdateNamedPos(QString named_pos);
68  void HandleLaunchButton1();
69  void HandleLaunchButton2();
70 
71 private:
72 
73  Ui::AdcWdg *ui;
74  std::string m_server_id;
75  QStringList m_options;
76  QStringList m_motors;
77  std::string m_address;
78  std::string m_simaddr;
79  std::string m_prefix;
80  std::unique_ptr<rad::cii::Subscriber<fcfif::AdcTopicUnion>> m_subscriber;
81  std::unique_ptr<rad::cii::Subscriber<fcfif::MotorPositionTopic>> m_motor1_subscriber;
82  std::unique_ptr<rad::cii::Subscriber<fcfif::MotorPositionTopic>> m_motor2_subscriber;
83 
84 };
85 
86 #endif // ADC_WDG_H
virtual void UpdateData(QList< QVariant > &data_list)
Definition: adc.cpp:176
void UpdateSpinner(int substate)
Definition: adc.cpp:279
Definition: device.h:112
void SetActive(int index)
Definition: adc.cpp:208
virtual ~AdcWdg()
Definition: adc.cpp:93
void HandleLaunchButton1()
Definition: adc.cpp:383
void UpdateNamedPos(QString named_pos)
Definition: adc.cpp:370
void UpdateAlpha(double position)
Definition: adc.cpp:375
void UpdateOptions(int mode)
Definition: adc.cpp:491
AdcWdg(QWidget *parent=0, std::string name="undefined", std::string filename="undefined_file", std::string server_id="undefined", int cmd_timeout=60000)
Definition: adc.cpp:22
void UpdateSubstate(int substate)
Definition: adc.cpp:250
void UpdateDelta(double position)
Definition: adc.cpp:379
void HandleLaunchButton2()
Definition: adc.cpp:407
virtual void StartSubscription()
Definition: adc.cpp:511
void UpdateEncoders(QString motor, double encoders)
Definition: adc.cpp:339
void UpdateTrackMode(int mode)
Definition: adc.cpp:310
virtual std::vector< std::string > GetDbAttributes(std::string server_id)
Definition: adc.cpp:143
void UpdatePosition(QString motor, double position)
Definition: adc.cpp:328
void GetMessage(std::shared_ptr<::elt::mal::Mal > mal, std::vector< std::shared_ptr<::fcfif::FcsUnion >> &setup_buffer, bool ignoreChecked=false)
Definition: adc.cpp:97
virtual void GetSubordinatedDevices(QStringList &dev_list)
Definition: adc.cpp:504
Definition: adc.h:28
WDGLIB DeviceWdg class declaration file.
virtual void SetEnable(bool flag)
Definition: adc.cpp:432