ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mainwindow.h
Go to the documentation of this file.
1 
9 #ifndef DEVMGR_GUI_REDIS_MAINWINDOW_HPP_
10 #define DEVMGR_GUI_REDIS_MAINWINDOW_HPP_
11 
12 #include <any>
13 #include <QMainWindow>
14 #include <QTimer>
15 #include <QMap>
16 #include <QPair>
20 #include <Fcfif.hpp>
21 
22 #include <mal/Cii.hpp>
23 #include <mal/Mal.hpp>
24 #include <mal/utility/LoadMal.hpp>
25 #include <mal/rr/qos/ReplyTime.hpp>
26 
27 
28 #include <yaml-cpp/yaml.h>
29 
30 #include <rad/dbAdapterRedis.hpp>
31 
32 #include <QCloseEvent>
33 
34 class QGroupBox;
35 class QLabel;
36 class QTextEdit;
37 class QLineEdit;
38 class QPushButton;
39 class QCheckBox;
40 class QComboBox;
41 class QListWidget;
42 
43 class QThread;
44 class QString;
45 //class QMap;
46 
47 
48 namespace Ui {
49  class MainWindow;
50 }
51 
52 class MainWindow : public QMainWindow {
53  Q_OBJECT
54 
55 public:
56  MainWindow(QWidget *parent,
57  fcf::devmgr::common::Config& config_file,
58  boost::asio::io_service& ios,
59  rad::DbAdapter& dbAdapter);
60  virtual ~MainWindow();
61 
62  void closeEvent(QCloseEvent *event);
63 
64 private:
65  void ConfigureMenus();
66  void ConfigureHeaderGroup();
67  void ConfigureControlGroup();
68  void CreateDeviceGroup();
69 
70 
71 private slots:
72  void Update();
73  void UpdateData(const QString& topic,
74  const std::any& data);
75 
76  void OnFileSave();
77  void OnFileLoad();
78 
79  void OnFcsInit();
80  void OnFcsEnable();
81  void OnFcsDisable();
82  void OnFcsRecover();
83  void OnFcsReset();
84  void OnFcsRestartServer();
85  void OnFcsStartServer();
86  void OnFcsStopServer();
87 
88  void OnFcsExit();
89 
90  void OnDevicesSelectAll();
91  void OnDevicesDeselectAll();
92  void OnDevicesReset();
93  void OnDevicesInit();
94  void OnDevicesEnable();
95  void OnDevicesDisable();
96  void OnDevicesSimulate();
97  void OnDevicesStopSim();
98  void OnDevicesIgnore();
99  void OnDevicesStopIgn();
100 
101  // Handle button functionality
102  void HandleSetupButton();
103  void HandleDeviceSetup(QString name);
104  void HandleStopButton();
105 
106  void AddLogEntry(const QString& type,
107  const QString& cmd,
108  const QString& text);
109 
110 private:
111 
112  QTimer* m_timer_1s;
113  QLabel* m_wdg_state;
114  QLabel* m_wdg_substate;
115  QLabel* m_wdg_name;
116  QList<AbstractDevice*> m_dev_list;
117  YAML::Node m_config_node;
118  fcf::devmgr::common::Config& m_config_file;
119  rad::DbAdapter& m_oldb;
120  Ui::MainWindow* m_ui;
121  QThread* m_subscribe_thread;
122  SubscribeCmdWorker* m_subscribe_worker;
123  QMap<QString, QPair<int, QString>> m_widget_map;
124  boost::asio::io_service& m_ios;
125  std::shared_ptr<::fcfif::StdCmdsSync> m_mal_client;
126  elt::mal::Mal::Properties m_mal_properties;
127  elt::mal::Uri m_mal_uri;
128 
129 };
130 
131 #endif // MAINWINDOW_H
MSGLIB SubscribeCmdWorker class declaration file.
void closeEvent(QCloseEvent *event)
Definition: mainwindow.cpp:441
Config class header file.
Definition: config.hpp:54
WDGLIB AbstractDevice class declaration file.
MainWindow(QWidget *parent, fcf::devmgr::common::Config &config_file, boost::asio::io_service &ios, rad::DbAdapter &dbAdapter)
Definition: mainwindow.cpp:58
Definition: subscribeCmdWorker.h:29
virtual ~MainWindow()
Definition: mainwindow.cpp:125
Definition: mainwindow.h:52