dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
outputcalibrationpage.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef OUTPUTCALIBRATIONPAGE_H
29 #define OUTPUTCALIBRATIONPAGE_H
30 
31 #include <QtSvg>
32 #include "abstractwizardpage.h"
33 #include "setupwizard.h"
34 #include "outputcalibrationutil.h"
36 
37 namespace Ui {
39 }
40 
42 {
43  Q_OBJECT
44 
45 public:
46  explicit OutputCalibrationPage(SetupWizard *wizard, QWidget *parent = nullptr);
48  void initializePage();
49  bool validatePage();
50 
51  bool isFinished() { return m_currentWizardIndex >= m_wizardIndexes.size() - 1; }
52 
53 protected:
54  void showEvent(QShowEvent *event);
55  void resizeEvent(QResizeEvent *event);
56 
57 public slots:
58  void customBackClicked();
59 
60 private slots:
61  void on_motorNeutralButton_toggled(bool checked);
62  void on_motorNeutralSlider_valueChanged(int value);
63 
64  void on_servoCenterButton_toggled(bool checked);
65  void on_servoCenterSlider_valueChanged(int position);
66 
67  void on_servoMinAngleButton_toggled(bool checked);
68  void on_servoMinAngleSlider_valueChanged(int position);
69 
70  void on_servoMaxAngleButton_toggled(bool checked);
71  void on_servoMaxAngleSlider_valueChanged(int position);
72 
73 private:
74  void setupVehicle();
75  void startWizard();
76  void setupVehicleItems();
77  void setupVehicleHighlightedPart();
78  void setWizardPage();
79  void enableButtons(bool enable);
80  void onStartButtonToggle(QAbstractButton *button, quint16 channel, quint16 value,
81  quint16 safeValue, QSlider *slider);
82  bool checkAlarms();
83  void debugLogChannelValues();
84  quint16 getCurrentChannel();
85 
86  Ui::OutputCalibrationPage *ui;
87  QSvgRenderer *m_vehicleRenderer;
88  QGraphicsScene *m_vehicleScene;
89  QGraphicsSvgItem *m_vehicleBoundsItem;
90 
91  qint16 m_currentWizardIndex;
92 
93  QList<QString> m_vehicleElementIds;
94  QList<QGraphicsSvgItem *> m_vehicleItems;
95  QList<quint16> m_vehicleHighlightElementIndexes;
96  QList<quint16> m_channelIndex;
97  QList<quint16> m_wizardIndexes;
98 
99  QList<actuatorChannelSettings> m_actuatorSettings;
100 
101  OutputCalibrationUtil *m_calibrationUtil;
102 };
103 
104 #endif // OUTPUTCALIBRATIONPAGE_H
OutputCalibrationPage(SetupWizard *wizard, QWidget *parent=nullptr)
void showEvent(QShowEvent *event)
The SetupWizard class is the main interface to the setup wizard. It provides selects the sequence of ...
Definition: setupwizard.h:47
void resizeEvent(QResizeEvent *event)