8 #ifndef FCF_GUI_MAINWINDOW_HPP_
9 #define FCF_GUI_MAINWINDOW_HPP_
12 #include <QMainWindow>
23 #include <mal/Cii.hpp>
24 #include <mal/Mal.hpp>
25 #include <mal/utility/LoadMal.hpp>
26 #include <mal/rr/qos/ReplyTime.hpp>
29 #include <utils/bat/dbInterface.hpp>
31 #include <yaml-cpp/yaml.h>
34 #include <QCloseEvent>
35 #include <QApplication>
88 OverrideCursor(Qt::CursorShape shape = Qt::WaitCursor)
90 QApplication::setOverrideCursor(shape);
95 QApplication::restoreOverrideCursor();
102 int polling_interval);
117 void on_actionExit_triggered();
120 void on_actionInit_triggered();
121 void on_actionEnable_triggered();
122 void on_actionDisable_triggered();
123 void on_actionRecover_triggered();
124 void on_actionReset_triggered();
125 void on_actionLogError_triggered() { SetFcsLogLevel(
"ERROR"); };
126 void on_actionLogInfo_triggered() { SetFcsLogLevel(
"INFO"); };
127 void on_actionLogDebug_triggered() { SetFcsLogLevel(
"DEBUG"); };
128 void on_actionLogTrace_triggered() { SetFcsLogLevel(
"TRACE"); };
131 void on_actionSelect_All_triggered();
132 void on_actionDeselect_All_triggered();
133 void on_actionDevReset_triggered();
134 void on_actionDevInit_triggered();
135 void on_actionDevEnable_triggered();
136 void on_actionDevDisable_triggered();
137 void on_actionDevSimulate_triggered();
138 void on_actionDevStopSim_triggered();
139 void on_actionDevIgnore_triggered();
140 void on_actionDevStopIgn_triggered();
143 void on_actionFCF_CLI_triggered();
146 void on_actionAbout_triggered();
147 void on_actionWhatsthis_triggered();
148 void onThemeActionTriggered();
151 void handleSetupButton();
152 void handleDeviceSetup(QString name);
153 void handleStopButton();
154 void addLogEntry(
const QString&
type,
156 const QString& text);
157 void updateWindowState();
161 void CreateMalInterfaces(
const QString uri);
162 void GetServerConfiguration();
163 void CreateDbClient();
164 void CreateDeviceWidgets();
166 const std::string& devtype,
167 const std::string& server_id,
169 std::vector<std::string> selectedDevices(MainWindow::Page page = MainWindow::All)
const;
170 void SetFcsLogLevel(
const std::string &level);
172 template <
class WorkerType>
173 void StartInThread(WorkerType* worker)
175 QThread* thread =
new QThread;
176 worker->moveToThread(thread);
177 QObject::connect(thread, &QThread::started, worker, &WorkerType::process);
178 QObject::connect(thread, &QThread::finished, thread, &QThread::deleteLater);
179 QObject::connect(worker, &WorkerType::finished, thread, &QThread::quit);
180 QObject::connect(worker, &WorkerType::finished, worker, &WorkerType::deleteLater);
181 QObject::connect(worker, &WorkerType::LogReplyOut,
182 this, &MainWindow::addLogEntry,
183 Qt::QueuedConnection);
188 void WriteSettings()
const;
191 void OnStateCurrentChanged(
const StateEnum& state);
194 static const QString org_name;
195 static const QString app_name;
196 static const int update_ms;
197 static const QString lamp_type;
198 static const QString shutter_type;
199 static const QString motor_type;
200 static const QString iodev_type;
201 static const QString drot_type;
202 static const QString adc_type;
203 static const QString piezo_type;
204 static const QString actuator_type;
205 static const QString smaract_type;
206 static const QString msm_type;
208 using WdgInfo = std::tuple<std::string, MainWindow::Page, AbstractDevice*>;
209 using WdgInfoVec = std::vector<WdgInfo>;
213 QLabel* m_server_connection_label;
219 std::unique_ptr<utils::bat::DbInterface> m_oldb;
220 std::shared_ptr<::elt::mal::Mal> m_mal_instance;
221 std::shared_ptr<::stdif::StdCmdsSync> m_mal_std;
222 std::shared_ptr<::fcfif::AppCmdsSync> m_mal_client;
223 elt::mal::Mal::Properties m_mal_properties;
224 elt::mal::Uri m_mal_uri;
225 elt::mal::Uri m_mal_uri2;
226 elt::mal::rr::ListenerRegistration m_connection_listener;
WDGLIB AbstractDevice class declaration file.
Definition: abstractDevice.h:21
Definition: mainwindow.hpp:12
void closeEvent(QCloseEvent *event) override
Definition: mainwindow.cpp:623
virtual ~MainWindow() override
MainWindow(QWidget *parent=nullptr)
Definition: mainwindow.cpp:8
Definition: config.hpp:56
Config class header file.
WDGLIB DeviceWdg class declaration file.
Definition: mainwindow.hpp:7
type
Definition: fcfLampGui.py:20
Definition: actionMgr.cpp:29
MSGLIB SubscribeCmdWorker class declaration file.