feat(cpn): add support for surface radios inc Radiomaster MT12 (#5381)

This commit is contained in:
Neil Horne
2024-09-26 20:39:51 +10:00
committed by GitHub
parent 2bd62c95c8
commit 149e1a2df0
90 changed files with 3746 additions and 2387 deletions
+11 -6
View File
@@ -19,8 +19,7 @@
* GNU General Public License for more details.
*/
#ifndef _FLIGHTMODES_H_
#define _FLIGHTMODES_H_
#pragma once
#include "modeledit.h"
#include "eeprominterface.h"
@@ -43,7 +42,7 @@ class FlightModePanel : public ModelPanel
public:
FlightModePanel(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, Firmware * firmware,
FilteredItemModel * rawSwitchFilteredModel);
FilteredItemModel * rawSwitchFilteredModel, QString radioType);
virtual ~FlightModePanel();
virtual void update();
@@ -54,6 +53,9 @@ class FlightModePanel : public ModelPanel
void phaseNameChanged();
void phaseSwitchChanged();
public slots:
void onThrottleReverseChanged();
private slots:
void phaseName_editingFinished();
void phaseSwitch_currentIndexChanged(int index);
@@ -119,6 +121,7 @@ class FlightModePanel : public ModelPanel
QVector<QSpinBox *> trimsValue;
QVector<QSlider *> trimsSlider;
Board::Type board;
QString radioType;
void trimUpdate(unsigned int trim);
void updateGVar(int index);
@@ -141,6 +144,7 @@ class FlightModePanel : public ModelPanel
bool gvMoveUpAllowed() const;
void gvSwapData(int idx1, int idx2);
void connectItemModelEvents(const FilteredItemModel * itemModel);
void populateGvarUseCB(QComboBox *b, unsigned int phase);
};
class FlightModesPanel : public ModelPanel
@@ -153,9 +157,11 @@ class FlightModesPanel : public ModelPanel
public slots:
virtual void update() override;
void onThrottleReverseChanged();
signals:
void updated();
void refreshThrottleTrim();
private slots:
void onPhaseNameChanged();
@@ -171,9 +177,8 @@ class FlightModesPanel : public ModelPanel
CompoundItemModelFactory *sharedItemModels;
FilteredItemModel *rawSwitchFilteredModel;
QVector<GenericPanel *> panels;
QString radioType;
void updateItemModels();
void connectItemModelEvents(const FilteredItemModel * itemModel);
};
#endif // _FLIGHTMODES_H_