Use RSSI dialog for ACCESS as well
This commit is contained in:
@@ -514,8 +514,6 @@ class TrainerModuleWindow : public FormGroup
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ModuleWindow : public FormGroup {
|
class ModuleWindow : public FormGroup {
|
||||||
public:
|
public:
|
||||||
ModuleWindow(FormWindow * parent, const rect_t &rect, uint8_t moduleIdx) :
|
ModuleWindow(FormWindow * parent, const rect_t &rect, uint8_t moduleIdx) :
|
||||||
@@ -1124,18 +1122,7 @@ class ModuleWindow : public FormGroup {
|
|||||||
resetPulsesAFHDS2();
|
resetPulsesAFHDS2();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
auto rssiDialog = new DynamicMessageDialog(
|
startRSSIDialog([]() {
|
||||||
this, "Range Test",
|
|
||||||
[=]() {
|
|
||||||
char buf[16];
|
|
||||||
sprintf(buf, "%d db", (int)TELEMETRY_RSSI());
|
|
||||||
return std::string(buf);
|
|
||||||
},
|
|
||||||
"RSSI:", 50,
|
|
||||||
COLOR_THEME_SECONDARY1 | CENTERED | FONT(BOLD) | FONT(XL));
|
|
||||||
rssiDialog->setCloseHandler([this]() {
|
|
||||||
rangeButton->check(false);
|
|
||||||
moduleState[moduleIdx].mode = MODULE_MODE_NORMAL;
|
|
||||||
#if defined(AFHDS2)
|
#if defined(AFHDS2)
|
||||||
if (isModuleFlySky(moduleIdx)) {
|
if (isModuleFlySky(moduleIdx)) {
|
||||||
resetPulsesAFHDS2();
|
resetPulsesAFHDS2();
|
||||||
@@ -1204,20 +1191,12 @@ class ModuleWindow : public FormGroup {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
moduleState[moduleIdx].mode = MODULE_MODE_RANGECHECK;
|
moduleState[moduleIdx].mode = MODULE_MODE_RANGECHECK;
|
||||||
|
startRSSIDialog();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
new StaticText(this, grid.getLabelSlot(true), TR_OPTIONS, 0,
|
|
||||||
COLOR_THEME_PRIMARY1);
|
|
||||||
auto options = new TextButton(this, grid.getFieldSlot(2, 0), TR_SET);
|
|
||||||
options->setPressHandler([=]() {
|
|
||||||
new ModuleOptions(this, moduleIdx);
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
grid.nextLine();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1268,6 +1247,23 @@ class ModuleWindow : public FormGroup {
|
|||||||
par->adjustInnerHeight();
|
par->adjustInnerHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void startRSSIDialog(std::function<void()> closeHandler = nullptr)
|
||||||
|
{
|
||||||
|
auto rssiDialog = new DynamicMessageDialog(
|
||||||
|
parent, "Range Test",
|
||||||
|
[=]() {
|
||||||
|
return std::to_string((int)TELEMETRY_RSSI()) + std::string(" db");
|
||||||
|
},
|
||||||
|
"RSSI:", 50,
|
||||||
|
COLOR_THEME_SECONDARY1 | CENTERED | FONT(BOLD) | FONT(XL));
|
||||||
|
|
||||||
|
rssiDialog->setCloseHandler([this, closeHandler]() {
|
||||||
|
rangeButton->check(false);
|
||||||
|
moduleState[moduleIdx].mode = MODULE_MODE_NORMAL;
|
||||||
|
if (closeHandler) closeHandler();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void checkEvents() override
|
void checkEvents() override
|
||||||
{
|
{
|
||||||
if (isModuleFailsafeAvailable(moduleIdx) != hasFailsafe
|
if (isModuleFailsafeAvailable(moduleIdx) != hasFailsafe
|
||||||
|
|||||||
Reference in New Issue
Block a user