1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 00:05:17 +03:00

36 switches hidden in Companion when no Multipos switches ...

This commit is contained in:
bsongis 2014-04-02 10:25:07 +02:00
parent a522dc149f
commit 1bf95c9438
29 changed files with 101 additions and 93 deletions

View file

@ -361,8 +361,10 @@ void populateBacklightCB(QComboBox *b, const uint8_t value)
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
{
GeneralSettings fakeSettings;
if (IS_ARM(GetEepromInterface()->getBoard())) {
populateSwitchCB(b, value);
populateSwitchCB(b, value, fakeSettings);
}
else {
RawSwitch item;
@ -387,7 +389,7 @@ void populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
}
}
void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr)
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr)
{
RawSwitch item;
@ -417,11 +419,15 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr)
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=-GetEepromInterface()->getCapability(MultiposPots) * GetEepromInterface()->getCapability(MultiposPotsPositions); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i);
for (int i=GetEepromInterface()->getCapability(MultiposPots)-1; i>=0; i--) {
if (generalSettings.potsType[i] == 2/* TODO constant*/) {
for (int j=-GetEepromInterface()->getCapability(MultiposPotsPositions); j<0; j++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i*GetEepromInterface()->getCapability(MultiposPotsPositions)+j);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
}
for (int i=-GetEepromInterface()->getCapability(SwitchesPositions); i<0; i++) {
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
@ -448,11 +454,15 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr)
if (item == value) b->setCurrentIndex(b->count()-1);
}
for (int i=1; i<=GetEepromInterface()->getCapability(MultiposPots) * GetEepromInterface()->getCapability(MultiposPotsPositions); i++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i);
for (int i=0; i<GetEepromInterface()->getCapability(MultiposPots); i++) {
if (generalSettings.potsType[i] == 2/* TODO constant*/) {
for (int j=1; j<=GetEepromInterface()->getCapability(MultiposPotsPositions); j++) {
item = RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i*GetEepromInterface()->getCapability(MultiposPotsPositions)+j);
b->addItem(item.toString(), item.toValue());
if (item == value) b->setCurrentIndex(b->count()-1);
}
}
}
for (int i=1; i<=8; i++) {
item = RawSwitch(SWITCH_TYPE_TRIM, i);

View file

@ -85,7 +85,7 @@ class CurveGroup : public QObject {
#define POPULATE_ONOFF 0x01
#define POPULATE_TIMER_MODES 0x02
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value);
void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr=0);
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr=0);
void populatePhasesCB(QComboBox *b, int value);
void populateGvarUseCB(QComboBox *b, unsigned int phase);

View file

@ -6,8 +6,8 @@
#include <QCheckBox>
#include <QDoubleSpinBox>
Channels::Channels(QWidget * parent, ModelData & model):
ModelPanel(parent, model)
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings)
{
QGridLayout * gridLayout = new QGridLayout(this);
bool minimize = false;

View file

@ -8,7 +8,7 @@ class Channels : public ModelPanel
Q_OBJECT
public:
Channels(QWidget *parent, ModelData & model);
Channels(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
~Channels();
private slots:

View file

@ -130,8 +130,8 @@ float curveSymmetricalX(float x, float coeff, float yMin, float yMid, float yMax
#endif
#endif
Curves::Curves(QWidget * parent, ModelData & model):
ModelPanel(parent, model),
Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
ui(new Ui::Curves),
currentCurve(0)
{

View file

@ -21,7 +21,7 @@ class Curves : public ModelPanel
Q_OBJECT
public:
Curves(QWidget *parent, ModelData & model);
Curves(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
virtual ~Curves();
virtual void update();

View file

@ -48,8 +48,7 @@ void RepeatComboBox::update()
}
CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model),
generalSettings(generalSettings),
ModelPanel(parent, model, generalSettings),
initialized(false),
phononCurrent(-1),
clickObject(NULL),
@ -476,7 +475,7 @@ void CustomFunctionsPanel::update()
lock = true;
for (int i=0; i<GetEepromInterface()->getCapability(CustomFunctions); i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, POPULATE_ONOFF);
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
@ -497,7 +496,7 @@ void CustomFunctionsPanel::fswPaste()
FuncSwData *fsw = &model.funcSw[selectedFunction];
memcpy(fsw, fswData.mid(0, sizeof(FuncSwData)).constData(), sizeof(FuncSwData));
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
refreshCustomFunction(selectedFunction);
lock = false;
@ -510,7 +509,7 @@ void CustomFunctionsPanel::fswDelete()
model.funcSw[selectedFunction].clear();
// TODO update switch and func
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, POPULATE_ONOFF);
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, POPULATE_ONOFF);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
refreshCustomFunction(selectedFunction);
lock = false;

View file

@ -61,7 +61,6 @@ class CustomFunctionsPanel : public ModelPanel
void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode=0);
void populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList);
GeneralSettings & generalSettings;
bool initialized;
QStringList paramarmList;
int phononCurrent;

View file

@ -2,10 +2,11 @@
#include "ui_expodialog.h"
#include "helpers.h"
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, int stickMode, char * inputName) :
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings, char * inputName) :
QDialog(parent),
ui(new Ui::ExpoDialog),
model(model),
generalSettings(generalSettings),
ed(expoData),
inputName(inputName)
{
@ -23,7 +24,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
populateSwitchCB(ui->switchesCB,ed->swtch);
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings);
ui->sideCB->setCurrentIndex(ed->mode-1);

View file

@ -14,7 +14,7 @@ namespace Ui {
class ExpoDialog : public QDialog {
Q_OBJECT
public:
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, int stickMode, char * inputName);
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings, char * inputName);
~ExpoDialog();
protected:
@ -27,6 +27,7 @@ class ExpoDialog : public QDialog {
private:
Ui::ExpoDialog * ui;
ModelData & model;
GeneralSettings & generalSettings;
ExpoData * ed;
char * inputName;
GVarGroup * gvGroup;

View file

@ -6,9 +6,8 @@
#include <QGridLayout>
FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings):
ModelPanel(parent, model),
ModelPanel(parent, model, generalSettings),
ui(new Ui::FlightMode),
generalSettings(generalSettings),
phaseIdx(phaseIdx),
phase(model.phaseData[phaseIdx]),
reCount(GetEepromInterface()->getCapability(RotaryEncoders)),
@ -32,7 +31,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
// Phase switch
if (phaseIdx > 0) {
populateSwitchCB(ui->swtch, phase.swtch);
populateSwitchCB(ui->swtch, phase.swtch, generalSettings);
connect(ui->swtch, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseSwitch_currentIndexChanged(int)));
}
else {
@ -401,7 +400,7 @@ void FlightMode::phaseTrimSlider_valueChanged()
/**********************************************************/
FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model),
ModelPanel(parent, model, generalSettings),
modesCount(GetEepromInterface()->getCapability(FlightPhases))
{
QGridLayout * gridLayout = new QGridLayout(this);

View file

@ -42,7 +42,6 @@ class FlightMode : public ModelPanel
private:
Ui::FlightMode *ui;
GeneralSettings & generalSettings;
int phaseIdx;
PhaseData & phase;
int reCount;

View file

@ -2,8 +2,8 @@
#include "ui_heli.h"
#include "helpers.h"
HeliPanel::HeliPanel(QWidget *parent, ModelData & model):
ModelPanel(parent, model),
HeliPanel::HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
ui(new Ui::Heli)
{
ui->setupUi(this);

View file

@ -12,7 +12,7 @@ class HeliPanel : public ModelPanel
Q_OBJECT
public:
HeliPanel(QWidget *parent, ModelData & model);
HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
~HeliPanel();
void update();

View file

@ -4,8 +4,7 @@
#include "helpers.h"
InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model),
generalSettings(generalSettings),
ModelPanel(parent, model, generalSettings),
expoInserted(false)
{
QGridLayout * exposLayout = new QGridLayout(this);
@ -175,7 +174,7 @@ void InputsPanel::gm_openExpo(int index)
if (GetEepromInterface()->getCapability(VirtualInputs))
strcpy(inputName, model.inputNames[mixd.chn]);
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings.stickMode, inputName);
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings, inputName);
if (g->exec()) {
model.expoData[index] = mixd;
if (GetEepromInterface()->getCapability(VirtualInputs))

View file

@ -31,7 +31,6 @@ class InputsPanel : public ModelPanel
void expoAdd();
private:
GeneralSettings & generalSettings;
bool expoInserted;
MixersList *ExposlistWidget;

View file

@ -7,8 +7,8 @@
#include <QDoubleSpinBox>
#include "helpers.h"
LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model):
ModelPanel(parent, model),
LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
selectedSwitch(0)
{
QGridLayout * gridLayout = new QGridLayout(this);
@ -303,12 +303,12 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
case LS_FAMILY_VBOOL:
case LS_FAMILY_STICKY:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2));
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2), generalSettings);
break;
case LS_FAMILY_STAY:
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, true);
break;

View file

@ -10,7 +10,7 @@ class LogicalSwitchesPanel : public ModelPanel
Q_OBJECT
public:
LogicalSwitchesPanel(QWidget *parent, ModelData & model);
LogicalSwitchesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
virtual ~LogicalSwitchesPanel();
virtual void update();

View file

@ -3,10 +3,11 @@
#include "eeprominterface.h"
#include "helpers.h"
MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, int stickMode) :
MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, GeneralSettings & generalSettings) :
QDialog(parent),
ui(new Ui::MixerDialog),
model(model),
generalSettings(generalSettings),
md(mixdata),
lock(false)
{
@ -76,7 +77,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, i
}
}
populateSwitchCB(ui->switchesCB,md->swtch);
populateSwitchCB(ui->switchesCB, md->swtch, generalSettings);
ui->warningCB->setCurrentIndex(md->mixWarn);
ui->mltpxCB->setCurrentIndex(md->mltpx);
int scale=GetEepromInterface()->getCapability(SlowScale);

View file

@ -14,7 +14,7 @@ namespace Ui {
class MixerDialog : public QDialog {
Q_OBJECT
public:
MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, int stickMode);
MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, GeneralSettings & generalSettings);
~MixerDialog();
protected:
@ -27,6 +27,7 @@ class MixerDialog : public QDialog {
private:
Ui::MixerDialog *ui;
ModelData & model;
GeneralSettings & generalSettings;
MixData *md;
bool lock;
GVarGroup * gvWeightGroup;

View file

@ -4,8 +4,7 @@
// #include "expodialog.h"
MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model),
generalSettings(generalSettings),
ModelPanel(parent, model, generalSettings),
mixInserted(false)
{
QGridLayout * mixesLayout = new QGridLayout(this);
@ -193,7 +192,7 @@ void MixesPanel::gm_openMix(int index)
emit modified();
update();
MixerDialog *g = new MixerDialog(this, model, &mixd, generalSettings.stickMode);
MixerDialog *g = new MixerDialog(this, model, &mixd, generalSettings);
if(g->exec()) {
model.mixData[index] = mixd;
emit modified();

View file

@ -38,7 +38,6 @@ class MixesPanel : public ModelPanel
void mixesEdited();
private:
GeneralSettings & generalSettings;
MixersList *MixerlistWidget;
bool mixInserted;

View file

@ -25,18 +25,18 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
setWindowIcon(CompanionIcon("edit.png"));
restoreGeometry(g.modelEditGeo());
ui->pushButton->setIcon(CompanionIcon("simulate.png"));
addTab(new Setup(this, model), tr("Setup"));
addTab(new HeliPanel(this, model), tr("Heli"));
addTab(new FlightModes(this, model, radioData.generalSettings), tr("Flight Modes"));
addTab(new InputsPanel(this, model, radioData.generalSettings), tr("Inputs"));
addTab(new MixesPanel(this, model, radioData.generalSettings), tr("Mixes"));
addTab(new Channels(this, model), tr("Channels"));
addTab(new LogicalSwitchesPanel(this, model), tr("Logical Switches"));
addTab(new Setup(this, model, generalSettings), tr("Setup"));
addTab(new HeliPanel(this, model, generalSettings), tr("Heli"));
addTab(new FlightModes(this, model, generalSettings), tr("Flight Modes"));
addTab(new InputsPanel(this, model, generalSettings), tr("Inputs"));
addTab(new MixesPanel(this, model, generalSettings), tr("Mixes"));
addTab(new Channels(this, model, generalSettings), tr("Channels"));
addTab(new LogicalSwitchesPanel(this, model, generalSettings), tr("Logical Switches"));
if (GetEepromInterface()->getCapability(CustomFunctions))
addTab(new CustomFunctionsPanel(this, model, radioData.generalSettings), tr("Special Functions"));
addTab(new Curves(this, model), tr("Curves"));
addTab(new CustomFunctionsPanel(this, model, generalSettings), tr("Special Functions"));
addTab(new Curves(this, model, generalSettings), tr("Curves"));
if (GetEepromInterface()->getCapability(Telemetry) & TM_HASTELEMETRY)
addTab(new TelemetryPanel(this, model), tr("Telemetry"));
addTab(new TelemetryPanel(this, model, generalSettings), tr("Telemetry"));
}
ModelEdit::~ModelEdit()

View file

@ -1,9 +1,10 @@
#include "modelpanel.h"
#include <QLabel>
ModelPanel::ModelPanel(QWidget * parent, ModelData & model):
ModelPanel::ModelPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings):
QWidget(parent),
model(model),
generalSettings(generalSettings),
lock(false)
{
}

View file

@ -10,7 +10,7 @@ class ModelPanel : public QWidget
Q_OBJECT
public:
ModelPanel(QWidget *parent, ModelData & model);
ModelPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
virtual ~ModelPanel();
signals:
@ -21,6 +21,7 @@ class ModelPanel : public QWidget
protected:
ModelData & model;
GeneralSettings & generalSettings;
bool lock;
void addLabel(QGridLayout * gridLayout, QString text, int col, bool mimimize=false);
void addEmptyLabel(QGridLayout * gridLayout, int col);

View file

@ -5,8 +5,8 @@
#include "helpers.h"
#include "appdata.h"
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer):
ModelPanel(parent, model),
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
timer(timer),
ui(new Ui::Timer)
{
@ -15,7 +15,7 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer):
lock = true;
// Mode
populateSwitchCB(ui->mode, timer.mode, POPULATE_TIMER_MODES);
populateSwitchCB(ui->mode, timer.mode, generalSettings, POPULATE_TIMER_MODES);
if (!GetEepromInterface()->getCapability(PermTimers)) {
ui->persistent->hide();
@ -94,8 +94,8 @@ void TimerPanel::on_minuteBeep_toggled(bool checked)
/******************************************************************************/
ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, int moduleIdx):
ModelPanel(parent, model),
ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, int moduleIdx):
ModelPanel(parent, model, generalSettings),
module(module),
moduleIdx(moduleIdx),
ui(new Ui::Module)
@ -320,8 +320,8 @@ void ModulePanel::onFailsafeSpinChanged(double value)
/******************************************************************************/
Setup::Setup(QWidget *parent, ModelData & model):
ModelPanel(parent, model),
Setup::Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
ui(new Ui::Setup)
{
lock = true;
@ -333,19 +333,19 @@ Setup::Setup(QWidget *parent, ModelData & model):
ui->name->setMaxLength(IS_TARANIS(GetEepromInterface()->getBoard()) ? 12 : 10);
for (int i=0; i<C9X_MAX_TIMERS; i++) {
timers[i] = new TimerPanel(this, model, model.timers[i]);
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings);
ui->gridLayout->addWidget(timers[i], 1+i, 1);
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
for (int i=0; i<GetEepromInterface()->getCapability(NumModules); i++) {
modules[i] = new ModulePanel(this, model, model.moduleData[i], i);
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, i);
ui->modulesLayout->addWidget(modules[i]);
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
}
if (GetEepromInterface()->getCapability(ModelTrainerEnable)) {
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], -1);
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, -1);
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
}

View file

@ -20,7 +20,7 @@ class TimerPanel : public ModelPanel
Q_OBJECT
public:
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer);
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings);
virtual ~TimerPanel();
virtual void update();
@ -42,7 +42,7 @@ class ModulePanel : public ModelPanel
Q_OBJECT
public:
ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, int moduleIdx);
ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, GeneralSettings & generalSettings, int moduleIdx);
virtual ~ModulePanel();
virtual void update();
@ -71,7 +71,7 @@ class Setup : public ModelPanel
Q_OBJECT
public:
Setup(QWidget *parent, ModelData & model);
Setup(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
virtual ~Setup();
virtual void update();

View file

@ -280,8 +280,8 @@ TelemetryAnalog::~TelemetryAnalog()
/******************************************************/
TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen):
ModelPanel(parent, model),
TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
ui(new Ui::TelemetryCustomScreen),
screen(screen)
{
@ -465,8 +465,8 @@ void TelemetryCustomScreen::barMaxChanged(double value)
/******************************************************/
TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model):
ModelPanel(parent, model),
TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings):
ModelPanel(parent, model, generalSettings),
ui(new Ui::Telemetry)
{
ui->setupUi(this);
@ -484,7 +484,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model):
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
for (int i=0; i<GetEepromInterface()->getCapability(TelemetryCustomScreens); i++) {
TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i]);
TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i], generalSettings);
ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1));
}

View file

@ -50,7 +50,7 @@ class TelemetryCustomScreen : public ModelPanel
Q_OBJECT
public:
TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen);
TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings);
~TelemetryCustomScreen();
void update();
@ -79,7 +79,7 @@ class TelemetryPanel : public ModelPanel
Q_OBJECT
public:
TelemetryPanel(QWidget *parent, ModelData & model);
TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings);
virtual ~TelemetryPanel();
signals: