-
Notifications
You must be signed in to change notification settings - Fork 49
/
parametereditor.h
82 lines (67 loc) · 2.44 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
/*
Original copyright 2018 Benjamin Vedder [email protected] and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Now forked to:
Danny Bokma [email protected]
This file is part of BMS Tool.
DieBieMS 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.
DieBieMS 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 = 0);
~ParameterEditor();
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();
private:
Ui::ParameterEditor *ui;
ConfigParams mParams;
QTimer *mTimer;
QLabel *mStatusLabel;
int mStatusInfoTime;
void updateUi();
void setEditorValues(QString name, ConfigParam p);
QString getEditorValues(ConfigParam *p);
void addEnum(QString name);
void showStatusInfo(QString info, bool isGood);
};
#endif // PARAMETEREDITOR_H