Files
BionxControl/bcvaluemodel.h

79 lines
2.2 KiB
C
Raw Normal View History

2025-12-17 16:26:22 +01:00
/***************************************************************************
2025-12-26 14:07:55 +01:00
BionxControl
2026-01-03 23:51:14 +01:00
© 2025 -2026 christoph holzheuer
2025-12-26 14:07:55 +01:00
christoph.holzheuer@gmail.com
2025-12-17 16:26:22 +01:00
2025-12-26 14:07:55 +01:00
Using:
2025-12-17 16:26:22 +01:00
2025-12-26 14:07:55 +01:00
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
2025-12-17 16:26:22 +01:00
2025-12-26 14:07:55 +01:00
Based on Bionx data type descriptions from:
2025-12-17 16:26:22 +01:00
2025-12-26 14:07:55 +01:00
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
2025-12-17 16:26:22 +01:00
2025-12-26 14:07:55 +01:00
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
2025-12-17 16:26:22 +01:00
***************************************************************************/
2025-12-26 15:19:33 +01:00
#ifndef BCVALUEMODEL_H
#define BCVALUEMODEL_H
2025-12-17 16:26:22 +01:00
#include <QAbstractTableModel>
2025-12-28 22:48:18 +01:00
#include <bcvalue.h>
2025-12-17 16:26:22 +01:00
2025-12-26 15:19:33 +01:00
/**
* @brief Das BCValueModel dient als Interface zu den eigentlichen Daten,
* der BCValueList und besitzt diese.
*
* Ist das so schlau?
*
*/
2025-12-17 16:26:22 +01:00
2025-12-26 15:19:33 +01:00
class BCValueModel : public QAbstractTableModel
2025-12-17 16:26:22 +01:00
{
Q_OBJECT
public:
2025-12-26 15:19:33 +01:00
explicit BCValueModel(QObject *parent = nullptr);
2025-12-19 17:37:24 +01:00
2025-12-28 14:42:12 +01:00
void takeValueList(BCValueList& valueList);
2025-12-28 22:48:18 +01:00
const BCValueList& getValueList() const;
2025-12-17 16:26:22 +01:00
2025-12-24 14:44:54 +01:00
// Pure Virtual Functions von QAbstractTableModel
2025-12-26 15:19:33 +01:00
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
2025-12-24 14:44:54 +01:00
2025-12-31 13:38:46 +01:00
//QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
2025-12-26 15:19:33 +01:00
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
2025-12-17 16:26:22 +01:00
// Nötig für Editierbarkeit
2025-12-23 11:09:26 +01:00
Qt::ItemFlags flags(const QModelIndex& index) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
2025-12-17 16:26:22 +01:00
2026-01-07 17:13:35 +01:00
void updateValue(int row, BCValue::Flag state, uint32_t rawValue );
2025-12-28 22:48:18 +01:00
protected:
2025-12-17 16:26:22 +01:00
2025-12-26 23:09:53 +01:00
// Die eigentlichen Werte wohnen im tatsächlich hier, im Model.
2025-12-26 15:19:33 +01:00
BCValueList _valueList;
2025-12-17 16:26:22 +01:00
};
2025-12-26 15:19:33 +01:00
#endif // BCVALUEMODEL_H