26 #ifndef CONFIGccpmWIDGET_H
27 #define CONFIGccpmWIDGET_H
30 #include "../uavobjectwidgetutils/configtaskwidget.h"
35 #include <QtSvg/QSvgRenderer>
36 #include <QtSvg/QGraphicsSvgItem>
37 #include <QGraphicsEllipseItem>
41 #define CCPM_MAX_SWASH_SERVOS 4
47 int ServoChannels[CCPM_MAX_SWASH_SERVOS];
48 int Used[CCPM_MAX_SWASH_SERVOS];
49 int Max[CCPM_MAX_SWASH_SERVOS];
50 int Neutral[CCPM_MAX_SWASH_SERVOS];
51 int Min[CCPM_MAX_SWASH_SERVOS];
65 Ui_CcpmWidget *m_ccpm;
66 QGraphicsSvgItem *SwashplateImg;
67 QGraphicsSvgItem *CurveImg;
68 QGraphicsSvgItem *Servos[CCPM_MAX_SWASH_SERVOS];
69 QGraphicsTextItem *ServosText[CCPM_MAX_SWASH_SERVOS];
70 QGraphicsLineItem *ServoLines[CCPM_MAX_SWASH_SERVOS];
71 QGraphicsEllipseItem *ServosTextCircles[CCPM_MAX_SWASH_SERVOS];
72 QSpinBox *SwashLvlSpinBoxes[CCPM_MAX_SWASH_SERVOS];
76 bool SwashLvlConfigurationInProgress;
77 UAVObject::Metadata SwashLvlaccInitialData;
79 int SwashLvlServoInterlock;
84 int MixerChannelData[6];
85 int ShowDisclaimer(
int messageID);
88 bool updatingFromHardware;
89 bool updatingToHardware;
94 SystemSettings::AirframeTypeOptions updateConfigObjects();
96 virtual void setupUI(SystemSettings::AirframeTypeOptions airframeType);
97 void refreshAirframeWidgetsValues(SystemSettings::AirframeTypeOptions frameType);
98 virtual SystemSettings::AirframeTypeOptions updateConfigObjectsFromWidgets();
99 virtual bool throwConfigError(SystemSettings::AirframeTypeOptions airframeType);
101 void ccpmSwashplateUpdate();
102 void ccpmSwashplateRedraw();
106 void SwashLvlStartButtonPressed();
107 void SwashLvlNextButtonPressed();
108 void SwashLvlCancelButtonPressed();
109 void SwashLvlFinishButtonPressed();
114 void SetUIComponentVisibilities();
116 void enableSwashplateLevellingControl(
bool state);
117 void setSwashplateLevel(
int percent);
118 void SwashLvlSpinBoxChanged(
int value);
119 virtual void refreshValues(){};
131 #endif // CONFIGccpmWIDGET_H
ConfigCcpmWidget(QWidget *parent=nullptr)
void showEvent(QShowEvent *event)
void resizeEvent(QResizeEvent *event)
static QStringList getChannelDescriptions()