fix: only display PPM multiplier for trainer when PPM is used (#5649)
This commit is contained in:
@@ -97,23 +97,25 @@ void RadioTrainerPage::build(Window* form)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Trainer multiplier
|
// Trainer multiplier
|
||||||
auto lbl = new StaticText(line, rect_t{}, STR_MULTIPLIER);
|
if (g_model.trainerData.mode == TRAINER_MODE_MASTER_TRAINER_JACK) {
|
||||||
lbl->padRight(PAD_SMALL);
|
auto lbl = new StaticText(line, rect_t{}, STR_MULTIPLIER);
|
||||||
lv_obj_set_grid_cell(lbl->getLvObj(), LV_GRID_ALIGN_END, 0, 2,
|
lbl->padRight(PAD_SMALL);
|
||||||
LV_GRID_ALIGN_CENTER, 0, 1);
|
lv_obj_set_grid_cell(lbl->getLvObj(), LV_GRID_ALIGN_END, 0, 2,
|
||||||
|
LV_GRID_ALIGN_CENTER, 0, 1);
|
||||||
|
|
||||||
auto multiplier =
|
auto multiplier =
|
||||||
new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, -10, 40,
|
new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, -10, 40,
|
||||||
GET_SET_DEFAULT(g_eeGeneral.PPM_Multiplier));
|
GET_SET_DEFAULT(g_eeGeneral.PPM_Multiplier));
|
||||||
multiplier->setDisplayHandler(
|
multiplier->setDisplayHandler(
|
||||||
[](int32_t value) { return formatNumberAsString(value + 10, PREC1); });
|
[](int32_t value) { return formatNumberAsString(value + 10, PREC1); });
|
||||||
lv_obj_set_grid_cell(multiplier->getLvObj(), LV_GRID_ALIGN_START, 2, 1,
|
lv_obj_set_grid_cell(multiplier->getLvObj(), LV_GRID_ALIGN_START, 2, 1,
|
||||||
LV_GRID_ALIGN_CENTER, 0, 1);
|
LV_GRID_ALIGN_CENTER, 0, 1);
|
||||||
|
|
||||||
#if PORTRAIT_LCD
|
#if PORTRAIT_LCD
|
||||||
line = form->newLine(grid);
|
line = form->newLine(grid);
|
||||||
line->padTop(10);
|
line->padTop(10);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Trainer calibration
|
// Trainer calibration
|
||||||
auto btn = new TextButton(line, rect_t{}, std::string(STR_CALIBRATION),
|
auto btn = new TextButton(line, rect_t{}, std::string(STR_CALIBRATION),
|
||||||
|
|||||||
@@ -97,9 +97,11 @@ void menuRadioTrainer(event_t event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
attr = (menuVerticalPosition==HEADER_LINE+4) ? blink : 0;
|
attr = (menuVerticalPosition==HEADER_LINE+4) ? blink : 0;
|
||||||
lcdDrawTextAlignedLeft(y, STR_MULTIPLIER);
|
if (g_model.trainerData.mode == TRAINER_MODE_MASTER_TRAINER_JACK) {
|
||||||
lcdDrawNumber(LEN_MULTIPLIER*FW+3*FW, y, g_eeGeneral.PPM_Multiplier+10, attr|PREC1|RIGHT);
|
lcdDrawTextAlignedLeft(y, STR_MULTIPLIER);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
lcdDrawNumber(LEN_MULTIPLIER * FW + 3 * FW, y, g_eeGeneral.PPM_Multiplier + 10, attr | PREC1 | RIGHT);
|
||||||
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||||
|
}
|
||||||
y += FH;
|
y += FH;
|
||||||
|
|
||||||
attr = (menuVerticalPosition==HEADER_LINE+5) ? INVERS : 0;
|
attr = (menuVerticalPosition==HEADER_LINE+5) ? INVERS : 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user