Refactor to Model level ui datamodels for sources, switches and curves
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class RawSwitchFilterItemModel;
|
||||
class RawSwitchItemModel;
|
||||
class RawItemFilteredModel;
|
||||
|
||||
constexpr char MIMETYPE_FLIGHTMODE[] = "application/x-companion-flightmode";
|
||||
constexpr char MIMETYPE_GVAR_PARAMS[] = "application/x-companion-gvar-params";
|
||||
@@ -40,14 +41,16 @@ class FlightModePanel : public ModelPanel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FlightModePanel(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, Firmware * firmware, RawSwitchFilterItemModel * switchModel);
|
||||
FlightModePanel(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, Firmware * firmware, RawItemFilteredModel * switchModel);
|
||||
virtual ~FlightModePanel();
|
||||
|
||||
virtual void update();
|
||||
|
||||
signals:
|
||||
void nameModified();
|
||||
void datachanged();
|
||||
void gvNameChanged();
|
||||
void phaseDataChanged();
|
||||
void phaseNameChanged();
|
||||
void phaseNoSwitchSet();
|
||||
|
||||
private slots:
|
||||
void phaseName_editingFinished();
|
||||
@@ -87,6 +90,8 @@ class FlightModePanel : public ModelPanel
|
||||
void gvCmPaste();
|
||||
void gvCmMoveDown();
|
||||
void gvCmMoveUp();
|
||||
void onModelDataAboutToBeUpdated();
|
||||
void onModelDataUpdateComplete();
|
||||
|
||||
private:
|
||||
Ui::FlightMode *ui;
|
||||
@@ -111,7 +116,6 @@ class FlightModePanel : public ModelPanel
|
||||
QVector<QComboBox *> trimsUse;
|
||||
QVector<QSpinBox *> trimsValue;
|
||||
QVector<QSlider *> trimsSlider;
|
||||
RawSwitchFilterItemModel * rawSwitchItemModel;
|
||||
Board::Type board;
|
||||
|
||||
void trimUpdate(unsigned int trim);
|
||||
@@ -141,24 +145,28 @@ class FlightModesPanel : public ModelPanel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FlightModesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
FlightModesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware, RawSwitchItemModel * rawSwitchItemModel);
|
||||
virtual ~FlightModesPanel();
|
||||
|
||||
public slots:
|
||||
virtual void update() override;
|
||||
|
||||
signals:
|
||||
void updateDataModels();
|
||||
void updated();
|
||||
|
||||
private slots:
|
||||
void onPhaseNameChanged();
|
||||
void refreshDataModels();
|
||||
void onTabIndexChanged(int index);
|
||||
|
||||
private:
|
||||
QString getTabName(int index);
|
||||
|
||||
int modesCount;
|
||||
QTabWidget *tabWidget;
|
||||
|
||||
RawItemFilteredModel *rawSwitchFilteredModel;
|
||||
QVector<GenericPanel *> panels;
|
||||
};
|
||||
|
||||
#endif // _FLIGHTMODES_H_
|
||||
|
||||
Reference in New Issue
Block a user