Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Controller for managing converter threads
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Dassow, NLT, 30-11-2018
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#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<QString, ConverterData> m_converterData; // portName, converter data
|
||||
QSystemTrayIcon *m_icon;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} //namespace SerialToTcpConverter
|
||||
Reference in new issue
Block a user