feat: Add options to disable radio and model menu tabs (#3484)
* Add options to disable radio and model menu tabs. - Update radio and model data structs - UI for color LCD radios - Convert existing 'noGlobalFunctions' property. - Language strings. * Make 'theme' control specific to color LCD radios. * Add B&W radio UI. * Simplify code, reduce compiled code size. Fix page count display on model select tab. Fix GVARS for 212x64 radios. * Collapse timer sections if timer is off. * Remove 'Use global functions' checkbox from B&W model setup. * Make preflight checks, throttle and view options sections expand & collapse (default collapsed). * Fix build. * Add view options to companion data classes, save and load values in YAML files. Fix scrolling for radio setup view options. * Add Companion UI for view option settings. * Remove 'Mixes' from list of tabs that can be hidden. * Updated Companion UI from elecpower. * Use view options flags to enable/disable functionality: - skip heli mixer logic if heli not enabled - Remove heli, gvars and telemetry options from source selection if not enabled * Remove 'flight mode', 'curve' and 'global variable' settings from input & mix editors if option disabled. * Rename 'View Options' to 'Enabled Features'. Put GVAR option under Flight Mode and indent text. Make relationship between FM and GV more obvious. * Remove global variable option dependency on flight modes. Hide FM1-FM8 in global variables if flight modes hidden. * Hide 'Custom Mixer Scripts' in source selection menu popup if disabled. * Add translation strings for Hebrew language file. * Fix typo. Add comment for double call to setCurrentTab.
This commit is contained in:
@@ -286,6 +286,21 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
|
||||
if (hasColorLcd)
|
||||
node["selectedTheme"] = rhs.selectedTheme;
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
if (hasColorLcd)
|
||||
node["radioThemesDisabled"] = (int)rhs.radioThemesDisabled;
|
||||
node["radioGFDisabled"] = (int)rhs.radioGFDisabled;
|
||||
node["radioTrainerDisabled"] = (int)rhs.radioTrainerDisabled;
|
||||
// Model level tabs control (global setting)
|
||||
node["modelHeliDisabled"] = (int)rhs.modelHeliDisabled;
|
||||
node["modelFMDisabled"] = (int)rhs.modelFMDisabled;
|
||||
node["modelCurvesDisabled"] = (int)rhs.modelCurvesDisabled;
|
||||
node["modelGVDisabled"] = (int)rhs.modelGVDisabled;
|
||||
node["modelLSDisabled"] = (int)rhs.modelLSDisabled;
|
||||
node["modelSFDisabled"] = (int)rhs.modelSFDisabled;
|
||||
node["modelCustomScriptsDisabled"] = (int)rhs.modelCustomScriptsDisabled;
|
||||
node["modelTelemetryDisabled"] = (int)rhs.modelTelemetryDisabled;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -503,6 +518,20 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
|
||||
|
||||
node["selectedTheme"] >> rhs.selectedTheme;
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
node["radioThemesDisabled"] >> rhs.radioThemesDisabled;
|
||||
node["radioGFDisabled"] >> rhs.radioGFDisabled;
|
||||
node["radioTrainerDisabled"] >> rhs.radioTrainerDisabled;
|
||||
// Model level tabs control (global setting)
|
||||
node["modelHeliDisabled"] >> rhs.modelHeliDisabled;
|
||||
node["modelFMDisabled"] >> rhs.modelFMDisabled;
|
||||
node["modelCurvesDisabled"] >> rhs.modelCurvesDisabled;
|
||||
node["modelGVDisabled"] >> rhs.modelGVDisabled;
|
||||
node["modelLSDisabled"] >> rhs.modelLSDisabled;
|
||||
node["modelSFDisabled"] >> rhs.modelSFDisabled;
|
||||
node["modelCustomScriptsDisabled"] >> rhs.modelCustomScriptsDisabled;
|
||||
node["modelTelemetryDisabled"] >> rhs.modelTelemetryDisabled;
|
||||
|
||||
return true;
|
||||
}
|
||||
} // namespace YAML
|
||||
|
||||
@@ -74,7 +74,7 @@ static const YamlLookupTable potsWarningModeLut = {
|
||||
{ 2, "WARN_AUTO" },
|
||||
};
|
||||
|
||||
static const YamlLookupTable jitterFilterLut = {
|
||||
static const YamlLookupTable globalOnOffFilterLut = {
|
||||
{ 0, "GLOBAL" },
|
||||
{ 1, "OFF" },
|
||||
{ 2, "ON" },
|
||||
@@ -782,6 +782,8 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
Node node;
|
||||
auto board = getCurrentBoard();
|
||||
|
||||
bool hasColorLcd = Boards::getCapability(board, Board::HasColorLcd);
|
||||
|
||||
node["semver"] = VERSION;
|
||||
|
||||
Node header;
|
||||
@@ -896,7 +898,7 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
|
||||
node["thrTrimSw"] = rhs.thrTrimSwitch;
|
||||
node["potsWarnMode"] = potsWarningModeLut << rhs.potsWarningMode;
|
||||
node["jitterFilter"] = jitterFilterLut << rhs.jitterFilter;
|
||||
node["jitterFilter"] = globalOnOffFilterLut << rhs.jitterFilter;
|
||||
|
||||
YamlPotsWarnEnabled potsWarnEnabled(&rhs.potsWarnEnabled[0]);
|
||||
node["potsWarnEnabled"] = potsWarnEnabled.value;
|
||||
@@ -943,7 +945,7 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
node["varioData"] = vario;
|
||||
node["rssiSource"] = YamlTelemSource(rhs.rssiSource);
|
||||
|
||||
if (IS_TARANIS_X9(getCurrentBoard())) {
|
||||
if (IS_TARANIS_X9(board)) {
|
||||
node["voltsSource"] = YamlTelemSource(rhs.frsky.voltsSource);
|
||||
node["altitudeSource"] = YamlTelemSource(rhs.frsky.altitudeSource);
|
||||
}
|
||||
@@ -986,7 +988,7 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
node["toplcdTimer"] = rhs.toplcdTimer;
|
||||
}
|
||||
|
||||
if (IS_FAMILY_HORUS_OR_T16(getCurrentBoard())) {
|
||||
if (IS_FAMILY_HORUS_OR_T16(board)) {
|
||||
for (int i=0; i<MAX_CUSTOM_SCREENS; i++) {
|
||||
const auto& csd = rhs.customScreens.customScreenData[i];
|
||||
if (!csd.isEmpty()) {
|
||||
@@ -1003,7 +1005,7 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
|
||||
node["modelRegistrationID"] = rhs.registrationId;
|
||||
|
||||
if (Boards::getCapability(getCurrentBoard(), Board::FunctionSwitches)) {
|
||||
if (Boards::getCapability(board, Board::FunctionSwitches)) {
|
||||
node["functionSwitchConfig"] = rhs.functionSwitchConfig;
|
||||
node["functionSwitchGroup"] = rhs.functionSwitchGroup;
|
||||
node["functionSwitchStartConfig"] = rhs.functionSwitchStartConfig;
|
||||
@@ -1026,6 +1028,21 @@ Node convert<ModelData>::encode(const ModelData& rhs)
|
||||
}
|
||||
}
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
if (hasColorLcd)
|
||||
node["radioThemesDisabled"] = globalOnOffFilterLut << rhs.radioThemesDisabled;
|
||||
node["radioGFDisabled"] = globalOnOffFilterLut << rhs.radioGFDisabled;
|
||||
node["radioTrainerDisabled"] = globalOnOffFilterLut << rhs.radioTrainerDisabled;
|
||||
// Model level tabs control (global setting)
|
||||
node["modelHeliDisabled"] = globalOnOffFilterLut << rhs.modelHeliDisabled;
|
||||
node["modelFMDisabled"] = globalOnOffFilterLut << rhs.modelFMDisabled;
|
||||
node["modelCurvesDisabled"] = globalOnOffFilterLut << rhs.modelCurvesDisabled;
|
||||
node["modelGVDisabled"] = globalOnOffFilterLut << rhs.modelGVDisabled;
|
||||
node["modelLSDisabled"] = globalOnOffFilterLut << rhs.modelLSDisabled;
|
||||
node["modelSFDisabled"] = globalOnOffFilterLut << rhs.modelSFDisabled;
|
||||
node["modelCustomScriptsDisabled"] = globalOnOffFilterLut << rhs.modelCustomScriptsDisabled;
|
||||
node["modelTelemetryDisabled"] = globalOnOffFilterLut << rhs.modelTelemetryDisabled;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1099,7 +1116,7 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
|
||||
|
||||
node["thrTrimSw"] >> rhs.thrTrimSwitch;
|
||||
node["potsWarnMode"] >> potsWarningModeLut >> rhs.potsWarningMode;
|
||||
node["jitterFilter"] >> jitterFilterLut >> rhs.jitterFilter;
|
||||
node["jitterFilter"] >> globalOnOffFilterLut >> rhs.jitterFilter;
|
||||
|
||||
YamlPotsWarnEnabled potsWarnEnabled;
|
||||
node["potsWarnEnabled"] >> potsWarnEnabled.value;
|
||||
@@ -1219,6 +1236,20 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
|
||||
node["usbJoystickCircularCut"] >> rhs.usbJoystickCircularCut;
|
||||
node["usbJoystickCh"] >> rhs.usbJoystickCh;
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
node["radioThemesDisabled"] >> globalOnOffFilterLut >> rhs.radioThemesDisabled;
|
||||
node["radioGFDisabled"] >> globalOnOffFilterLut >> rhs.radioGFDisabled;
|
||||
node["radioTrainerDisabled"] >> globalOnOffFilterLut >> rhs.radioTrainerDisabled;
|
||||
// Model level tabs control (global setting)
|
||||
node["modelHeliDisabled"] >> globalOnOffFilterLut >> rhs.modelHeliDisabled;
|
||||
node["modelFMDisabled"] >> globalOnOffFilterLut >> rhs.modelFMDisabled;
|
||||
node["modelCurvesDisabled"] >> globalOnOffFilterLut >> rhs.modelCurvesDisabled;
|
||||
node["modelGVDisabled"] >> globalOnOffFilterLut >> rhs.modelGVDisabled;
|
||||
node["modelLSDisabled"] >> globalOnOffFilterLut >> rhs.modelLSDisabled;
|
||||
node["modelSFDisabled"] >> globalOnOffFilterLut >> rhs.modelSFDisabled;
|
||||
node["modelCustomScriptsDisabled"] >> globalOnOffFilterLut >> rhs.modelCustomScriptsDisabled;
|
||||
node["modelTelemetryDisabled"] >> globalOnOffFilterLut >> rhs.modelTelemetryDisabled;
|
||||
|
||||
// preferably perform conversions here to avoid cluttering the field decodes
|
||||
|
||||
if (SemanticVersion(QString(rhs.semver)) < SemanticVersion("2.8.0")) {
|
||||
|
||||
@@ -286,6 +286,20 @@ class GeneralSettings {
|
||||
|
||||
char selectedTheme[SELECTED_THEME_NAME_LEN + 1];
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
bool radioThemesDisabled;
|
||||
bool radioGFDisabled;
|
||||
bool radioTrainerDisabled;
|
||||
// Model level tabs control (global setting)
|
||||
bool modelHeliDisabled;
|
||||
bool modelFMDisabled;
|
||||
bool modelCurvesDisabled;
|
||||
bool modelGVDisabled;
|
||||
bool modelLSDisabled;
|
||||
bool modelSFDisabled;
|
||||
bool modelCustomScriptsDisabled;
|
||||
bool modelTelemetryDisabled;
|
||||
|
||||
bool switchPositionAllowedTaranis(int index) const;
|
||||
bool switchSourceAllowedTaranis(int index) const;
|
||||
bool isPotAvailable(int index) const;
|
||||
|
||||
@@ -191,6 +191,20 @@ class ModelData {
|
||||
|
||||
char registrationId[8+1];
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
unsigned int radioThemesDisabled;
|
||||
unsigned int radioGFDisabled;
|
||||
unsigned int radioTrainerDisabled;
|
||||
// Model level tabs control (global setting)
|
||||
unsigned int modelHeliDisabled;
|
||||
unsigned int modelFMDisabled;
|
||||
unsigned int modelCurvesDisabled;
|
||||
unsigned int modelGVDisabled;
|
||||
unsigned int modelLSDisabled;
|
||||
unsigned int modelSFDisabled;
|
||||
unsigned int modelCustomScriptsDisabled;
|
||||
unsigned int modelTelemetryDisabled;
|
||||
|
||||
enum FunctionSwitchConfig {
|
||||
FUNC_SWITCH_CONFIG_NONE,
|
||||
FUNC_SWITCH_CONFIG_FIRST = FUNC_SWITCH_CONFIG_NONE,
|
||||
|
||||
@@ -9,12 +9,14 @@ set(generaledit_SRCS
|
||||
calibration.cpp
|
||||
hardware.cpp
|
||||
trainer.cpp
|
||||
generaloptions.cpp
|
||||
)
|
||||
|
||||
set(generaledit_HDRS
|
||||
calibration.h
|
||||
hardware.h
|
||||
trainer.h
|
||||
generaloptions.h
|
||||
)
|
||||
|
||||
set(generaledit_UIS
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "calibration.h"
|
||||
#include "hardware.h"
|
||||
#include "../modeledit/customfunctions.h"
|
||||
#include "generaloptions.h"
|
||||
#include "verticalscrollarea.h"
|
||||
#include "compounditemmodels.h"
|
||||
|
||||
@@ -69,6 +70,7 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, Firmware * fir
|
||||
auto hwpnl = new HardwarePanel(this, generalSettings, firmware, editorItemModels);
|
||||
addTab(hwpnl, tr("Hardware"));
|
||||
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
|
||||
addTab(new GeneralOptionsPanel(this, generalSettings, firmware), tr("Enabled Features"));
|
||||
|
||||
connect(hwpnl, &HardwarePanel::internalModuleChanged, this, [&] { intModChanged = true; });
|
||||
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "generaloptions.h"
|
||||
#include "autocheckbox.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QGridLayout>
|
||||
|
||||
GeneralOptionsPanel::GeneralOptionsPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
board(firmware->getBoard()),
|
||||
params(new QList<QWidget *>),
|
||||
row(0),
|
||||
col(0)
|
||||
{
|
||||
grid = new QGridLayout(this);
|
||||
|
||||
addSection(tr("Radio Menus"));
|
||||
|
||||
if (Boards::getCapability(board, Board::HasColorLcd)) {
|
||||
addLabel(tr("Themes"));
|
||||
AutoCheckBox *themesDisable = new AutoCheckBox(this);
|
||||
themesDisable->setField(generalSettings.radioThemesDisabled, this, true);
|
||||
params->append(themesDisable);
|
||||
addParams();
|
||||
}
|
||||
|
||||
addLabel(tr("Global Functions"));
|
||||
AutoCheckBox *globalFuncsDisable = new AutoCheckBox(this);
|
||||
globalFuncsDisable->setField(generalSettings.radioGFDisabled, this, true);
|
||||
params->append(globalFuncsDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Trainer"));
|
||||
AutoCheckBox *trainerDisable = new AutoCheckBox(this);
|
||||
trainerDisable->setField(generalSettings.radioTrainerDisabled, this, true);
|
||||
params->append(trainerDisable);
|
||||
addParams();
|
||||
|
||||
row = 0;
|
||||
col = 2;
|
||||
addSection(tr("Model Menus"));
|
||||
|
||||
if (firmware->getCapability(Heli)) {
|
||||
addLabel(tr("Heli"));
|
||||
AutoCheckBox *heliDisable = new AutoCheckBox(this);
|
||||
heliDisable->setField(generalSettings.modelHeliDisabled, this, true);
|
||||
params->append(heliDisable);
|
||||
addParams();
|
||||
}
|
||||
|
||||
addLabel(tr("Flight Modes"));
|
||||
AutoCheckBox *fmDisable = new AutoCheckBox(this);
|
||||
fmDisable->setField(generalSettings.modelFMDisabled, this, true);
|
||||
params->append(fmDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Curves"));
|
||||
AutoCheckBox *curvesDisable = new AutoCheckBox(this);
|
||||
curvesDisable->setField(generalSettings.modelCurvesDisabled, this, true);
|
||||
params->append(curvesDisable);
|
||||
addParams();
|
||||
|
||||
if (firmware->getCapability(Gvars)) {
|
||||
addLabel(tr("Global Variables"));
|
||||
AutoCheckBox *gvDisable = new AutoCheckBox(this);
|
||||
gvDisable->setField(generalSettings.modelGVDisabled, this, true);
|
||||
params->append(gvDisable);
|
||||
addParams();
|
||||
}
|
||||
|
||||
addLabel(tr("Logical Switches"));
|
||||
AutoCheckBox *lsDisable = new AutoCheckBox(this);
|
||||
lsDisable->setField(generalSettings.modelLSDisabled, this, true);
|
||||
params->append(lsDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Special Functions"));
|
||||
AutoCheckBox *sfDisable = new AutoCheckBox(this);
|
||||
sfDisable->setField(generalSettings.modelSFDisabled, this, true);
|
||||
params->append(sfDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Custom Mix Scripts"));
|
||||
AutoCheckBox *cmsDisable = new AutoCheckBox(this);
|
||||
cmsDisable->setField(generalSettings.modelCustomScriptsDisabled, this, true);
|
||||
params->append(cmsDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Telemetry"));
|
||||
AutoCheckBox *teleDisable = new AutoCheckBox(this);
|
||||
teleDisable->setField(generalSettings.modelTelemetryDisabled, this, true);
|
||||
params->append(teleDisable);
|
||||
addParams();
|
||||
|
||||
addVSpring(grid, 0, grid->rowCount());
|
||||
addHSpring(grid, grid->columnCount(), 0);
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
GeneralOptionsPanel::~GeneralOptionsPanel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void GeneralOptionsPanel::addLabel(QString text)
|
||||
{
|
||||
QLabel *label = new QLabel(this);
|
||||
label->setText(text);
|
||||
grid->addWidget(label, row, col);
|
||||
}
|
||||
|
||||
void GeneralOptionsPanel::addLine()
|
||||
{
|
||||
QFrame *line = new QFrame(this);
|
||||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
line->setLineWidth(1);
|
||||
line->setMidLineWidth(0);
|
||||
grid->addWidget(line, row++, 0, 1, grid->columnCount());
|
||||
}
|
||||
|
||||
void GeneralOptionsPanel::addParams()
|
||||
{
|
||||
int col = 0;
|
||||
QGridLayout *subgrid = new QGridLayout();
|
||||
|
||||
for (int i = 0; i < params->size(); i++) {
|
||||
subgrid->addWidget(params->at(i), 0, col++);
|
||||
}
|
||||
|
||||
addHSpring(subgrid, col, 0);
|
||||
grid->addLayout(subgrid, row++, this->col + 1);
|
||||
params->clear();
|
||||
}
|
||||
|
||||
void GeneralOptionsPanel::addSection(QString text)
|
||||
{
|
||||
addLabel(QString("<b>%1</b>").arg(text));
|
||||
row++;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "generaledit.h"
|
||||
|
||||
class QGridLayout;
|
||||
|
||||
class GeneralOptionsPanel : public GeneralPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GeneralOptionsPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~GeneralOptionsPanel();
|
||||
|
||||
private:
|
||||
Board::Type board;
|
||||
QGridLayout *grid;
|
||||
QList<QWidget *> *params;
|
||||
int row;
|
||||
int col;
|
||||
|
||||
void addLabel(QString text);
|
||||
void addLine();
|
||||
void addParams();
|
||||
void addSection(QString text);
|
||||
};
|
||||
@@ -27,6 +27,7 @@ set(modeledit_SRCS
|
||||
colorcustomscreens.cpp
|
||||
telemetry_customscreens.cpp
|
||||
curves.cpp
|
||||
modeloptions.cpp
|
||||
)
|
||||
|
||||
set(modeledit_HDRS
|
||||
@@ -41,6 +42,7 @@ set(modeledit_HDRS
|
||||
colorcustomscreens.h
|
||||
telemetry_customscreens.h
|
||||
curves.h
|
||||
modeloptions.h
|
||||
)
|
||||
|
||||
set(modeledit_UIS
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "telemetry.h"
|
||||
#include "colorcustomscreens.h"
|
||||
#include "telemetry_customscreens.h"
|
||||
#include "modeloptions.h"
|
||||
#include "appdata.h"
|
||||
#include "compounditemmodels.h"
|
||||
|
||||
@@ -116,6 +117,9 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
||||
s1.report("Telemetry Custom Screens");
|
||||
}
|
||||
|
||||
addTab(new ModelOptionsPanel(this, model, generalSettings, firmware), tr("Enabled Features"));
|
||||
s1.report("Enabled Features");
|
||||
|
||||
connect(setupPanel, &SetupPanel::extendedLimitsToggled, channelsPanel, &ChannelsPanel::refreshExtendedLimits);
|
||||
connect(ui->tabWidget, &QTabWidget::currentChanged, this, &ModelEdit::onTabIndexChanged);
|
||||
connect(ui->pushButton, &QPushButton::clicked, this, &ModelEdit::launchSimulation);
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "modeloptions.h"
|
||||
#include "autocombobox.h"
|
||||
#include "compounditemmodels.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QGridLayout>
|
||||
|
||||
ModelOptionsPanel::ModelOptionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
board(firmware->getBoard()),
|
||||
params(new QList<QWidget *>),
|
||||
row(0),
|
||||
col(0)
|
||||
{
|
||||
// grid within a grid to compact the inner grid layout more than a single grid
|
||||
QGridLayout* panelgrid = new QGridLayout(this);
|
||||
grid = new QGridLayout();
|
||||
panelgrid->addLayout(grid, 0, 0);
|
||||
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->appendToItemList(tr("Global"), 0);
|
||||
mdl->appendToItemList(tr("Off"), 1);
|
||||
mdl->appendToItemList(tr("On"), 2);
|
||||
mdl->loadItemList();
|
||||
|
||||
addSection(tr("Radio Menus"));
|
||||
|
||||
if (Boards::getCapability(board, Board::HasColorLcd)) {
|
||||
addLabel(tr("Themes"));
|
||||
AutoComboBox *themesDisable = new AutoComboBox(this);
|
||||
themesDisable->setModel(mdl);
|
||||
themesDisable->setField(model.radioThemesDisabled, this);
|
||||
params->append(themesDisable);
|
||||
addParams();
|
||||
}
|
||||
|
||||
addLabel(tr("Global Functions"));
|
||||
AutoComboBox *globalFuncsDisable = new AutoComboBox(this);
|
||||
globalFuncsDisable->setModel(mdl);
|
||||
globalFuncsDisable->setField(model.radioGFDisabled, this);
|
||||
params->append(globalFuncsDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Trainer"));
|
||||
AutoComboBox *trainerDisable = new AutoComboBox(this);
|
||||
trainerDisable->setModel(mdl);
|
||||
trainerDisable->setField(model.radioTrainerDisabled, this);
|
||||
params->append(trainerDisable);
|
||||
addParams();
|
||||
|
||||
row = 0;
|
||||
col = 2;
|
||||
addSection(tr("Model Menus"));
|
||||
|
||||
if (firmware->getCapability(Heli)) {
|
||||
addLabel(tr("Heli"));
|
||||
AutoComboBox *heliDisable = new AutoComboBox(this);
|
||||
heliDisable->setModel(mdl);
|
||||
heliDisable->setField(model.modelHeliDisabled, this);
|
||||
params->append(heliDisable);
|
||||
addParams();
|
||||
}
|
||||
|
||||
addLabel(tr("Flight Modes"));
|
||||
AutoComboBox *fmDisable = new AutoComboBox(this);
|
||||
fmDisable->setModel(mdl);
|
||||
fmDisable->setField(model.modelFMDisabled, this);
|
||||
params->append(fmDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Curves"));
|
||||
AutoComboBox *curvesDisable = new AutoComboBox(this);
|
||||
curvesDisable->setModel(mdl);
|
||||
curvesDisable->setField(model.modelCurvesDisabled, this);
|
||||
params->append(curvesDisable);
|
||||
addParams();
|
||||
|
||||
if (firmware->getCapability(Gvars)) {
|
||||
addLabel(tr("Global Variables"));
|
||||
AutoComboBox *gvDisable = new AutoComboBox(this);
|
||||
gvDisable->setModel(mdl);
|
||||
gvDisable->setField(model.modelGVDisabled, this);
|
||||
params->append(gvDisable);
|
||||
addParams();
|
||||
}
|
||||
|
||||
addLabel(tr("Logical Switches"));
|
||||
AutoComboBox *lsDisable = new AutoComboBox(this);
|
||||
lsDisable->setModel(mdl);
|
||||
lsDisable->setField(model.modelLSDisabled, this);
|
||||
params->append(lsDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Special Functions"));
|
||||
AutoComboBox *sfDisable = new AutoComboBox(this);
|
||||
sfDisable->setModel(mdl);
|
||||
sfDisable->setField(model.modelSFDisabled, this);
|
||||
params->append(sfDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Custom Mix Scripts"));
|
||||
AutoComboBox *cmsDisable = new AutoComboBox(this);
|
||||
cmsDisable->setModel(mdl);
|
||||
cmsDisable->setField(model.modelCustomScriptsDisabled, this);
|
||||
params->append(cmsDisable);
|
||||
addParams();
|
||||
|
||||
addLabel(tr("Telemetry"));
|
||||
AutoComboBox *teleDisable = new AutoComboBox(this);
|
||||
teleDisable->setModel(mdl);
|
||||
teleDisable->setField(model.modelTelemetryDisabled, this);
|
||||
params->append(teleDisable);
|
||||
addParams();
|
||||
|
||||
addVSpring(panelgrid, 0, panelgrid->rowCount());
|
||||
addHSpring(panelgrid, panelgrid->columnCount(), 0);
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
ModelOptionsPanel::~ModelOptionsPanel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ModelOptionsPanel::addLabel(QString text)
|
||||
{
|
||||
QLabel *label = new QLabel(this);
|
||||
label->setText(text);
|
||||
grid->addWidget(label, row, col);
|
||||
}
|
||||
|
||||
void ModelOptionsPanel::addLine()
|
||||
{
|
||||
QFrame *line = new QFrame(this);
|
||||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
line->setLineWidth(1);
|
||||
line->setMidLineWidth(0);
|
||||
grid->addWidget(line, row++, 0, 1, grid->columnCount());
|
||||
}
|
||||
|
||||
void ModelOptionsPanel::addParams()
|
||||
{
|
||||
int col = 0;
|
||||
QGridLayout *subgrid = new QGridLayout();
|
||||
|
||||
for (int i = 0; i < params->size(); i++) {
|
||||
subgrid->addWidget(params->at(i), 0, col++);
|
||||
}
|
||||
|
||||
addHSpring(subgrid, col, 0);
|
||||
grid->addLayout(subgrid, row++, this->col + 1);
|
||||
params->clear();
|
||||
}
|
||||
|
||||
void ModelOptionsPanel::addSection(QString text)
|
||||
{
|
||||
addLabel(QString("<b>%1</b>").arg(text));
|
||||
row++;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class QGridLayout;
|
||||
|
||||
class ModelOptionsPanel : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ModelOptionsPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~ModelOptionsPanel();
|
||||
|
||||
private:
|
||||
Board::Type board;
|
||||
QGridLayout *grid;
|
||||
QList<QWidget *> *params;
|
||||
int row;
|
||||
int col;
|
||||
|
||||
void addLabel(QString text);
|
||||
void addLine();
|
||||
void addParams();
|
||||
void addSection(QString text);
|
||||
};
|
||||
|
||||
+20
-20
@@ -117,37 +117,37 @@ static inline void check_struct()
|
||||
CHKSIZE(TrainerData, 16);
|
||||
|
||||
#if defined(PCBXLITES)
|
||||
CHKSIZE(RadioData, 862);
|
||||
CHKSIZE(ModelData, 6217);
|
||||
CHKSIZE(RadioData, 864);
|
||||
CHKSIZE(ModelData, 6220);
|
||||
#elif defined(PCBXLITE)
|
||||
CHKSIZE(RadioData, 860);
|
||||
CHKSIZE(ModelData, 6217);
|
||||
CHKSIZE(RadioData, 862);
|
||||
CHKSIZE(ModelData, 6220);
|
||||
#elif defined(RADIO_TPRO)
|
||||
CHKSIZE(RadioData, 843);
|
||||
CHKSIZE(ModelData, 6242);
|
||||
CHKSIZE(RadioData, 845);
|
||||
CHKSIZE(ModelData, 6245);
|
||||
#elif defined(RADIO_BOXER)
|
||||
CHKSIZE(RadioData, 875);
|
||||
CHKSIZE(ModelData, 6218);
|
||||
CHKSIZE(RadioData, 877);
|
||||
CHKSIZE(ModelData, 6221);
|
||||
#elif defined(PCBX7)
|
||||
CHKSIZE(RadioData, 866);
|
||||
CHKSIZE(ModelData, 6217);
|
||||
CHKSIZE(RadioData, 868);
|
||||
CHKSIZE(ModelData, 6220);
|
||||
#elif defined(PCBX9E)
|
||||
CHKSIZE(RadioData, 956);
|
||||
CHKSIZE(ModelData, 6669);
|
||||
CHKSIZE(RadioData, 958);
|
||||
CHKSIZE(ModelData, 6672);
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP)
|
||||
CHKSIZE(RadioData, 898);
|
||||
CHKSIZE(ModelData, 6661);
|
||||
CHKSIZE(RadioData, 900);
|
||||
CHKSIZE(ModelData, 6664);
|
||||
#elif defined(PCBHORUS)
|
||||
#if defined(PCBX10)
|
||||
CHKSIZE(RadioData, 950);
|
||||
CHKSIZE(ModelData, 15451);
|
||||
CHKSIZE(RadioData, 952);
|
||||
CHKSIZE(ModelData, 15454);
|
||||
#else
|
||||
CHKSIZE(RadioData, 932);
|
||||
CHKSIZE(ModelData, 15449);
|
||||
CHKSIZE(RadioData, 934);
|
||||
CHKSIZE(ModelData, 15452);
|
||||
#endif
|
||||
#elif defined(PCBNV14)
|
||||
CHKSIZE(RadioData, 878);
|
||||
CHKSIZE(ModelData, 15265);
|
||||
CHKSIZE(RadioData, 880);
|
||||
CHKSIZE(ModelData, 15268);
|
||||
#endif
|
||||
|
||||
#undef CHKSIZE
|
||||
|
||||
@@ -764,6 +764,22 @@ PACK(struct ModelData {
|
||||
uint8_t usbJoystickIfMode:3 ENUM(USBJoystickIfMode);
|
||||
uint8_t usbJoystickCircularCut:4;
|
||||
USBJoystickChData usbJoystickCh[USBJ_MAX_JOYSTICK_CHANNELS];
|
||||
|
||||
// Radio level tabs control (model settings)
|
||||
#if defined(COLORLCD)
|
||||
uint8_t radioThemesDisabled:2 ENUM(ModelOverridableEnable);
|
||||
#endif
|
||||
uint8_t radioGFDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t radioTrainerDisabled:2 ENUM(ModelOverridableEnable);
|
||||
// Model level tabs control (model setting)
|
||||
uint8_t modelHeliDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelFMDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelCurvesDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelGVDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelLSDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelSFDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelCustomScriptsDisabled:2 ENUM(ModelOverridableEnable);
|
||||
uint8_t modelTelemetryDisabled:2 ENUM(ModelOverridableEnable);
|
||||
});
|
||||
|
||||
/*
|
||||
@@ -955,6 +971,22 @@ PACK(struct RadioData {
|
||||
#if defined(COLORLCD)
|
||||
NOBACKUP(char selectedTheme[SELECTED_THEME_NAME_LEN]);
|
||||
#endif
|
||||
|
||||
// Radio level tabs control (global settings)
|
||||
#if defined(COLORLCD)
|
||||
uint8_t radioThemesDisabled:1;
|
||||
#endif
|
||||
uint8_t radioGFDisabled:1;
|
||||
uint8_t radioTrainerDisabled:1;
|
||||
// Model level tabs control (global setting)
|
||||
uint8_t modelHeliDisabled:1;
|
||||
uint8_t modelFMDisabled:1;
|
||||
uint8_t modelCurvesDisabled:1;
|
||||
uint8_t modelGVDisabled:1;
|
||||
uint8_t modelLSDisabled:1;
|
||||
uint8_t modelSFDisabled:1;
|
||||
uint8_t modelCustomScriptsDisabled:1;
|
||||
uint8_t modelTelemetryDisabled:1;
|
||||
});
|
||||
|
||||
#undef SWITCHES_WARNING_DATA
|
||||
|
||||
@@ -144,8 +144,8 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
#define CURSOR_ON_LINE() (0)
|
||||
#endif
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow);
|
||||
void check_simple(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
void check(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow);
|
||||
void check_simple(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
void check_submenu_simple(event_t event, uint8_t maxrow);
|
||||
|
||||
void title(const char * s);
|
||||
|
||||
@@ -77,16 +77,21 @@ void menuRadioPowerMeter(event_t event);
|
||||
void menuRadioCalibration(event_t event);
|
||||
void menuGhostModuleConfig(event_t event);
|
||||
|
||||
static const MenuHandlerFunc menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
extern bool radioGFEnabled();
|
||||
extern bool radioTrainerEnabled();
|
||||
|
||||
static const MenuHandler menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
#if defined(RADIO_TOOLS)
|
||||
menuRadioTools,
|
||||
{ menuRadioTools, nullptr },
|
||||
#endif
|
||||
CASE_SDCARD(menuRadioSdManager)
|
||||
menuRadioSetup,
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
menuRadioHardware,
|
||||
menuRadioVersion
|
||||
#if defined(SDCARD)
|
||||
{ menuRadioSdManager, nullptr },
|
||||
#endif
|
||||
{ menuRadioSetup, nullptr },
|
||||
{ menuRadioSpecialFunctions, radioGFEnabled },
|
||||
{ menuRadioTrainer, radioTrainerEnabled },
|
||||
{ menuRadioHardware, nullptr },
|
||||
{ menuRadioVersion, nullptr }
|
||||
};
|
||||
|
||||
enum MenuModelIndexes {
|
||||
@@ -135,22 +140,34 @@ void menuModelGVarOne(event_t event);
|
||||
void menuModelUSBJoystick(event_t event);
|
||||
#endif
|
||||
|
||||
static const MenuHandlerFunc menuTabModel[] = {
|
||||
menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
menuModelCurvesAll,
|
||||
menuModelLogicalSwitches,
|
||||
menuModelSpecialFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
extern bool modelHeliEnabled();
|
||||
extern bool modelFMEnabled();
|
||||
extern bool modelCurvesEnabled();
|
||||
extern bool modelLSEnabled();
|
||||
extern bool modelSFEnabled();
|
||||
extern bool modelCustomScriptsEnabled();
|
||||
extern bool modelTelemetryEnabled();
|
||||
|
||||
static const MenuHandler menuTabModel[] = {
|
||||
{ menuModelSelect, nullptr },
|
||||
{ menuModelSetup, nullptr },
|
||||
#if defined(HELI)
|
||||
{ menuModelHeli, modelHeliEnabled },
|
||||
#endif
|
||||
menuModelTelemetry,
|
||||
menuModelDisplay,
|
||||
#if defined(FLIGHT_MODES)
|
||||
{ menuModelFlightModesAll, modelFMEnabled },
|
||||
#endif
|
||||
{ menuModelExposAll, nullptr },
|
||||
{ menuModelMixAll, nullptr },
|
||||
{ menuModelLimits, nullptr },
|
||||
{ menuModelCurvesAll, modelCurvesEnabled },
|
||||
{ menuModelLogicalSwitches, modelLSEnabled },
|
||||
{ menuModelSpecialFunctions, modelSFEnabled },
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
{ menuModelCustomScripts, modelCustomScriptsEnabled },
|
||||
#endif
|
||||
{ menuModelTelemetry, modelTelemetryEnabled },
|
||||
{ menuModelDisplay, nullptr }
|
||||
};
|
||||
|
||||
void menuStatisticsView(event_t event);
|
||||
|
||||
@@ -48,6 +48,13 @@ enum ExposFields {
|
||||
EXPO_FIELD_MAX
|
||||
};
|
||||
|
||||
uint8_t FM_ROW(uint8_t value)
|
||||
{
|
||||
if (modelFMEnabled())
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
void menuModelExpoOne(event_t event)
|
||||
{
|
||||
#if defined(KEYS_GPIO_REG_MDL)
|
||||
@@ -71,7 +78,9 @@ void menuModelExpoOne(event_t event)
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX, {0, 0, 0, ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW, 0, 0, LABEL(Curve), 1, CASE_FLIGHT_MODES(LABEL(Flight Mode)) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/});
|
||||
SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX,
|
||||
{0, 0, 0, ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW, 0, 0, LABEL(Curve), 1,
|
||||
CASE_FLIGHT_MODES(FM_ROW(LABEL(Flight Mode))) CASE_FLIGHT_MODES(FM_ROW((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE)) 0 /*, ...*/});
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ enum MixFields {
|
||||
MIX_FIELD_COUNT
|
||||
};
|
||||
|
||||
extern uint8_t FM_ROW(uint8_t);
|
||||
|
||||
void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||
{
|
||||
const int gaugeWidth = 33;
|
||||
@@ -107,22 +109,23 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
SUBMENU(STR_MIXES, MIX_FIELD_COUNT, {0, 0, 0, 0, 0, 1, CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/});
|
||||
SUBMENU(STR_MIXES, MIX_FIELD_COUNT,
|
||||
{0, 0, 0, 0, 0, 1, CASE_FLIGHT_MODES(FM_ROW((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE)) 0, 0 /*, ...*/});
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
for (int k=0; k<LCD_LINES-1; k++) {
|
||||
coord_t y;
|
||||
if (k >= LCD_LINES-1)
|
||||
y = 1 + (k-LCD_LINES+2)*FH;
|
||||
else
|
||||
y = 1 + (k+1)*FH;
|
||||
int8_t i = k;
|
||||
|
||||
i += menuVerticalOffset;
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||
|
||||
for (int k=0; k<NUM_BODY_LINES; k++) {
|
||||
int i = k + menuVerticalOffset;
|
||||
for (int j=0; j<=i; ++j) {
|
||||
if (j<(int)DIM(mstate_tab) && mstate_tab[j] == HIDDEN_ROW) {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
LcdFlags attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||
|
||||
switch(i) {
|
||||
case MIX_FIELD_NAME:
|
||||
editSingleName(MIXES_2ND_COLUMN, y, STR_MIXNAME, md2->name,
|
||||
@@ -205,5 +208,6 @@ void menuModelMixOne(event_t event)
|
||||
md2->speedDown = EDIT_DELAY(0, y, event, attr, STR_SLOWDOWN, md2->speedDown);
|
||||
break;
|
||||
}
|
||||
y += FH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ void menuModelSelect(event_t event)
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PAGEDN)
|
||||
case EVT_KEY_FIRST(KEY_PAGEUP):
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -224,7 +224,7 @@ void menuModelSelect(event_t event)
|
||||
break;
|
||||
#elif defined(KEYS_GPIO_REG_PAGE)
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -242,7 +242,7 @@ void menuModelSelect(event_t event)
|
||||
if ((!IS_ROTARY_RIGHT(event) && !IS_ROTARY_LEFT(event)) || s_editMode < 0) {
|
||||
#endif
|
||||
if (sub == g_eeGeneral.currModel) {
|
||||
chainMenu((IS_ROTARY_RIGHT(event) || event == EVT_KEY_FIRST(KEY_RIGHT)) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu((IS_ROTARY_RIGHT(event) || event == EVT_KEY_FIRST(KEY_RIGHT)) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
}
|
||||
else {
|
||||
AUDIO_WARNING2();
|
||||
@@ -291,12 +291,14 @@ void menuModelSelect(event_t event)
|
||||
lcdDrawNumber(lcdLastRightPos+3, 0, reusableBuffer.modelsel.eepromfree, LEFT);
|
||||
#endif
|
||||
|
||||
extern uint8_t menuSize(const MenuHandler*, uint8_t);
|
||||
uint8_t sz = menuSize(menuTabModel, DIM(menuTabModel));
|
||||
#if defined(NAVIGATION_X7)
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), 0);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, sz, 0);
|
||||
#elif defined(ROTARY_ENCODER_NAVIGATION)
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_ROTARY_ENCODER_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, sz, (sub == g_eeGeneral.currModel) ? ((IS_ROTARY_ENCODER_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||
#else
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, sz, (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
||||
#endif
|
||||
|
||||
title(STR_MENUMODELSEL);
|
||||
|
||||
@@ -91,6 +91,7 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_EXTENDED_TRIMS,
|
||||
ITEM_MODEL_SETUP_DISPLAY_TRIMS,
|
||||
ITEM_MODEL_SETUP_TRIM_INC,
|
||||
ITEM_MODEL_SETUP_THROTTLE_LABEL,
|
||||
ITEM_MODEL_SETUP_THROTTLE_REVERSED,
|
||||
ITEM_MODEL_SETUP_THROTTLE_TRACE,
|
||||
ITEM_MODEL_SETUP_THROTTLE_TRIM,
|
||||
@@ -106,7 +107,6 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_POTS_WARNING,
|
||||
#endif
|
||||
ITEM_MODEL_SETUP_BEEP_CENTER,
|
||||
ITEM_MODEL_SETUP_USE_GLOBAL_FUNCTIONS,
|
||||
ITEM_MODEL_SETUP_USE_JITTER_FILTER,
|
||||
#if defined(PXX2)
|
||||
ITEM_MODEL_SETUP_REGISTRATION_ID,
|
||||
@@ -198,6 +198,21 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_TRAINER_PPM_PARAMS,
|
||||
#endif
|
||||
|
||||
ITEM_VIEW_OPTIONS_LABEL,
|
||||
ITEM_VIEW_OPTIONS_RADIO_TAB,
|
||||
ITEM_VIEW_OPTIONS_GF,
|
||||
ITEM_VIEW_OPTIONS_TRAINER,
|
||||
ITEM_VIEW_OPTIONS_MODEL_TAB,
|
||||
CASE_HELI(ITEM_VIEW_OPTIONS_HELI)
|
||||
CASE_FLIGHT_MODES(ITEM_VIEW_OPTIONS_FM)
|
||||
ITEM_VIEW_OPTIONS_CURVES,
|
||||
ITEM_VIEW_OPTIONS_LS,
|
||||
ITEM_VIEW_OPTIONS_SF,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS,
|
||||
#endif
|
||||
ITEM_VIEW_OPTIONS_TELEMETRY,
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_LABEL,
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_MODE,
|
||||
@@ -206,9 +221,39 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_CH_BUTTON,
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_APPLY,
|
||||
#endif
|
||||
|
||||
ITEM_MODEL_SETUP_LINES_COUNT
|
||||
};
|
||||
|
||||
PACK(struct ExpandState {
|
||||
uint8_t preflight:1;
|
||||
uint8_t throttle:1;
|
||||
uint8_t viewOpt:1;
|
||||
});
|
||||
|
||||
struct ExpandState expandState;
|
||||
|
||||
uint8_t PREFLIGHT_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.preflight)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t THROTTLE_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.throttle)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t VIEWOPT_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.viewOpt)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
#define MODEL_SETUP_2ND_COLUMN (LCD_W-11*FW)
|
||||
#define MODEL_SETUP_SET_FAILSAFE_OFS 7*FW-2
|
||||
|
||||
@@ -248,9 +293,14 @@ enum MenuModelSetupItems {
|
||||
|
||||
#define MAX_SWITCH_PER_LINE (getSwitchWarningsCount() > 5 ? 4 : 5)
|
||||
#if defined(PCBXLITE)
|
||||
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsCount()), uint8_t(getSwitchWarningsCount() > 4 ? TITLE_ROW : HIDDEN_ROW) // X-Lite needs an additional column for full line selection (<])
|
||||
// X-Lite needs an additional column for full line selection (<])
|
||||
#define SW_WARN_ROWS \
|
||||
PREFLIGHT_ROW(uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsCount())), \
|
||||
PREFLIGHT_ROW(uint8_t(getSwitchWarningsCount() > 4 ? TITLE_ROW : HIDDEN_ROW))
|
||||
#else
|
||||
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > MAX_SWITCH_PER_LINE ? TITLE_ROW : HIDDEN_ROW)
|
||||
#define SW_WARN_ROWS \
|
||||
PREFLIGHT_ROW(uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1))), \
|
||||
PREFLIGHT_ROW(uint8_t(getSwitchWarningsCount() > MAX_SWITCH_PER_LINE ? TITLE_ROW : HIDDEN_ROW))
|
||||
#endif
|
||||
|
||||
inline uint8_t MODULE_TYPE_ROWS(int moduleIdx)
|
||||
@@ -272,13 +322,20 @@ inline uint8_t MODULE_SUBTYPE_ROWS(int moduleIdx)
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
#define POT_WARN_ROWS ((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0)
|
||||
inline uint8_t TIMER_ROW(uint8_t timer, uint8_t value)
|
||||
{
|
||||
if (g_model.timers[timer].mode > 0)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
#define POT_WARN_ROWS PREFLIGHT_ROW(((g_model.potsWarnMode) ? (uint8_t)(NUM_POTS+NUM_SLIDERS) : (uint8_t)0))
|
||||
|
||||
#define TIMER_ROWS(x) \
|
||||
1, 0, \
|
||||
(uint8_t)((g_model.timers[x].start) ? 2 : 1), \
|
||||
0, 0, \
|
||||
g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 \
|
||||
: (uint8_t)0
|
||||
1, TIMER_ROW(x,0), \
|
||||
TIMER_ROW(x,(uint8_t)((g_model.timers[x].start) ? 2 : 1)), \
|
||||
TIMER_ROW(x,0), TIMER_ROW(x,0), \
|
||||
TIMER_ROW(x,g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0)
|
||||
|
||||
#define EXTRA_MODULE_ROWS
|
||||
|
||||
@@ -453,7 +510,7 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
POT_WARN_ROWS, /* Pot warning */
|
||||
#else
|
||||
#define WARN_ROWS \
|
||||
NUM_SWITCHES - 1, /* Switch warning */
|
||||
PREFLIGHT_ROW((NUM_SWITCHES - 1), /* Switch warning */
|
||||
#endif
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
@@ -479,6 +536,23 @@ inline uint8_t USB_JOYSTICK_APPLYROW()
|
||||
static const char* _fct_sw_start[] = { STR_CHAR_UP, STR_CHAR_DOWN, "=" };
|
||||
#endif
|
||||
|
||||
uint8_t viewOptChoice(coord_t y, const char* title, uint8_t value, uint8_t attr, event_t event)
|
||||
{
|
||||
lcdDrawText(INDENT_WIDTH-1, y, title);
|
||||
return editChoice(96, y, nullptr, STR_ADCFILTERVALUES, value, 0, 2, attr, event);
|
||||
}
|
||||
|
||||
uint8_t expandableSection(coord_t y, const char* title, uint8_t value, uint8_t attr, event_t event)
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, title);
|
||||
lcdDrawText(120, y, value ? STR_CHAR_UP : STR_CHAR_DOWN, attr);
|
||||
if (attr && (event == EVT_KEY_BREAK(KEY_ENTER))) {
|
||||
value = !value;
|
||||
s_editMode = 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
void menuModelSetup(event_t event)
|
||||
{
|
||||
int8_t old_editMode = s_editMode;
|
||||
@@ -498,20 +572,20 @@ void menuModelSetup(event_t event)
|
||||
1, // Extended trims
|
||||
0, // Show trims
|
||||
0, // Trims step
|
||||
0, // Throttle reverse
|
||||
0, // Throttle trace source
|
||||
0, // Throttle trim
|
||||
0, // Throttle trim switch
|
||||
0, // Throttle section
|
||||
THROTTLE_ROW(0), // Throttle reverse
|
||||
THROTTLE_ROW(0), // Throttle trace source
|
||||
THROTTLE_ROW(0), // Throttle trim
|
||||
THROTTLE_ROW(0), // Throttle trim switch
|
||||
|
||||
LABEL(PreflightCheck),
|
||||
0, // Checklist
|
||||
0, // Throttle warning
|
||||
0, // Custom position for throttle warning enable
|
||||
0, // Custom position for throttle warning value
|
||||
0, // Preflight section
|
||||
PREFLIGHT_ROW(0), // Checklist
|
||||
PREFLIGHT_ROW(0), // Throttle warning
|
||||
PREFLIGHT_ROW(0), // Custom position for throttle warning enable
|
||||
PREFLIGHT_ROW(0), // Custom position for throttle warning value
|
||||
WARN_ROWS
|
||||
|
||||
NUM_STICKS + NUM_POTS + NUM_SLIDERS - 1, // Center beeps
|
||||
0, // Global functions
|
||||
|
||||
0, // ADC Jitter filter
|
||||
|
||||
@@ -525,7 +599,21 @@ void menuModelSetup(event_t event)
|
||||
|
||||
TRAINER_ROWS,
|
||||
|
||||
USB_JOYSTICK_ROWS
|
||||
// View options
|
||||
0,
|
||||
VIEWOPT_ROW(LABEL(RadioMenuTabs)),
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(LABEL(ModelMenuTabs)),
|
||||
CASE_HELI(VIEWOPT_ROW(0))
|
||||
CASE_FLIGHT_MODES(VIEWOPT_ROW(0))
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(0),
|
||||
CASE_LUA_MODEL_SCRIPTS(VIEWOPT_ROW(0))
|
||||
VIEWOPT_ROW(0),
|
||||
|
||||
USB_JOYSTICK_ROWS,
|
||||
});
|
||||
|
||||
MENU_CHECK(menuTabModel, MENU_MODEL_SETUP, HEADER_LINE + ITEM_MODEL_SETUP_LINES_COUNT);
|
||||
@@ -788,13 +876,18 @@ void menuModelSetup(event_t event)
|
||||
g_model.trimInc = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_TRIMINC, STR_VTRIMINC, g_model.trimInc, -2, 2, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_LABEL:
|
||||
expandState.throttle = expandableSection(y, STR_THROTTLE_LABEL, expandState.throttle, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_REVERSED:
|
||||
g_model.throttleReversed = editCheckBox(g_model.throttleReversed, MODEL_SETUP_2ND_COLUMN, y, STR_THROTTLEREVERSE, attr, event );
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_THROTTLEREVERSE);
|
||||
g_model.throttleReversed = editCheckBox(g_model.throttleReversed, MODEL_SETUP_2ND_COLUMN+20, y, nullptr, attr, event );
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_TRACE:
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, STR_TTRACE);
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_TTRACE);
|
||||
if (attr)
|
||||
CHECK_INCDEC_MODELVAR_ZERO_CHECK(
|
||||
event, g_model.thrTraceSrc,
|
||||
@@ -802,23 +895,24 @@ void menuModelSetup(event_t event)
|
||||
isThrottleSourceAvailable);
|
||||
|
||||
uint8_t idx = throttleSource2Source(g_model.thrTraceSrc);
|
||||
drawSource(MODEL_SETUP_2ND_COLUMN, y, idx, attr);
|
||||
drawSource(MODEL_SETUP_2ND_COLUMN+20, y, idx, attr);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_TRIM:
|
||||
g_model.thrTrim = editCheckBox(g_model.thrTrim, MODEL_SETUP_2ND_COLUMN, y, STR_TTRIM, attr, event);
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_TTRIM);
|
||||
g_model.thrTrim = editCheckBox(g_model.thrTrim, MODEL_SETUP_2ND_COLUMN+20, y, nullptr, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_TRIM_SWITCH:
|
||||
lcdDrawTextAlignedLeft(y, STR_TTRIM_SW);
|
||||
lcdDrawText(INDENT_WIDTH, y, STR_TTRIM_SW);
|
||||
if (attr)
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.thrTrimSw, NUM_TRIMS - 1);
|
||||
drawSource(MODEL_SETUP_2ND_COLUMN, y, g_model.getThrottleStickTrimSource(), attr);
|
||||
drawSource(MODEL_SETUP_2ND_COLUMN+20, y, g_model.getThrottleStickTrimSource(), attr);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_PREFLIGHT_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_PREFLIGHT);
|
||||
expandState.preflight = expandableSection(y, STR_PREFLIGHT, expandState.preflight, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_CHECKLIST_DISPLAY:
|
||||
@@ -1008,12 +1102,6 @@ void menuModelSetup(event_t event)
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_USE_GLOBAL_FUNCTIONS:
|
||||
lcdDrawTextAlignedLeft(y, STR_USE_GLOBAL_FUNCS);
|
||||
drawCheckBox(MODEL_SETUP_2ND_COLUMN, y, !g_model.noGlobalFunctions, attr);
|
||||
if (attr) g_model.noGlobalFunctions = !checkIncDecModel(event, !g_model.noGlobalFunctions, 0, 1);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_USE_JITTER_FILTER:
|
||||
g_model.jitterFilter = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_JITTER_FILTER, STR_ADCFILTERVALUES, g_model.jitterFilter, 0, 2, attr, event);
|
||||
break;
|
||||
@@ -2101,6 +2189,49 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_VIEW_OPTIONS_LABEL:
|
||||
expandState.viewOpt = expandableSection(y, STR_VIEW_OPTIONS, expandState.viewOpt, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_RADIO_TAB:
|
||||
lcdDrawText(INDENT_WIDTH-2, y, TR_RADIO_MENU_TABS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_GF:
|
||||
g_model.radioGFDisabled = viewOptChoice(y, STR_MENUSPECIALFUNCS, g_model.radioGFDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_TRAINER:
|
||||
g_model.radioTrainerDisabled = viewOptChoice(y, STR_MENUTRAINER, g_model.radioTrainerDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_MODEL_TAB:
|
||||
lcdDrawText(INDENT_WIDTH-2, y, TR_MODEL_MENU_TABS);
|
||||
break;
|
||||
#if defined(HELI)
|
||||
case ITEM_VIEW_OPTIONS_HELI:
|
||||
g_model.modelHeliDisabled = viewOptChoice(y, STR_MENUHELISETUP, g_model.modelHeliDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
#if defined(FLIGHT_MODES)
|
||||
case ITEM_VIEW_OPTIONS_FM:
|
||||
g_model.modelFMDisabled = viewOptChoice(y, STR_MENUFLIGHTMODES, g_model.modelFMDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_CURVES:
|
||||
g_model.modelCurvesDisabled = viewOptChoice(y, STR_MENUCURVES, g_model.modelCurvesDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_LS:
|
||||
g_model.modelLSDisabled = viewOptChoice(y, STR_MENULOGICALSWITCHES, g_model.modelLSDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_SF:
|
||||
g_model.modelSFDisabled = viewOptChoice(y, STR_MENUCUSTOMFUNC, g_model.modelSFDisabled, attr, event);
|
||||
break;
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
case ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS:
|
||||
g_model.modelCustomScriptsDisabled = viewOptChoice(y, STR_MENUCUSTOMSCRIPTS, g_model.modelCustomScriptsDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_TELEMETRY:
|
||||
g_model.modelTelemetryDisabled = viewOptChoice(y, STR_MENUTELEMETRY, g_model.modelTelemetryDisabled, attr, event);
|
||||
break;
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
case ITEM_MODEL_SETUP_USBJOYSTICK_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_USBJOYSTICK_LABEL);
|
||||
|
||||
@@ -106,6 +106,18 @@ enum {
|
||||
CASE_ROTARY_ENCODER(ITEM_RADIO_SETUP_ROTARY_ENC_MODE)
|
||||
ITEM_RADIO_SETUP_STICK_MODE_LABELS,
|
||||
ITEM_RADIO_SETUP_STICK_MODE,
|
||||
ITEM_VIEW_OPTIONS_LABEL,
|
||||
ITEM_VIEW_OPTIONS_RADIO_TAB,
|
||||
ITEM_VIEW_OPTIONS_GF,
|
||||
ITEM_VIEW_OPTIONS_TRAINER,
|
||||
ITEM_VIEW_OPTIONS_MODEL_TAB,
|
||||
CASE_HELI(ITEM_VIEW_OPTIONS_HELI)
|
||||
CASE_FLIGHT_MODES(ITEM_VIEW_OPTIONS_FM)
|
||||
ITEM_VIEW_OPTIONS_CURVES,
|
||||
ITEM_VIEW_OPTIONS_LS,
|
||||
ITEM_VIEW_OPTIONS_SF,
|
||||
CASE_LUA_MODEL_SCRIPTS(ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS)
|
||||
ITEM_VIEW_OPTIONS_TELEMETRY,
|
||||
ITEM_RADIO_SETUP_MAX
|
||||
};
|
||||
|
||||
@@ -115,6 +127,12 @@ enum {
|
||||
#define COL_TX_MODE LABEL(TX_MODE)
|
||||
#endif
|
||||
|
||||
uint8_t viewOptCheckBox(coord_t y, const char* title, uint8_t value, uint8_t attr, event_t event)
|
||||
{
|
||||
lcdDrawText(INDENT_WIDTH, y, title);
|
||||
return !editCheckBox(!value, 110, y, nullptr, attr, event ) ;
|
||||
}
|
||||
|
||||
void menuRadioSetup(event_t event)
|
||||
{
|
||||
#if defined(RTCLOCK)
|
||||
@@ -180,7 +198,9 @@ void menuRadioSetup(event_t event)
|
||||
0, // USB mode
|
||||
CASE_JACK_DETECT(0) // Jack mode
|
||||
CASE_ROTARY_ENCODER(0)
|
||||
0, COL_TX_MODE, 0, 1/*to force edit mode*/});
|
||||
0, COL_TX_MODE, 0,
|
||||
LABEL(ViewOptions), LABEL(RadioMenuTabs), 0, 0, LABEL(ModelMenuTabs), CASE_HELI(0) CASE_FLIGHT_MODES(0) 0, 0, 0, CASE_LUA_MODEL_SCRIPTS(0) 0,
|
||||
1/*to force edit mode*/});
|
||||
|
||||
if (event == EVT_ENTRY) {
|
||||
reusableBuffer.generalSettings.stickMode = g_eeGeneral.stickMode;
|
||||
@@ -701,6 +721,49 @@ void menuRadioSetup(event_t event)
|
||||
waitKeysReleased();
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_VIEW_OPTIONS_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_VIEW_OPTIONS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_RADIO_TAB:
|
||||
lcdDrawText(INDENT_WIDTH-2, y, TR_RADIO_MENU_TABS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_GF:
|
||||
g_eeGeneral.radioGFDisabled = viewOptCheckBox(y, STR_MENUSPECIALFUNCS, g_eeGeneral.radioGFDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_TRAINER:
|
||||
g_eeGeneral.radioTrainerDisabled = viewOptCheckBox(y, STR_MENUTRAINER, g_eeGeneral.radioTrainerDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_MODEL_TAB:
|
||||
lcdDrawText(INDENT_WIDTH-2, y, TR_MODEL_MENU_TABS);
|
||||
break;
|
||||
#if defined(HELI)
|
||||
case ITEM_VIEW_OPTIONS_HELI:
|
||||
g_eeGeneral.modelHeliDisabled = viewOptCheckBox(y, STR_MENUHELISETUP, g_eeGeneral.modelHeliDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
#if defined(FLIGHT_MODES)
|
||||
case ITEM_VIEW_OPTIONS_FM:
|
||||
g_eeGeneral.modelFMDisabled = viewOptCheckBox(y, STR_MENUFLIGHTMODES, g_eeGeneral.modelFMDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_CURVES:
|
||||
g_eeGeneral.modelCurvesDisabled = viewOptCheckBox(y, STR_MENUCURVES, g_eeGeneral.modelCurvesDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_LS:
|
||||
g_eeGeneral.modelLSDisabled = viewOptCheckBox(y, STR_MENULOGICALSWITCHES, g_eeGeneral.modelLSDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_SF:
|
||||
g_eeGeneral.modelSFDisabled = viewOptCheckBox(y, STR_MENUCUSTOMFUNC, g_eeGeneral.modelSFDisabled, attr, event);
|
||||
break;
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
case ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS:
|
||||
g_eeGeneral.modelCustomScriptsDisabled = viewOptCheckBox(y, STR_MENUCUSTOMSCRIPTS, g_eeGeneral.modelCustomScriptsDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_TELEMETRY:
|
||||
g_eeGeneral.modelTelemetryDisabled = viewOptCheckBox(y, STR_MENUTELEMETRY, g_eeGeneral.modelTelemetryDisabled, attr, event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ void menuMainView(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_GENERAL_MENU:
|
||||
pushMenu(menuTabGeneral[0]);
|
||||
pushMenu(menuTabGeneral[0].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
||||
|
||||
// TRACE("editGVarFieldValue(val=%d min=%d max=%d)", value, min, max);
|
||||
|
||||
if (invers && event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
if (modelGVEnabled() && invers && event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
s_editMode = !s_editMode;
|
||||
if (attr & PREC1)
|
||||
value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, mixerCurrentFlightMode)*10 : delta);
|
||||
|
||||
@@ -164,8 +164,8 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
#define CURSOR_ON_LINE() (menuHorizontalPosition<0)
|
||||
|
||||
#define CHECK_FLAG_NO_SCREEN_INDEX 1
|
||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
|
||||
void check_simple(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
void check(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
|
||||
void check_simple(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
void check_submenu_simple(event_t event, uint8_t maxrow);
|
||||
|
||||
void title(const char * s);
|
||||
|
||||
@@ -21,25 +21,29 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
menuModelCurvesAll,
|
||||
const MenuHandler menuTabModel[] = {
|
||||
{ menuModelSelect, nullptr },
|
||||
{ menuModelSetup, nullptr },
|
||||
#if defined(HELI)
|
||||
{ menuModelHeli, modelHeliEnabled },
|
||||
#endif
|
||||
#if defined(FLIGHT_MODES)
|
||||
{ menuModelFlightModesAll, modelFMEnabled },
|
||||
#endif
|
||||
{ menuModelExposAll, nullptr },
|
||||
{ menuModelMixAll, nullptr },
|
||||
{ menuModelLimits, nullptr },
|
||||
{ menuModelCurvesAll, modelCurvesEnabled },
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
{ menuModelGVars, modelGVEnabled },
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelSpecialFunctions,
|
||||
{ menuModelLogicalSwitches, modelLSEnabled },
|
||||
{ menuModelSpecialFunctions, modelSFEnabled },
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
{ menuModelCustomScripts, modelCustomScriptsEnabled },
|
||||
#endif
|
||||
menuModelTelemetry,
|
||||
menuModelDisplay
|
||||
{ menuModelTelemetry, modelTelemetryEnabled },
|
||||
{ menuModelDisplay, nullptr }
|
||||
};
|
||||
|
||||
uint8_t editDelay(coord_t y, event_t event, uint8_t attr, const char * str, uint8_t delay)
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
const MenuHandlerFunc menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
const MenuHandler menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
#if defined(RADIO_TOOLS)
|
||||
menuRadioTools,
|
||||
{ menuRadioTools, nullptr },
|
||||
#endif
|
||||
menuRadioSdManager,
|
||||
menuRadioSetup,
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
menuRadioHardware,
|
||||
menuRadioVersion
|
||||
{ menuRadioSdManager, nullptr },
|
||||
{ menuRadioSetup, nullptr },
|
||||
{ menuRadioSpecialFunctions, radioGFEnabled },
|
||||
{ menuRadioTrainer, radioTrainerEnabled },
|
||||
{ menuRadioHardware, nullptr },
|
||||
{ menuRadioVersion, nullptr }
|
||||
};
|
||||
|
||||
void menuRadioSpecialFunctions(event_t event)
|
||||
|
||||
@@ -79,7 +79,7 @@ void menuRadioSpectrumAnalyser(event_t event);
|
||||
void menuRadioPowerMeter(event_t event);
|
||||
void menuGhostModuleConfig(event_t event);
|
||||
|
||||
extern const MenuHandlerFunc menuTabGeneral[MENU_RADIO_PAGES_COUNT];
|
||||
extern const MenuHandler menuTabGeneral[MENU_RADIO_PAGES_COUNT];
|
||||
|
||||
enum MenuModelIndexes {
|
||||
MENU_MODEL_SELECT,
|
||||
@@ -126,6 +126,6 @@ void menuModelDisplay(event_t event);
|
||||
void menuModelUSBJoystick(event_t event);
|
||||
#endif
|
||||
|
||||
extern const MenuHandlerFunc menuTabModel[MENU_MODEL_PAGES_COUNT];
|
||||
extern const MenuHandler menuTabModel[MENU_MODEL_PAGES_COUNT];
|
||||
|
||||
#endif // _MENUS_H_
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
static int numFlightModes() { return modelFMEnabled() ? MAX_FLIGHT_MODES : 1; }
|
||||
|
||||
void editGVarValue(coord_t x, coord_t y, event_t event, uint8_t gvar, uint8_t flightMode, LcdFlags flags)
|
||||
{
|
||||
FlightModeData * fm = &g_model.flightModeData[flightMode];
|
||||
@@ -75,7 +77,7 @@ void menuModelGVarOne(event_t event)
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
SIMPLE_SUBMENU(STR_GVARS, GVAR_FIELD_LAST);
|
||||
SIMPLE_SUBMENU(STR_GVARS, modelFMEnabled() ? GVAR_FIELD_LAST : GVAR_FIELD_FM0+1);
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i * FH;
|
||||
@@ -112,7 +114,10 @@ void menuModelGVarOne(event_t event)
|
||||
break;
|
||||
|
||||
default:
|
||||
drawStringWithIndex(0, y, STR_FM, k-GVAR_FIELD_FM0);
|
||||
if (modelFMEnabled())
|
||||
drawStringWithIndex(0, y, STR_FM, k-GVAR_FIELD_FM0);
|
||||
else
|
||||
lcdDrawText(0, y, STR_VALUE);
|
||||
editGVarValue(GVAR_2ND_COLUMN, y, event, s_currIdx, k-GVAR_FIELD_FM0, LEFT|attr);
|
||||
break;
|
||||
}
|
||||
@@ -135,14 +140,19 @@ void onGVARSMenu(const char * result)
|
||||
}
|
||||
}
|
||||
|
||||
#define GVARS_COLUMNS (NAVIGATION_LINE_BY_LINE|(MAX_FLIGHT_MODES-1))
|
||||
#define GVARS_FM_COLUMN(p) (7*FW - 7 + (p)*20)
|
||||
|
||||
uint8_t colCount() {
|
||||
if (modelFMEnabled())
|
||||
return NAVIGATION_LINE_BY_LINE | (MAX_FLIGHT_MODES - 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void menuModelGVars(event_t event)
|
||||
{
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
const char * menuTitle;
|
||||
bool after2seconds = (tmr10ms - menuEntryTime > 200); /*2 seconds*/
|
||||
bool after2seconds = modelFMEnabled() && (tmr10ms - menuEntryTime > 200); /*2 seconds*/
|
||||
|
||||
if (after2seconds) {
|
||||
menuTitle = STR_GVARS;
|
||||
@@ -154,7 +164,8 @@ void menuModelGVars(event_t event)
|
||||
menuTitle = STR_MENU_GLOBAL_VARS;
|
||||
}
|
||||
|
||||
MENU_FLAGS(menuTitle, menuTabModel, MENU_MODEL_GVARS, after2seconds ? CHECK_FLAG_NO_SCREEN_INDEX : 0, MAX_GVARS, { GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS, GVARS_COLUMNS });
|
||||
MENU_FLAGS(menuTitle, menuTabModel, MENU_MODEL_GVARS, after2seconds ? CHECK_FLAG_NO_SCREEN_INDEX : 0, MAX_GVARS,
|
||||
{ colCount(), colCount(), colCount(), colCount(), colCount(), colCount(), colCount(), colCount(), colCount() });
|
||||
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
@@ -164,7 +175,7 @@ void menuModelGVars(event_t event)
|
||||
|
||||
drawGVarName(0, y, i, (sub==i && menuHorizontalPosition<0) ? INVERS : 0);
|
||||
|
||||
for (int j=0; j<MAX_FLIGHT_MODES; j++) {
|
||||
for (int j=0; j<numFlightModes(); j++) {
|
||||
FlightModeData * fm = &g_model.flightModeData[j];
|
||||
gvar_t v = fm->gvars[i];
|
||||
|
||||
@@ -185,7 +196,7 @@ void menuModelGVars(event_t event)
|
||||
}
|
||||
}
|
||||
|
||||
if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
if ((menuHorizontalPosition<0 || !modelFMEnabled()) && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_EDIT);
|
||||
POPUP_MENU_ADD_ITEM(STR_CLEAR);
|
||||
|
||||
@@ -48,6 +48,13 @@ enum ExposFields {
|
||||
|
||||
#define CURVE_ROWS 1
|
||||
|
||||
uint8_t FM_ROW(uint8_t value)
|
||||
{
|
||||
if (modelFMEnabled())
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
void menuModelExpoOne(event_t event)
|
||||
{
|
||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
||||
@@ -61,7 +68,9 @@ void menuModelExpoOne(event_t event)
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX, {0, 0, 0, ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW, 0, 0, CURVE_ROWS, CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/});
|
||||
SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX,
|
||||
{0, 0, 0, ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW, 0, 0, CURVE_ROWS,
|
||||
CASE_FLIGHT_MODES(FM_ROW((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE)) 0 /*, ...*/});
|
||||
|
||||
SET_SCROLLBAR_X(EXPO_ONE_2ND_COLUMN+10*FW);
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ enum MixFields {
|
||||
MIX_FIELD_COUNT
|
||||
};
|
||||
|
||||
extern uint8_t FM_ROW(uint8_t);
|
||||
|
||||
void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
|
||||
{
|
||||
const int gaugeWidth = 33;
|
||||
@@ -97,14 +99,21 @@ void menuModelMixOne(event_t event)
|
||||
|
||||
uint8_t old_editMode = s_editMode;
|
||||
|
||||
SUBMENU(STR_MIXES, MIX_FIELD_COUNT, {0, 0, 0, 0, 0, 1, CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/});
|
||||
SUBMENU(STR_MIXES, MIX_FIELD_COUNT,
|
||||
{0, 0, 0, 0, 0, 1, CASE_FLIGHT_MODES(FM_ROW((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE)) 0, 0 /*, ...*/});
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
int8_t editMode = s_editMode;
|
||||
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||
|
||||
for (uint8_t k=0; k<NUM_BODY_LINES; k++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
|
||||
int i = k + menuVerticalOffset;
|
||||
for (int j=0; j<=i; ++j) {
|
||||
if (j<(int)DIM(mstate_tab) && mstate_tab[j] == HIDDEN_ROW) {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
LcdFlags attr = (sub==i ? INVERS | (editMode>0 ? BLINK : 0) : 0);
|
||||
switch (i) {
|
||||
case MIX_FIELD_NAME:
|
||||
@@ -189,5 +198,6 @@ void menuModelMixOne(event_t event)
|
||||
md2->speedDown = EDIT_DELAY(y, event, attr, STR_SLOWDOWN, md2->speedDown);
|
||||
break;
|
||||
}
|
||||
y += FH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ void menuModelSelect(event_t event)
|
||||
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
chainMenu(event == EVT_KEY_BREAK(KEY_PAGE) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu(event == EVT_KEY_BREAK(KEY_PAGE) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -249,7 +249,8 @@ void menuModelSelect(event_t event)
|
||||
lcdDrawText(lcdLastRightPos + 3, 0, STR_FREE);
|
||||
#endif
|
||||
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), 0);
|
||||
extern uint8_t menuSize(const MenuHandler*, uint8_t);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, menuSize(menuTabModel, DIM(menuTabModel)), 0);
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
title(STR_MENUMODELSEL);
|
||||
|
||||
@@ -95,7 +95,6 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_POTS_WARNING2,
|
||||
#endif
|
||||
ITEM_MODEL_SETUP_BEEP_CENTER,
|
||||
ITEM_MODEL_SETUP_USE_GLOBAL_FUNCTIONS,
|
||||
ITEM_MODEL_SETUP_USE_JITTER_FILTER,
|
||||
#if defined(PXX2)
|
||||
ITEM_MODEL_SETUP_REGISTRATION_ID,
|
||||
@@ -158,6 +157,22 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_TRAINER_CHANNELS,
|
||||
ITEM_MODEL_SETUP_TRAINER_PPM_PARAMS,
|
||||
|
||||
ITEM_VIEW_OPTIONS_LABEL,
|
||||
ITEM_VIEW_OPTIONS_RADIO_TAB,
|
||||
ITEM_VIEW_OPTIONS_GF,
|
||||
ITEM_VIEW_OPTIONS_TRAINER,
|
||||
ITEM_VIEW_OPTIONS_MODEL_TAB,
|
||||
CASE_HELI(ITEM_VIEW_OPTIONS_HELI)
|
||||
CASE_FLIGHT_MODES(ITEM_VIEW_OPTIONS_FM)
|
||||
CASE_GVARS(ITEM_VIEW_OPTIONS_GV)
|
||||
ITEM_VIEW_OPTIONS_CURVES,
|
||||
ITEM_VIEW_OPTIONS_LS,
|
||||
ITEM_VIEW_OPTIONS_SF,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS,
|
||||
#endif
|
||||
ITEM_VIEW_OPTIONS_TELEMETRY,
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_LABEL,
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_MODE,
|
||||
@@ -166,6 +181,7 @@ enum MenuModelSetupItems {
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_CH_BUTTON,
|
||||
ITEM_MODEL_SETUP_USBJOYSTICK_APPLY,
|
||||
#endif
|
||||
|
||||
ITEM_MODEL_SETUP_LINES_COUNT
|
||||
};
|
||||
|
||||
@@ -173,6 +189,35 @@ enum MenuModelSetupItems {
|
||||
#define MODEL_SETUP_3RD_COLUMN (MODEL_SETUP_2ND_COLUMN+6*FW)
|
||||
#define MODEL_SETUP_SET_FAILSAFE_OFS 10*FW-2
|
||||
|
||||
PACK(struct ExpandState {
|
||||
uint8_t preflight:1;
|
||||
uint8_t throttle:1;
|
||||
uint8_t viewOpt:1;
|
||||
});
|
||||
|
||||
struct ExpandState expandState;
|
||||
|
||||
uint8_t PREFLIGHT_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.preflight)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t THROTTLE_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.throttle)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
uint8_t VIEWOPT_ROW(uint8_t value)
|
||||
{
|
||||
if (expandState.viewOpt)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
void copySelection(char * dst, const char * src, uint8_t size)
|
||||
{
|
||||
if (memcmp(src, "---", 3) == 0)
|
||||
@@ -323,13 +368,18 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
#define TRAINER_ROWS LABEL(Trainer), 0, TRAINER_CHANNELS_ROW, TRAINER_PPM_PARAMS_ROW
|
||||
#endif
|
||||
|
||||
inline uint8_t TIMER_ROW(uint8_t timer, uint8_t value)
|
||||
{
|
||||
if (g_model.timers[timer].mode > 0)
|
||||
return value;
|
||||
return HIDDEN_ROW;
|
||||
}
|
||||
|
||||
#define TIMER_ROWS(x) \
|
||||
1 | NAVIGATION_LINE_BY_LINE, 0, \
|
||||
(uint8_t)(((g_model.timers[x].start) ? 2 : 1) | \
|
||||
NAVIGATION_LINE_BY_LINE), \
|
||||
0, 0, \
|
||||
g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 \
|
||||
: (uint8_t)0
|
||||
1 | NAVIGATION_LINE_BY_LINE, TIMER_ROW(x,0), \
|
||||
TIMER_ROW(x,(uint8_t)((g_model.timers[x].start) ? 2 : 1) | NAVIGATION_LINE_BY_LINE), \
|
||||
TIMER_ROW(x,0), TIMER_ROW(x,0), \
|
||||
TIMER_ROW(x,g_model.timers[x].countdownBeep != COUNTDOWN_SILENT ? (uint8_t)1 : (uint8_t)0)
|
||||
|
||||
inline uint8_t EXTERNAL_MODULE_TYPE_ROW()
|
||||
{
|
||||
@@ -347,12 +397,19 @@ inline uint8_t EXTERNAL_MODULE_TYPE_ROW()
|
||||
#define TIMERS_ROWS TIMER_ROWS(0), TIMER_ROWS(1), TIMER_ROWS(2)
|
||||
#endif
|
||||
#if defined(PCBX9E)
|
||||
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1)), uint8_t(getSwitchWarningsCount() > 8 ? TITLE_ROW : HIDDEN_ROW), uint8_t(getSwitchWarningsCount() > 16 ? TITLE_ROW : HIDDEN_ROW)
|
||||
#define POT_WARN_ROWS uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|(NUM_POTS+NUM_SLIDERS) : 0), uint8_t(g_model.potsWarnMode ? TITLE_ROW : HIDDEN_ROW)
|
||||
#define SW_WARN_ROWS \
|
||||
PREFLIGHT_ROW(uint8_t(NAVIGATION_LINE_BY_LINE|(getSwitchWarningsCount()-1))), \
|
||||
PREFLIGHT_ROW(uint8_t(getSwitchWarningsCount() > 8 ? TITLE_ROW : HIDDEN_ROW)), \
|
||||
PREFLIGHT_ROW(uint8_t(getSwitchWarningsCount() > 16 ? TITLE_ROW : HIDDEN_ROW))
|
||||
#define POT_WARN_ROWS \
|
||||
PREFLIGHT_ROW(uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|(NUM_POTS+NUM_SLIDERS) : 0)), \
|
||||
PREFLIGHT_ROW(uint8_t(g_model.potsWarnMode ? TITLE_ROW : HIDDEN_ROW))
|
||||
#define TOPLCD_ROWS 0,
|
||||
#else
|
||||
#define SW_WARN_ROWS uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsCount())
|
||||
#define POT_WARN_ROWS uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|(NUM_POTS+NUM_SLIDERS) : 0)
|
||||
#define SW_WARN_ROWS \
|
||||
PREFLIGHT_ROW(uint8_t(NAVIGATION_LINE_BY_LINE|getSwitchWarningsCount()))
|
||||
#define POT_WARN_ROWS \
|
||||
PREFLIGHT_ROW(uint8_t(g_model.potsWarnMode ? NAVIGATION_LINE_BY_LINE|(NUM_POTS+NUM_SLIDERS) : 0))
|
||||
#define TOPLCD_ROWS
|
||||
#endif
|
||||
|
||||
@@ -424,6 +481,26 @@ inline uint8_t USB_JOYSTICK_APPLYROW()
|
||||
#define USB_JOYSTICK_ROWS
|
||||
#endif
|
||||
|
||||
uint8_t viewOptChoice(coord_t y, const char* title, uint8_t value, uint8_t attr, event_t event, bool globalState)
|
||||
{
|
||||
lcdDrawText(INDENT_WIDTH*2, y, title);
|
||||
uint8_t rv = editChoice(MODEL_SETUP_2ND_COLUMN, y, nullptr, STR_ADCFILTERVALUES, value, 0, 2, attr, event);
|
||||
if (rv == OVERRIDE_GLOBAL)
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN + 40, y, STR_ADCFILTERVALUES[globalState == 0 ? 2 : 1]);
|
||||
return rv;
|
||||
}
|
||||
|
||||
uint8_t expandableSection(coord_t y, const char* title, uint8_t value, uint8_t attr, event_t event)
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, title);
|
||||
lcdDrawText(200, y, value ? STR_CHAR_UP : STR_CHAR_DOWN, attr);
|
||||
if (attr && (event == EVT_KEY_BREAK(KEY_ENTER))) {
|
||||
value = !value;
|
||||
s_editMode = 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
void menuModelSetup(event_t event)
|
||||
{
|
||||
horzpos_t l_posHorz = menuHorizontalPosition;
|
||||
@@ -446,24 +523,22 @@ void menuModelSetup(event_t event)
|
||||
0, // Show trims
|
||||
0, // Trims step
|
||||
|
||||
LABEL(Throttle),
|
||||
0, // Thrxottle reverse
|
||||
0, // Throttle trace source
|
||||
0, // Throttle trim
|
||||
0, // Throttle trim switch
|
||||
0, // Throttle section
|
||||
THROTTLE_ROW(0), // Throttle reverse
|
||||
THROTTLE_ROW(0), // Throttle trace source
|
||||
THROTTLE_ROW(0), // Throttle trim
|
||||
THROTTLE_ROW(0), // Throttle trim switch
|
||||
|
||||
LABEL(PreflightCheck),
|
||||
0, // Checklist
|
||||
0, // Throttle warning
|
||||
0, // Custom position for throttle warning enable
|
||||
0, // Custom position for throttle warning value
|
||||
0, // Preflight section
|
||||
PREFLIGHT_ROW(0), // Checklist
|
||||
PREFLIGHT_ROW(0), // Throttle warning
|
||||
PREFLIGHT_ROW(0), // Custom position for throttle warning enable
|
||||
PREFLIGHT_ROW(0), // Custom position for throttle warning value
|
||||
SW_WARN_ROWS, // Switch warning
|
||||
POT_WARN_ROWS, // Pot warning
|
||||
|
||||
NAVIGATION_LINE_BY_LINE | (NUM_STICKS+NUM_POTS+NUM_SLIDERS-1), // Center beeps
|
||||
|
||||
0, // Global functions
|
||||
|
||||
0, // ADC Jitter filter
|
||||
|
||||
REGISTRATION_ID_ROWS
|
||||
@@ -504,6 +579,21 @@ void menuModelSetup(event_t event)
|
||||
|
||||
TRAINER_ROWS,
|
||||
|
||||
// View options
|
||||
0,
|
||||
VIEWOPT_ROW(LABEL(RadioMenuTabs)),
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(LABEL(ModelMenuTabs)),
|
||||
CASE_HELI(VIEWOPT_ROW(0))
|
||||
CASE_FLIGHT_MODES(VIEWOPT_ROW(0))
|
||||
CASE_GVARS(VIEWOPT_ROW(0))
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(0),
|
||||
VIEWOPT_ROW(0),
|
||||
CASE_LUA_MODEL_SCRIPTS(VIEWOPT_ROW(0))
|
||||
VIEWOPT_ROW(0),
|
||||
|
||||
USB_JOYSTICK_ROWS
|
||||
});
|
||||
|
||||
@@ -693,7 +783,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_THROTTLE_LABEL);
|
||||
expandState.throttle = expandableSection(y, STR_THROTTLE_LABEL, expandState.throttle, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_THROTTLE_REVERSED:
|
||||
@@ -726,7 +816,7 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_PREFLIGHT_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_PREFLIGHT);
|
||||
expandState.preflight = expandableSection(y, STR_PREFLIGHT, expandState.preflight, attr, event);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_CHECKLIST_DISPLAY:
|
||||
@@ -937,12 +1027,6 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_MODEL_SETUP_USE_GLOBAL_FUNCTIONS:
|
||||
lcdDrawTextAlignedLeft(y, STR_USE_GLOBAL_FUNCS);
|
||||
drawCheckBox(MODEL_SETUP_2ND_COLUMN, y, !g_model.noGlobalFunctions, attr);
|
||||
if (attr) g_model.noGlobalFunctions = !checkIncDecModel(event, !g_model.noGlobalFunctions, 0, 1);
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_SETUP_USE_JITTER_FILTER:
|
||||
g_model.jitterFilter = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_JITTER_FILTER, STR_ADCFILTERVALUES, g_model.jitterFilter, 0, 2, attr, event);
|
||||
break;
|
||||
@@ -1814,6 +1898,54 @@ void menuModelSetup(event_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
case ITEM_VIEW_OPTIONS_LABEL:
|
||||
expandState.viewOpt = expandableSection(y, STR_VIEW_OPTIONS, expandState.viewOpt, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_RADIO_TAB:
|
||||
lcdDrawText(INDENT_WIDTH, y, TR_RADIO_MENU_TABS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_GF:
|
||||
g_model.radioGFDisabled = viewOptChoice(y, STR_MENUSPECIALFUNCS, g_model.radioGFDisabled, attr, event, g_eeGeneral.radioGFDisabled);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_TRAINER:
|
||||
g_model.radioTrainerDisabled = viewOptChoice(y, STR_MENUTRAINER, g_model.radioTrainerDisabled, attr, event, g_eeGeneral.radioTrainerDisabled);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_MODEL_TAB:
|
||||
lcdDrawText(INDENT_WIDTH, y, TR_MODEL_MENU_TABS);
|
||||
break;
|
||||
#if defined(HELI)
|
||||
case ITEM_VIEW_OPTIONS_HELI:
|
||||
g_model.modelHeliDisabled = viewOptChoice(y, STR_MENUHELISETUP, g_model.modelHeliDisabled, attr, event, g_eeGeneral.modelHeliDisabled);
|
||||
break;
|
||||
#endif
|
||||
#if defined(FLIGHT_MODES)
|
||||
case ITEM_VIEW_OPTIONS_FM:
|
||||
g_model.modelFMDisabled = viewOptChoice(y, STR_MENUFLIGHTMODES, g_model.modelFMDisabled, attr, event, g_eeGeneral.modelFMDisabled);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_CURVES:
|
||||
g_model.modelCurvesDisabled = viewOptChoice(y, STR_MENUCURVES, g_model.modelCurvesDisabled, attr, event, g_eeGeneral.modelCurvesDisabled);
|
||||
break;
|
||||
#if defined(GVARS)
|
||||
case ITEM_VIEW_OPTIONS_GV:
|
||||
g_model.modelGVDisabled = viewOptChoice(y, STR_MENU_GLOBAL_VARS, g_model.modelGVDisabled, attr, event, g_eeGeneral.modelGVDisabled);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_LS:
|
||||
g_model.modelLSDisabled = viewOptChoice(y, STR_MENULOGICALSWITCHES, g_model.modelLSDisabled, attr, event, g_eeGeneral.modelLSDisabled);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_SF:
|
||||
g_model.modelSFDisabled = viewOptChoice(y, STR_MENUCUSTOMFUNC, g_model.modelSFDisabled, attr, event, g_eeGeneral.modelSFDisabled);
|
||||
break;
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
case ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS:
|
||||
g_model.modelCustomScriptsDisabled = viewOptChoice(y, STR_MENUCUSTOMSCRIPTS, g_model.modelCustomScriptsDisabled, attr, event, g_eeGeneral.modelCustomScriptsDisabled);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_TELEMETRY:
|
||||
g_model.modelTelemetryDisabled = viewOptChoice(y, STR_MENUTELEMETRY, g_model.modelTelemetryDisabled, attr, event, g_eeGeneral.modelTelemetryDisabled);
|
||||
break;
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
case ITEM_MODEL_SETUP_USBJOYSTICK_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_USBJOYSTICK_LABEL);
|
||||
|
||||
@@ -99,9 +99,28 @@ enum MenuRadioSetupItems {
|
||||
CASE_ROTARY_ENCODER(ITEM_RADIO_SETUP_ROTARY_ENC_MODE)
|
||||
ITEM_RADIO_SETUP_STICK_MODE_LABELS,
|
||||
ITEM_RADIO_SETUP_STICK_MODE,
|
||||
ITEM_VIEW_OPTIONS_LABEL,
|
||||
ITEM_VIEW_OPTIONS_RADIO_TAB,
|
||||
ITEM_VIEW_OPTIONS_GF,
|
||||
ITEM_VIEW_OPTIONS_TRAINER,
|
||||
ITEM_VIEW_OPTIONS_MODEL_TAB,
|
||||
CASE_HELI(ITEM_VIEW_OPTIONS_HELI)
|
||||
CASE_FLIGHT_MODES(ITEM_VIEW_OPTIONS_FM)
|
||||
CASE_GVARS(ITEM_VIEW_OPTIONS_GV)
|
||||
ITEM_VIEW_OPTIONS_CURVES,
|
||||
ITEM_VIEW_OPTIONS_LS,
|
||||
ITEM_VIEW_OPTIONS_SF,
|
||||
CASE_LUA_MODEL_SCRIPTS(ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS)
|
||||
ITEM_VIEW_OPTIONS_TELEMETRY,
|
||||
ITEM_RADIO_SETUP_MAX
|
||||
};
|
||||
|
||||
uint8_t viewOptCheckBox(coord_t y, const char* title, uint8_t value, uint8_t attr, event_t event)
|
||||
{
|
||||
lcdDrawText(INDENT_WIDTH*2, y, title);
|
||||
return !editCheckBox(!value, RADIO_SETUP_2ND_COLUMN, y, nullptr, attr, event );
|
||||
}
|
||||
|
||||
void menuRadioSetup(event_t event)
|
||||
{
|
||||
#if defined(RTCLOCK)
|
||||
@@ -181,6 +200,7 @@ void menuRadioSetup(event_t event)
|
||||
CASE_ROTARY_ENCODER(0) // Invert rotary encoder
|
||||
LABEL(TX_MODE),
|
||||
0, // sticks mode
|
||||
LABEL(ViewOptions), LABEL(RadioMenuTabs), 0, 0, LABEL(ModelMenuTabs), CASE_HELI(0) CASE_FLIGHT_MODES(0) CASE_GVARS(0) 0, 0, 0, CASE_LUA_MODEL_SCRIPTS(0) 0,
|
||||
1 /*to force edit mode*/
|
||||
});
|
||||
|
||||
@@ -196,6 +216,11 @@ void menuRadioSetup(event_t event)
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||
uint8_t k = i + menuVerticalOffset;
|
||||
for (int j = 0; j <= k; j++) {
|
||||
if (mstate_tab[j] == HIDDEN_ROW)
|
||||
k++;
|
||||
}
|
||||
|
||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
uint8_t attr = (sub == k ? blink : 0);
|
||||
|
||||
@@ -631,6 +656,54 @@ void menuRadioSetup(event_t event)
|
||||
waitKeysReleased();
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_VIEW_OPTIONS_LABEL:
|
||||
lcdDrawTextAlignedLeft(y, STR_VIEW_OPTIONS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_RADIO_TAB:
|
||||
lcdDrawText(INDENT_WIDTH, y, TR_RADIO_MENU_TABS);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_GF:
|
||||
g_eeGeneral.radioGFDisabled = viewOptCheckBox(y, STR_MENUSPECIALFUNCS, g_eeGeneral.radioGFDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_TRAINER:
|
||||
g_eeGeneral.radioTrainerDisabled = viewOptCheckBox(y, STR_MENUTRAINER, g_eeGeneral.radioTrainerDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_MODEL_TAB:
|
||||
lcdDrawText(INDENT_WIDTH, y, TR_MODEL_MENU_TABS);
|
||||
break;
|
||||
#if defined(HELI)
|
||||
case ITEM_VIEW_OPTIONS_HELI:
|
||||
g_eeGeneral.modelHeliDisabled = viewOptCheckBox(y, STR_MENUHELISETUP, g_eeGeneral.modelHeliDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
#if defined(FLIGHT_MODES)
|
||||
case ITEM_VIEW_OPTIONS_FM:
|
||||
g_eeGeneral.modelFMDisabled = viewOptCheckBox(y, STR_MENUFLIGHTMODES, g_eeGeneral.modelFMDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_CURVES:
|
||||
g_eeGeneral.modelCurvesDisabled = viewOptCheckBox(y, STR_MENUCURVES, g_eeGeneral.modelCurvesDisabled, attr, event);
|
||||
break;
|
||||
#if defined(GVARS)
|
||||
case ITEM_VIEW_OPTIONS_GV:
|
||||
g_model.modelGVDisabled = viewOptCheckBox(y, STR_MENU_GLOBAL_VARS, g_model.modelGVDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_LS:
|
||||
g_eeGeneral.modelLSDisabled = viewOptCheckBox(y, STR_MENULOGICALSWITCHES, g_eeGeneral.modelLSDisabled, attr, event);
|
||||
break;
|
||||
case ITEM_VIEW_OPTIONS_SF:
|
||||
g_eeGeneral.modelSFDisabled = viewOptCheckBox(y, STR_MENUCUSTOMFUNC, g_eeGeneral.modelSFDisabled, attr, event);
|
||||
break;
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
case ITEM_VIEW_OPTIONS_CUSTOM_SCRIPTS:
|
||||
g_eeGeneral.modelCustomScriptsDisabled = viewOptCheckBox(y, STR_MENUCUSTOMSCRIPTS, g_eeGeneral.modelCustomScriptsDisabled, attr, event);
|
||||
break;
|
||||
#endif
|
||||
case ITEM_VIEW_OPTIONS_TELEMETRY:
|
||||
g_eeGeneral.modelTelemetryDisabled = viewOptCheckBox(y, STR_MENUTELEMETRY, g_eeGeneral.modelTelemetryDisabled, attr, event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ void menuMainView(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_MENU):
|
||||
pushMenu(menuTabGeneral[0]);
|
||||
pushMenu(menuTabGeneral[0].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
||||
|
||||
// TRACE("editGVarFieldValue(val=%d min=%d max=%d)", value, min, max);
|
||||
|
||||
if (invers && event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
if (modelGVEnabled() && invers && event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
s_editMode = !s_editMode;
|
||||
if (attr & PREC1) {
|
||||
value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, mixerCurrentFlightMode)*10 : delta);
|
||||
|
||||
@@ -29,9 +29,11 @@
|
||||
|
||||
void CurveParam::LongPressHandler(void* data)
|
||||
{
|
||||
int8_t* value = (int8_t*)data;
|
||||
if (*value != 0) {
|
||||
ModelCurvesPage::pushEditCurve(abs(*value) - 1);
|
||||
if (modelCurvesEnabled()) {
|
||||
int8_t* value = (int8_t*)data;
|
||||
if (*value != 0) {
|
||||
ModelCurvesPage::pushEditCurve(abs(*value) - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +55,7 @@ CurveParam::CurveParam(Window* parent, const rect_t& rect, CurveRef* ref,
|
||||
lv_obj_set_style_flex_cross_place(lvobj, LV_FLEX_ALIGN_CENTER, 0);
|
||||
lv_obj_set_size(lvobj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
|
||||
new Choice(this, rect_t{}, STR_VCURVETYPE, 0, CURVE_REF_CUSTOM,
|
||||
new Choice(this, rect_t{}, STR_VCURVETYPE, 0, modelCurvesEnabled() ? CURVE_REF_CUSTOM : CURVE_REF_FUNC,
|
||||
GET_DEFAULT(ref->type), [=](int32_t newValue) {
|
||||
ref->type = newValue;
|
||||
ref->value = 0;
|
||||
|
||||
@@ -73,12 +73,14 @@ GVarNumberEdit::GVarNumberEdit(Window* parent, const rect_t& rect, int32_t vmin,
|
||||
|
||||
#if defined(GVARS)
|
||||
// The GVAR button
|
||||
m_gvBtn = new TextButton(this, rect_t{}, STR_GV, [=]() {
|
||||
switchGVarMode();
|
||||
return GV_IS_GV_VALUE(getValue(), vmin, vmax);
|
||||
});
|
||||
m_gvBtn->check(GV_IS_GV_VALUE(getValue(), vmin, vmax));
|
||||
lv_obj_set_height(m_gvBtn->getLvObj(), lv_obj_get_height(gvar_field->getLvObj()));
|
||||
if (modelGVEnabled()) {
|
||||
m_gvBtn = new TextButton(this, rect_t{}, STR_GV, [=]() {
|
||||
switchGVarMode();
|
||||
return GV_IS_GV_VALUE(getValue(), vmin, vmax);
|
||||
});
|
||||
m_gvBtn->check(GV_IS_GV_VALUE(getValue(), vmin, vmax));
|
||||
lv_obj_set_height(m_gvBtn->getLvObj(), lv_obj_get_height(gvar_field->getLvObj()));
|
||||
}
|
||||
#endif
|
||||
|
||||
lv_obj_add_event_cb(lvobj, GVarNumberEdit::value_changed,
|
||||
@@ -90,18 +92,20 @@ GVarNumberEdit::GVarNumberEdit(Window* parent, const rect_t& rect, int32_t vmin,
|
||||
|
||||
void GVarNumberEdit::switchGVarMode()
|
||||
{
|
||||
int32_t value = getValue();
|
||||
setValue(
|
||||
GV_IS_GV_VALUE(value, vmin, vmax)
|
||||
? ((textFlags & PREC1)
|
||||
? GET_GVAR_PREC1(value, vmin, vmax, mixerCurrentFlightMode)
|
||||
: GET_GVAR(value, vmin, vmax, mixerCurrentFlightMode))
|
||||
: GV_GET_GV1_VALUE(vmin, vmax));
|
||||
if (modelGVEnabled()) {
|
||||
int32_t value = getValue();
|
||||
setValue(
|
||||
GV_IS_GV_VALUE(value, vmin, vmax)
|
||||
? ((textFlags & PREC1)
|
||||
? GET_GVAR_PREC1(value, vmin, vmax, mixerCurrentFlightMode)
|
||||
: GET_GVAR(value, vmin, vmax, mixerCurrentFlightMode))
|
||||
: GV_GET_GV1_VALUE(vmin, vmax));
|
||||
|
||||
m_gvBtn->check(GV_IS_GV_VALUE(value, vmin, vmax));
|
||||
m_gvBtn->check(GV_IS_GV_VALUE(value, vmin, vmax));
|
||||
|
||||
// update field type based on value
|
||||
update();
|
||||
// update field type based on value
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void GVarNumberEdit::setSuffix(std::string value)
|
||||
|
||||
@@ -67,7 +67,9 @@ InputEditAdvanced::InputEditAdvanced(uint8_t input_n, uint8_t index) :
|
||||
});
|
||||
|
||||
// Flight modes
|
||||
line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_FLMODE, 0, COLOR_THEME_PRIMARY1);
|
||||
new FMMatrix<ExpoData>(line, rect_t{}, input);
|
||||
if (modelFMEnabled()) {
|
||||
line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_FLMODE, 0, COLOR_THEME_PRIMARY1);
|
||||
new FMMatrix<ExpoData>(line, rect_t{}, input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ void InputMixButton::setSource(mixsrc_t idx)
|
||||
|
||||
void InputMixButton::setFlightModes(uint16_t modes)
|
||||
{
|
||||
if (!modelFMEnabled()) return;
|
||||
if (modes == fm_modes) return;
|
||||
fm_modes = modes;
|
||||
|
||||
|
||||
@@ -40,32 +40,72 @@
|
||||
ModelMenu::ModelMenu():
|
||||
TabsGroup(ICON_MODEL)
|
||||
{
|
||||
build();
|
||||
}
|
||||
|
||||
void ModelMenu::build()
|
||||
{
|
||||
_modelHeliEnabled = modelHeliEnabled();
|
||||
_modelFMEnabled = modelFMEnabled();
|
||||
_modelCurvesEnabled = modelCurvesEnabled();
|
||||
_modelGVEnabled = modelGVEnabled();
|
||||
_modelLSEnabled = modelLSEnabled();
|
||||
_modelSFEnabled = modelSFEnabled();
|
||||
_modelCustomScriptsEnabled = modelCustomScriptsEnabled();
|
||||
_modelTelemetryEnabled = modelTelemetryEnabled();
|
||||
|
||||
addTab(new ModelSetupPage());
|
||||
#if defined(HELI)
|
||||
addTab(new ModelHeliPage());
|
||||
if (_modelHeliEnabled)
|
||||
addTab(new ModelHeliPage());
|
||||
#endif
|
||||
#if defined(FLIGHT_MODES)
|
||||
addTab(new ModelFlightModesPage());
|
||||
if (_modelFMEnabled)
|
||||
addTab(new ModelFlightModesPage());
|
||||
#endif
|
||||
addTab(new ModelInputsPage());
|
||||
addTab(new ModelMixesPage());
|
||||
addTab(new ModelOutputsPage());
|
||||
addTab(new ModelCurvesPage());
|
||||
if (_modelCurvesEnabled)
|
||||
addTab(new ModelCurvesPage());
|
||||
#if defined(GVARS)
|
||||
addTab(new ModelGVarsPage());
|
||||
if (_modelGVEnabled)
|
||||
addTab(new ModelGVarsPage());
|
||||
#endif
|
||||
addTab(new ModelLogicalSwitchesPage());
|
||||
addTab(new SpecialFunctionsPage(g_model.customFn));
|
||||
if (_modelLSEnabled)
|
||||
addTab(new ModelLogicalSwitchesPage());
|
||||
if (_modelSFEnabled)
|
||||
addTab(new SpecialFunctionsPage(g_model.customFn));
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
addTab(new ModelMixerScriptsPage());
|
||||
if (_modelCustomScriptsEnabled)
|
||||
addTab(new ModelMixerScriptsPage());
|
||||
#endif
|
||||
addTab(new ModelTelemetryPage());
|
||||
if (_modelTelemetryEnabled)
|
||||
addTab(new ModelTelemetryPage());
|
||||
|
||||
#if defined(PCBNV14) || defined(PCBPL18)
|
||||
addGoToMonitorsButton();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ModelMenu::checkEvents()
|
||||
{
|
||||
TabsGroup::checkEvents();
|
||||
|
||||
if (_modelHeliEnabled != modelHeliEnabled() ||
|
||||
_modelFMEnabled != modelFMEnabled() ||
|
||||
_modelCurvesEnabled != modelCurvesEnabled() ||
|
||||
_modelGVEnabled != modelGVEnabled() ||
|
||||
_modelLSEnabled != modelLSEnabled() ||
|
||||
_modelSFEnabled != modelSFEnabled() ||
|
||||
_modelCustomScriptsEnabled != modelCustomScriptsEnabled() ||
|
||||
_modelTelemetryEnabled != modelTelemetryEnabled()) {
|
||||
removeAllTabs();
|
||||
build();
|
||||
setCurrentTab(0);
|
||||
}
|
||||
}
|
||||
|
||||
void ModelMenu::onEvent(event_t event)
|
||||
{
|
||||
#if defined(HARDWARE_KEYS)
|
||||
|
||||
@@ -26,19 +26,30 @@
|
||||
|
||||
class ModelMenu : public TabsGroup
|
||||
{
|
||||
public:
|
||||
ModelMenu();
|
||||
public:
|
||||
ModelMenu();
|
||||
|
||||
void onEvent(event_t event);
|
||||
void onEvent(event_t event) override;
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
std::string getName() const override { return "ModelMenu"; }
|
||||
std::string getName() const override { return "ModelMenu"; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
#if defined(PCBNV14) || defined(PCBPL18)
|
||||
protected:
|
||||
void addGoToMonitorsButton(void);
|
||||
void addGoToMonitorsButton(void);
|
||||
#endif
|
||||
bool _modelHeliEnabled = true;
|
||||
bool _modelFMEnabled = true;
|
||||
bool _modelCurvesEnabled = true;
|
||||
bool _modelGVEnabled = true;
|
||||
bool _modelLSEnabled = true;
|
||||
bool _modelSFEnabled = true;
|
||||
bool _modelCustomScriptsEnabled = true;
|
||||
bool _modelTelemetryEnabled = true;
|
||||
|
||||
void build();
|
||||
void checkEvents() override;
|
||||
};
|
||||
|
||||
#endif // _MENU_MODEL_H_
|
||||
|
||||
@@ -35,17 +35,44 @@
|
||||
RadioMenu::RadioMenu():
|
||||
TabsGroup(ICON_RADIO)
|
||||
{
|
||||
addTab(new RadioToolsPage());
|
||||
addTab(new RadioSdManagerPage());
|
||||
addTab(new RadioSetupPage());
|
||||
addTab(new ThemeSetupPage());
|
||||
addTab(new SpecialFunctionsPage(g_eeGeneral.customFn));
|
||||
addTab(new RadioTrainerPage());
|
||||
addTab(new RadioHardwarePage());
|
||||
addTab(new RadioVersionPage());
|
||||
build();
|
||||
}
|
||||
|
||||
RadioMenu::~RadioMenu()
|
||||
{
|
||||
storageCheck(true);
|
||||
storageCheck(true);
|
||||
}
|
||||
|
||||
void RadioMenu::build()
|
||||
{
|
||||
_radioThemesEnabled = radioThemesEnabled();
|
||||
_radioGFEnabled = radioGFEnabled();
|
||||
_radioTrainerEnabled = radioTrainerEnabled();
|
||||
|
||||
addTab(new RadioToolsPage());
|
||||
addTab(new RadioSdManagerPage());
|
||||
addTab(new RadioSetupPage());
|
||||
if (_radioThemesEnabled)
|
||||
addTab(new ThemeSetupPage());
|
||||
if (_radioGFEnabled)
|
||||
addTab(new SpecialFunctionsPage(g_eeGeneral.customFn));
|
||||
if (_radioTrainerEnabled)
|
||||
addTab(new RadioTrainerPage());
|
||||
addTab(new RadioHardwarePage());
|
||||
addTab(new RadioVersionPage());
|
||||
}
|
||||
|
||||
void RadioMenu::checkEvents()
|
||||
{
|
||||
TabsGroup::checkEvents();
|
||||
|
||||
if (_radioThemesEnabled != radioThemesEnabled() ||
|
||||
_radioGFEnabled != radioGFEnabled() ||
|
||||
_radioTrainerEnabled != radioTrainerEnabled()) {
|
||||
removeAllTabs();
|
||||
build();
|
||||
// Need to set current tab twice to work properly. TODO: can this be fixed?
|
||||
setCurrentTab(0);
|
||||
setCurrentTab(2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,14 @@ class RadioMenu: public TabsGroup {
|
||||
public:
|
||||
RadioMenu();
|
||||
~RadioMenu();
|
||||
|
||||
protected:
|
||||
bool _radioThemesEnabled = true;
|
||||
bool _radioGFEnabled = true;
|
||||
bool _radioTrainerEnabled = true;
|
||||
|
||||
void build();
|
||||
void checkEvents() override;
|
||||
};
|
||||
|
||||
#endif // _MENU_RADIO_H_
|
||||
|
||||
@@ -68,9 +68,11 @@ void MixEditAdvanced::buildBody(FormWindow* form)
|
||||
new Choice(line, rect_t{}, STR_VMLTPX, 0, 2, GET_SET_DEFAULT(mix->mltpx));
|
||||
|
||||
// Flight modes
|
||||
line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_FLMODE, 0, COLOR_THEME_PRIMARY1);
|
||||
new FMMatrix<MixData>(line, rect_t{}, mix);
|
||||
if (modelFMEnabled()) {
|
||||
line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_FLMODE, 0, COLOR_THEME_PRIMARY1);
|
||||
new FMMatrix<MixData>(line, rect_t{}, mix);
|
||||
}
|
||||
|
||||
// Trim
|
||||
line = form->newLine(&grid);
|
||||
|
||||
@@ -63,7 +63,8 @@ class GVarStyle
|
||||
lv_style_set_bg_color(&fmContStyleChecked, makeLvColor(COLOR_THEME_SECONDARY3));
|
||||
|
||||
lv_style_init(&fmLabelStyle);
|
||||
lv_style_set_height(&fmLabelStyle, PAGE_LINE_HEIGHT - 6);
|
||||
if (modelFMEnabled())
|
||||
lv_style_set_height(&fmLabelStyle, PAGE_LINE_HEIGHT - 6);
|
||||
lv_style_set_width(&fmLabelStyle, GVAR_VAL_W);
|
||||
lv_style_set_text_font(&fmLabelStyle, getFont(FONT(XS)));
|
||||
lv_style_set_text_color(&fmLabelStyle, makeLvColor(COLOR_THEME_SECONDARY1));
|
||||
@@ -81,7 +82,7 @@ class GVarStyle
|
||||
lv_style_set_pad_top(&fmValueStyleSmall, 3);
|
||||
|
||||
lv_style_init(&fmNameStyle);
|
||||
lv_style_set_width(&fmNameStyle, GVAR_NAME_SIZE);
|
||||
lv_style_set_width(&fmNameStyle, modelFMEnabled() ? GVAR_NAME_SIZE : GVAR_NAME_SIZE * 2);
|
||||
lv_style_set_text_font(&fmNameStyle, getFont(FONT(STD)));
|
||||
lv_style_set_text_color(&fmNameStyle, makeLvColor(COLOR_THEME_SECONDARY1));
|
||||
lv_style_set_text_align(&fmNameStyle, LV_TEXT_ALIGN_LEFT);
|
||||
@@ -136,7 +137,9 @@ class GVarButton : public Button
|
||||
setHeight(BTN_H);
|
||||
lv_obj_set_flex_flow(lvobj, LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_style_pad_all(lvobj, 0, LV_PART_MAIN);
|
||||
lv_obj_set_flex_align(lvobj, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_AROUND);
|
||||
lv_obj_set_flex_align(lvobj, modelFMEnabled() ? LV_FLEX_ALIGN_CENTER : LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_AROUND);
|
||||
if (!modelFMEnabled())
|
||||
padLeft(8);
|
||||
|
||||
lv_obj_add_event_cb(lvobj, GVarButton::on_draw,
|
||||
LV_EVENT_DRAW_MAIN_BEGIN, nullptr);
|
||||
@@ -156,18 +159,30 @@ class GVarButton : public Button
|
||||
}
|
||||
|
||||
protected:
|
||||
bool init = false;
|
||||
uint8_t gvarIdx;
|
||||
uint8_t currentFlightMode = 0; // used for invalidation
|
||||
lv_obj_t* fmCont[MAX_FLIGHT_MODES];
|
||||
lv_obj_t* valueTexts[MAX_FLIGHT_MODES];
|
||||
gvar_t values[MAX_FLIGHT_MODES];
|
||||
|
||||
int numFlightModes() { return modelFMEnabled() ? MAX_FLIGHT_MODES : 1; }
|
||||
|
||||
void checkEvents()
|
||||
{
|
||||
Button::checkEvents();
|
||||
if (init) {
|
||||
uint8_t newFM = getFlightMode();
|
||||
if (currentFlightMode != newFM) {
|
||||
lv_obj_add_state(fmCont[newFM], LV_STATE_CHECKED);
|
||||
lv_obj_clear_state(fmCont[currentFlightMode], LV_STATE_CHECKED);
|
||||
if (modelFMEnabled()) {
|
||||
uint8_t newFM = getFlightMode();
|
||||
if (currentFlightMode != newFM) {
|
||||
lv_obj_add_state(fmCont[newFM], LV_STATE_CHECKED);
|
||||
lv_obj_clear_state(fmCont[currentFlightMode], LV_STATE_CHECKED);
|
||||
|
||||
currentFlightMode = newFM;
|
||||
currentFlightMode = newFM;
|
||||
}
|
||||
}
|
||||
for (int flightMode = 0; flightMode < MAX_FLIGHT_MODES; flightMode++) {
|
||||
|
||||
for (int flightMode = 0; flightMode < numFlightModes(); flightMode++) {
|
||||
FlightModeData* fmData = &g_model.flightModeData[flightMode];
|
||||
if (values[flightMode] != fmData->gvars[gvarIdx]) {
|
||||
updateValueText(flightMode);
|
||||
@@ -176,14 +191,6 @@ class GVarButton : public Button
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
bool init = false;
|
||||
uint8_t gvarIdx;
|
||||
uint8_t currentFlightMode = 0; // used for invalidation
|
||||
lv_obj_t* fmCont[MAX_FLIGHT_MODES];
|
||||
lv_obj_t* valueTexts[MAX_FLIGHT_MODES];
|
||||
gvar_t values[MAX_FLIGHT_MODES];
|
||||
|
||||
void build()
|
||||
{
|
||||
if (init) return;
|
||||
@@ -196,35 +203,42 @@ class GVarButton : public Button
|
||||
gvarStyle.setNameStyle(lbl);
|
||||
lv_label_set_text(lbl, getGVarString(gvarIdx));
|
||||
|
||||
lv_obj_t* container = lv_obj_create(lvobj);
|
||||
lv_obj_set_width(container, GVAR_VAL_W * GVAR_COLS);
|
||||
lv_obj_set_height(container, GVAR_H);
|
||||
lv_obj_set_style_pad_all(container, 0, LV_PART_MAIN);
|
||||
lv_obj_add_flag(container, LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||
if (modelFMEnabled()) {
|
||||
lv_obj_t* container = lv_obj_create(lvobj);
|
||||
lv_obj_set_width(container, GVAR_VAL_W * GVAR_COLS);
|
||||
lv_obj_set_height(container, GVAR_H);
|
||||
lv_obj_set_style_pad_all(container, 0, LV_PART_MAIN);
|
||||
lv_obj_add_flag(container, LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||
|
||||
for (int flightMode = 0; flightMode < MAX_FLIGHT_MODES; flightMode++) {
|
||||
fmCont[flightMode] = lv_obj_create(container);
|
||||
gvarStyle.setContStyle(fmCont[flightMode]);
|
||||
lv_obj_set_pos(fmCont[flightMode], (flightMode%GVAR_COLS)*GVAR_VAL_W, (flightMode/GVAR_COLS)*GVAR_VAL_H);
|
||||
lv_obj_set_user_data(fmCont[flightMode], this);
|
||||
lv_obj_add_flag(fmCont[flightMode], LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||
if (flightMode == currentFlightMode) {
|
||||
lv_obj_add_state(fmCont[flightMode], LV_STATE_CHECKED);
|
||||
for (int flightMode = 0; flightMode < numFlightModes(); flightMode++) {
|
||||
fmCont[flightMode] = lv_obj_create(container);
|
||||
gvarStyle.setContStyle(fmCont[flightMode]);
|
||||
lv_obj_set_pos(fmCont[flightMode], (flightMode%GVAR_COLS)*GVAR_VAL_W, (flightMode/GVAR_COLS)*GVAR_VAL_H);
|
||||
lv_obj_set_user_data(fmCont[flightMode], this);
|
||||
lv_obj_add_flag(fmCont[flightMode], LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||
if (flightMode == currentFlightMode) {
|
||||
lv_obj_add_state(fmCont[flightMode], LV_STATE_CHECKED);
|
||||
}
|
||||
|
||||
char label[16] = {};
|
||||
getFlightModeString(label, flightMode + 1);
|
||||
|
||||
lbl = lv_label_create(fmCont[flightMode]);
|
||||
gvarStyle.setLabelStyle(lbl);
|
||||
lv_label_set_text(lbl, label);
|
||||
lv_obj_set_pos(lbl, 0, 0);
|
||||
|
||||
valueTexts[flightMode] = lv_label_create(fmCont[flightMode]);
|
||||
gvarStyle.setValueStyle(valueTexts[flightMode]);
|
||||
lv_obj_set_pos(valueTexts[flightMode], 0, PAGE_LINE_HEIGHT - 6);
|
||||
|
||||
updateValueText(flightMode);
|
||||
}
|
||||
} else {
|
||||
valueTexts[0] = lv_label_create(lvobj);
|
||||
gvarStyle.setValueStyle(valueTexts[0]);
|
||||
|
||||
char label[16] = {};
|
||||
getFlightModeString(label, flightMode + 1);
|
||||
|
||||
lbl = lv_label_create(fmCont[flightMode]);
|
||||
gvarStyle.setLabelStyle(lbl);
|
||||
lv_label_set_text(lbl, label);
|
||||
lv_obj_set_pos(lbl, 0, 0);
|
||||
|
||||
valueTexts[flightMode] = lv_label_create(fmCont[flightMode]);
|
||||
gvarStyle.setValueStyle(valueTexts[flightMode]);
|
||||
lv_obj_set_pos(valueTexts[flightMode], 0, PAGE_LINE_HEIGHT - 6);
|
||||
|
||||
updateValueText(flightMode);
|
||||
updateValueText(0);
|
||||
}
|
||||
|
||||
lv_obj_enable_style_refresh(true);
|
||||
@@ -287,6 +301,8 @@ class GVarEditWindow : public Page
|
||||
NumberEdit* values[MAX_FLIGHT_MODES] = {};
|
||||
StaticText* gVarInHeader = nullptr;
|
||||
|
||||
int numFlightModes() { return modelFMEnabled() ? MAX_FLIGHT_MODES : 1; }
|
||||
|
||||
void buildHeader(Window* window)
|
||||
{
|
||||
header.setTitle(STR_MENU_GLOBAL_VARS);
|
||||
@@ -317,8 +333,12 @@ class GVarEditWindow : public Page
|
||||
strcat(label, getGVarValue(index, lastGVar, 0).c_str());
|
||||
}
|
||||
gVarInHeader->setText(label);
|
||||
for (auto& value : values) {
|
||||
value->invalidate();
|
||||
if (modelFMEnabled()) {
|
||||
for (auto& value : values) {
|
||||
value->invalidate();
|
||||
}
|
||||
} else {
|
||||
values[0]->invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,7 +373,7 @@ class GVarEditWindow : public Page
|
||||
max->update();
|
||||
}
|
||||
FlightModeData* fmData;
|
||||
for (int fm = 0; fm < MAX_FLIGHT_MODES; fm++) {
|
||||
for (int fm = 0; fm < numFlightModes(); fm++) {
|
||||
if (values[fm] == nullptr) // KLK: the order of calls has changed and
|
||||
// this might not be initialized yet.
|
||||
continue;
|
||||
@@ -409,38 +429,31 @@ class GVarEditWindow : public Page
|
||||
|
||||
new StaticText(line, rect_t{}, STR_NAME, 0, COLOR_THEME_PRIMARY1);
|
||||
grid.nextCell();
|
||||
Window* input =
|
||||
new ModelTextEdit(line, rect_t{}, gvar->name, LEN_GVAR_NAME);
|
||||
lv_obj_set_style_grid_cell_x_align(input->getLvObj(), LV_GRID_ALIGN_STRETCH,
|
||||
0);
|
||||
new ModelTextEdit(line, rect_t{}, gvar->name, LEN_GVAR_NAME);
|
||||
|
||||
line = window->newLine(&grid);
|
||||
|
||||
new StaticText(line, rect_t{}, STR_UNIT, 0, COLOR_THEME_PRIMARY1);
|
||||
grid.nextCell();
|
||||
input = new Choice(line, rect_t{}, "\001-%", 0, 1, GET_DEFAULT(gvar->unit),
|
||||
[=](int16_t newValue) {
|
||||
refreshTitle = (gvar->unit != newValue);
|
||||
gvar->unit = newValue;
|
||||
SET_DIRTY();
|
||||
setProperties();
|
||||
});
|
||||
lv_obj_set_style_grid_cell_x_align(input->getLvObj(), LV_GRID_ALIGN_STRETCH,
|
||||
0);
|
||||
new Choice(line, rect_t{}, "\001-%", 0, 1, GET_DEFAULT(gvar->unit),
|
||||
[=](int16_t newValue) {
|
||||
refreshTitle = (gvar->unit != newValue);
|
||||
gvar->unit = newValue;
|
||||
SET_DIRTY();
|
||||
setProperties();
|
||||
});
|
||||
|
||||
line = window->newLine(&grid);
|
||||
|
||||
new StaticText(line, rect_t{}, STR_PRECISION, 0, COLOR_THEME_PRIMARY1);
|
||||
grid.nextCell();
|
||||
input = new Choice(line, rect_t{}, STR_VPREC, 0, 1, GET_DEFAULT(gvar->prec),
|
||||
[=](int16_t newValue) {
|
||||
refreshTitle = (gvar->prec != newValue);
|
||||
gvar->prec = newValue;
|
||||
SET_DIRTY();
|
||||
setProperties();
|
||||
});
|
||||
lv_obj_set_style_grid_cell_x_align(input->getLvObj(), LV_GRID_ALIGN_STRETCH,
|
||||
0);
|
||||
new Choice(line, rect_t{}, STR_VPREC, 0, 1, GET_DEFAULT(gvar->prec),
|
||||
[=](int16_t newValue) {
|
||||
refreshTitle = (gvar->prec != newValue);
|
||||
gvar->prec = newValue;
|
||||
SET_DIRTY();
|
||||
setProperties();
|
||||
});
|
||||
|
||||
line = window->newLine(&grid);
|
||||
|
||||
@@ -455,8 +468,6 @@ class GVarEditWindow : public Page
|
||||
setProperties();
|
||||
});
|
||||
min->setAccelFactor(16);
|
||||
lv_obj_set_style_grid_cell_x_align(min->getLvObj(), LV_GRID_ALIGN_STRETCH,
|
||||
0);
|
||||
|
||||
line = window->newLine(&grid);
|
||||
|
||||
@@ -471,23 +482,27 @@ class GVarEditWindow : public Page
|
||||
setProperties();
|
||||
});
|
||||
max->setAccelFactor(16);
|
||||
lv_obj_set_style_grid_cell_x_align(max->getLvObj(), LV_GRID_ALIGN_STRETCH,
|
||||
0);
|
||||
|
||||
line = window->newLine(&grid);
|
||||
char flightModeName[16];
|
||||
FlightModeData* fmData;
|
||||
|
||||
for (int flightMode = 0; flightMode < MAX_FLIGHT_MODES; flightMode++) {
|
||||
for (int flightMode = 0; flightMode < numFlightModes(); flightMode++) {
|
||||
fmData = &g_model.flightModeData[flightMode];
|
||||
getFlightModeString(flightModeName, flightMode + 1);
|
||||
|
||||
int userNameLen = zlen(fmData->name, LEN_FLIGHT_MODE_NAME);
|
||||
if (modelFMEnabled()) {
|
||||
getFlightModeString(flightModeName, flightMode + 1);
|
||||
|
||||
if (userNameLen > 0) {
|
||||
strcpy(flightModeName, fmData->name);
|
||||
int userNameLen = zlen(fmData->name, LEN_FLIGHT_MODE_NAME);
|
||||
|
||||
if (userNameLen > 0) {
|
||||
strcpy(flightModeName, fmData->name);
|
||||
}
|
||||
new StaticText(line, rect_t{}, flightModeName, 0, COLOR_THEME_PRIMARY1);
|
||||
} else {
|
||||
new StaticText(line, rect_t{}, STR_VALUE, 0, COLOR_THEME_PRIMARY1);
|
||||
}
|
||||
new StaticText(line, rect_t{}, flightModeName, 0, COLOR_THEME_PRIMARY1);
|
||||
|
||||
if (flightMode > 0) {
|
||||
auto cb = new CheckBox(
|
||||
line, rect_t{}, [=] { return fmData->gvars[index] <= GVAR_MAX; },
|
||||
|
||||
@@ -225,6 +225,132 @@ static const lv_coord_t line_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1),
|
||||
static const lv_coord_t line_row_dsc[] = {LV_GRID_CONTENT,
|
||||
LV_GRID_TEMPLATE_LAST};
|
||||
|
||||
class ModelViewOptions : public Page
|
||||
{
|
||||
public:
|
||||
class OptChoice : FormWindow
|
||||
{
|
||||
public:
|
||||
OptChoice(Window* parent, const char *const values[], int vmin, int vmax,
|
||||
std::function<int()> _getValue,
|
||||
std::function<void(int)> _setValue,
|
||||
bool globalState) :
|
||||
FormWindow(parent, rect_t{}),
|
||||
m_getValue(std::move(_getValue)),
|
||||
m_setValue(std::move(_setValue))
|
||||
{
|
||||
setFlexLayout(LV_FLEX_FLOW_ROW, 4);
|
||||
lv_obj_set_flex_align(lvobj, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_AROUND);
|
||||
|
||||
new Choice(this, rect_t{}, values, vmin, vmax,
|
||||
m_getValue,
|
||||
[=](int newValue) {
|
||||
m_setValue(newValue);
|
||||
setState();
|
||||
});
|
||||
m_lbl = new StaticText(this, rect_t{}, STR_ADCFILTERVALUES[globalState ? 1: 2], 0, COLOR_THEME_SECONDARY1);
|
||||
setState();
|
||||
}
|
||||
|
||||
protected:
|
||||
StaticText* m_lbl;
|
||||
std::function<int()> m_getValue;
|
||||
std::function<void(int)> m_setValue;
|
||||
|
||||
void setState()
|
||||
{
|
||||
if (m_getValue() == 0) {
|
||||
lv_obj_clear_flag(m_lbl->getLvObj(), LV_OBJ_FLAG_HIDDEN);
|
||||
} else {
|
||||
lv_obj_add_flag(m_lbl->getLvObj(), LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ModelViewOptions() : Page(ICON_MODEL_SETUP)
|
||||
{
|
||||
header.setTitle(STR_MENU_MODEL_SETUP);
|
||||
header.setTitle2(STR_VIEW_OPTIONS);
|
||||
|
||||
body.padAll(8);
|
||||
|
||||
auto form = new FormWindow(&body, rect_t{});
|
||||
form->setFlexLayout();
|
||||
form->padAll(4);
|
||||
|
||||
FlexGridLayout grid(line_col_dsc, line_row_dsc, 2);
|
||||
|
||||
auto line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_RADIO_MENU_TABS, 0, COLOR_THEME_PRIMARY1);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_THEME_EDITOR, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.radioThemesDisabled), g_eeGeneral.radioThemesDisabled);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUSPECIALFUNCS, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.radioGFDisabled), g_eeGeneral.radioGFDisabled);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUTRAINER, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.radioTrainerDisabled), g_eeGeneral.radioTrainerDisabled);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_MODEL_MENU_TABS, 0, COLOR_THEME_PRIMARY1);
|
||||
|
||||
#if defined(HELI)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUHELISETUP, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelHeliDisabled), g_eeGeneral.modelHeliDisabled);
|
||||
#endif
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUFLIGHTMODES, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelFMDisabled), g_eeGeneral.modelFMDisabled);
|
||||
#endif
|
||||
|
||||
#if defined(GVARS)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENU_GLOBAL_VARS, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelGVDisabled), g_eeGeneral.modelGVDisabled);
|
||||
#endif
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUCURVES, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelCurvesDisabled), g_eeGeneral.modelCurvesDisabled);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENULOGICALSWITCHES, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelLSDisabled), g_eeGeneral.modelLSDisabled);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUCUSTOMFUNC, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelSFDisabled), g_eeGeneral.modelSFDisabled);
|
||||
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUCUSTOMSCRIPTS, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelCustomScriptsDisabled), g_eeGeneral.modelCustomScriptsDisabled);
|
||||
#endif
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUTELEMETRY, 0, COLOR_THEME_PRIMARY1);
|
||||
new OptChoice(line, STR_ADCFILTERVALUES, 0, 2, GET_SET_DEFAULT(g_model.modelTelemetryDisabled), g_eeGeneral.modelTelemetryDisabled);
|
||||
}
|
||||
};
|
||||
|
||||
void ModelSetupPage::build(FormWindow * window)
|
||||
{
|
||||
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, 0);
|
||||
@@ -269,11 +395,6 @@ void ModelSetupPage::build(FormWindow * window)
|
||||
// TODO: show bitmap thumbnail instead?
|
||||
new ModelBitmapEdit(line, rect_t{});
|
||||
|
||||
// Global functions
|
||||
line = window->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_USE_GLOBAL_FUNCS, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_model.noGlobalFunctions));
|
||||
|
||||
// Model ADC jitter filter
|
||||
line = window->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_JITTER_FILTER, 0, COLOR_THEME_PRIMARY1);
|
||||
@@ -328,12 +449,15 @@ void ModelSetupPage::build(FormWindow * window)
|
||||
btn = new SubScreenButton(form, STR_THROTTLE_LABEL, []() { new ThrottleParams(); });
|
||||
lv_obj_set_grid_cell(btn->getLvObj(), LV_GRID_ALIGN_STRETCH, 2, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
form = new FormGroup(oform, rect_t{});
|
||||
form->setFlexLayout(LV_FLEX_FLOW_ROW, lv_dpx(PAGE_PADDING));
|
||||
lv_obj_set_grid_dsc_array(form->getLvObj(), col_dsc, row_dsc);
|
||||
|
||||
btn = new SubScreenButton(form, STR_USBJOYSTICK_LABEL, []() { new ModelUSBJoystickPage(); });
|
||||
btn = new SubScreenButton(form, STR_VIEW_OPTIONS, []() { new ModelViewOptions(); });
|
||||
lv_obj_set_grid_cell(btn->getLvObj(), LV_GRID_ALIGN_STRETCH, 0, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
|
||||
#if defined(USBJ_EX)
|
||||
btn = new SubScreenButton(form, STR_USBJOYSTICK_LABEL, []() { new ModelUSBJoystickPage(); });
|
||||
lv_obj_set_grid_cell(btn->getLvObj(), LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ class WindowButtonGroup : public FormGroup
|
||||
setFlexLayout(LV_FLEX_FLOW_ROW_WRAP, lv_dpx(8));
|
||||
lv_obj_set_style_flex_main_place(lvobj, LV_FLEX_ALIGN_SPACE_EVENLY, 0);
|
||||
padRow(lv_dpx(8));
|
||||
padBottom(4);
|
||||
|
||||
for (auto& entry : pages) {
|
||||
auto btn = new TextButton(this, rect_t{}, entry.first, [&, entry]() {
|
||||
@@ -243,7 +244,8 @@ class SubPage : public Page
|
||||
public:
|
||||
SubPage(MenuIcons icon, const char* title) : Page(icon)
|
||||
{
|
||||
header.setTitle(title);
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(title);
|
||||
|
||||
body.setFlexLayout();
|
||||
body.padAll(8);
|
||||
@@ -254,10 +256,7 @@ class SoundPage : public SubPage {
|
||||
public:
|
||||
SoundPage() : SubPage(ICON_RADIO_SETUP, STR_SOUND_LABEL)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_SOUND_LABEL);
|
||||
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 3);
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 2);
|
||||
|
||||
auto line = body.newLine(&grid);
|
||||
|
||||
@@ -311,9 +310,6 @@ class VarioPage : public SubPage {
|
||||
public:
|
||||
VarioPage() : SubPage(ICON_RADIO_SETUP, STR_VARIO)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_VARIO);
|
||||
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 4);
|
||||
|
||||
auto line = body.newLine(&grid);
|
||||
@@ -355,9 +351,6 @@ class HapticPage : public SubPage {
|
||||
public:
|
||||
HapticPage() : SubPage(ICON_RADIO_SETUP, STR_HAPTIC_LABEL)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_HAPTIC_LABEL);
|
||||
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 4);
|
||||
|
||||
auto line = body.newLine(&grid);
|
||||
@@ -384,9 +377,6 @@ class AlarmsPage : public SubPage {
|
||||
public:
|
||||
AlarmsPage() : SubPage(ICON_RADIO_SETUP, STR_ALARMS_LABEL)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_ALARMS_LABEL);
|
||||
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 4);
|
||||
|
||||
auto line = body.newLine(&grid);
|
||||
@@ -445,9 +435,6 @@ class BacklightPage : public SubPage {
|
||||
public:
|
||||
BacklightPage() : SubPage(ICON_RADIO_SETUP, STR_BACKLIGHT_LABEL)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_BACKLIGHT_LABEL);
|
||||
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 4);
|
||||
|
||||
auto line = body.newLine(&grid);
|
||||
@@ -565,9 +552,6 @@ class GpsPage : public SubPage {
|
||||
public:
|
||||
GpsPage() : SubPage(ICON_RADIO_SETUP, STR_GPS)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_GPS);
|
||||
|
||||
FlexGridLayout grid(col_two_dsc, row_dsc, 4);
|
||||
|
||||
auto line = body.newLine(&grid);
|
||||
@@ -588,6 +572,95 @@ class GpsPage : public SubPage {
|
||||
}
|
||||
};
|
||||
|
||||
class ViewOptionsPage : public Page
|
||||
{
|
||||
public:
|
||||
const lv_coord_t opt_col_two_dsc[3] = {LV_GRID_FR(7), LV_GRID_FR(3), LV_GRID_TEMPLATE_LAST};
|
||||
|
||||
ViewOptionsPage() : Page(ICON_RADIO_SETUP)
|
||||
{
|
||||
header.setTitle(STR_RADIO_SETUP);
|
||||
header.setTitle2(STR_VIEW_OPTIONS);
|
||||
|
||||
body.padAll(8);
|
||||
|
||||
FlexGridLayout grid(opt_col_two_dsc, row_dsc, 2);
|
||||
|
||||
auto form = new FormWindow(&body, rect_t{});
|
||||
form->setFlexLayout();
|
||||
form->padAll(0);
|
||||
|
||||
auto line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_RADIO_MENU_TABS, 0, COLOR_THEME_PRIMARY1);
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_THEME_EDITOR, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.radioThemesDisabled));
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUSPECIALFUNCS, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.radioGFDisabled));
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUTRAINER, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.radioTrainerDisabled));
|
||||
|
||||
line = form->newLine(&grid);
|
||||
new StaticText(line, rect_t{}, STR_MODEL_MENU_TABS, 0, COLOR_THEME_PRIMARY1);
|
||||
|
||||
#if defined(HELI)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUHELISETUP, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelHeliDisabled));
|
||||
#endif
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUFLIGHTMODES, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelFMDisabled));
|
||||
#endif
|
||||
|
||||
#if defined(GVARS)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENU_GLOBAL_VARS, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelGVDisabled));
|
||||
#endif
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUCURVES, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelCurvesDisabled));
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENULOGICALSWITCHES, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelLSDisabled));
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUCUSTOMFUNC, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelSFDisabled));
|
||||
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUCUSTOMSCRIPTS, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelCustomScriptsDisabled));
|
||||
#endif
|
||||
|
||||
line = form->newLine(&grid);
|
||||
line->padLeft(10);
|
||||
new StaticText(line, rect_t{}, STR_MENUTELEMETRY, 0, COLOR_THEME_PRIMARY1);
|
||||
new CheckBox(line, rect_t{}, GET_SET_INVERTED(g_eeGeneral.modelTelemetryDisabled));
|
||||
}
|
||||
};
|
||||
|
||||
RadioSetupPage::RadioSetupPage():
|
||||
PageTab(STR_RADIO_SETUP, ICON_RADIO_SETUP)
|
||||
{
|
||||
@@ -613,9 +686,9 @@ void RadioSetupPage::build(FormWindow * window)
|
||||
{STR_ALARMS_LABEL, []() { new AlarmsPage(); }},
|
||||
{STR_BACKLIGHT_LABEL, []() { new BacklightPage(); }},
|
||||
{STR_GPS, [](){new GpsPage();}},
|
||||
{STR_VIEW_OPTIONS, [](){new ViewOptionsPage();}},
|
||||
});
|
||||
|
||||
|
||||
#if defined(PWR_BUTTON_PRESS)
|
||||
// Pwr Off Delay
|
||||
{
|
||||
|
||||
@@ -37,22 +37,26 @@ class SourceChoiceMenuToolbar : public MenuToolbar
|
||||
{
|
||||
addButton(STR_CHAR_INPUT, MIXSRC_FIRST_INPUT, MIXSRC_LAST_INPUT);
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
addButton(STR_CHAR_LUA, MIXSRC_FIRST_LUA, MIXSRC_LAST_LUA);
|
||||
if (modelCustomScriptsEnabled())
|
||||
addButton(STR_CHAR_LUA, MIXSRC_FIRST_LUA, MIXSRC_LAST_LUA);
|
||||
#endif
|
||||
addButton(STR_CHAR_STICK, MIXSRC_FIRST_STICK, MIXSRC_LAST_STICK);
|
||||
addButton(STR_CHAR_POT, MIXSRC_FIRST_POT, MIXSRC_LAST_POT);
|
||||
addButton(STR_CHAR_FUNCTION, MIXSRC_MAX, MIXSRC_MAX);
|
||||
#if defined(HELI)
|
||||
addButton(STR_CHAR_CYC, MIXSRC_FIRST_HELI, MIXSRC_LAST_HELI);
|
||||
if (modelHeliEnabled())
|
||||
addButton(STR_CHAR_CYC, MIXSRC_FIRST_HELI, MIXSRC_LAST_HELI);
|
||||
#endif
|
||||
addButton(STR_CHAR_TRIM, MIXSRC_FIRST_TRIM, MIXSRC_LAST_TRIM);
|
||||
addButton(STR_CHAR_SWITCH, MIXSRC_FIRST_SWITCH, MIXSRC_LAST_SWITCH);
|
||||
addButton(STR_CHAR_TRAINER, MIXSRC_FIRST_TRAINER, MIXSRC_LAST_TRAINER);
|
||||
addButton(STR_CHAR_CHANNEL, MIXSRC_FIRST_CH, MIXSRC_LAST_CH);
|
||||
#if defined(GVARS)
|
||||
addButton(STR_CHAR_SLIDER, MIXSRC_LAST_GVAR, MIXSRC_FIRST_GVAR);
|
||||
if (modelGVEnabled())
|
||||
addButton(STR_CHAR_SLIDER, MIXSRC_LAST_GVAR, MIXSRC_FIRST_GVAR);
|
||||
#endif
|
||||
addButton(STR_CHAR_TELEMETRY, MIXSRC_FIRST_TELEM, MIXSRC_LAST_TELEM);
|
||||
if (modelTelemetryEnabled())
|
||||
addButton(STR_CHAR_TELEMETRY, MIXSRC_FIRST_TELEM, MIXSRC_LAST_TELEM);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,6 +28,19 @@ typedef int8_t horzpos_t;
|
||||
typedef uint16_t vertpos_t;
|
||||
|
||||
typedef void (* MenuHandlerFunc)(event_t event);
|
||||
typedef bool (* MenuEnabledFunc)();
|
||||
|
||||
typedef struct _MenuHandler {
|
||||
MenuHandlerFunc menuFunc;
|
||||
MenuEnabledFunc enabledFunc;
|
||||
|
||||
bool isEnabled() const
|
||||
{
|
||||
if (enabledFunc)
|
||||
return enabledFunc();
|
||||
return true;
|
||||
}
|
||||
} MenuHandler;
|
||||
|
||||
extern tmr10ms_t menuEntryTime;
|
||||
extern vertpos_t menuVerticalPosition;
|
||||
|
||||
@@ -128,7 +128,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlag
|
||||
lcdDrawTextAtIndex(x1, y, STR_VCURVETYPE, curve.type, flags1);
|
||||
|
||||
if (active && menuHorizontalPosition==0) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, curve.type, CURVE_REF_CUSTOM);
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, curve.type, modelCurvesEnabled() ? CURVE_REF_CUSTOM : CURVE_REF_FUNC);
|
||||
if (checkIncDec_Ret) curve.value = 0;
|
||||
}
|
||||
switch (curve.type) {
|
||||
|
||||
@@ -182,8 +182,12 @@ bool isSourceAvailable(int source)
|
||||
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
if (source >= MIXSRC_FIRST_LUA && source <= MIXSRC_LAST_LUA) {
|
||||
div_t qr = div(source - MIXSRC_FIRST_LUA, MAX_SCRIPT_OUTPUTS);
|
||||
return (qr.rem<scriptInputsOutputs[qr.quot].outputsCount);
|
||||
if (modelCustomScriptsEnabled()) {
|
||||
div_t qr = div(source - MIXSRC_FIRST_LUA, MAX_SCRIPT_OUTPUTS);
|
||||
return (qr.rem<scriptInputsOutputs[qr.quot].outputsCount);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#elif defined(LUA_INPUTS)
|
||||
if (source >= MIXSRC_FIRST_LUA && source <= MIXSRC_LAST_LUA)
|
||||
@@ -215,6 +219,9 @@ bool isSourceAvailable(int source)
|
||||
#if !defined(HELI)
|
||||
if (source >= MIXSRC_CYC1 && source <= MIXSRC_CYC3)
|
||||
return false;
|
||||
#else
|
||||
if (!modelHeliEnabled() && source >= MIXSRC_CYC1 && source <= MIXSRC_CYC3)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (source >= MIXSRC_FIRST_CH && source <= MIXSRC_LAST_CH) {
|
||||
@@ -229,6 +236,9 @@ bool isSourceAvailable(int source)
|
||||
#if !defined(GVARS)
|
||||
if (source >= MIXSRC_GVAR1 && source <= MIXSRC_LAST_GVAR)
|
||||
return false;
|
||||
#else
|
||||
if (!modelGVEnabled() && source >= MIXSRC_GVAR1 && source <= MIXSRC_LAST_GVAR)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (source >= MIXSRC_FIRST_RESERVE && source <= MIXSRC_LAST_RESERVE)
|
||||
@@ -238,6 +248,8 @@ bool isSourceAvailable(int source)
|
||||
return g_model.trainerData.mode > 0;
|
||||
|
||||
if (source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
||||
if (!modelTelemetryEnabled())
|
||||
return false;
|
||||
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);
|
||||
if (qr.rem == 0)
|
||||
return isTelemetryFieldAvailable(qr.quot);
|
||||
@@ -260,7 +272,7 @@ bool isSourceAvailableInCustomSwitches(int source)
|
||||
{
|
||||
bool result = isSourceAvailable(source);
|
||||
|
||||
if (result && source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
||||
if (result && modelTelemetryEnabled() && source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
||||
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);
|
||||
result = isTelemetryFieldComparisonAvailable(qr.quot);
|
||||
}
|
||||
@@ -298,12 +310,12 @@ bool isSourceAvailableInInputs(int source)
|
||||
if (source >= MIXSRC_FIRST_TRAINER && source <= MIXSRC_LAST_TRAINER)
|
||||
return g_model.trainerData.mode > 0;
|
||||
|
||||
if (source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
||||
if (modelTelemetryEnabled() && source >= MIXSRC_FIRST_TELEM && source <= MIXSRC_LAST_TELEM) {
|
||||
div_t qr = div(source - MIXSRC_FIRST_TELEM, 3);
|
||||
return isTelemetryFieldAvailable(qr.quot) && isTelemetryFieldComparisonAvailable(qr.quot);
|
||||
}
|
||||
|
||||
if (source >= MIXSRC_FIRST_GVAR && source <= MIXSRC_LAST_GVAR)
|
||||
if (modelGVEnabled() && source >= MIXSRC_FIRST_GVAR && source <= MIXSRC_LAST_GVAR)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -105,7 +105,7 @@ void check_submenu_simple(event_t event, uint8_t rowcount)
|
||||
check_simple(event, 0, nullptr, 0, rowcount);
|
||||
}
|
||||
|
||||
void check_simple(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, vertpos_t rowcount)
|
||||
void check_simple(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, vertpos_t rowcount)
|
||||
{
|
||||
check(event, curr, menuTab, menuTabSize, 0, 0, rowcount);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,38 @@ tmr10ms_t menuEntryTime;
|
||||
#define MAXCOL(row) (horTab ? *(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
|
||||
#define POS_HORZ_INIT(posVert) 0
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
||||
uint8_t chgMenu(uint8_t curr, const MenuHandler * menuTab, uint8_t menuTabSize, int direction)
|
||||
{
|
||||
int cc = curr + direction;
|
||||
while (cc != curr) {
|
||||
if (cc < 0)
|
||||
cc = menuTabSize - 1;
|
||||
else if (cc >= menuTabSize)
|
||||
cc = 0;
|
||||
if (menuTab[cc].isEnabled())
|
||||
return cc;
|
||||
cc += direction;
|
||||
}
|
||||
return curr;
|
||||
}
|
||||
|
||||
uint8_t menuSize(const MenuHandler * menuTab, uint8_t menuTabSize)
|
||||
{
|
||||
uint8_t sz = 0;
|
||||
for (int i = 0; i < menuTabSize; i += 1) {
|
||||
if (menuTab[i].isEnabled()) {
|
||||
sz += 1;
|
||||
}
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
uint8_t menuIdx(const MenuHandler * menuTab, uint8_t curr)
|
||||
{
|
||||
return menuSize(menuTab, curr + 1) - 1;
|
||||
}
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
||||
{
|
||||
vertpos_t l_posVert = menuVerticalPosition;
|
||||
horzpos_t l_posHorz = menuHorizontalPosition;
|
||||
@@ -209,10 +240,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
break;
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
if (curr > 0)
|
||||
cc = curr - 1;
|
||||
else
|
||||
cc = menuTabSize-1;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, -1);
|
||||
break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
@@ -221,15 +249,12 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
break;
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
if (curr < (menuTabSize-1))
|
||||
cc = curr + 1;
|
||||
else
|
||||
cc = 0;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cc != curr) {
|
||||
chainMenu(menuTab[cc]);
|
||||
chainMenu(menuTab[cc].menuFunc);
|
||||
}
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
@@ -239,7 +264,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
}
|
||||
|
||||
menuCalibrationState = 0;
|
||||
drawScreenIndex(curr, menuTabSize, attr);
|
||||
drawScreenIndex(menuIdx(menuTab, curr), menuSize(menuTab, menuTabSize), attr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -145,17 +145,19 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
if (i_min <= MIXSRC_FIRST_POT && i_max >= MIXSRC_FIRST_POT) POPUP_MENU_ADD_ITEM(STR_MENU_POTS);
|
||||
if (i_min <= MIXSRC_MAX && i_max >= MIXSRC_MAX) POPUP_MENU_ADD_ITEM(STR_MENU_MAX);
|
||||
#if defined(HELI)
|
||||
if (i_min <= MIXSRC_FIRST_HELI && i_max >= MIXSRC_FIRST_HELI) POPUP_MENU_ADD_ITEM(STR_MENU_HELI);
|
||||
if (modelHeliEnabled())
|
||||
if (i_min <= MIXSRC_FIRST_HELI && i_max >= MIXSRC_FIRST_HELI && isValueAvailable && isValueAvailable(MIXSRC_FIRST_HELI))
|
||||
POPUP_MENU_ADD_ITEM(STR_MENU_HELI);
|
||||
#endif
|
||||
if (i_min <= MIXSRC_FIRST_TRIM && i_max >= MIXSRC_FIRST_TRIM) POPUP_MENU_ADD_ITEM(STR_MENU_TRIMS);
|
||||
if (i_min <= MIXSRC_FIRST_SWITCH && i_max >= MIXSRC_FIRST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES);
|
||||
if (i_min <= MIXSRC_FIRST_TRAINER && i_max >= MIXSRC_FIRST_TRAINER) POPUP_MENU_ADD_ITEM(STR_MENU_TRAINER);
|
||||
if (i_min <= MIXSRC_FIRST_CH && i_max >= MIXSRC_FIRST_CH) POPUP_MENU_ADD_ITEM(STR_MENU_CHANNELS);
|
||||
if (i_min <= MIXSRC_FIRST_GVAR && i_max >= MIXSRC_FIRST_GVAR && isValueAvailable(MIXSRC_FIRST_GVAR)) {
|
||||
if (i_min <= MIXSRC_FIRST_GVAR && i_max >= MIXSRC_FIRST_GVAR && isValueAvailable && isValueAvailable(MIXSRC_FIRST_GVAR)) {
|
||||
POPUP_MENU_ADD_ITEM(STR_MENU_GVARS);
|
||||
}
|
||||
|
||||
if (i_min <= MIXSRC_FIRST_TELEM && i_max >= MIXSRC_FIRST_TELEM) {
|
||||
if (modelTelemetryEnabled() && i_min <= MIXSRC_FIRST_TELEM && i_max >= MIXSRC_FIRST_TELEM) {
|
||||
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
||||
TelemetrySensor * sensor = & g_model.telemetrySensors[i];
|
||||
if (sensor->isAvailable()) {
|
||||
@@ -215,7 +217,38 @@ tmr10ms_t menuEntryTime;
|
||||
#define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE))
|
||||
#define POS_HORZ_INIT(posVert) ((COLATTR(posVert) & NAVIGATION_LINE_BY_LINE) ? -1 : 0)
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, vertpos_t rowcount)
|
||||
uint8_t chgMenu(uint8_t curr, const MenuHandler * menuTab, uint8_t menuTabSize, int direction)
|
||||
{
|
||||
int cc = curr + direction;
|
||||
while (cc != curr) {
|
||||
if (cc < 0)
|
||||
cc = menuTabSize - 1;
|
||||
else if (cc >= menuTabSize)
|
||||
cc = 0;
|
||||
if (menuTab[cc].isEnabled())
|
||||
return cc;
|
||||
cc += direction;
|
||||
}
|
||||
return curr;
|
||||
}
|
||||
|
||||
uint8_t menuSize(const MenuHandler * menuTab, uint8_t menuTabSize)
|
||||
{
|
||||
uint8_t sz = 0;
|
||||
for (int i = 0; i < menuTabSize; i += 1) {
|
||||
if (menuTab[i].isEnabled()) {
|
||||
sz += 1;
|
||||
}
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
uint8_t menuIdx(const MenuHandler * menuTab, uint8_t curr)
|
||||
{
|
||||
return menuSize(menuTab, curr + 1) - 1;
|
||||
}
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandler * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, vertpos_t rowcount)
|
||||
{
|
||||
vertpos_t l_posVert = menuVerticalPosition;
|
||||
horzpos_t l_posHorz = menuHorizontalPosition;
|
||||
@@ -233,10 +266,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
||||
if (s_editMode>0)
|
||||
break;
|
||||
|
||||
if (curr > 0)
|
||||
cc = curr - 1;
|
||||
else
|
||||
cc = menuTabSize-1;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, -1);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -248,18 +278,15 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
||||
if (s_editMode>0)
|
||||
break;
|
||||
|
||||
if (curr < (menuTabSize-1))
|
||||
cc = curr + 1;
|
||||
else
|
||||
cc = 0;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!menuCalibrationState && cc != curr) {
|
||||
chainMenu(menuTab[cc]);
|
||||
chainMenu(menuTab[cc].menuFunc);
|
||||
}
|
||||
|
||||
drawScreenIndex(curr, menuTabSize, 0);
|
||||
drawScreenIndex(menuIdx(menuTab, curr), menuSize(menuTab, menuTabSize), 0);
|
||||
}
|
||||
|
||||
switch (event) {
|
||||
|
||||
@@ -223,17 +223,19 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
if (i_min <= MIXSRC_FIRST_POT && i_max >= MIXSRC_FIRST_POT) POPUP_MENU_ADD_ITEM(STR_MENU_POTS);
|
||||
if (i_min <= MIXSRC_MAX && i_max >= MIXSRC_MAX) POPUP_MENU_ADD_ITEM(STR_MENU_MAX);
|
||||
#if defined(HELI)
|
||||
if (i_min <= MIXSRC_FIRST_HELI && i_max >= MIXSRC_FIRST_HELI) POPUP_MENU_ADD_ITEM(STR_MENU_HELI);
|
||||
if (modelHeliEnabled())
|
||||
if (i_min <= MIXSRC_FIRST_HELI && i_max >= MIXSRC_FIRST_HELI && isValueAvailable && isValueAvailable(MIXSRC_FIRST_HELI))
|
||||
POPUP_MENU_ADD_ITEM(STR_MENU_HELI);
|
||||
#endif
|
||||
if (i_min <= MIXSRC_FIRST_TRIM && i_max >= MIXSRC_FIRST_TRIM) POPUP_MENU_ADD_ITEM(STR_MENU_TRIMS);
|
||||
if (i_min <= MIXSRC_FIRST_SWITCH && i_max >= MIXSRC_FIRST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES);
|
||||
if (i_min <= MIXSRC_FIRST_TRAINER && i_max >= MIXSRC_FIRST_TRAINER) POPUP_MENU_ADD_ITEM(STR_MENU_TRAINER);
|
||||
if (i_min <= MIXSRC_FIRST_CH && i_max >= MIXSRC_FIRST_CH) POPUP_MENU_ADD_ITEM(STR_MENU_CHANNELS);
|
||||
if (i_min <= MIXSRC_FIRST_GVAR && i_max >= MIXSRC_FIRST_GVAR && isValueAvailable(MIXSRC_FIRST_GVAR)) {
|
||||
if (i_min <= MIXSRC_FIRST_GVAR && i_max >= MIXSRC_FIRST_GVAR && isValueAvailable && isValueAvailable(MIXSRC_FIRST_GVAR)) {
|
||||
POPUP_MENU_ADD_ITEM(STR_MENU_GVARS);
|
||||
}
|
||||
|
||||
if (i_min <= MIXSRC_FIRST_TELEM && i_max >= MIXSRC_FIRST_TELEM) {
|
||||
if (modelTelemetryEnabled() && i_min <= MIXSRC_FIRST_TELEM && i_max >= MIXSRC_FIRST_TELEM) {
|
||||
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
||||
TelemetrySensor * sensor = & g_model.telemetrySensors[i];
|
||||
if (sensor->isAvailable()) {
|
||||
@@ -300,7 +302,38 @@ void onLongMenuPress(const char * result)
|
||||
|
||||
tmr10ms_t menuEntryTime;
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags)
|
||||
uint8_t chgMenu(uint8_t curr, const MenuHandler * menuTab, uint8_t menuTabSize, int direction)
|
||||
{
|
||||
int cc = curr + direction;
|
||||
while (cc != curr) {
|
||||
if (cc < 0)
|
||||
cc = menuTabSize - 1;
|
||||
else if (cc >= menuTabSize)
|
||||
cc = 0;
|
||||
if (menuTab[cc].isEnabled())
|
||||
return cc;
|
||||
cc += direction;
|
||||
}
|
||||
return curr;
|
||||
}
|
||||
|
||||
uint8_t menuSize(const MenuHandler * menuTab, uint8_t menuTabSize)
|
||||
{
|
||||
uint8_t sz = 0;
|
||||
for (int i = 0; i < menuTabSize; i += 1) {
|
||||
if (menuTab[i].isEnabled()) {
|
||||
sz += 1;
|
||||
}
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
uint8_t menuIdx(const MenuHandler * menuTab, uint8_t curr)
|
||||
{
|
||||
return menuSize(menuTab, curr + 1) - 1;
|
||||
}
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags)
|
||||
{
|
||||
vertpos_t l_posVert = menuVerticalPosition;
|
||||
horzpos_t l_posHorz = menuHorizontalPosition;
|
||||
@@ -328,10 +361,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
if (s_editMode>0)
|
||||
break;
|
||||
|
||||
if (curr > 0)
|
||||
cc = curr - 1;
|
||||
else
|
||||
cc = menuTabSize-1;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, -1);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -339,19 +369,16 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
if (s_editMode>0)
|
||||
break;
|
||||
|
||||
if (curr < (menuTabSize-1))
|
||||
cc = curr + 1;
|
||||
else
|
||||
cc = 0;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!menuCalibrationState && cc != curr) {
|
||||
chainMenu(menuTab[cc]);
|
||||
chainMenu(menuTab[cc].menuFunc);
|
||||
}
|
||||
|
||||
if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) {
|
||||
drawScreenIndex(curr, menuTabSize, 0);
|
||||
drawScreenIndex(menuIdx(menuTab, curr), menuSize(menuTab, menuTabSize), 0);
|
||||
}
|
||||
|
||||
lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
|
||||
@@ -199,17 +199,19 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
if (i_min <= MIXSRC_FIRST_POT && i_max >= MIXSRC_FIRST_POT) POPUP_MENU_ADD_ITEM(STR_MENU_POTS);
|
||||
if (i_min <= MIXSRC_MAX && i_max >= MIXSRC_MAX) POPUP_MENU_ADD_ITEM(STR_MENU_MAX);
|
||||
#if defined(HELI)
|
||||
if (i_min <= MIXSRC_FIRST_HELI && i_max >= MIXSRC_FIRST_HELI) POPUP_MENU_ADD_ITEM(STR_MENU_HELI);
|
||||
if (modelHeliEnabled())
|
||||
if (i_min <= MIXSRC_FIRST_HELI && i_max >= MIXSRC_FIRST_HELI && isValueAvailable && isValueAvailable(MIXSRC_FIRST_HELI))
|
||||
POPUP_MENU_ADD_ITEM(STR_MENU_HELI);
|
||||
#endif
|
||||
if (i_min <= MIXSRC_FIRST_TRIM && i_max >= MIXSRC_FIRST_TRIM) POPUP_MENU_ADD_ITEM(STR_MENU_TRIMS);
|
||||
if (i_min <= MIXSRC_FIRST_SWITCH && i_max >= MIXSRC_FIRST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES);
|
||||
if (i_min <= MIXSRC_FIRST_TRAINER && i_max >= MIXSRC_FIRST_TRAINER) POPUP_MENU_ADD_ITEM(STR_MENU_TRAINER);
|
||||
if (i_min <= MIXSRC_FIRST_CH && i_max >= MIXSRC_FIRST_CH) POPUP_MENU_ADD_ITEM(STR_MENU_CHANNELS);
|
||||
if (i_min <= MIXSRC_FIRST_GVAR && i_max >= MIXSRC_FIRST_GVAR && isValueAvailable(MIXSRC_FIRST_GVAR)) {
|
||||
if (i_min <= MIXSRC_FIRST_GVAR && i_max >= MIXSRC_FIRST_GVAR && isValueAvailable && isValueAvailable(MIXSRC_FIRST_GVAR)) {
|
||||
POPUP_MENU_ADD_ITEM(STR_MENU_GVARS);
|
||||
}
|
||||
|
||||
if (i_min <= MIXSRC_FIRST_TELEM && i_max >= MIXSRC_FIRST_TELEM) {
|
||||
if (modelTelemetryEnabled() && i_min <= MIXSRC_FIRST_TELEM && i_max >= MIXSRC_FIRST_TELEM) {
|
||||
for (int i = 0; i < MAX_TELEMETRY_SENSORS; i++) {
|
||||
TelemetrySensor * sensor = & g_model.telemetrySensors[i];
|
||||
if (sensor->isAvailable()) {
|
||||
@@ -269,7 +271,38 @@ tmr10ms_t menuEntryTime;
|
||||
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
|
||||
#define POS_HORZ_INIT(posVert) 0
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
||||
uint8_t chgMenu(uint8_t curr, const MenuHandler * menuTab, uint8_t menuTabSize, int direction)
|
||||
{
|
||||
int cc = curr + direction;
|
||||
while (cc != curr) {
|
||||
if (cc < 0)
|
||||
cc = menuTabSize - 1;
|
||||
else if (cc >= menuTabSize)
|
||||
cc = 0;
|
||||
if (menuTab[cc].isEnabled())
|
||||
return cc;
|
||||
cc += direction;
|
||||
}
|
||||
return curr;
|
||||
}
|
||||
|
||||
uint8_t menuSize(const MenuHandler * menuTab, uint8_t menuTabSize)
|
||||
{
|
||||
uint8_t sz = 0;
|
||||
for (int i = 0; i < menuTabSize; i += 1) {
|
||||
if (menuTab[i].isEnabled()) {
|
||||
sz += 1;
|
||||
}
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
uint8_t menuIdx(const MenuHandler * menuTab, uint8_t curr)
|
||||
{
|
||||
return menuSize(menuTab, curr + 1) - 1;
|
||||
}
|
||||
|
||||
void check(event_t event, uint8_t curr, const MenuHandler *menuTab, uint8_t menuTabSize, const uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
||||
{
|
||||
vertpos_t l_posVert = menuVerticalPosition;
|
||||
horzpos_t l_posHorz = menuHorizontalPosition;
|
||||
@@ -286,27 +319,21 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
if (curr > 0)
|
||||
cc = curr - 1;
|
||||
else
|
||||
cc = menuTabSize-1;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, -1);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
if (curr < (menuTabSize-1))
|
||||
cc = curr + 1;
|
||||
else
|
||||
cc = 0;
|
||||
cc = chgMenu(curr, menuTab, menuTabSize, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cc != curr) {
|
||||
chainMenu(menuTab[cc]);
|
||||
chainMenu(menuTab[cc].menuFunc);
|
||||
}
|
||||
}
|
||||
|
||||
menuCalibrationState = 0;
|
||||
drawScreenIndex(curr, menuTabSize, attr);
|
||||
drawScreenIndex(menuIdx(menuTab, curr), menuSize(menuTab, menuTabSize), attr);
|
||||
}
|
||||
|
||||
switch (event) {
|
||||
|
||||
@@ -622,7 +622,7 @@ static bool luaLoadFunctionScript(uint8_t ref)
|
||||
idx = ref - SCRIPT_FUNC_FIRST;
|
||||
fn = &g_model.customFn[idx];
|
||||
}
|
||||
else if (!g_model.noGlobalFunctions) {
|
||||
else if (radioGFEnabled()) {
|
||||
idx = ref - SCRIPT_GFUNC_FIRST;
|
||||
fn = &g_eeGeneral.customFn[idx];
|
||||
}
|
||||
|
||||
+59
-55
@@ -642,66 +642,70 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms)
|
||||
evalLogicalSwitches(mode==e_perout_mode_normal);
|
||||
|
||||
#if defined(HELI)
|
||||
int heliEleValue = getValue(g_model.swashR.elevatorSource);
|
||||
int heliAilValue = getValue(g_model.swashR.aileronSource);
|
||||
if (g_model.swashR.value) {
|
||||
uint32_t v = ((int32_t)heliEleValue*heliEleValue + (int32_t)heliAilValue*heliAilValue);
|
||||
uint32_t q = calc100toRESX(g_model.swashR.value);
|
||||
q *= q;
|
||||
if (v>q) {
|
||||
uint16_t d = isqrt32(v);
|
||||
int16_t tmp = calc100toRESX(g_model.swashR.value);
|
||||
heliEleValue = (int32_t) heliEleValue*tmp/d;
|
||||
heliAilValue = (int32_t) heliAilValue*tmp/d;
|
||||
if (modelHeliEnabled()) {
|
||||
int heliEleValue = getValue(g_model.swashR.elevatorSource);
|
||||
int heliAilValue = getValue(g_model.swashR.aileronSource);
|
||||
if (g_model.swashR.value) {
|
||||
uint32_t v = ((int32_t)heliEleValue*heliEleValue + (int32_t)heliAilValue*heliAilValue);
|
||||
uint32_t q = calc100toRESX(g_model.swashR.value);
|
||||
q *= q;
|
||||
if (v>q) {
|
||||
uint16_t d = isqrt32(v);
|
||||
int16_t tmp = calc100toRESX(g_model.swashR.value);
|
||||
heliEleValue = (int32_t) heliEleValue*tmp/d;
|
||||
heliAilValue = (int32_t) heliAilValue*tmp/d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define REZ_SWASH_X(x) ((x) - (x)/8 - (x)/128 - (x)/512) // 1024*sin(60) ~= 886
|
||||
#define REZ_SWASH_Y(x) ((x)) // 1024 => 1024
|
||||
#define REZ_SWASH_X(x) ((x) - (x)/8 - (x)/128 - (x)/512) // 1024*sin(60) ~= 886
|
||||
#define REZ_SWASH_Y(x) ((x)) // 1024 => 1024
|
||||
|
||||
if (g_model.swashR.type) {
|
||||
getvalue_t vp = heliEleValue + getSourceTrimValue(g_model.swashR.elevatorSource);
|
||||
getvalue_t vr = heliAilValue + getSourceTrimValue(g_model.swashR.aileronSource);
|
||||
getvalue_t vc = 0;
|
||||
if (g_model.swashR.collectiveSource)
|
||||
vc = getValue(g_model.swashR.collectiveSource);
|
||||
if (g_model.swashR.type) {
|
||||
getvalue_t vp = heliEleValue + getSourceTrimValue(g_model.swashR.elevatorSource);
|
||||
getvalue_t vr = heliAilValue + getSourceTrimValue(g_model.swashR.aileronSource);
|
||||
getvalue_t vc = 0;
|
||||
if (g_model.swashR.collectiveSource)
|
||||
vc = getValue(g_model.swashR.collectiveSource);
|
||||
|
||||
vp = (vp * g_model.swashR.elevatorWeight) / 100;
|
||||
vr = (vr * g_model.swashR.aileronWeight) / 100;
|
||||
vc = (vc * g_model.swashR.collectiveWeight) / 100;
|
||||
vp = (vp * g_model.swashR.elevatorWeight) / 100;
|
||||
vr = (vr * g_model.swashR.aileronWeight) / 100;
|
||||
vc = (vc * g_model.swashR.collectiveWeight) / 100;
|
||||
|
||||
switch (g_model.swashR.type) {
|
||||
case SWASH_TYPE_120:
|
||||
vp = REZ_SWASH_Y(vp);
|
||||
vr = REZ_SWASH_X(vr);
|
||||
cyc_anas[0] = vc - vp;
|
||||
cyc_anas[1] = vc + vp/2 + vr;
|
||||
cyc_anas[2] = vc + vp/2 - vr;
|
||||
break;
|
||||
case SWASH_TYPE_120X:
|
||||
vp = REZ_SWASH_X(vp);
|
||||
vr = REZ_SWASH_Y(vr);
|
||||
cyc_anas[0] = vc - vr;
|
||||
cyc_anas[1] = vc + vr/2 + vp;
|
||||
cyc_anas[2] = vc + vr/2 - vp;
|
||||
break;
|
||||
case SWASH_TYPE_140:
|
||||
vp = REZ_SWASH_Y(vp);
|
||||
vr = REZ_SWASH_Y(vr);
|
||||
cyc_anas[0] = vc - vp;
|
||||
cyc_anas[1] = vc + vp + vr;
|
||||
cyc_anas[2] = vc + vp - vr;
|
||||
break;
|
||||
case SWASH_TYPE_90:
|
||||
vp = REZ_SWASH_Y(vp);
|
||||
vr = REZ_SWASH_Y(vr);
|
||||
cyc_anas[0] = vc - vp;
|
||||
cyc_anas[1] = vc + vr;
|
||||
cyc_anas[2] = vc - vr;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
switch (g_model.swashR.type) {
|
||||
case SWASH_TYPE_120:
|
||||
vp = REZ_SWASH_Y(vp);
|
||||
vr = REZ_SWASH_X(vr);
|
||||
cyc_anas[0] = vc - vp;
|
||||
cyc_anas[1] = vc + vp/2 + vr;
|
||||
cyc_anas[2] = vc + vp/2 - vr;
|
||||
break;
|
||||
case SWASH_TYPE_120X:
|
||||
vp = REZ_SWASH_X(vp);
|
||||
vr = REZ_SWASH_Y(vr);
|
||||
cyc_anas[0] = vc - vr;
|
||||
cyc_anas[1] = vc + vr/2 + vp;
|
||||
cyc_anas[2] = vc + vr/2 - vp;
|
||||
break;
|
||||
case SWASH_TYPE_140:
|
||||
vp = REZ_SWASH_Y(vp);
|
||||
vr = REZ_SWASH_Y(vr);
|
||||
cyc_anas[0] = vc - vp;
|
||||
cyc_anas[1] = vc + vp + vr;
|
||||
cyc_anas[2] = vc + vp - vr;
|
||||
break;
|
||||
case SWASH_TYPE_90:
|
||||
vp = REZ_SWASH_Y(vp);
|
||||
vr = REZ_SWASH_Y(vr);
|
||||
cyc_anas[0] = vc - vp;
|
||||
cyc_anas[1] = vc + vr;
|
||||
cyc_anas[2] = vc - vr;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cyc_anas[0] = cyc_anas[1] = cyc_anas[2] = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1052,7 +1056,7 @@ void evalMixes(uint8_t tick10ms)
|
||||
requiredSpeakerVolume = g_eeGeneral.speakerVolume + VOLUME_LEVEL_DEF;
|
||||
requiredBacklightBright = g_eeGeneral.backlightBright;
|
||||
|
||||
if (!g_model.noGlobalFunctions) {
|
||||
if (radioGFEnabled()) {
|
||||
evalFunctions(g_eeGeneral.customFn, globalFunctionsContext);
|
||||
} else {
|
||||
globalFunctionsContext.reset();
|
||||
|
||||
@@ -1943,3 +1943,42 @@ uint32_t availableMemory()
|
||||
return ((uint32_t)((unsigned char *)&_heap_end - heap)) + info.fordblks;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Radio menu tab state
|
||||
#if defined(COLORLCD)
|
||||
bool radioThemesEnabled() {
|
||||
return (g_model.radioThemesDisabled == OVERRIDE_GLOBAL && g_eeGeneral.radioThemesDisabled == 0) || (g_model.radioThemesDisabled == 2);
|
||||
}
|
||||
#endif
|
||||
bool radioGFEnabled() {
|
||||
return (g_model.radioGFDisabled == OVERRIDE_GLOBAL && g_eeGeneral.radioGFDisabled == 0) || (g_model.radioGFDisabled == 2);
|
||||
}
|
||||
bool radioTrainerEnabled() {
|
||||
return (g_model.radioTrainerDisabled == OVERRIDE_GLOBAL && g_eeGeneral.radioTrainerDisabled == 0) || (g_model.radioTrainerDisabled == 2);
|
||||
}
|
||||
|
||||
// Model menu tab state
|
||||
bool modelHeliEnabled() {
|
||||
return (g_model.modelHeliDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelHeliDisabled == 0) || (g_model.modelHeliDisabled == 2);
|
||||
}
|
||||
bool modelFMEnabled() {
|
||||
return (g_model.modelFMDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelFMDisabled == 0) || (g_model.modelFMDisabled == 2);
|
||||
}
|
||||
bool modelCurvesEnabled() {
|
||||
return (g_model.modelCurvesDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelCurvesDisabled == 0) || (g_model.modelCurvesDisabled == 2);
|
||||
}
|
||||
bool modelGVEnabled() {
|
||||
return (g_model.modelGVDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelGVDisabled == 0) || (g_model.modelGVDisabled == 2);
|
||||
}
|
||||
bool modelLSEnabled() {
|
||||
return (g_model.modelLSDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelLSDisabled == 0) || (g_model.modelLSDisabled == 2);
|
||||
}
|
||||
bool modelSFEnabled() {
|
||||
return (g_model.modelSFDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelSFDisabled == 0) || (g_model.modelSFDisabled == 2);
|
||||
}
|
||||
bool modelCustomScriptsEnabled() {
|
||||
return (g_model.modelCustomScriptsDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelCustomScriptsDisabled == 0) || (g_model.modelCustomScriptsDisabled == 2);
|
||||
}
|
||||
bool modelTelemetryEnabled() {
|
||||
return (g_model.modelTelemetryDisabled == OVERRIDE_GLOBAL && g_eeGeneral.modelTelemetryDisabled == 0) || (g_model.modelTelemetryDisabled == 2);
|
||||
}
|
||||
|
||||
@@ -168,6 +168,12 @@
|
||||
#define CASE_GVARS(x)
|
||||
#endif
|
||||
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
#define CASE_LUA_MODEL_SCRIPTS(x) x,
|
||||
#else
|
||||
#define CASE_LUA_MODEL_SCRIPTS(x)
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9DP) || defined(PCBX9E)
|
||||
#define CASE_PCBX9E_PCBX9DP(x) x,
|
||||
#else
|
||||
@@ -1193,3 +1199,18 @@ inline bool isAsteriskDisplayed()
|
||||
#include "module.h"
|
||||
|
||||
extern CircularBuffer<uint8_t, 8> luaSetStickySwitchBuffer;
|
||||
|
||||
// Radio menu tab state
|
||||
#if defined(COLORLCD)
|
||||
extern bool radioThemesEnabled();
|
||||
#endif
|
||||
extern bool radioGFEnabled();
|
||||
extern bool radioTrainerEnabled();
|
||||
extern bool modelHeliEnabled();
|
||||
extern bool modelFMEnabled();
|
||||
extern bool modelCurvesEnabled();
|
||||
extern bool modelGVEnabled();
|
||||
extern bool modelLSEnabled();
|
||||
extern bool modelSFEnabled();
|
||||
extern bool modelCustomScriptsEnabled();
|
||||
extern bool modelTelemetryEnabled();
|
||||
|
||||
@@ -139,6 +139,14 @@ static void sortMixerLines()
|
||||
|
||||
void postModelLoad(bool alarms)
|
||||
{
|
||||
// Convert 'noGlobalFunctions' to 'radioGFDisabled'
|
||||
// TODO: Remove sometime in the future (and remove 'noGlobalFunctions' property)
|
||||
if (g_model.noGlobalFunctions) {
|
||||
g_model.radioGFDisabled = OVERRIDE_OFF;
|
||||
g_model.noGlobalFunctions = 0;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
#if defined(PXX2)
|
||||
if (is_memclear(g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID)) {
|
||||
memcpy(g_model.modelRegistrationID, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID);
|
||||
|
||||
@@ -427,6 +427,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -892,6 +902,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -459,6 +459,17 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "stickDeadZone", 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("selectedTheme", 26),
|
||||
YAML_UNSIGNED( "radioThemesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -923,6 +934,17 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioThemesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -432,6 +432,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -902,6 +912,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -490,6 +490,17 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "imuMax", 8 ),
|
||||
YAML_SIGNED( "imuOffset", 8 ),
|
||||
YAML_STRING("selectedTheme", 26),
|
||||
YAML_UNSIGNED( "radioThemesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -954,6 +965,17 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioThemesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -488,6 +488,17 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "imuMax", 8 ),
|
||||
YAML_SIGNED( "imuOffset", 8 ),
|
||||
YAML_STRING("selectedTheme", 26),
|
||||
YAML_UNSIGNED( "radioThemesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -952,6 +963,17 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioThemesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -433,6 +433,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -906,6 +916,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -472,6 +472,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -946,6 +956,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -411,6 +411,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -876,6 +886,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -421,6 +421,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -886,6 +896,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -418,6 +418,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -883,6 +893,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -422,6 +422,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "imuMax", 8 ),
|
||||
YAML_SIGNED( "imuOffset", 8 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -887,6 +897,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -426,6 +426,16 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "radioGFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "radioTrainerDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelHeliDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelFMDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCurvesDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelGVDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelLSDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelSFDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelCustomScriptsDisabled", 1 ),
|
||||
YAML_UNSIGNED( "modelTelemetryDisabled", 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
@@ -891,6 +901,16 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_ENUM("usbJoystickIfMode", 3, enum_USBJoystickIfMode),
|
||||
YAML_UNSIGNED( "usbJoystickCircularCut", 4 ),
|
||||
YAML_ARRAY("usbJoystickCh", 16, 26, struct_USBJoystickChData, NULL),
|
||||
YAML_ENUM("radioGFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("radioTrainerDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelHeliDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelFMDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCurvesDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelGVDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelLSDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelSFDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelCustomScriptsDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_ENUM("modelTelemetryDisabled", 2, enum_ModelOverridableEnable),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
|
||||
@@ -1000,3 +1000,6 @@ const char STR_SIGNAL_OUTPUT[] = TR_SIGNAL_OUTPUT;
|
||||
const char STR_SERIAL_BUS[] = TR_SERIAL_BUS;
|
||||
const char STR_SYNC[] = TR_SYNC;
|
||||
|
||||
const char STR_VIEW_OPTIONS[] = TR_VIEW_OPTIONS;
|
||||
const char STR_RADIO_MENU_TABS[] = TR_RADIO_MENU_TABS;
|
||||
const char STR_MODEL_MENU_TABS[] = TR_MODEL_MENU_TABS;
|
||||
|
||||
@@ -826,6 +826,10 @@ extern const char STR_SIGNAL_OUTPUT[];
|
||||
extern const char STR_SERIAL_BUS[];
|
||||
extern const char STR_SYNC[];
|
||||
|
||||
extern const char STR_VIEW_OPTIONS[];
|
||||
extern const char STR_RADIO_MENU_TABS[];
|
||||
extern const char STR_MODEL_MENU_TABS[];
|
||||
|
||||
|
||||
struct LanguagePack {
|
||||
const char * id;
|
||||
|
||||
@@ -1286,3 +1286,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "信号强度输出"
|
||||
#define TR_SERIAL_BUS "串行总线"
|
||||
#define TR_SYNC "同步"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1288,3 +1288,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1301,3 +1301,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal uddata"
|
||||
#define TR_SERIAL_BUS "Seriel bus"
|
||||
#define TR_SYNC "Synk"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1287,3 +1287,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1280,3 +1280,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1291,3 +1291,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1304,3 +1304,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1308,3 +1308,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1284,3 +1284,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1285,3 +1285,8 @@
|
||||
#define TR_SIGNAL_OUTPUT "Segnale d'uscita"
|
||||
#define TR_SERIAL_BUS "Bus seriale"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
|
||||
@@ -1281,3 +1281,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1301,3 +1301,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1285,3 +1285,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1294,3 +1294,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1325,3 +1325,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "Signal output"
|
||||
#define TR_SERIAL_BUS "Serial bus"
|
||||
#define TR_SYNC "Sync"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
@@ -1284,3 +1284,7 @@
|
||||
#define TR_SIGNAL_OUTPUT "信號強度輸出"
|
||||
#define TR_SERIAL_BUS "串行總線"
|
||||
#define TR_SYNC "同步"
|
||||
|
||||
#define TR_VIEW_OPTIONS "Enabled Features"
|
||||
#define TR_RADIO_MENU_TABS "Radio Menu Tabs"
|
||||
#define TR_MODEL_MENU_TABS "Model Menu Tabs"
|
||||
|
||||
Reference in New Issue
Block a user