fix: only display PPM multiplier for trainer when PPM is used (#5649)

This commit is contained in:
3djc
2024-11-09 12:35:16 +10:00
committed by GitHub
parent 50cfd4d1f7
commit d1c7bff8ef
2 changed files with 20 additions and 16 deletions
+15 -13
View File
@@ -97,23 +97,25 @@ void RadioTrainerPage::build(Window* form)
#endif
// Trainer multiplier
auto lbl = new StaticText(line, rect_t{}, STR_MULTIPLIER);
lbl->padRight(PAD_SMALL);
lv_obj_set_grid_cell(lbl->getLvObj(), LV_GRID_ALIGN_END, 0, 2,
LV_GRID_ALIGN_CENTER, 0, 1);
if (g_model.trainerData.mode == TRAINER_MODE_MASTER_TRAINER_JACK) {
auto lbl = new StaticText(line, rect_t{}, STR_MULTIPLIER);
lbl->padRight(PAD_SMALL);
lv_obj_set_grid_cell(lbl->getLvObj(), LV_GRID_ALIGN_END, 0, 2,
LV_GRID_ALIGN_CENTER, 0, 1);
auto multiplier =
new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, -10, 40,
GET_SET_DEFAULT(g_eeGeneral.PPM_Multiplier));
multiplier->setDisplayHandler(
[](int32_t value) { return formatNumberAsString(value + 10, PREC1); });
lv_obj_set_grid_cell(multiplier->getLvObj(), LV_GRID_ALIGN_START, 2, 1,
LV_GRID_ALIGN_CENTER, 0, 1);
auto multiplier =
new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, -10, 40,
GET_SET_DEFAULT(g_eeGeneral.PPM_Multiplier));
multiplier->setDisplayHandler(
[](int32_t value) { return formatNumberAsString(value + 10, PREC1); });
lv_obj_set_grid_cell(multiplier->getLvObj(), LV_GRID_ALIGN_START, 2, 1,
LV_GRID_ALIGN_CENTER, 0, 1);
#if PORTRAIT_LCD
line = form->newLine(grid);
line->padTop(10);
line = form->newLine(grid);
line->padTop(10);
#endif
}
// Trainer calibration
auto btn = new TextButton(line, rect_t{}, std::string(STR_CALIBRATION),