Made 'syncFromDevice' work again.

This commit is contained in:
2025-12-28 22:48:18 +01:00
parent 517dcceb81
commit b7d4441d56
20 changed files with 167 additions and 916 deletions

View File

@@ -83,7 +83,7 @@ void BCTransmitter::onToggleConnectionState( bool connect )
}
void BCTransmitter::enqueueValueOp(BC::OpID opID, const BCDataValue* value)
void BCTransmitter::enqueueValueOp(BC::OpID opID, const BCValue* value)
{
QMutexLocker locker(&_mutex);
_valueQueue.enqueue( value );
@@ -116,7 +116,7 @@ void BCTransmitter::processValueOp( BC::OpID opID )
while (true)
{
const BCDataValue* currentValue{};
const BCValue* currentValue{};
{
QMutexLocker locker(&_mutex);
if (_valueQueue.isEmpty())
@@ -130,9 +130,14 @@ void BCTransmitter::processValueOp( BC::OpID opID )
try
{
// Abkürzung
const BCValue& val = *currentValue;
// Value ist 'under construction'
emit valueUpdated( val.deviceID, val.indexRow, BC::State::Locked );
if( opID == BC::OpID::ReadValue )
{
QString result = currentValue->readRawValueX( *this );
emit valueUpdated( val.deviceID, val.indexRow, BC::State::InSync, result );
}
else if( opID == BC::OpID::WriteValue )
@@ -148,21 +153,23 @@ void BCTransmitter::processValueOp( BC::OpID opID )
//emit commandFinished(cmd.id, true);
//emit commandFinished(0, true);
//emit valueStateChanged(cmd.id, true);
//emit valueStateChanged(0, true);
}
}
uint32_t BCTransmitter::readRawByte( uint32_t deviceID, uint8_t registerID ) const
{
uint32_t result{};
try
{
return _canDriver.readRawByte( deviceID, registerID );
result = _canDriver.readRawByte( deviceID, registerID );
}
catch ( BCException& exception )
{
qDebug() << " -- OUCH: read exception: " << exception.what();
}
return result;
}