Backup.
This commit is contained in:
@@ -47,7 +47,7 @@ void BCTransmitter::onToggleConnectionState( bool connect )
|
||||
{
|
||||
if( connect )
|
||||
{
|
||||
if( _canDriver->getState() != BCDriver::DriverState::DeviceReady )
|
||||
if( _canDriver->getDriverState() != BCDriver::DriverState::DeviceReady )
|
||||
_canDriver->onStartDriver();
|
||||
|
||||
// __fix!
|
||||
@@ -73,7 +73,7 @@ void BCTransmitter::enqueueValueOp(BCValue::OpID opID, const BCValue* value)
|
||||
_valueQueue.enqueue( value );
|
||||
|
||||
// wir wollen nicht den ganzen Value verschicken, erstrecht
|
||||
// wollen wir den Value in verschiedenen Threads gleichzeitig
|
||||
// wollen wir nicht den Value in verschiedenen Threads gleichzeitig
|
||||
// in die Hand nehmen, also hantieren wir nur mit den Inidizes.
|
||||
|
||||
// Trigger processing im Event-Loop des Worker Threads
|
||||
@@ -109,63 +109,39 @@ void BCTransmitter::processValueOp( BCValue::OpID opID )
|
||||
} // Mutex wird hier freigegeben! WICHTIG: Execute ohne Lock!
|
||||
|
||||
|
||||
try
|
||||
// Abkürzung
|
||||
const BCValue& val = *currentValue;
|
||||
// Value ist 'under construction'
|
||||
//emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::Locked );
|
||||
if( opID == BCValue::OpID::ReadValue )
|
||||
{
|
||||
// Abkürzung
|
||||
const BCValue& val = *currentValue;
|
||||
// Value ist 'under construction'
|
||||
//emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::Locked );
|
||||
if( opID == BCValue::OpID::ReadValue )
|
||||
{
|
||||
QString result = currentValue->readRawValueX( *this );
|
||||
emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::InSync, result );
|
||||
}
|
||||
|
||||
else if( opID == BCValue::OpID::WriteValue )
|
||||
{
|
||||
currentValue->writeRawValueX( *this );
|
||||
}
|
||||
|
||||
QString result = currentValue->readRawValueX( *this );
|
||||
emit valueUpdated( val.deviceID, val.indexRow, BCValue::State::InSync, result );
|
||||
}
|
||||
catch (...)
|
||||
else if( opID == BCValue::OpID::WriteValue )
|
||||
{
|
||||
qDebug() << " --- OUCH!";
|
||||
currentValue->writeRawValueX( *this );
|
||||
}
|
||||
|
||||
// __fix
|
||||
bc::processEventsFor(50);
|
||||
bc::processEventsFor(50);
|
||||
|
||||
//emit valueStateChanged(cmd.id, true);
|
||||
//emit valueStateChanged(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t BCTransmitter::readByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
uint8_t BCTransmitter::readByte( uint32_t deviceID, uint8_t registerID ) const
|
||||
{
|
||||
BCDriver::TransmitResult result;
|
||||
try
|
||||
{
|
||||
result = _canDriver->readRawByte( deviceID, registerID );
|
||||
}
|
||||
catch ( BCException& exception )
|
||||
{
|
||||
qDebug() << " -- OUCH: read exception: " << exception.what();
|
||||
}
|
||||
BCDriver::TransmitResult result = _canDriver->readRawByte( deviceID, registerID );
|
||||
|
||||
return result.value();
|
||||
|
||||
}
|
||||
|
||||
void BCTransmitter::writeByte( uint32_t deviceID, uint8_t registerID , uint8_t value ) const
|
||||
{
|
||||
try
|
||||
{
|
||||
_canDriver->writeRawByte( deviceID, registerID, value );
|
||||
}
|
||||
catch ( BCException& exception )
|
||||
{
|
||||
qDebug() << " -- OUCH: write exception: " << exception.what();
|
||||
}
|
||||
|
||||
_canDriver->writeRawByte( deviceID, registerID, value );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user