Compiles again.
This commit is contained in:
@@ -256,7 +256,7 @@ void BCMainWindow::onSyncFromDevice()
|
|||||||
// wir setze
|
// wir setze
|
||||||
// statt '_transmitter.enqueueValueCommand( value )' entkoppeln
|
// statt '_transmitter.enqueueValueCommand( value )' entkoppeln
|
||||||
// wir das eleganter über emit requestValueUpdate()
|
// wir das eleganter über emit requestValueUpdate()
|
||||||
//emit requestValueUpdate( value);
|
emit requestValueUpdate( value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
|
|
||||||
// Internes Signal, um Daten an den Worker Thread zu senden
|
// Internes Signal, um Daten an den Worker Thread zu senden
|
||||||
void requestValueUpdate( const BCValue& value);
|
void requestValueUpdate( const BCValuePtr value);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
// Hier sind wir noch in GUI Thread
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_mutex);
|
||||||
@@ -98,7 +98,7 @@ void BCTransmitter::processValueOp()
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
BCValue* currentValue{};
|
BCValuePtr value{};
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_mutex);
|
||||||
if (_valueQueue.isEmpty())
|
if (_valueQueue.isEmpty())
|
||||||
@@ -106,15 +106,16 @@ void BCTransmitter::processValueOp()
|
|||||||
_isBusy = false;
|
_isBusy = false;
|
||||||
break; // Schleife verlassen, warten auf neue Events
|
break; // Schleife verlassen, warten auf neue Events
|
||||||
}
|
}
|
||||||
//currentValue =_valueQueue.dequeue();
|
value =_valueQueue.dequeue();
|
||||||
} // Mutex wird hier freigegeben! WICHTIG: Execute ohne Lock!
|
} // Mutex wird hier freigegeben! WICHTIG: Execute ohne Lock!
|
||||||
|
|
||||||
/*
|
|
||||||
// Abkürzung
|
// Abkürzung
|
||||||
const BCValue& value = *currentValue;
|
//const BCValue& value = *currentValue;
|
||||||
// Value ist 'under construction'
|
// Value ist 'under construction'
|
||||||
//emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::Locked );
|
//emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::Locked );
|
||||||
|
|
||||||
|
/*
|
||||||
if( opID == BCValue::OpID::ReadValue )
|
if( opID == BCValue::OpID::ReadValue )
|
||||||
{
|
{
|
||||||
QString result = currentValue->readRawValueX( *this );
|
QString result = currentValue->readRawValueX( *this );
|
||||||
@@ -125,6 +126,7 @@ void BCTransmitter::processValueOp()
|
|||||||
currentValue->writeRawValueX( *this );
|
currentValue->writeRawValueX( *this );
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
emit valueUpdated( value->deviceID, value->indexRow, BCValue::State::InSync, "fitze!");
|
||||||
|
|
||||||
// __fix
|
// __fix
|
||||||
bc::processEventsFor(50);
|
bc::processEventsFor(50);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void onToggleConnectionState( bool connect );
|
void onToggleConnectionState( bool connect );
|
||||||
void enqueueValueOp(const BCValue& value );
|
void enqueueValueOp(const BCValuePtr value );
|
||||||
void processValueOp();
|
void processValueOp();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -74,7 +74,7 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
using BCDataQueue = QQueue<BCValue>;
|
using BCDataQueue = QQueue<BCValuePtr>;
|
||||||
|
|
||||||
BCDataQueue _valueQueue;
|
BCDataQueue _valueQueue;
|
||||||
QMutex _mutex;
|
QMutex _mutex;
|
||||||
|
|||||||
@@ -109,13 +109,14 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(BCValue::States)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(const BCValue&)
|
|
||||||
//Q_DECLARE_METATYPE(const BCValue&)
|
//Q_DECLARE_METATYPE(const BCValue&)
|
||||||
|
|
||||||
using BCValuePtr = std::shared_ptr<BCValue>;
|
using BCValuePtr = std::shared_ptr<BCValue>;
|
||||||
//using BCValueList = QList<BCValue>;
|
//using BCValueList = QList<BCValue>;
|
||||||
using BCValueList = QList<BCValuePtr>;
|
using BCValueList = QList<BCValuePtr>;
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(const BCValuePtr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
class BCValueList : public QList<BCValue>
|
class BCValueList : public QList<BCValue>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user