Added stylesheet, demo docs etc.
This commit is contained in:
17
bcvalue.cpp
17
bcvalue.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user