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));
|
GET_SET_DEFAULT(g_model.trainerData.pulsePol));
|
||||||
grid.nextLine();
|
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:
|
protected:
|
||||||
@@ -789,18 +790,22 @@ class ModuleWindow : public FormGroup {
|
|||||||
clear();
|
clear();
|
||||||
|
|
||||||
// Module Type
|
// Module Type
|
||||||
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(this, grid.getLabelSlot(true), STR_MODE, 0,
|
||||||
moduleChoice = new Choice(this, grid.getFieldSlot(2, 0), STR_INTERNAL_MODULE_PROTOCOLS,
|
COLOR_THEME_PRIMARY1);
|
||||||
MODULE_TYPE_NONE, MODULE_TYPE_COUNT - 1,
|
moduleChoice = new Choice(
|
||||||
GET_DEFAULT(g_model.moduleData[moduleIdx].type),
|
this, grid.getFieldSlot(2, 0), STR_INTERNAL_MODULE_PROTOCOLS,
|
||||||
[=](int32_t newValue) {
|
MODULE_TYPE_NONE, MODULE_TYPE_COUNT - 1,
|
||||||
setModuleType(moduleIdx, newValue);
|
GET_DEFAULT(g_model.moduleData[moduleIdx].type),
|
||||||
update();
|
[=](int32_t newValue) {
|
||||||
moduleChoice->setFocus(SET_FOCUS_DEFAULT);
|
setModuleType(moduleIdx, newValue);
|
||||||
SET_DIRTY();
|
update();
|
||||||
});
|
moduleChoice->setFocus(SET_FOCUS_DEFAULT);
|
||||||
|
SET_DIRTY();
|
||||||
|
});
|
||||||
moduleChoice->setAvailableHandler([=](int8_t moduleType) {
|
moduleChoice->setAvailableHandler([=](int8_t moduleType) {
|
||||||
return moduleIdx == INTERNAL_MODULE ? isInternalModuleAvailable(moduleType) : isExternalModuleAvailable(moduleType);
|
return moduleIdx == INTERNAL_MODULE
|
||||||
|
? isInternalModuleAvailable(moduleType)
|
||||||
|
: isExternalModuleAvailable(moduleType);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Module parameters
|
// Module parameters
|
||||||
@@ -1392,7 +1397,9 @@ class ModuleWindow : public FormGroup {
|
|||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
getParent()->moveWindowsTop(top() + 1, adjustHeight());
|
auto par = getParent();
|
||||||
|
par->moveWindowsTop(top() + 1, adjustHeight());
|
||||||
|
par->adjustInnerHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkEvents() override
|
void checkEvents() override
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ RadioVersionPage::RadioVersionPage():
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern uint32_t NV14internalModuleFwVersion;
|
||||||
void RadioVersionPage::build(FormWindow * window)
|
void RadioVersionPage::build(FormWindow * window)
|
||||||
{
|
{
|
||||||
FormGridLayout grid;
|
FormGridLayout grid;
|
||||||
@@ -236,8 +237,12 @@ void RadioVersionPage::build(FormWindow * window)
|
|||||||
auto options = new OptionsText(window, grid.getFieldSlot(1,0));
|
auto options = new OptionsText(window, grid.getFieldSlot(1,0));
|
||||||
grid.nextLine(options->height() + 4);
|
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)
|
#if defined(PXX2)
|
||||||
// Module and receivers versions
|
// Module and receivers versions
|
||||||
auto moduleVersions = new TextButton(window, grid.getLineSlot(), STR_MODULES_RX_VERSION);
|
auto moduleVersions = new TextButton(window, grid.getLineSlot(), STR_MODULES_RX_VERSION);
|
||||||
|
|||||||
Reference in New Issue
Block a user