Create and rework data handling, part I
This commit is contained in:
23
bcvalue.h
23
bcvalue.h
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user