-
Notifications
You must be signed in to change notification settings - Fork 531
/
parametereditor.h
108 lines (92 loc) · 3.52 KB
/
parametereditor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
Copyright 2016 - 2017 Benjamin Vedder [email protected]
This file is part of VESC Tool.
VESC Tool 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.
VESC Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PARAMETEREDITOR_H
#define PARAMETEREDITOR_H
#include <QMainWindow>
#include <QLabel>
#include <QTimer>
#include "configparams.h"
namespace Ui {
class ParameterEditor;
}
class ParameterEditor : public QMainWindow
{
Q_OBJECT
public:
explicit ParameterEditor(QWidget *parent = nullptr);
~ParameterEditor();
void saveStateToSettings();
void setParams(const ConfigParams *params);
private slots:
void timerSlot();
void on_paramRemoveButton_clicked();
void on_paramDownButton_clicked();
void on_paramUpButton_clicked();
void on_paramOpenButton_clicked();
void on_paramSaveButton_clicked();
void on_paramResetButton_clicked();
void on_serRemoveButton_clicked();
void on_serDownButton_clicked();
void on_serUpButton_clicked();
void on_serAddButton_clicked();
void on_paramList_doubleClicked(const QModelIndex &index);
void on_enumAddButton_clicked();
void on_enumRemoveButton_clicked();
void on_enumMoveUpButton_clicked();
void on_enumMoveDownButton_clicked();
void on_actionLoad_XML_triggered();
void on_actionSave_XML_as_triggered();
void on_actionDeleteAll_triggered();
void on_doubleTxTypeBox_currentIndexChanged(int index);
void on_actionCalculatePacketSize_triggered();
void on_groupRemoveButton_clicked();
void on_groupDownButton_clicked();
void on_groupUpButton_clicked();
void on_groupAddButton_clicked();
void on_groupEditButton_clicked();
void on_subgroupRemoveButton_clicked();
void on_subgroupDownButton_clicked();
void on_subgroupUpButton_clicked();
void on_subgroupAddButton_clicked();
void on_subgroupEditButton_clicked();
void on_groupParamRemoveButton_clicked();
void on_groupParamDownButton_clicked();
void on_groupParamUpButton_clicked();
void on_groupParamAddButton_clicked();
void on_groupParamEditButton_clicked();
void on_actionExportConfigurationParser_triggered();
void on_actionSave_Configuration_C_Header_as_triggered();
void on_actionSave_Configuration_C_Header_ifdef_wrapped_as_triggered();
void on_actionExportCompressedCArray_triggered();
void on_actionCalculateCompressedCArraySize_triggered();
void on_actionSave_XML_and_export_config_parser_and_compressed_C_array_triggered();
private:
Ui::ParameterEditor *ui;
ConfigParams mParams;
QTimer *mTimer;
QLabel *mStatusLabel;
int mStatusInfoTime;
QString mLastXmlPath;
void updateUi();
void setEditorValues(QString name, ConfigParam p);
QString getEditorValues(ConfigParam *p);
void addEnum(QString name);
void showStatusInfo(QString info, bool isGood);
void updateGroupList();
void updateSubgroupList();
void updateGroupParamList();
void saveParamFileDialog(bool wrapIfdef);
};
#endif // PARAMETEREDITOR_H