Visual Cleanups.

This commit is contained in:
2026-01-03 00:09:26 +01:00
parent f5ad48faf2
commit 4545bf81c3
6 changed files with 91 additions and 125 deletions

View File

@@ -102,6 +102,7 @@ BCValueType::BCValueType()
}
BCValueType::BCValueType(QString unitKey_, QString unitLabel_, double factor_, optDouble min_, optDouble max_ )
: unitLabel{unitLabel_}, factor{factor_}, min{min_}, max{max_}
{
@@ -110,28 +111,6 @@ BCValueType::BCValueType(QString unitKey_, QString unitLabel_, double factor_, o
}
QString BCValueType::readRawValueX(const BCAbstractTransmitter& transmitter , const BCValue& value) const
{
qDebug() << " --- READ X!";
/*
uint32_t devID = static_cast<uint32_t>(deviceID);
uint8_t regID = static_cast<uint8_t> (registerID);
// wir sind hier im anderen thread! nicht einfach so reinschreiben, nur lesen
if( valueType->readValueFunc )
{
uint32_t result = valueType->readValueFunc( transmitter, devID, regID );
return valueType->formatValue( result );
}
*/
return QString();
}
void BCValueType::writeRawValueX( const BCAbstractTransmitter& transmitter, const BCValue& value ) const
{
qDebug() << " --- WRITE X!";
}
QString BCValueType::formatValue( uint32_t value ) const
{
if( factor == 1 )
@@ -147,17 +126,20 @@ std::optional<ReadValueFunc> BCValueType::fetchReadValueFunction( const QString&
{
{ "Byte", readByteValue },
{ "Word", readWordValue },
{ "Assist", readByteValue },
{ "Kmh", readByteValue },
{ "Percent",readByteValue },
{ "KWh", readByteValue },
{ "Watt", readByteValue },
{ "Km", readByteValue },
{ "Kmh", readByteValue },
{ "Mm", readByteValue },
{ "Sec", readByteValue },
{ "Degree", readByteValue },
{ "SoC", readByteValue },
{ "Odo", readByteValue },
{ "Assist", readByteValue }
};
if( !s_bcReadValueFunctions.contains( unitTypeKey ) )
@@ -170,11 +152,12 @@ std::optional<BCValueType*> BCValueType::fetchValueType( const QString& unitType
{
static QHash<QString,BCValueType*> s_bcDataTypes
{
{ "Byte", new BCValueType( "Byte", "", 1.5625F) },
{ "Word", new BCValueType( "Word", "", 1.5625F) }
{ "Byte", new BCValueType( "Byte", "", 1.5625F) },
{ "Word", new BCValueType( "Word", "", 1.5625F) },
{ "Percent", new BCValueType( "Byte", "%", 1.5625 ) },
{ "AssInit", new BCValueType( "Byte", "", 1.0, 0 ,4 ) },
{ "Assist", new BCValueType( "Byte", "%", 0,400 ) }
/*
{ "Float", new BCValueType( "", 1.5625F) },
{ "Percent",new BCValueType( "%", 1.5625 ) },
{ "KWh", new BCValueType( "kwh", 1.5625 ) },
{ "Watt", new BCValueType( "w", 1.5625 ) },
{ "Km", new BCValueType( "km", 1.5625 ) },
@@ -184,7 +167,7 @@ std::optional<BCValueType*> BCValueType::fetchValueType( const QString& unitType
{ "Degree", new BCValueType( "°C", 1.0 ) },
{ "SoC", new BCValueType( "%", 1.5625 ) },
{ "Odo", new BCValueType( "km", 1.5625 ) },
{ "Assist", new BCValueType( "", 0 ,4 ) },
{ "Assist", new BCValueType( "%" ) },
*/
};