Fix module and trainer subform resizing and show NV14 RF module version (#800)
* Fixes #792 * Add RF module FW version * Clean(er) implementation * Whitespace changes cleanup * Cleanup * Trainer module fix Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
@@ -669,12 +669,13 @@ class TrainerModuleWindow : public FormGroup
|
||||
GET_SET_DEFAULT(g_model.trainerData.pulsePol));
|
||||
grid.nextLine();
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
new StaticText(this, grid.getLabelSlot(true));
|
||||
#endif
|
||||
getParent()->moveWindowsTop(top() + 1, adjustHeight());
|
||||
}
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
new StaticText(this, grid.getLabelSlot(true));
|
||||
#endif
|
||||
auto par = getParent();
|
||||
par->moveWindowsTop(top() + 1, adjustHeight());
|
||||
par->adjustInnerHeight();
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -789,18 +790,22 @@ class ModuleWindow : public FormGroup {
|
||||
clear();
|
||||
|
||||
// Module Type
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0, COLOR_THEME_PRIMARY1);
|
||||
moduleChoice = new Choice(this, grid.getFieldSlot(2, 0), STR_INTERNAL_MODULE_PROTOCOLS,
|
||||
MODULE_TYPE_NONE, MODULE_TYPE_COUNT - 1,
|
||||
GET_DEFAULT(g_model.moduleData[moduleIdx].type),
|
||||
[=](int32_t newValue) {
|
||||
setModuleType(moduleIdx, newValue);
|
||||
update();
|
||||
moduleChoice->setFocus(SET_FOCUS_DEFAULT);
|
||||
SET_DIRTY();
|
||||
});
|
||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0,
|
||||
COLOR_THEME_PRIMARY1);
|
||||
moduleChoice = new Choice(
|
||||
this, grid.getFieldSlot(2, 0), STR_INTERNAL_MODULE_PROTOCOLS,
|
||||
MODULE_TYPE_NONE, MODULE_TYPE_COUNT - 1,
|
||||
GET_DEFAULT(g_model.moduleData[moduleIdx].type),
|
||||
[=](int32_t newValue) {
|
||||
setModuleType(moduleIdx, newValue);
|
||||
update();
|
||||
moduleChoice->setFocus(SET_FOCUS_DEFAULT);
|
||||
SET_DIRTY();
|
||||
});
|
||||
moduleChoice->setAvailableHandler([=](int8_t moduleType) {
|
||||
return moduleIdx == INTERNAL_MODULE ? isInternalModuleAvailable(moduleType) : isExternalModuleAvailable(moduleType);
|
||||
return moduleIdx == INTERNAL_MODULE
|
||||
? isInternalModuleAvailable(moduleType)
|
||||
: isExternalModuleAvailable(moduleType);
|
||||
});
|
||||
|
||||
// Module parameters
|
||||
@@ -1392,7 +1397,9 @@ class ModuleWindow : public FormGroup {
|
||||
grid.nextLine();
|
||||
}
|
||||
|
||||
getParent()->moveWindowsTop(top() + 1, adjustHeight());
|
||||
auto par = getParent();
|
||||
par->moveWindowsTop(top() + 1, adjustHeight());
|
||||
par->adjustInnerHeight();
|
||||
}
|
||||
|
||||
void checkEvents() override
|
||||
|
||||
@@ -205,6 +205,7 @@ RadioVersionPage::RadioVersionPage():
|
||||
{
|
||||
}
|
||||
|
||||
extern uint32_t NV14internalModuleFwVersion;
|
||||
void RadioVersionPage::build(FormWindow * window)
|
||||
{
|
||||
FormGridLayout grid;
|
||||
@@ -236,8 +237,12 @@ void RadioVersionPage::build(FormWindow * window)
|
||||
auto options = new OptionsText(window, grid.getFieldSlot(1,0));
|
||||
grid.nextLine(options->height() + 4);
|
||||
|
||||
//TODO: NV14 internal module version (NV14internalModuleFwVersion)
|
||||
|
||||
#if defined(AFHDS2)
|
||||
new StaticText(window, grid.getLabelSlot(), "RF FW:");
|
||||
sprintf(reusableBuffer.moduleSetup.msg, "%d.%d.%d", (int)((NV14internalModuleFwVersion >> 16) & 0xFF), (int)((NV14internalModuleFwVersion >> 8) & 0xFF), (int)(NV14internalModuleFwVersion & 0xFF));
|
||||
new StaticText(window, grid.getFieldSlot(), reusableBuffer.moduleSetup.msg);
|
||||
grid.nextLine();
|
||||
#endif
|
||||
#if defined(PXX2)
|
||||
// Module and receivers versions
|
||||
auto moduleVersions = new TextButton(window, grid.getLineSlot(), STR_MODULES_RX_VERSION);
|
||||
|
||||
Reference in New Issue
Block a user