Added stylesheet, demo docs etc.

This commit is contained in:
2025-12-17 13:11:26 +01:00
parent 4c5e42fcfd
commit 08d6c593da
17 changed files with 530 additions and 160 deletions

View File

@@ -48,7 +48,7 @@ uint8_t BCValue::getLongValue()
}
BCValue* BCValue::makeValue( BCDevice::ID deviceID, const BCValueParams& params )
BCValue BCValue::makeValue( BCDevice::ID deviceID, const BCValueParams& params )
{
auto setIfExists = [&]( QStringView source, optDouble& target )
@@ -69,17 +69,18 @@ BCValue* BCValue::makeValue( BCDevice::ID deviceID, const BCValueParams& params
- eine gültige ID
*/
BCValue* newValue{};
BCValue newValue{};
auto IDVal = s_bcValueEnum.keyToValue64( params.ID.toLatin1().constData() );
if( IDVal.has_value() )
{
newValue = new BCValue( deviceID, BC::ID( IDVal.value() ) );
setIfExists( params.Factor, newValue->factor );
setIfExists( params.Min, newValue->min );
setIfExists( params.Max, newValue->max );
newValue->defaultValue.setValue( params.Default );
newValue->value.setValue( params.Current );
newValue = BCValue( deviceID, BC::ID( IDVal.value() ) );
setIfExists( params.Factor, newValue.factor );
setIfExists( params.Min, newValue.min );
setIfExists( params.Max, newValue.max );
newValue.defaultValue.setValue( params.Label );
newValue.value.setValue( params.Current );
newValue.label = params.Label;
}
return newValue;