5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
24 #include "modeledit.h"
25 #include "eeprominterface.h"
31 class TelemetryAnalog
;
32 class TelemetryCustomScreen
;
33 class TelemetrySensor
;
37 class TelemetryAnalog
: public ModelPanel
41 friend class TelemetryPanel
;
44 TelemetryAnalog(QWidget
*parent
, FrSkyChannelData
& analog
, ModelData
& model
, GeneralSettings
& generalSettings
, Firmware
* firmware
);
45 virtual ~TelemetryAnalog();
51 void on_UnitCB_currentIndexChanged(int index
);
52 void on_RatioSB_editingFinished();
53 void on_RatioSB_valueChanged();
54 void on_CalibSB_editingFinished();
55 void on_alarm1LevelCB_currentIndexChanged(int index
);
56 void on_alarm1GreaterCB_currentIndexChanged(int index
);
57 void on_alarm1ValueSB_editingFinished();
58 void on_alarm2LevelCB_currentIndexChanged(int index
);
59 void on_alarm2GreaterCB_currentIndexChanged(int index
);
60 void on_alarm2ValueSB_editingFinished();
63 Ui::TelemetryAnalog
*ui
;
64 FrSkyChannelData
& analog
;
70 class TelemetryCustomScreen
: public ModelPanel
75 TelemetryCustomScreen(QWidget
*parent
, ModelData
& model
, FrSkyScreenData
& screen
, GeneralSettings
& generalSettings
, Firmware
* firmware
);
76 ~TelemetryCustomScreen();
80 void on_screenType_currentIndexChanged(int index
);
81 void scriptNameEdited();
82 void customFieldChanged(int index
);
83 void barSourceChanged(int index
);
84 void barMinChanged(double value
);
85 void barMaxChanged(double value
);
86 void barTimeChanged();
89 void populateTelemetrySourceCB(QComboBox
* b
, RawSource
& source
, bool last
=false);
92 void updateBar(int line
);
93 Ui::TelemetryCustomScreen
* ui
;
94 FrSkyScreenData
& screen
;
95 QComboBox
* fieldsCB
[4][3];
96 QComboBox
* barsCB
[4];
97 QDoubleSpinBox
* minSB
[4];
98 QDoubleSpinBox
* maxSB
[4];
99 TimerEdit
* minTime
[4];
100 TimerEdit
* maxTime
[4];
103 class TelemetrySensorPanel
: public ModelPanel
108 TelemetrySensorPanel(QWidget
*parent
, SensorData
& sensor
, ModelData
& model
, GeneralSettings
& generalSettings
, Firmware
* firmware
);
109 ~TelemetrySensorPanel();
116 void on_name_editingFinished();
117 void on_type_currentIndexChanged(int index
);
118 void on_formula_currentIndexChanged(int index
);
119 void on_unit_currentIndexChanged(int index
);
120 void on_prec_valueChanged(double value
);
123 void updateSourcesComboBox(AutoComboBox
* cb
, bool negative
);
126 Ui::TelemetrySensor
* ui
;
131 class TelemetryPanel
: public ModelPanel
136 TelemetryPanel(QWidget
*parent
, ModelData
& model
, GeneralSettings
& generalSettings
, Firmware
* firmware
);
137 virtual ~TelemetryPanel();
138 virtual void update();
141 void on_telemetryProtocol_currentIndexChanged(int index
);
143 void on_frskyProtoCB_currentIndexChanged(int index
);
144 void on_bladesCount_editingFinished();
145 void on_rssiAlarmWarningCB_currentIndexChanged(int index
);
146 void on_rssiAlarmCriticalCB_currentIndexChanged(int index
);
147 void on_rssiAlarmWarningSB_editingFinished();
148 void on_rssiAlarmCriticalSB_editingFinished();
149 void on_varioLimitMin_DSB_editingFinished();
150 void on_varioLimitMax_DSB_editingFinished();
151 void on_varioLimitCenterMin_DSB_editingFinished();
152 void on_varioLimitCenterMax_DSB_editingFinished();
153 void on_fasOffset_DSB_editingFinished();
154 void on_mahCount_SB_editingFinished();
155 void on_mahCount_ChkB_toggled(bool checked
);
159 TelemetryAnalog
* analogs
[4];
160 TelemetryCustomScreen
* telemetryCustomScreens
[4];
161 TelemetrySensorPanel
* sensorPanels
[CPN_MAX_SENSORS
];
165 void populateVoltsSource();
166 void populateCurrentSource();
167 void populateVarioSource();
170 #endif // _TELEMETRY_H_