Added getter & setter for BCValue

This commit is contained in:
2026-01-11 14:48:51 +01:00
parent 9c35c9ea42
commit 25e752e83b
11 changed files with 139 additions and 59 deletions

View File

@@ -67,6 +67,8 @@ class BCValue
{
Q_GADGET
friend class BCXmlLoader;
public:
// Aus dem Type ergibt sich
@@ -97,11 +99,46 @@ public:
BCValue( BCDevice::ID deviceID_, BC::ID registerID_ );
QString formatValue() const;
double calcRatio() 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; }
BCDevice::ID getDeviceID() const noexcept { return deviceID; }
//void setDeviceID(BCDevice::ID newDeviceID) { deviceID = newDeviceID; }
BC::ID getRegisterID() const noexcept { return registerID; }
void setRegisterID(BC::ID newRegisterID) { registerID = newRegisterID; }
ValueType getValueType() const noexcept { return valueType; }
void setValueType(ValueType newValueType) { valueType = newValueType; }
int getIndexRow() const noexcept { return indexRow; }
void setIndexRow(int newIndexRow) { indexRow = newIndexRow; }
QString getLabel() const { return label; }
void setLabel(const QString &newLabel) { label = newLabel; }
uint32_t getRawValue() const noexcept { return rawValue; }
void setRawValue(uint32_t newRawValue) const { rawValue = newRawValue; }
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; }
protected:
mutable Flags valueFlags{BCValue::Flag::NoFlag};
BCDevice::ID deviceID{BCDevice::ID::Invalid};
BC::ID registerID{BC::ID::Invalid};
@@ -113,6 +150,7 @@ public:
double factor{1};
OptDouble optMin;
OptDouble optMax;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(BCValue::Flags)