Before cleanup.
This commit is contained in:
@@ -318,11 +318,14 @@ void BCMainWindow::onSyncDeviceView()
|
|||||||
|
|
||||||
for( const BCValuePtr& value : currentList )
|
for( const BCValuePtr& value : currentList )
|
||||||
{
|
{
|
||||||
qDebug() << " --- begin sync of value: " << value->label;
|
qDebug() << " --- begin sync of value: " << QThread::currentThreadId() << " : " << value->label;
|
||||||
// wir setzen auf 'lesen'
|
// wir setzen auf 'lesen'
|
||||||
value->state.setFlag( BCValue::State::ReadMe );
|
value->state.setFlag( BCValue::State::ReadMe );
|
||||||
// statt '_transmitter.onEnqueueValueCommand( value )' entkoppeln
|
|
||||||
// wir das eleganter über emit requestValueUpdate()
|
// statt '_transmitter.onEnqueueValue( value )' müssen wir hier
|
||||||
|
// über emit requestValueUpdate() zur Thread sysnchronisation
|
||||||
|
// entkoppeln,
|
||||||
|
|
||||||
emit requestValueUpdate( value);
|
emit requestValueUpdate( value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,12 @@ void BCTransmitter::disconnectCanDriver()
|
|||||||
|
|
||||||
void BCTransmitter::onEnqueueValue( BCValuePtrConst value)
|
void BCTransmitter::onEnqueueValue( BCValuePtrConst value)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// wir stellen hier auf die arte Tour sicher, das onEnqueueValue
|
||||||
|
// nicht aus dem Parent-Thread direkt sondern über die EventQueue aufgerufen wurde.
|
||||||
|
|
||||||
|
Q_ASSERT(QThread::currentThread() == this->thread());
|
||||||
|
|
||||||
// Hier sind wir noch in GUI Thread
|
// Hier sind wir noch in GUI Thread
|
||||||
//QMutexLocker locker(&_mutex);
|
//QMutexLocker locker(&_mutex);
|
||||||
_valueQueue.enqueue( value );
|
_valueQueue.enqueue( value );
|
||||||
@@ -134,21 +140,15 @@ void BCTransmitter::onEnqueueValue( BCValuePtrConst value)
|
|||||||
// invokeMethod mit QueuedConnection entkoppelt den Aufruf,
|
// invokeMethod mit QueuedConnection entkoppelt den Aufruf,
|
||||||
// damit onEnqueueValue sofort zurückkehrt (non-blocking für den Aufrufer).
|
// damit onEnqueueValue sofort zurückkehrt (non-blocking für den Aufrufer).
|
||||||
|
|
||||||
QMetaObject::invokeMethod(this, "onProcessValue", Qt::QueuedConnection);
|
//QMetaObject::invokeMethod(this, "onProcessValue", Qt::QueuedConnection);
|
||||||
|
|
||||||
/*
|
|
||||||
QMetaObject::invokeMethod(this, [this]()
|
|
||||||
{
|
|
||||||
onProcessValue();
|
onProcessValue();
|
||||||
}, Qt::QueuedConnection );
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCTransmitter::onProcessValue()
|
void BCTransmitter::onProcessValue()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_isBusy)
|
//if (_isBusy)
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
_isBusy = true;
|
_isBusy = true;
|
||||||
|
|
||||||
@@ -168,6 +168,8 @@ void BCTransmitter::onProcessValue()
|
|||||||
// Kosmetik
|
// Kosmetik
|
||||||
const BCValue& value = *(valuePtr.get());
|
const BCValue& value = *(valuePtr.get());
|
||||||
|
|
||||||
|
qDebug() << "------- DE.-.QUEUE: " << QThread::currentThreadId() << ": " << value.label;
|
||||||
|
|
||||||
// Value ist 'under construction'
|
// Value ist 'under construction'
|
||||||
//emit valueUpdated( value.deviceID, value.indexRow, BCValue::State::Locked );
|
//emit valueUpdated( value.deviceID, value.indexRow, BCValue::State::Locked );
|
||||||
|
|
||||||
@@ -204,10 +206,9 @@ void BCTransmitter::onProcessValue()
|
|||||||
emit valueUpdated( value.deviceID, value.indexRow, newState, newVisibleValue );
|
emit valueUpdated( value.deviceID, value.indexRow, newState, newVisibleValue );
|
||||||
|
|
||||||
// __fix
|
// __fix
|
||||||
bc::processEventsFor(50);
|
//bc::processEventsFor(150);
|
||||||
|
bc::delay_millis(150);
|
||||||
|
|
||||||
//emit valueStateChanged(cmd.id, true);
|
|
||||||
//emit valueStateChanged(0, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user