Updated ValueHandling.
This commit is contained in:
41
bcvalue.h
41
bcvalue.h
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user