Added BCTransmitter & woker thread.

This commit is contained in:
2025-12-18 20:34:38 +01:00
parent 1d558198c9
commit 059f3081d3
12 changed files with 90 additions and 252 deletions

View File

@@ -36,8 +36,10 @@
#include <QXmlStreamWriter>
#include <QMetaEnum>
#include <bcvaluemodel.h>
#include <QThread>
#include <bcdatamodel.h>
#include <bccandrivertinycan.h>
#include <bctransmitter.h>
class BCValueManager : public QObject
{
@@ -45,13 +47,16 @@ class BCValueManager : public QObject
public:
BCValueManager();
BCValueManager( );
virtual ~BCValueManager();
std::optional<BCValueModel*> getModel(const QString& key );
BCValue makeValue(BCDevice::ID deviceID, const BCValueParams& params );
// Public API für die Applikation
void transmitValue( const BCValue& value);
public slots:
void loadXml();
@@ -60,6 +65,14 @@ public slots:
signals:
// Internes Signal, um Daten an den Worker Thread zu senden
void newCommandArrived(BCValue cmd);
private slots:
// Slots für Rückmeldungen vom Runner
void onCommandFinished(int id, bool success);
void onRunnerMessage(const QString &msg);
protected:
@@ -71,6 +84,10 @@ protected:
QMetaEnum _bcDeviceEnum{QMetaEnum::fromType<BCDevice::ID>()};
BCCanDriverTinyCan _canDriver;
QThread _worker;
BCTransmitter _transmitter;
};
#endif // BCVALUEMANAGER_H