/** * Controller for managing converter threads * $Id$ * $HeadURL$ * $Author$ * Created by Philipp Dassow, NLT, 30-11-2018 */ #pragma once #include #include #include "converter.h" #include "logger.h" class QSystemTrayIcon; class QAction; namespace SerialToTcpConverter { struct ConverterData { QString serialPortName; ConverterThread *thread = nullptr; QAction *menuAction = nullptr; }; class Controller : public QObject { Q_OBJECT public: explicit Controller(QObject* parent = nullptr); ~Controller(); bool init(); private slots: void onThreadExit(); void onThreadConnected(const QString &portName); private: QMap m_converterData; // portName, converter data QSystemTrayIcon *m_icon; LOGGER_T m_logger; }; } //namespace SerialToTcpConverter