Cleanups.

This commit is contained in:
2026-01-02 16:25:21 +01:00
parent acbd80c446
commit 26d7f726d4
109 changed files with 565 additions and 6171 deletions

View File

@@ -153,13 +153,13 @@ void BCMainWindow::initMainWindow()
// besser: model::emit dataChanged
// also: emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole, ValueRole});
connect( _connectButton, &QToolButton::clicked, &_transmitter, &BCTransmitter::onToggleConnectionState );
connect( _syncButton, &QToolButton::clicked, this, &BCMainWindow::onSyncFromDevice );
connect( _syncButton, &QToolButton::clicked, this, &BCMainWindow::onSyncDeviceView );
connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
_transmitter.moveToThread(&_worker);
connect(this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::enqueueValueOp);
connect(this, &BCMainWindow::requestValueUpdate, &_transmitter, &BCTransmitter::enqueueValue);
connect(&_worker, &QThread::finished, &_transmitter, &QObject::deleteLater);
_worker.start();
@@ -239,10 +239,10 @@ void BCMainWindow::onValueUpdated(BCDevice::ID deviceID, int index, BCValue::Sta
* zu synchronisieren, d.h. die aktuellen Werte über den CAN-Bus abzufragen.
*/
void BCMainWindow::onSyncFromDevice()
void BCMainWindow::onSyncDeviceView()
{
Q_ASSERT_X(_currentPanel, "onSyncFromDevice()", "_currentpanel ist null!");
Q_ASSERT_X(_currentPanel, "onSyncDeviceView()", "_currentpanel ist null!");
qDebug() << " ---Syncing";
@@ -250,10 +250,11 @@ void BCMainWindow::onSyncFromDevice()
// alle einzeln? echt jetzt?
for( const BCValuePtr &value : currentList )
for( const BCValuePtr& value : currentList )
{
qDebug() << " --- begin sync of value: " << value->label;
// wir setze
// wir setzen auf 'lesen'
value->state.setFlag( BCValue::State::ReadMe );
// statt '_transmitter.enqueueValueCommand( value )' entkoppeln
// wir das eleganter über emit requestValueUpdate()
emit requestValueUpdate( value);