Recreated device sync, part I.
This commit is contained in:
@@ -162,9 +162,10 @@ void BCMainWindow::initMainWindow()
|
||||
|
||||
// C) Aufräumen: Wenn Thread endet, lösche den Runner
|
||||
connect(&_worker, &QThread::finished, &_transmitter, &QObject::deleteLater);
|
||||
|
||||
// 5. Thread starten
|
||||
_worker.start();
|
||||
|
||||
_consoleAction->trigger();
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +180,7 @@ void BCMainWindow::onValueListReady( BCDevice::ID deviceID )
|
||||
BCValueList& newValueList = _dataManager.getCurrentValueList();
|
||||
qDebug() << " --- Before: " << victim.size() << " orig:" << newValueList.size();
|
||||
victim = std::exchange(newValueList, BCValueList());
|
||||
//_devicePanels[deviceID]->setValueList( newValueList );
|
||||
//_devicePanels[deviceID]->exchangeValueList( newValueList );
|
||||
qDebug() << " ---After: " << victim.size() << " orig:" << newValueList.size();
|
||||
}
|
||||
}
|
||||
@@ -230,40 +231,35 @@ void BCMainWindow::onRunnerMessage(const QString &msg)
|
||||
|
||||
|
||||
|
||||
|
||||
void BCMainWindow::onSyncFromDevice()
|
||||
{
|
||||
qDebug() << " ---Syncing";
|
||||
/*
|
||||
if( _currentDeviceID != BCDevice::ID::Invalid )
|
||||
|
||||
Q_ASSERT(_currentPanel && "currentpanel ist null!");
|
||||
|
||||
const BCValueList& currentList =_currentPanel->getValueList();
|
||||
|
||||
// alle einzeln? echt jetzt?
|
||||
|
||||
for( const BCDataValue& value : currentList )
|
||||
{
|
||||
if( _valueModels.contains(_currentDeviceID) )
|
||||
{
|
||||
qDebug() << " --- value: " << value.label;
|
||||
|
||||
BCValueModel* model = _valueModels[_currentDeviceID];
|
||||
BCValueList& currentList = model->getValueList();
|
||||
// statt '_transmitter.enqueueValueCommand( value )' entkoppeln
|
||||
// wir das eleganter über emit sendValueCommand()
|
||||
|
||||
//BCDataValue& value = currentList[4];
|
||||
//_transmitter.enqueueValueCommand( value );
|
||||
emit sendValueCommand( BC::OpID::ReadValue, &value);
|
||||
|
||||
for( const BCDataValue& value : currentList )
|
||||
{
|
||||
qDebug() << " --- value: " << value.label;
|
||||
emit valueTouched( value.rowInModel );
|
||||
|
||||
// statt '_transmitter.enqueueValueCommand( value )' entkoppeln
|
||||
// wir das eleganter über emit sendValueCommand()
|
||||
bc::processEventsFor(500);
|
||||
|
||||
//_transmitter.enqueueValueCommand( value );
|
||||
emit sendValueCommand( BC::OpID::ReadValue, &value);
|
||||
//QApplication::processEvents();
|
||||
// Thread schlafen lassen (Simulation einer blockierenden Operation)
|
||||
//QThread::msleep(500);
|
||||
|
||||
emit valueTouched( value.rowInModel );
|
||||
|
||||
bc::processEventsFor(500);
|
||||
|
||||
//QApplication::processEvents();
|
||||
// Thread schlafen lassen (Simulation einer blockierenden Operation)
|
||||
//QThread::msleep(500);
|
||||
|
||||
}
|
||||
} // if contains
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user