Updated ValueHandling.

This commit is contained in:
Christoph Holzheuer
2026-01-07 17:13:35 +01:00
parent 7d43b0a694
commit 3bdc491830
17 changed files with 152 additions and 150 deletions

View File

@@ -72,46 +72,47 @@ public:
// später der Editor
enum class ValueType : uint8_t
{
Plain,
Plain, // nur lesen, sowas wie SerialNo
Bool,
Number,
Float
};
enum class State : uint8_t
enum class Flag : uint8_t
{
NoState = 0x00,
NoFlag = 0x00,
ReadMe = 0x01,
WriteMe = 0x02,
ReadOnly = 0x04,
Locked = 0x08,
Failed = 0x10,
InSync = 0x20,
OK = 0x40
OK = 0x40,
IsWord = 0x80
};
Q_DECLARE_FLAGS(States, State )
Q_DECLARE_FLAGS(Flags, Flag )
BCValue( BCDevice::ID deviceID_, BC::ID registerID_ );
QString formatValues( uint32_t value ) const;
QString formatValue() const;
double calcRatio() const;
void dumpValue() const;
bool isWord() const;
mutable States state{BCValue::State::ReadOnly};
BCDevice::ID deviceID{BCDevice::ID::Invalid};
BC::ID registerID{BC::ID::Invalid};
ValueType valueType{ValueType::Plain};
int indexRow{-1};
QString label;
mutable QString visibleValue;
mutable double rawValue;
bool isWord{false};
QString unitLabel;
double factor{1};
OptDouble optMin;
OptDouble optMax;
mutable Flags flags{BCValue::Flag::ReadOnly};
BCDevice::ID deviceID{BCDevice::ID::Invalid};
BC::ID registerID{BC::ID::Invalid};
ValueType valueType{ValueType::Plain};
int indexRow{-1};
QString label;
mutable double rawDoubleValue;
mutable uint32_t rawUIntValue;
QString unitLabel;
double factor{1};
OptDouble optMin;
OptDouble optMax;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(BCValue::States)
Q_DECLARE_OPERATORS_FOR_FLAGS(BCValue::Flags)