Skip to content

Commit

Permalink
Merge branch 'EdgeTX:main' into Russian-translation
Browse files Browse the repository at this point in the history
  • Loading branch information
kobakirill authored Oct 17, 2023
2 parents 70ec6d7 + e5cefb3 commit 7f049cf
Show file tree
Hide file tree
Showing 33 changed files with 507 additions and 343 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ body:
label: Version
description: What version of EdgeTX software are you running?
options:
- 2.9.1
- 2.9.0
- 2.8.5
- 2.8.4
Expand Down
33 changes: 28 additions & 5 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)) {
else if (IS_FLYSKY_NV14(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_2POS, "SA"},
{SWITCH_3POS, "SB"},
Expand All @@ -360,6 +360,20 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_FLYSKY_EL18(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_2POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_2POS, "SD"},
{SWITCH_2POS, "SE"},
{SWITCH_3POS, "SF"},
{SWITCH_3POS, "SG"},
{SWITCH_TOGGLE, "SH"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_FAMILY_HORUS_OR_T16(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
Expand Down Expand Up @@ -700,10 +714,17 @@ StringTagMappingTable Boards::getAnalogNamesLookupTable(Board::Type board, const
{tr("S3").toStdString(), "POT3"},
});
} else if ((IS_TARANIS_SMALL(board) && !IS_JUMPER_TLITE(board)) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)) {
tbl.insert(tbl.end(), {
{tr("S1").toStdString(), "POT1"},
{tr("S2").toStdString(), "POT2"},
});
if (version < adcVersion) {
tbl.insert(tbl.end(), {
{tr("S1").toStdString(), "POT1"},
{tr("S2").toStdString(), "POT2"},
});
} else {
tbl.insert(tbl.end(), {
{tr("S1").toStdString(), "P1", 4},
{tr("S2").toStdString(), "P2", 5},
});
}
} else if (IS_TARANIS_X9(board)) {
if (version < adcVersion) {
tbl.insert(tbl.end(), {
Expand Down Expand Up @@ -892,6 +913,8 @@ QString Boards::potTypeToString(int value)
return tr("Multi pos switch");
case POT_WITHOUT_DETENT:
return tr("Pot without detent");
case POT_SLIDER_WITH_DETENT:
return tr("slider");
default:
return CPN_STR_UNKNOWN_ITEM;
}
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ namespace Board {
POT_WITH_DETENT,
POT_MULTIPOS_SWITCH,
POT_WITHOUT_DETENT,
POT_SLIDER_WITH_DETENT,
POT_TYPE_COUNT
};

Expand Down
6 changes: 4 additions & 2 deletions companion/src/firmwares/edgetx/yaml_generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
node["fai"] = (int)rhs.fai;
node["disableMemoryWarning"] = (int)rhs.disableMemoryWarning;
node["beepMode"] = rhs.beeperMode;
node["alarmsFlash"] = (int)rhs.flashBeep;
node["disableAlarmWarning"] = (int)rhs.disableAlarmWarning;
node["disableRssiPoweroffAlarm"] = (int)rhs.disableRssiPoweroffAlarm;
node["USBMode"] = rhs.usbMode;
Expand Down Expand Up @@ -297,7 +298,7 @@ Node convert<GeneralSettings>::encode(const GeneralSettings& rhs)
seq = getCurrentFirmware()->getAnalogInputSeqADC(adcoffset + i) - sticks;
if (seq >= 0 && seq < maxPots) {
strcpy(potName[seq], rhs.sliderName[i]);
potConfig[seq] = rhs.sliderConfig[i];
potConfig[seq] = ((rhs.sliderConfig[i] == Board::SLIDER_WITH_DETENT) ? Board::POT_SLIDER_WITH_DETENT : Board::POT_NONE);
}
}

Expand Down Expand Up @@ -436,6 +437,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
node["fai"] >> rhs.fai;
node["disableMemoryWarning"] >> rhs.disableMemoryWarning;
node["beepMode"] >> rhs.beeperMode;
node["alarmsFlash"] >> rhs.flashBeep;
node["disableAlarmWarning"] >> rhs.disableAlarmWarning;
node["disableRssiPoweroffAlarm"] >> rhs.disableRssiPoweroffAlarm;
node["USBMode"] >> rhs.usbMode;
Expand Down Expand Up @@ -576,7 +578,7 @@ bool convert<GeneralSettings>::decode(const Node& node, GeneralSettings& rhs)
else {
for (int i = 0; i < Boards::getCapability(board, Board::Sliders); i++) {
strcpy(rhs.sliderName[i], potName[numPots + i]);
rhs.sliderConfig[i] = potConfig[numPots + i];
rhs.sliderConfig[i] = ((potConfig[numPots + i] == Board::POT_SLIDER_WITH_DETENT) ? Board::SLIDER_WITH_DETENT : Board::SLIDER_NONE);
}
}

Expand Down
2 changes: 2 additions & 0 deletions companion/src/firmwares/edgetx/yaml_rawsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ RawSource YamlRawSourceDecode(const std::string& src_str)
}

int ana_idx = getCurrentFirmware()->getAnalogInputIndex(ana_str.c_str());
if (ana_idx < 0)
ana_idx = getCurrentFirmware()->getAnalogInputIndexADC(ana_str.c_str());
if (ana_idx >= 0) {
rhs.type = SOURCE_TYPE_STICK;
rhs.index = ana_idx;
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/edgetx/yaml_switchconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const YamlLookupTable potConfigLut = {
{Board::POT_WITH_DETENT, "with_detent"},
{Board::POT_MULTIPOS_SWITCH, "multipos_switch"},
{Board::POT_WITHOUT_DETENT, "without_detent"},
{Board::POT_SLIDER_WITH_DETENT, "slider"},
};

const YamlLookupTable slidersLut = {
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/eeprominterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ enum Capability {
HasIntModuleCRSF,
HasIntModuleELRS,
HasIntModuleFlySky,
BacklightLevelMin,
};

class EEPROMInterface
Expand Down
6 changes: 6 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,12 @@ int OpenTxFirmware::getCapability(::Capability capability)
case HasIntModuleFlySky:
return id.contains("afhds2a") || id.contains("afhds3") ||
IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board);
case BacklightLevelMin:
if (IS_HORUS_X12S(board))
return 5;
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
return 1;
return 46;
default:
return 0;
}
Expand Down
31 changes: 25 additions & 6 deletions companion/src/generaledit/generalsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ ui(new Ui::GeneralSetup)
populateRotEncCB(reCount);
}

if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) {
ui->backlightautoSB->setMinimum(5);
}

ui->contrastSB->setMinimum(firmware->getCapability(MinContrast));
ui->contrastSB->setMaximum(firmware->getCapability(MaxContrast));
ui->contrastSB->setValue(generalSettings.contrast);
Expand Down Expand Up @@ -470,10 +474,15 @@ void GeneralSetupPanel::setValues()
ui->label_HL->hide();
ui->hapticLengthCB->hide();
}
ui->OFFBright_SB->setMinimum(firmware->getCapability(BacklightLevelMin));
if (generalSettings.backlightOffBright > 100-generalSettings.backlightBright)
generalSettings.backlightOffBright = 100-generalSettings.backlightBright;
ui->BLBright_SB->setValue(100-generalSettings.backlightBright);
ui->OFFBright_SB->setValue(generalSettings.backlightOffBright);
ui->BLBright_SB->setMinimum(ui->OFFBright_SB->value());
ui->OFFBright_SB->setMaximum(ui->BLBright_SB->value());
ui->soundModeCB->setCurrentIndex(generalSettings.speakerMode);
ui->volume_SB->setValue(generalSettings.speakerVolume);
ui->volume_SB->setValue(generalSettings.speakerVolume + 12);
ui->beeperlenCB->setCurrentIndex(generalSettings.beeperLength+2);
ui->speakerPitchSB->setValue(generalSettings.speakerPitch);
ui->hapticStrength->setValue(generalSettings.hapticStrength);
Expand Down Expand Up @@ -624,19 +633,29 @@ void GeneralSetupPanel::on_varioR0_SB_editingFinished()

void GeneralSetupPanel::on_BLBright_SB_editingFinished()
{
generalSettings.backlightBright = 100 - ui->BLBright_SB->value();
emit modified();
if (ui->BLBright_SB->value() < ui->OFFBright_SB->value()) {
ui->BLBright_SB->setValue(ui->OFFBright_SB->value());
} else {
ui->OFFBright_SB->setMaximum(ui->BLBright_SB->value());
generalSettings.backlightBright = 100 - ui->BLBright_SB->value();
emit modified();
}
}

void GeneralSetupPanel::on_OFFBright_SB_editingFinished()
{
generalSettings.backlightOffBright = ui->OFFBright_SB->value();
emit modified();
if (ui->OFFBright_SB->value() > ui->BLBright_SB->value()) {
ui->OFFBright_SB->setValue(ui->BLBright_SB->value());
} else {
ui->BLBright_SB->setMinimum(ui->OFFBright_SB->value());
generalSettings.backlightOffBright = ui->OFFBright_SB->value();
emit modified();
}
}

void GeneralSetupPanel::on_volume_SB_editingFinished()
{
generalSettings.speakerVolume = ui->volume_SB->value();
generalSettings.speakerVolume = ui->volume_SB->value() - 12;
emit modified();
}

Expand Down
8 changes: 2 additions & 6 deletions radio/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,8 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext

getvalue_t raw = getValue(CFN_PARAM(cfn));
#if defined(COLORLCD)
if (raw == -1024)
requiredBacklightBright = 100;
else
requiredBacklightBright =
(1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) /
2048;
requiredBacklightBright = BACKLIGHT_LEVEL_MAX - (g_eeGeneral.blOffBright +
((1024 + raw) * ((BACKLIGHT_LEVEL_MAX - g_eeGeneral.backlightBright) - g_eeGeneral.blOffBright) / 2048));
#elif defined(OLED_SCREEN)
requiredBacklightBright = (raw + 1024) * 254 / 2048;
#else
Expand Down
55 changes: 29 additions & 26 deletions radio/src/gui/colorlcd/menu_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

#include "menu_model.h"

#include "translations.h"
#include "view_channels.h"
#include "menu_radio.h"
#include "model_curves.h"
#include "model_flightmodes.h"
#include "model_gvars.h"
Expand All @@ -32,16 +31,15 @@
#include "model_mixer_scripts.h"
#include "model_mixes.h"
#include "model_outputs.h"
#include "model_select.h"
#include "model_setup.h"
#include "model_telemetry.h"
#include "opentx.h"
#include "special_functions.h"
#include "translations.h"
#include "view_channels.h"

ModelMenu::ModelMenu():
TabsGroup(ICON_MODEL)
{
build();
}
ModelMenu::ModelMenu() : TabsGroup(ICON_MODEL) { build(); }

void ModelMenu::build()
{
Expand All @@ -56,32 +54,24 @@ void ModelMenu::build()

addTab(new ModelSetupPage());
#if defined(HELI)
if (_modelHeliEnabled)
addTab(new ModelHeliPage());
if (_modelHeliEnabled) addTab(new ModelHeliPage());
#endif
#if defined(FLIGHT_MODES)
if (_modelFMEnabled)
addTab(new ModelFlightModesPage());
if (_modelFMEnabled) addTab(new ModelFlightModesPage());
#endif
addTab(new ModelInputsPage());
addTab(new ModelMixesPage());
addTab(new ModelOutputsPage());
if (_modelCurvesEnabled)
addTab(new ModelCurvesPage());
if (_modelCurvesEnabled) addTab(new ModelCurvesPage());
#if defined(GVARS)
if (_modelGVEnabled)
addTab(new ModelGVarsPage());
if (_modelGVEnabled) addTab(new ModelGVarsPage());
#endif
if (_modelLSEnabled)
addTab(new ModelLogicalSwitchesPage());
if (_modelSFEnabled)
addTab(new SpecialFunctionsPage(g_model.customFn));
if (_modelLSEnabled) addTab(new ModelLogicalSwitchesPage());
if (_modelSFEnabled) addTab(new SpecialFunctionsPage(g_model.customFn));
#if defined(LUA_MODEL_SCRIPTS)
if (_modelCustomScriptsEnabled)
addTab(new ModelMixerScriptsPage());
if (_modelCustomScriptsEnabled) addTab(new ModelMixerScriptsPage());
#endif
if (_modelTelemetryEnabled)
addTab(new ModelTelemetryPage());
if (_modelTelemetryEnabled) addTab(new ModelTelemetryPage());

#if defined(PCBNV14) || defined(PCBPL18)
addGoToMonitorsButton();
Expand Down Expand Up @@ -109,9 +99,21 @@ void ModelMenu::checkEvents()
void ModelMenu::onEvent(event_t event)
{
#if defined(HARDWARE_KEYS)
if (event == EVT_KEY_FIRST(KEY_MODEL)) {
if (event == EVT_KEY_BREAK(KEY_MODEL)) {
killEvents(event);
new ChannelsViewMenu();
new ChannelsViewMenu(this);
} else if (event == EVT_KEY_LONG(KEY_MODEL)) {
killEvents(KEY_MODEL);
onCancel();
new ModelLabelsWindow();
} else if (event == EVT_KEY_BREAK(KEY_SYS)) {
onCancel();
new RadioMenu();
} else if (event == EVT_KEY_LONG(KEY_SYS)) {
onCancel();
killEvents(KEY_SYS);
// Radio setup
(new RadioMenu())->setCurrentTab(2);
} else {
TabsGroup::onEvent(event);
}
Expand All @@ -122,7 +124,8 @@ void ModelMenu::onEvent(event_t event)
void ModelMenu::addGoToMonitorsButton()
{
new TextButton(
&header, {LCD_W / 2 + 6, MENU_TITLE_TOP + 1, LCD_W / 2 - 8, MENU_TITLE_HEIGHT - 2},
&header,
{LCD_W / 2 + 6, MENU_TITLE_TOP + 1, LCD_W / 2 - 8, MENU_TITLE_HEIGHT - 2},
STR_OPEN_CHANNEL_MONITORS, [=]() {
pushEvent(EVT_KEY_FIRST(KEY_MODEL));
return 0;
Expand Down
40 changes: 18 additions & 22 deletions radio/src/gui/colorlcd/menu_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,33 @@
* GNU General Public License for more details.
*/

#ifndef _MENU_MODEL_H_
#define _MENU_MODEL_H_
#pragma once

#include "tabsgroup.h"

class ModelMenu : public TabsGroup
{
public:
ModelMenu();

void onEvent(event_t event) override;
public:
ModelMenu();

#if defined(DEBUG_WINDOWS)
std::string getName() const override { return "ModelMenu"; }
std::string getName() const override { return "ModelMenu"; }
#endif

protected:
protected:
#if defined(PCBNV14) || defined(PCBPL18)
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;
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;
void onEvent(event_t event) override;
};

#endif // _MENU_MODEL_H_
Loading

0 comments on commit 7f049cf

Please sign in to comment.