Reworked value reading.

This commit is contained in:
2025-12-24 12:11:59 +01:00
parent 4eb3b494fe
commit e948c9103c
16 changed files with 163 additions and 263 deletions

View File

@@ -29,52 +29,32 @@
#include <QMetaEnum>
#include <bcdataitem.h>
BCDataType::BCDataType()
{
}
BCDataType::BCDataType( QString unitLabel_, double factor_, optDouble min_, optDouble max_ )
: unitLabel{unitLabel_}, factor{factor_}, min{min_}, max{max_}
{
}
double BCDataType::readValue( const BCAbstractTransmitter& transmitter )
{
return 0;
}
void BCDataType::writeValue( const BCAbstractTransmitter& transmitter )
{
}
#include <bcdatavalue.h>
#include <bcvaluetype.h>
///-------------------------------
BCDataItem::BCDataItem(const BCDataType* valueType_, BCDevice::ID deviceID_, BC::ID registerID_)
BCDataValue::BCDataValue(const BCValueType* valueType_, BCDevice::ID deviceID_, BC::ID registerID_)
: valueType{valueType_}, deviceID{deviceID_}, registerID{registerID_}
{
value = "--";
visibleValue = "--";
}
void BCDataItem::readRawValueX( const BCAbstractTransmitter& transmitter ) const
void BCDataValue::readRawValueX( const BCAbstractTransmitter& transmitter ) const
{
qDebug() << " --- READ X!";
//uint32_t rawValue = transmitter.readRawValue( deviceID, registerID );
//const BCDataType& xxx = valueType.value().get();
uint32_t devID = static_cast<uint32_t>(deviceID);
uint8_t regID = static_cast<uint8_t> (registerID);
visibleValue = valueType->createStringValue( transmitter, devID, regID );
//uint32_t result = std::visit( myVisi, BCTypeVariant{valueType} );
}
void BCDataItem::writeRawValueX( const BCAbstractTransmitter& transmitter ) const
void BCDataValue::writeRawValueX( const BCAbstractTransmitter& transmitter ) const
{
qDebug() << " --- WRITE X!";
}