3#include <QtCore/QObject>
5#include <QtQmlIntegration/QtQmlIntegration>
44 int rowCount (
const QModelIndex & parent = QModelIndex())
const override;
45 int columnCount (
const QModelIndex &parent = QModelIndex())
const override;
46 QVariant
data (
const QModelIndex & index,
int role = Qt::DisplayRole)
const override;
47 QVariant
headerData (
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
48 QHash<int, QByteArray>
roleNames(
void)
const override;
54 bool _isResetting()
const {
return _resetNestingCount > 0; }
56 int _tableViewColCount = 4;
57 QList<ColumnData> _tableData;
58 uint _resetNestingCount = 0;
68 Q_PROPERTY(QString
name MEMBER
name CONSTANT)
85 Q_PROPERTY(QString
name MEMBER
name CONSTANT)
103 Q_PROPERTY(QString
name MEMBER
name CONSTANT)
109 Q_PROPERTY(QString
units MEMBER
units CONSTANT)
136 Q_PROPERTY(QAbstractTableModel* parameters MEMBER _parameters NOTIFY
parametersChanged)
159 Q_INVOKABLE
void saveToFile (
const QString& filename);
163 Q_INVOKABLE
void refresh (
void);
167 Q_INVOKABLE
bool isFavorite (
const QString& paramName)
const;
184 QStringList favoriteParameterNames (
void)
const;
185 void setCurrentCategory (QObject* currentCategory);
186 void setCurrentGroup (QObject* currentGroup);
209 void _currentCategoryChanged(
void);
210 void _currentGroupChanged (
void);
211 void _searchTextChanged (
void);
212 void _hideReadOnlyChanged (
void);
213 void _buildLists (
void);
214 void _buildListsForComponent(
int compId);
215 void _factAdded (
int compId,
Fact* fact);
218 bool _shouldShow(
Fact *fact)
const;
219 void _performSearch();
220 void _loadFavorites();
221 void _saveFavorites();
222 void _updateDiffSelectedCount();
227 static bool _convertFileValue(
const FactMetaData& metaData,
const QString& fileValueStr, QVariant& typedValue,
228 QString& errorString);
231 template <
typename T,
typename SignalFn>
232 void _setDiffProperty(T& member,
const T& value, SignalFn changedSignal);
239 bool _showModifiedOnly =
false;
240 bool _showFavoritesOnly =
false;
241 bool _hideReadOnly =
false;
242 bool _diffOtherVehicle =
false;
243 bool _diffMultipleComponents =
false;
244 int _diffParsedCount = 0;
245 int _diffUnchangedCount = 0;
246 int _diffReadOnlyCount = 0;
247 int _diffNoVehicleCount = 0;
248 int _diffSendableCount = 0;
249 int _diffSelectedCount = 0;
250 QStringList _diffMissingParams;
251 QStringList _diffInvalidParams;
252 QSet<QString> _favoriteNames;
257 QAbstractTableModel* _parameters =
nullptr;
258 QMap<QString, ParameterEditorCategory*> _mapCategoryName2Category;
FactPanelController(QObject *parent=nullptr)
A Fact is used to hold a single value within the system.
QMap< QString, ParameterEditorGroup * > mapGroupName2Group
QmlObjectListModel groups
ParameterEditorCategory(QObject *parent)
QmlObjectListModel * getGroups(void)
QStringList diffInvalidParams(void) const
void diffMissingParamsChanged(const QStringList &diffMissingParams)
QStringList diffMissingParams(void) const
Q_INVOKABLE void resetAllToVehicleConfiguration(void)
void showFavoritesOnlyChanged(void)
Q_INVOKABLE bool buildDiffFromFile(const QString &filename)
void parametersChanged(void)
int diffParsedCount(void) const
Q_INVOKABLE void refresh(void)
void currentGroupChanged(void)
int diffSendableCount(void) const
void diffSelectedCountChanged(int diffSelectedCount)
QmlObjectListModel * diffList(void)
QmlObjectListModel * categories(void)
void diffMultipleComponentsChanged(bool diffMultipleComponents)
Q_INVOKABLE void toggleFavorite(const QString ¶mName)
QObject * currentCategory(void)
void diffParsedCountChanged(int diffParsedCount)
void diffReadOnlyCountChanged(int diffReadOnlyCount)
int diffReadOnlyCount(void) const
Q_INVOKABLE void clearAllFavorites(void)
void diffNoVehicleCountChanged(int diffNoVehicleCount)
QStringList favoriteParameterNames(void) const
void setCurrentGroup(QObject *currentGroup)
int diffSelectedCount(void) const
Q_INVOKABLE void saveToFile(const QString &filename)
void diffUnchangedCountChanged(int diffUnchangedCount)
ParameterEditorController(QObject *parent=nullptr)
void searchTextChanged(QString searchText)
Q_INVOKABLE void sendDiff(void)
void currentCategoryChanged(void)
void diffOtherVehicleChanged(bool diffOtherVehicle)
void setCurrentCategory(QObject *currentCategory)
void diffSendableCountChanged(int diffSendableCount)
void favoritesChanged(void)
int diffNoVehicleCount(void) const
bool diffMultipleComponents(void) const
Q_INVOKABLE bool isFavorite(const QString ¶mName) const
void diffInvalidParamsChanged(const QStringList &diffInvalidParams)
bool diffOtherVehicle(void) const
Q_INVOKABLE void clearDiff(void)
void showModifiedOnlyChanged(void)
int diffUnchangedCount(void) const
QObject * currentGroup(void)
Q_INVOKABLE void resetAllToDefaults(void)
void hideReadOnlyChanged(void)
bool invalidFileValue
File value cannot be converted to the parameter's type.
bool cannotSend
Shown but never sent: MP param not on vehicle, or invalid file value.
void loadChanged(bool load)
FactMetaData::ValueType_t valueType
ParameterEditorDiff(QObject *parent)
QAbstractTableModel * getFacts(void)
ParameterEditorGroup(QObject *parent)
ParameterTableModel facts
QVector< QVariant > ColumnData
void insert(int row, Fact *fact)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QHash< int, QByteArray > roleNames(void) const override
~ParameterTableModel() override
void rowCountChanged(int count)
void endReset()
Supports nesting - only outermost call has effect.
void beginReset()
Supports nesting - only outermost call has effect.
ParameterTableModel(QObject *parent=nullptr)
Fact * factAt(int row) const