Mini Milestone: Driver loads and connects.

This commit is contained in:
2025-12-18 16:26:51 +01:00
parent b5ed3ff733
commit 2acf280c55
20 changed files with 5407 additions and 59 deletions

View File

@@ -56,6 +56,46 @@ BCValueManager::~BCValueManager()
// our models are autokilled.
}
void BCValueManager::onToggleConnectionState( bool connect )
{
if( connect )
{
if( BCCanDriver::sIdle == _canDriver.getState() )
_canDriver.onStartDriver();
int hwVersion = _canDriver.getValue( BCDevice::ID::Console, BC::ID::Cons_Rev_Hw);
if (hwVersion == 0)
{
qDebug() << "Console not responding";
}
else {
/*
swVersion = getValue(CONSOLE, CONSOLE_REF_SW);
printf( "Console information:" _NL
" hardware version ........: %02d" _NL
" software version ........: %02d" _NL
" assistance level ........: %d" _NL,
hwVersion, swVersion,
getValue(CONSOLE, CONSOLE_ASSIST_INITLEVEL)
);
if (!gNoSerialNumbers)
printf( " part number .............: %05d" _NL
" item number .............: %05d" _NL _NL,
((getValue(CONSOLE, CONSOLE_SN_PN_HI) << 8) + getValue(CONSOLE, CONSOLE_SN_PN_LO)),
((getValue(CONSOLE, CONSOLE_SN_ITEM_HI) << 8) + getValue(CONSOLE, CONSOLE_SN_ITEM_LO))
);
*/
}
}
}
std::optional<BCValueModel*> BCValueManager::getModel(const QString& key )
{
if( _valueModels.contains( key) )
@@ -267,6 +307,7 @@ BCValue BCValueManager::makeValue( BCDevice::ID deviceID, const BCValueParams& p
newValue.defaultValue.setValue( params.Label );
newValue.value.setValue( params.Current );
newValue.label = params.Label;
//qDebug() << " --- created: " << params.Label;
}
return newValue;