Create and rework data handling, part I

This commit is contained in:
2025-12-21 10:30:39 +01:00
parent f83f351d99
commit c382ba472d
12 changed files with 1540 additions and 25 deletions

View File

@@ -31,7 +31,6 @@
#ifndef BCVALUE_H
#define BCVALUE_H
#include "qnamespace.h"
#include <QObject>
#include <QString>
#include <QList>
@@ -54,6 +53,18 @@
-
*/
class BCAbstractTransmitter
{
public:
//
virtual uint32_t readValue( BCDevice::ID deviceID_, BC::ID targetID_ ) const = 0;
///virtual uint32_t readByte( BCDevice::ID deviceID_, BC::ID targetID_ ) const = 0;
};
using optDouble = std::optional<double>;
struct BCValueType
@@ -109,6 +120,10 @@ public:
BCValue();
BCValue( const BCValueType& valueType_, BCDevice::ID deviceID_, BC::ID targetID_ );
void readRawValue( const BCAbstractTransmitter& transmitter ) const;
void writeRawValue( const BCAbstractTransmitter& transmitter ) const;
// void reset()
BCValueTypeCRef valueType;
BCDevice::ID deviceID{BCDevice::ID::Invalid};
BC::ID targetID{BC::ID::Invalid};
@@ -116,13 +131,15 @@ public:
QString label;
QVariant value;
QVariant defaultValue;
bool inSync{false};
bool readOnly{false};
// void reset()
mutable double rawValue{};
};
// Damit QVariant dieses Struct transportieren kann:
Q_DECLARE_METATYPE(BCValue)