Further renamings.
This commit is contained in:
@@ -26,7 +26,7 @@ windows
|
|||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
bc.cpp \
|
bc.cpp \
|
||||||
bcdata.cpp \
|
bcdataitem.cpp \
|
||||||
bcdatamodel.cpp \
|
bcdatamodel.cpp \
|
||||||
bcitemdelegate.cpp \
|
bcitemdelegate.cpp \
|
||||||
bctransmitter.cpp \
|
bctransmitter.cpp \
|
||||||
@@ -41,7 +41,7 @@ HEADERS += \
|
|||||||
bc.h \
|
bc.h \
|
||||||
bccandriver.h \
|
bccandriver.h \
|
||||||
bccandrivertinycan.h \
|
bccandrivertinycan.h \
|
||||||
bcdata.h \
|
bcdataitem.h \
|
||||||
bcdatamodel.h \
|
bcdatamodel.h \
|
||||||
bcitemdelegate.h \
|
bcitemdelegate.h \
|
||||||
bcmainwindow.h \
|
bcmainwindow.h \
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
|
||||||
|
|
||||||
#include <bcdata.h>
|
#include <bcdataitem.h>
|
||||||
|
|
||||||
BCDataType::BCDataType()
|
BCDataType::BCDataType()
|
||||||
{
|
{
|
||||||
@@ -46,18 +46,18 @@ BCDataType::BCDataType( TypeID ID_, QString unitLabel_, optDouble factor_, optDo
|
|||||||
///-------------------------------
|
///-------------------------------
|
||||||
|
|
||||||
|
|
||||||
BCData::BCData(const BCDataType& valueType_, BCDevice::ID deviceID_, BC::ID registerID_)
|
BCDataItem::BCDataItem(const BCDataType& valueType_, BCDevice::ID deviceID_, BC::ID registerID_)
|
||||||
: valueType{valueType_}, deviceID{deviceID_}, registerID{registerID_}
|
: valueType{valueType_}, deviceID{deviceID_}, registerID{registerID_}
|
||||||
{
|
{
|
||||||
value = "--";
|
value = "--";
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCData::readRawValue( const BCAbstractTransmitter& transmitter ) const
|
void BCDataItem::readRawValue( const BCAbstractTransmitter& transmitter ) const
|
||||||
{
|
{
|
||||||
bcdata_t rawValue = transmitter.readRawValue( deviceID, registerID );
|
bcdata_t rawValue = transmitter.readRawValue( deviceID, registerID );
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCData::writeRawValue( const BCAbstractTransmitter& transmitter ) const
|
void BCDataItem::writeRawValue( const BCAbstractTransmitter& transmitter ) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#ifndef BCDATA_H
|
#ifndef BCDATAITEM_H
|
||||||
#define BCDATA_H
|
#define BCDATAITEM_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@@ -114,12 +114,12 @@ public:
|
|||||||
using BCDataTypeCRef = std::optional<std::reference_wrapper<const BCDataType>>;
|
using BCDataTypeCRef = std::optional<std::reference_wrapper<const BCDataType>>;
|
||||||
|
|
||||||
|
|
||||||
class BCData
|
class BCDataItem
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
BCData( const BCDataType& valueType_, BCDevice::ID deviceID_, BC::ID registerID_ );
|
BCDataItem( const BCDataType& valueType_, BCDevice::ID deviceID_, BC::ID registerID_ );
|
||||||
|
|
||||||
void readRawValue( const BCAbstractTransmitter& transmitter ) const;
|
void readRawValue( const BCAbstractTransmitter& transmitter ) const;
|
||||||
void writeRawValue( const BCAbstractTransmitter& transmitter ) const;
|
void writeRawValue( const BCAbstractTransmitter& transmitter ) const;
|
||||||
@@ -141,7 +141,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(BCData*)
|
Q_DECLARE_METATYPE(BCDataItem*)
|
||||||
|
|
||||||
|
|
||||||
struct BCDataParams
|
struct BCDataParams
|
||||||
@@ -168,7 +168,7 @@ constexpr auto to_u(E e) noexcept {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using BCDataList = QVector<BCData>;
|
using BCDataList = QVector<BCDataItem>;
|
||||||
|
|
||||||
|
|
||||||
#endif // BCDATA_H
|
#endif // BCDATAITEM_H
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
BCDataModel::BCDataModel(QObject *parent) : QAbstractListModel(parent) {}
|
BCDataModel::BCDataModel(QObject *parent) : QAbstractListModel(parent) {}
|
||||||
|
|
||||||
void BCDataModel::addValue(const BCData &val)
|
void BCDataModel::addValue(const BCDataItem& val)
|
||||||
{
|
{
|
||||||
int row = _valueList.size();
|
int row = _valueList.size();
|
||||||
beginInsertRows(QModelIndex(), row, row);
|
beginInsertRows(QModelIndex(), row, row);
|
||||||
@@ -55,7 +55,7 @@ BCDataList& BCDataModel::getValueList()
|
|||||||
return _valueList;
|
return _valueList;
|
||||||
}
|
}
|
||||||
|
|
||||||
int BCDataModel::rowCount(const QModelIndex &parent) const
|
int BCDataModel::rowCount(const QModelIndex& parent) const
|
||||||
{
|
{
|
||||||
if (parent.isValid())
|
if (parent.isValid())
|
||||||
return 0;
|
return 0;
|
||||||
@@ -68,7 +68,7 @@ QVariant BCDataModel::data(const QModelIndex& index, int role) const
|
|||||||
if (!index.isValid() || row >= _valueList.size())
|
if (!index.isValid() || row >= _valueList.size())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
BCData& entry = const_cast<BCData&>(_valueList.at( row ));
|
BCDataItem& entry = const_cast<BCDataItem&>(_valueList.at( row ));
|
||||||
entry.rowInModel = row;
|
entry.rowInModel = row;
|
||||||
|
|
||||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||||
@@ -78,7 +78,7 @@ QVariant BCDataModel::data(const QModelIndex& index, int role) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Qt::ItemFlags BCDataModel::flags(const QModelIndex &index) const
|
Qt::ItemFlags BCDataModel::flags(const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
@@ -87,11 +87,11 @@ Qt::ItemFlags BCDataModel::flags(const QModelIndex &index) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BCDataModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
bool BCDataModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
||||||
{
|
{
|
||||||
if (index.isValid() && role == Qt::EditRole)
|
if (index.isValid() && role == Qt::EditRole)
|
||||||
{
|
{
|
||||||
BCData item = _valueList[index.row()];
|
BCDataItem item = _valueList[index.row()];
|
||||||
|
|
||||||
// Wir erwarten hier nur den Value-Teil (vom Slider/Editor)
|
// Wir erwarten hier nur den Value-Teil (vom Slider/Editor)
|
||||||
// Checken ob Int oder Double
|
// Checken ob Int oder Double
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
|
||||||
#include <bcdata.h>
|
#include <bcdataitem.h>
|
||||||
|
|
||||||
|
|
||||||
class BCDataModel : public QAbstractListModel
|
class BCDataModel : public QAbstractListModel
|
||||||
@@ -44,16 +44,16 @@ public:
|
|||||||
|
|
||||||
explicit BCDataModel(QObject *parent = nullptr);
|
explicit BCDataModel(QObject *parent = nullptr);
|
||||||
|
|
||||||
void addValue(const BCData &val);
|
void addValue(const BCDataItem& val);
|
||||||
void setValueList(const BCDataList& valueList);
|
void setValueList(const BCDataList& valueList);
|
||||||
BCDataList& getValueList();
|
BCDataList& getValueList();
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
// Nötig für Editierbarkeit
|
// Nötig für Editierbarkeit
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#include "bcitemdelegate.h"
|
#include "bcitemdelegate.h"
|
||||||
#include "bcdata.h"
|
#include "bcdataitem.h"
|
||||||
#include "qapplication.h"
|
#include "qapplication.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -27,9 +27,9 @@ BCItemDelegate::BCItemDelegate(QListView *view)
|
|||||||
QString BCItemDelegate::displayText(const QVariant& dataValue, const QLocale& locale) const
|
QString BCItemDelegate::displayText(const QVariant& dataValue, const QLocale& locale) const
|
||||||
{
|
{
|
||||||
// Wir prüfen, ob im Variant unser Struct steckt
|
// Wir prüfen, ob im Variant unser Struct steckt
|
||||||
if (dataValue.canConvert<BCData*>())
|
if (dataValue.canConvert<BCDataItem*>())
|
||||||
{
|
{
|
||||||
BCData& bc = *dataValue.value<BCData*>();
|
BCDataItem& bc = *dataValue.value<BCDataItem*>();
|
||||||
qDebug() << " --- YES: " << bc.label;
|
qDebug() << " --- YES: " << bc.label;
|
||||||
// Hier bauen wir den String zusammen, den man sieht,
|
// Hier bauen wir den String zusammen, den man sieht,
|
||||||
// wenn KEIN Editor offen ist.
|
// wenn KEIN Editor offen ist.
|
||||||
@@ -46,13 +46,13 @@ QString BCItemDelegate::displayText(const QVariant& dataValue, const QLocale& lo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget *BCItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
QWidget *BCItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
QVariant rawData = index.data(Qt::EditRole);
|
QVariant rawData = index.data(Qt::EditRole);
|
||||||
if (!rawData.canConvert<BCData*>())
|
if (!rawData.canConvert<BCDataItem*>())
|
||||||
return QStyledItemDelegate::createEditor(parent, option, index);
|
return QStyledItemDelegate::createEditor(parent, option, index);
|
||||||
|
|
||||||
const BCData& bc = *rawData.value<BCData*>();
|
const BCDataItem& bc = *rawData.value<BCDataItem*>();
|
||||||
|
|
||||||
// Nur bei Integern den Slider-Editor bauen
|
// Nur bei Integern den Slider-Editor bauen
|
||||||
if (bc.value.typeId() == QMetaType::Int)
|
if (bc.value.typeId() == QMetaType::Int)
|
||||||
@@ -94,10 +94,10 @@ QWidget *BCItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewIte
|
|||||||
return QStyledItemDelegate::createEditor(parent, option, index);
|
return QStyledItemDelegate::createEditor(parent, option, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
void BCItemDelegate::setEditorData(QWidget *editor, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
// Daten vom Model in den Editor laden
|
// Daten vom Model in den Editor laden
|
||||||
const BCData& bc = *index.data(Qt::EditRole).value<BCData*>();
|
const BCDataItem& bc = *index.data(Qt::EditRole).value<BCDataItem*>();
|
||||||
|
|
||||||
QSlider *slider = editor->findChild<QSlider*>("slider");
|
QSlider *slider = editor->findChild<QSlider*>("slider");
|
||||||
QLabel *lblUnit = editor->findChild<QLabel*>("lblUnit");
|
QLabel *lblUnit = editor->findChild<QLabel*>("lblUnit");
|
||||||
@@ -113,7 +113,7 @@ void BCItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
void BCItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
// Daten vom Editor zurück ins Model speichern (Beim Schließen)
|
// Daten vom Editor zurück ins Model speichern (Beim Schließen)
|
||||||
QSlider *slider = editor->findChild<QSlider*>("slider");
|
QSlider *slider = editor->findChild<QSlider*>("slider");
|
||||||
@@ -126,12 +126,12 @@ void BCItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
void BCItemDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
editor->setGeometry(option.rect);
|
editor->setGeometry(option.rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize BCItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
QSize BCItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
return QStyledItemDelegate::sizeHint(option,index);
|
return QStyledItemDelegate::sizeHint(option,index);
|
||||||
/*
|
/*
|
||||||
@@ -326,7 +326,7 @@ void BCItemDelegate::updateRow(int row)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BCItemDelegate::formatDisplayString(const QModelIndex &index) const
|
QString BCItemDelegate::formatDisplayString(const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return QString();
|
return QString();
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ public:
|
|||||||
QString displayText(const QVariant& dataValue, const QLocale& locale) const override;
|
QString displayText(const QVariant& dataValue, const QLocale& locale) const override;
|
||||||
|
|
||||||
// Zuständig für den Edit-Modus (Doppelklick)
|
// Zuständig für den Edit-Modus (Doppelklick)
|
||||||
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex& index) const override;
|
||||||
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
|
void setEditorData(QWidget *editor, const QModelIndex& index) const override;
|
||||||
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
|
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex& index) const override;
|
||||||
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex& index) const override;
|
||||||
|
|
||||||
QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const override;
|
QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex& index) const override;
|
||||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override;
|
||||||
|
|
||||||
qreal highlightOpacity() const
|
qreal highlightOpacity() const
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ signals:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
void updateRow(int row);
|
void updateRow(int row);
|
||||||
QString formatDisplayString(const QModelIndex &index) const;
|
QString formatDisplayString(const QModelIndex& index) const;
|
||||||
void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
|
||||||
|
|
||||||
int _highlightedRow{-1};
|
int _highlightedRow{-1};
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ void BCTransmitter::onToggleConnectionState( bool connect )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BCTransmitter::enqueueValueOp(BC::OpID opID, const BCData* value)
|
void BCTransmitter::enqueueValueOp(BC::OpID opID, const BCDataItem* value)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_mutex);
|
||||||
_valueQueue.enqueue( value );
|
_valueQueue.enqueue( value );
|
||||||
@@ -83,7 +83,7 @@ void BCTransmitter::processValueOp( BC::OpID opID )
|
|||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
const BCData* currentValue{};
|
const BCDataItem* currentValue{};
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&_mutex);
|
QMutexLocker locker(&_mutex);
|
||||||
if (_valueQueue.isEmpty())
|
if (_valueQueue.isEmpty())
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#include <bcdata.h>
|
#include <bcdataitem.h>
|
||||||
#include <bccandrivertinycan.h>
|
#include <bccandrivertinycan.h>
|
||||||
|
|
||||||
// template ...
|
// template ...
|
||||||
@@ -24,7 +24,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void onToggleConnectionState( bool connect );
|
void onToggleConnectionState( bool connect );
|
||||||
void enqueueValueOp(BC::OpID opID, const BCData* value );
|
void enqueueValueOp(BC::OpID opID, const BCDataItem* value );
|
||||||
void processValueOp(BC::OpID opID);
|
void processValueOp(BC::OpID opID);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -34,7 +34,7 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
using BCDataQueue = QQueue<const BCData*>;
|
using BCDataQueue = QQueue<const BCDataItem*>;
|
||||||
|
|
||||||
BCDataQueue _valueQueue;
|
BCDataQueue _valueQueue;
|
||||||
QMutex _mutex;
|
QMutex _mutex;
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ BCDataManager::BCDataManager(QObject *parent)
|
|||||||
{
|
{
|
||||||
createValueTypes();
|
createValueTypes();
|
||||||
|
|
||||||
//qRegisterMetaType<BCData*>("BCData*");
|
//qRegisterMetaType<BCDataItem*>("BCDataItem*");
|
||||||
qRegisterMetaType<BCData*>();
|
qRegisterMetaType<BCDataItem*>();
|
||||||
|
|
||||||
_transmitter.moveToThread(&_worker);
|
_transmitter.moveToThread(&_worker);
|
||||||
|
|
||||||
@@ -144,9 +144,9 @@ void BCDataManager::onSyncFromDevice()
|
|||||||
BCDataModel* model = _valueModels[_currentDeviceID];
|
BCDataModel* model = _valueModels[_currentDeviceID];
|
||||||
BCDataList& currentList = model->getValueList();
|
BCDataList& currentList = model->getValueList();
|
||||||
|
|
||||||
//BCData& value = currentList[4];
|
//BCDataItem& value = currentList[4];
|
||||||
|
|
||||||
for( const BCData& value : currentList )
|
for( const BCDataItem& value : currentList )
|
||||||
{
|
{
|
||||||
qDebug() << " --- value: " << value.label;
|
qDebug() << " --- value: " << value.label;
|
||||||
|
|
||||||
@@ -294,10 +294,10 @@ void BCDataManager::loadDeviceData( BCDataList& parsedValues )
|
|||||||
};
|
};
|
||||||
|
|
||||||
// __fix! können ungültige werte erzeugt werden ?
|
// __fix! können ungültige werte erzeugt werden ?
|
||||||
//BCData newValue = BCData::makeValue( _currentDeviceID, params );
|
//BCDataItem newValue = BCData::makeDataItem( _currentDeviceID, params );
|
||||||
//if(newValue)
|
//if(newValue)
|
||||||
// parsedValues.push_back( newValue );
|
// parsedValues.push_back( newValue );
|
||||||
std::optional<BCData> newValue = makeValue( _currentDeviceID, params );
|
std::optional<BCDataItem> newValue = makeDataItem( _currentDeviceID, params );
|
||||||
if(newValue)
|
if(newValue)
|
||||||
parsedValues.push_back( *newValue );
|
parsedValues.push_back( *newValue );
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@ void BCDataManager::loadDeviceData( BCDataList& parsedValues )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<BCData> BCDataManager::makeValue( BCDevice::ID deviceID, const BCDataParams& params )
|
std::optional<BCDataItem> BCDataManager::makeDataItem( BCDevice::ID deviceID, const BCDataParams& params )
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -332,7 +332,7 @@ std::optional<BCData> BCDataManager::makeValue( BCDevice::ID deviceID, const BCD
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::optional<BCData> newValue;
|
std::optional<BCDataItem> newValue;
|
||||||
|
|
||||||
std::optional<quint64> IDVal = s_bcValueEnum.keyToValue64( params.ID.toLatin1().constData() );
|
std::optional<quint64> IDVal = s_bcValueEnum.keyToValue64( params.ID.toLatin1().constData() );
|
||||||
if( IDVal.has_value() )
|
if( IDVal.has_value() )
|
||||||
@@ -341,7 +341,7 @@ std::optional<BCData> BCDataManager::makeValue( BCDevice::ID deviceID, const BCD
|
|||||||
{
|
{
|
||||||
|
|
||||||
const BCDataType& valueType = _valueTypes[params.UnitType];
|
const BCDataType& valueType = _valueTypes[params.UnitType];
|
||||||
newValue = BCData( valueType, deviceID, static_cast<BC::ID>(IDVal.value()) );
|
newValue = BCDataItem( valueType, deviceID, static_cast<BC::ID>(IDVal.value()) );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
setIfExists( params.Factor, newValue.factor );
|
setIfExists( params.Factor, newValue.factor );
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
std::optional<BCDataModel*> getModel(BCDevice::ID deviceID );
|
std::optional<BCDataModel*> getModel(BCDevice::ID deviceID );
|
||||||
BCTransmitter* getTransmitter();
|
BCTransmitter* getTransmitter();
|
||||||
|
|
||||||
std::optional<BCData> makeValue( BCDevice::ID deviceID, const BCDataParams& params );
|
std::optional<BCDataItem> makeDataItem( BCDevice::ID deviceID, const BCDataParams& params );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
@@ -64,8 +64,8 @@ public slots:
|
|||||||
signals:
|
signals:
|
||||||
|
|
||||||
// Internes Signal, um Daten an den Worker Thread zu senden
|
// Internes Signal, um Daten an den Worker Thread zu senden
|
||||||
void sendValueCommand( BC::OpID, const BCData* cmd);
|
void sendValueCommand( BC::OpID, const BCDataItem* cmd);
|
||||||
//void valuedTouched(const BCData& cmd);
|
//void valuedTouched(const BCDataItem& cmd);
|
||||||
void valueTouched(int rowInModel );
|
void valueTouched(int rowInModel );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user