Cleanups.

This commit is contained in:
2026-01-12 23:06:36 +01:00
parent c0ce6a81e3
commit beae1c1b3d
3 changed files with 67 additions and 68 deletions

View File

@@ -98,60 +98,44 @@ public:
BCValue( BCDevice::ID deviceID_, BC::ID registerID_ );
QString formatValue() const;
double calcMinMaxRatio() const;
void dumpValue() const;
bool isWord() const;
bool isReadOnly() const;
QString formatValue() const;
double calcMinMaxRatio() const;
void dumpValue() const;
bool isWord() const;
bool isReadOnly() const;
Flags& getValueFlags() const noexcept { return valueFlags; }
void setValueFlags(Flags newFlags) { valueFlags = newFlags; }
Flags& getValueFlags() const noexcept { return _valueFlags; }
void setValueFlags(Flags newFlags) { _valueFlags = newFlags; }
BCDevice::ID getDeviceID() const noexcept { return deviceID; }
//void setDeviceID(BCDevice::ID newDeviceID) { deviceID = newDeviceID; }
BCDevice::ID getDeviceID() const noexcept { return _deviceID; }
BC::ID getRegisterID() const noexcept { return _registerID; }
BC::ID getRegisterID() const noexcept { return registerID; }
uint32_t getRawValue() const noexcept { return _rawValue; }
void setRawValue(uint32_t newRawValue) const { _rawValue = newRawValue; }
void setFromDouble( double value );
ValueType getValueType() const noexcept { return valueType; }
int getIndexRow() const noexcept { return indexRow; }
void setIndexRow(int newIndexRow) { indexRow = newIndexRow; }
QString getLabel() const { return label; }
uint32_t getRawValue() const noexcept { return rawValue; }
void setRawValue(uint32_t newRawValue) const { rawValue = newRawValue; }
void setFromDouble( double value )
{
Q_UNUSED(value)
}
QString getUnitLabel() const { return unitLabel; }
void setUnitLabel(const QString &newUnitLabel) { unitLabel = newUnitLabel; }
double getFactor() const noexcept { return factor; }
void setFactor(double newFactor) { factor = newFactor; }
const OptDouble getOptMin() const { return optMin; }
void setOptMin(const OptDouble &newOptMin) { optMin = newOptMin; }
const OptDouble getOptMax() const { return optMax; }
void setOptMax(const OptDouble &newOptMax) { optMax = newOptMax; }
ValueType getValueType() const noexcept { return _valueType; }
int getIndexRow() const noexcept { return _indexRow; }
void setIndexRow(int newIndexRow) { _indexRow = newIndexRow; }
QString getLabel() const { return _label; }
QString getUnitLabel() const { return _unitLabel; }
double getFactor() const noexcept { return _factor; }
const OptDouble getOptMin() const { return _optMin; }
const OptDouble getOptMax() const { return _optMax; }
protected:
mutable Flags valueFlags{BCValue::Flag::NoFlag};
BCDevice::ID deviceID{BCDevice::ID::Invalid};
BC::ID registerID{BC::ID::Invalid};
ValueType valueType{ValueType::Plain};
int indexRow{-1};
QString label;
mutable uint32_t rawValue{};
QString unitLabel;
double factor{1};
OptDouble optMin;
OptDouble optMax;
mutable Flags _valueFlags{BCValue::Flag::NoFlag};
BCDevice::ID _deviceID{BCDevice::ID::Invalid};
BC::ID _registerID{BC::ID::Invalid};
ValueType _valueType{ValueType::Plain};
int _indexRow{-1};
QString _label;
mutable uint32_t _rawValue{};
QString _unitLabel;
double _factor{1};
OptDouble _optMin;
OptDouble _optMax;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(BCValue::Flags)