From acbd80c446af60d5c4448e9872faa1f886e3bb87 Mon Sep 17 00:00:00 2001 From: "PANIK\\chris" Date: Fri, 2 Jan 2026 01:52:48 +0100 Subject: [PATCH] Compiles again. --- bcmainwindow.cpp | 2 +- bcmainwindow.h | 2 +- bctransmitter.cpp | 14 ++++++++------ bctransmitter.h | 4 ++-- bcvalue.h | 3 ++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bcmainwindow.cpp b/bcmainwindow.cpp index afc4604..53f91f7 100644 --- a/bcmainwindow.cpp +++ b/bcmainwindow.cpp @@ -256,7 +256,7 @@ void BCMainWindow::onSyncFromDevice() // wir setze // statt '_transmitter.enqueueValueCommand( value )' entkoppeln // wir das eleganter über emit requestValueUpdate() - //emit requestValueUpdate( value); + emit requestValueUpdate( value); } diff --git a/bcmainwindow.h b/bcmainwindow.h index 569c40e..55a1d55 100644 --- a/bcmainwindow.h +++ b/bcmainwindow.h @@ -64,7 +64,7 @@ public slots: signals: // Internes Signal, um Daten an den Worker Thread zu senden - void requestValueUpdate( const BCValue& value); + void requestValueUpdate( const BCValuePtr value); protected: diff --git a/bctransmitter.cpp b/bctransmitter.cpp index aff4766..90e5857 100644 --- a/bctransmitter.cpp +++ b/bctransmitter.cpp @@ -67,7 +67,7 @@ void BCTransmitter::onToggleConnectionState( bool connect ) } -void BCTransmitter::enqueueValueOp( const BCValue& value) +void BCTransmitter::enqueueValueOp( const BCValuePtr value) { // Hier sind wir noch in GUI Thread QMutexLocker locker(&_mutex); @@ -98,7 +98,7 @@ void BCTransmitter::processValueOp() while (true) { - BCValue* currentValue{}; + BCValuePtr value{}; { QMutexLocker locker(&_mutex); if (_valueQueue.isEmpty()) @@ -106,15 +106,16 @@ void BCTransmitter::processValueOp() _isBusy = false; break; // Schleife verlassen, warten auf neue Events } - //currentValue =_valueQueue.dequeue(); + value =_valueQueue.dequeue(); } // Mutex wird hier freigegeben! WICHTIG: Execute ohne Lock! - /* + // Abkürzung - const BCValue& value = *currentValue; + //const BCValue& value = *currentValue; // Value ist 'under construction' //emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::Locked ); + /* if( opID == BCValue::OpID::ReadValue ) { QString result = currentValue->readRawValueX( *this ); @@ -124,7 +125,8 @@ void BCTransmitter::processValueOp() { currentValue->writeRawValueX( *this ); } -*/ + */ + emit valueUpdated( value->deviceID, value->indexRow, BCValue::State::InSync, "fitze!"); // __fix bc::processEventsFor(50); diff --git a/bctransmitter.h b/bctransmitter.h index 34d3fb9..af8a612 100644 --- a/bctransmitter.h +++ b/bctransmitter.h @@ -64,7 +64,7 @@ public: public slots: void onToggleConnectionState( bool connect ); - void enqueueValueOp(const BCValue& value ); + void enqueueValueOp(const BCValuePtr value ); void processValueOp(); signals: @@ -74,7 +74,7 @@ signals: private: - using BCDataQueue = QQueue; + using BCDataQueue = QQueue; BCDataQueue _valueQueue; QMutex _mutex; diff --git a/bcvalue.h b/bcvalue.h index b648d9c..fccc267 100644 --- a/bcvalue.h +++ b/bcvalue.h @@ -109,13 +109,14 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(BCValue::States) -Q_DECLARE_METATYPE(const BCValue&) //Q_DECLARE_METATYPE(const BCValue&) using BCValuePtr = std::shared_ptr; //using BCValueList = QList; using BCValueList = QList; +Q_DECLARE_METATYPE(const BCValuePtr) + /* class BCValueList : public QList {