radio version: flex layout
This commit is contained in:
committed by
Raphael Coeffic
parent
e75ec459f1
commit
a8a9477343
@@ -41,179 +41,213 @@ char *getVersion(char *str, PXX2Version version)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class VersionDialog: public Dialog
|
static const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_FR(2),
|
||||||
|
LV_GRID_TEMPLATE_LAST};
|
||||||
|
static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
|
||||||
|
|
||||||
|
class VersionDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
StaticText* int_name;
|
||||||
VersionDialog(Window * parent, rect_t rect) :
|
StaticText* int_status;
|
||||||
Dialog(parent, STR_MODULES_RX_VERSION, rect)
|
Window* int_rx_line;
|
||||||
{
|
StaticText* int_rx_name;
|
||||||
memclear(&reusableBuffer.hardwareAndSettings.modules, sizeof(reusableBuffer.hardwareAndSettings.modules));
|
StaticText* int_rx_status;
|
||||||
reusableBuffer.hardwareAndSettings.updateTime = get_tmr10ms();
|
|
||||||
|
|
||||||
// Query modules
|
StaticText* ext_name;
|
||||||
if (isModulePXX2(INTERNAL_MODULE) && IS_INTERNAL_MODULE_ON()) {
|
StaticText* ext_status;
|
||||||
moduleState[INTERNAL_MODULE].readModuleInformation(&reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE], PXX2_HW_INFO_TX_ID, PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
Window* ext_rx_line;
|
||||||
}
|
StaticText* ext_rx_name;
|
||||||
|
StaticText* ext_rx_status;
|
||||||
|
|
||||||
|
public:
|
||||||
|
VersionDialog(Window *parent) :
|
||||||
|
Dialog(parent, STR_MODULES_RX_VERSION, rect_t{ 0, 0, 200, 100 })
|
||||||
|
{
|
||||||
|
memclear(&reusableBuffer.hardwareAndSettings.modules,
|
||||||
|
sizeof(reusableBuffer.hardwareAndSettings.modules));
|
||||||
|
reusableBuffer.hardwareAndSettings.updateTime = get_tmr10ms();
|
||||||
|
|
||||||
if (isModulePXX2(EXTERNAL_MODULE) && IS_EXTERNAL_MODULE_ON()) {
|
// Query modules
|
||||||
moduleState[EXTERNAL_MODULE].readModuleInformation(&reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE], PXX2_HW_INFO_TX_ID, PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
if (isModulePXX2(INTERNAL_MODULE) && IS_INTERNAL_MODULE_ON()) {
|
||||||
}
|
moduleState[INTERNAL_MODULE].readModuleInformation(
|
||||||
|
&reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE],
|
||||||
setCloseWhenClickOutside(true);
|
PXX2_HW_INFO_TX_ID, PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update()
|
if (isModulePXX2(EXTERNAL_MODULE) && IS_EXTERNAL_MODULE_ON()) {
|
||||||
{
|
moduleState[EXTERNAL_MODULE].readModuleInformation(
|
||||||
FormGroup * form = &content->form;
|
&reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE],
|
||||||
FormGridLayout grid(content->form.width());
|
PXX2_HW_INFO_TX_ID, PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
||||||
form->clear();
|
|
||||||
|
|
||||||
grid.setLabelWidth(100);
|
|
||||||
|
|
||||||
// Internal module
|
|
||||||
drawModuleVersion(form, &grid, INTERNAL_MODULE);
|
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
// external module
|
|
||||||
drawModuleVersion(form, &grid, EXTERNAL_MODULE);
|
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
// Exit
|
|
||||||
exitButton = new TextButton(form, grid.getLabelSlot(), "EXIT",
|
|
||||||
[=]() -> int8_t {
|
|
||||||
this->deleteLater();
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
// exitButton->setFocus(SET_FOCUS_DEFAULT);
|
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
grid.spacer(PAGE_PADDING);
|
|
||||||
form->setHeight(grid.getWindowHeight());
|
|
||||||
content->adjustHeight();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawModuleVersion(FormGroup * form, FormGridLayout *grid, uint8_t module)
|
setCloseWhenClickOutside(true);
|
||||||
{
|
|
||||||
char tmp[20];
|
|
||||||
|
|
||||||
// Module
|
auto form = &content->form;
|
||||||
if (module == INTERNAL_MODULE)
|
form->setFlexLayout();
|
||||||
new StaticText(form, grid->getLineSlot(), STR_INTERNAL_MODULE, 0, COLOR_THEME_PRIMARY1);
|
|
||||||
else
|
FlexGridLayout grid(col_dsc, row_dsc);
|
||||||
new StaticText(form, grid->getLineSlot(), STR_EXTERNAL_MODULE, 0, COLOR_THEME_PRIMARY1);
|
|
||||||
grid->nextLine();
|
|
||||||
|
|
||||||
new StaticText(form, grid->getLabelSlot(true), STR_MODULE, 0, COLOR_THEME_PRIMARY1);
|
new StaticText(form, rect_t{}, STR_INTERNAL_MODULE, 0, COLOR_THEME_PRIMARY1);
|
||||||
if (g_model.moduleData[module].type == MODULE_TYPE_NONE) {
|
|
||||||
new StaticText(form, grid->getFieldSlot(1, 0), STR_OFF, 0, COLOR_THEME_PRIMARY1);
|
auto line = form->newLine(&grid);
|
||||||
}
|
new StaticText(line, rect_t{}, STR_MODULE, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
int_name = new StaticText(line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
int_status = new StaticText(line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
|
int_rx_line = form->newLine(&grid);
|
||||||
|
new StaticText(int_rx_line, rect_t{}, STR_RECEIVER, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
int_rx_name = new StaticText(int_rx_line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
int_rx_status = new StaticText(int_rx_line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
lv_obj_add_flag(int_rx_line->getLvObj(), LV_OBJ_FLAG_HIDDEN);
|
||||||
|
|
||||||
|
new StaticText(form, rect_t{}, STR_EXTERNAL_MODULE, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
|
line = form->newLine(&grid);
|
||||||
|
new StaticText(line, rect_t{}, STR_MODULE, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
ext_name = new StaticText(line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
ext_status = new StaticText(line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
|
ext_rx_line = form->newLine(&grid);
|
||||||
|
new StaticText(ext_rx_line, rect_t{}, STR_RECEIVER, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
ext_rx_name = new StaticText(ext_rx_line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
ext_rx_status = new StaticText(ext_rx_line, rect_t{}, "", 0, COLOR_THEME_PRIMARY1);
|
||||||
|
lv_obj_add_flag(ext_rx_line->getLvObj(), LV_OBJ_FLAG_HIDDEN);
|
||||||
|
|
||||||
|
content->setWidth(LCD_W * 0.8);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void update()
|
||||||
|
{
|
||||||
|
updateModule(INTERNAL_MODULE, int_name, int_status, int_rx_line,
|
||||||
|
int_rx_name, int_rx_status);
|
||||||
|
updateModule(EXTERNAL_MODULE, ext_name, ext_status, ext_rx_line,
|
||||||
|
ext_rx_name, ext_rx_status);
|
||||||
|
content->updateSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateModule(uint8_t module, StaticText* name, StaticText* status,
|
||||||
|
Window* rx_line, StaticText* rx_name, StaticText* rx_status)
|
||||||
|
{
|
||||||
|
char tmp[20];
|
||||||
|
|
||||||
|
if (g_model.moduleData[module].type == MODULE_TYPE_NONE) {
|
||||||
|
name->setText(STR_OFF);
|
||||||
|
status->setText("");
|
||||||
|
}
|
||||||
#if defined(CROSSFIRE)
|
#if defined(CROSSFIRE)
|
||||||
else if (isModuleCrossfire(module)) {
|
else if (isModuleCrossfire(module)) {
|
||||||
char statusText[64] = "";
|
name->setText("CRSF");
|
||||||
new StaticText(form, grid->getFieldSlot(2, 0), "CRSF", 0, COLOR_THEME_PRIMARY1);
|
|
||||||
sprintf(statusText,"%d Hz %lu Err", 1000000 / getMixerSchedulerPeriod(), telemetryErrors);
|
char statusText[64];
|
||||||
new StaticText(form, grid->getFieldSlot(2, 1), statusText, 0, COLOR_THEME_PRIMARY1);
|
auto hz = 1000000 / getMixerSchedulerPeriod();
|
||||||
}
|
snprintf(statusText, 64, "%d Hz %lu Err", hz, telemetryErrors);
|
||||||
|
status->setText(statusText);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(MULTIMODULE)
|
#if defined(MULTIMODULE)
|
||||||
else if (isModuleMultimodule(module)) {
|
else if (isModuleMultimodule(module)) {
|
||||||
char statusText[64] = "";
|
name->setText("Multimodule");
|
||||||
new StaticText(form, grid->getFieldSlot(2, 0), "Multimodule", 0, COLOR_THEME_PRIMARY1);
|
|
||||||
getMultiModuleStatus(module).getStatusString(statusText);
|
char statusText[64] = "";
|
||||||
new StaticText(form, grid->getFieldSlot(2, 1), statusText, 0, COLOR_THEME_PRIMARY1);
|
getMultiModuleStatus(module).getStatusString(statusText);
|
||||||
}
|
status->setText(statusText);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!isModulePXX2(module)) {
|
#if defined(PXX2)
|
||||||
new StaticText(form, grid->getFieldSlot(1, 0), STR_NO_INFORMATION, 0, COLOR_THEME_PRIMARY1);
|
else if (isModulePXX2(module)) {
|
||||||
|
|
||||||
|
// PXX2 Module
|
||||||
|
name->setText(getPXX2ModuleName(reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
|
.information.modelID));
|
||||||
|
|
||||||
|
std::string mod_ver;
|
||||||
|
if (reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
|
.information.modelID) {
|
||||||
|
|
||||||
|
mod_ver += getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
|
.information.hwVersion);
|
||||||
|
mod_ver += " / ";
|
||||||
|
mod_ver += getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
|
.information.swVersion);
|
||||||
|
|
||||||
|
static const char *variants[] = {"FCC", "EU", "FLEX"};
|
||||||
|
uint8_t variant = reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
|
.information.variant - 1;
|
||||||
|
if (variant < DIM(variants)) {
|
||||||
|
mod_ver += " ";
|
||||||
|
mod_ver += variants[variant];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
status->setText(mod_ver);
|
||||||
// PXX2 Module
|
|
||||||
new StaticText(form, grid->getFieldSlot(4, 0), getPXX2ModuleName(reusableBuffer.hardwareAndSettings.modules[module].information.modelID), 0, COLOR_THEME_PRIMARY1);
|
// PXX2 Receivers
|
||||||
if (reusableBuffer.hardwareAndSettings.modules[module].information.modelID) {
|
std::string rx_n;
|
||||||
new StaticText(form, grid->getFieldSlot(4, 1), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].information.hwVersion), 0, COLOR_THEME_PRIMARY1);
|
std::string rx_ver;
|
||||||
new StaticText(form, grid->getFieldSlot(4, 2), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].information.swVersion), 0, COLOR_THEME_PRIMARY1);
|
|
||||||
static const char * variants[] = {"FCC", "EU", "FLEX"};
|
for (uint8_t receiver = 0; receiver < PXX2_MAX_RECEIVERS_PER_MODULE; receiver++) {
|
||||||
uint8_t variant = reusableBuffer.hardwareAndSettings.modules[module].information.variant - 1;
|
if (reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
if (variant < DIM(variants)) {
|
.receivers[receiver]
|
||||||
new StaticText(form, grid->getFieldSlot(4, 3), variants[variant], 0, COLOR_THEME_PRIMARY1);
|
.information.modelID) {
|
||||||
|
|
||||||
|
if (!rx_ver.empty()){
|
||||||
|
rx_n += "\n";
|
||||||
|
rx_ver += "\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
grid->nextLine();
|
// Receiver model
|
||||||
|
uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
|
.receivers[receiver]
|
||||||
|
.information.modelID;
|
||||||
|
rx_n += getPXX2ReceiverName(modelId);
|
||||||
|
|
||||||
// PXX2 Receivers
|
// Receiver version
|
||||||
for (uint8_t receiver=0; receiver<PXX2_MAX_RECEIVERS_PER_MODULE; receiver++) {
|
rx_ver += getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
if (reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.modelID) {
|
.receivers[receiver]
|
||||||
// Receiver model
|
.information.hwVersion);
|
||||||
new StaticText(form, grid->getLabelSlot(true), STR_RECEIVER, 0, COLOR_THEME_PRIMARY1);
|
rx_ver += " / ";
|
||||||
uint8_t modelId = reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.modelID;
|
rx_ver += getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module]
|
||||||
new StaticText(form, grid->getFieldSlot(4, 0), getPXX2ReceiverName(modelId), 0, COLOR_THEME_PRIMARY1);
|
.receivers[receiver]
|
||||||
|
.information.swVersion);
|
||||||
// Receiver version
|
|
||||||
new StaticText(form, grid->getFieldSlot(4, 1), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.hwVersion), 0, COLOR_THEME_PRIMARY1);
|
|
||||||
new StaticText(form, grid->getFieldSlot(4, 2), getVersion(tmp, reusableBuffer.hardwareAndSettings.modules[module].receivers[receiver].information.swVersion), 0, COLOR_THEME_PRIMARY1);
|
|
||||||
grid->nextLine();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!rx_n.empty() && !rx_ver.empty()) {
|
||||||
|
// unhide RX labels
|
||||||
|
lv_obj_clear_flag(rx_line->getLvObj(), LV_OBJ_FLAG_HIDDEN);
|
||||||
|
rx_name->setText(rx_n);
|
||||||
|
rx_status->setText(rx_ver);
|
||||||
|
} else {
|
||||||
|
// hide RX labels
|
||||||
|
lv_obj_add_flag(rx_line->getLvObj(), LV_OBJ_FLAG_HIDDEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
void checkEvents() override
|
else {
|
||||||
{
|
name->setText(STR_NO_INFORMATION);
|
||||||
if (get_tmr10ms() >= reusableBuffer.hardwareAndSettings.updateTime) {
|
status->setText("");
|
||||||
// Query modules
|
|
||||||
if (isModulePXX2(INTERNAL_MODULE) && IS_INTERNAL_MODULE_ON()) {
|
|
||||||
moduleState[INTERNAL_MODULE].readModuleInformation(&reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE], PXX2_HW_INFO_TX_ID,
|
|
||||||
PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
|
||||||
}
|
|
||||||
if (isModulePXX2(EXTERNAL_MODULE) && IS_EXTERNAL_MODULE_ON()) {
|
|
||||||
moduleState[EXTERNAL_MODULE].readModuleInformation(&reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE], PXX2_HW_INFO_TX_ID,
|
|
||||||
PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
|
||||||
}
|
|
||||||
reusableBuffer.hardwareAndSettings.updateTime = get_tmr10ms() + 500 /* 5s*/;
|
|
||||||
}
|
|
||||||
update();
|
|
||||||
Dialog::checkEvents();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
void checkEvents() override
|
||||||
rect_t rect;
|
{
|
||||||
TextButton * exitButton;
|
if (get_tmr10ms() >= reusableBuffer.hardwareAndSettings.updateTime) {
|
||||||
};
|
// Query modules
|
||||||
|
if (isModulePXX2(INTERNAL_MODULE) && IS_INTERNAL_MODULE_ON()) {
|
||||||
class OptionsText: public StaticText {
|
moduleState[INTERNAL_MODULE].readModuleInformation(
|
||||||
public:
|
&reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE],
|
||||||
OptionsText(Window * parent, const rect_t &rect) :
|
PXX2_HW_INFO_TX_ID, PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
||||||
StaticText(parent, rect, "", 0, COLOR_THEME_PRIMARY1)
|
|
||||||
{
|
|
||||||
coord_t optionWidth = 0;
|
|
||||||
for (uint8_t i = 0; options[i]; i++) {
|
|
||||||
const char * option = options[i];
|
|
||||||
optionWidth += getTextWidth(option);
|
|
||||||
if (optionWidth + 5 > width()) {
|
|
||||||
setHeight(height() + 20);
|
|
||||||
optionWidth = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
if (isModulePXX2(EXTERNAL_MODULE) && IS_EXTERNAL_MODULE_ON()) {
|
||||||
|
moduleState[EXTERNAL_MODULE].readModuleInformation(
|
||||||
void paint(BitmapBuffer * dc) override
|
&reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE],
|
||||||
{
|
PXX2_HW_INFO_TX_ID, PXX2_MAX_RECEIVERS_PER_MODULE - 1);
|
||||||
coord_t y = 2;
|
|
||||||
coord_t x = 0;
|
|
||||||
for (uint8_t i = 0; options[i]; i++) {
|
|
||||||
const char * option = options[i];
|
|
||||||
coord_t optionWidth = getTextWidth(option);
|
|
||||||
if (x + 5 + optionWidth > width()) {
|
|
||||||
dc->drawText(x, y, ",", COLOR_THEME_PRIMARY1);
|
|
||||||
x = 0;
|
|
||||||
y += FH;
|
|
||||||
}
|
|
||||||
if (i > 0 && x != 0)
|
|
||||||
x = dc->drawText(x, y, ", ", COLOR_THEME_PRIMARY1);
|
|
||||||
x = dc->drawText(x, y, option, COLOR_THEME_PRIMARY1);
|
|
||||||
}
|
}
|
||||||
|
reusableBuffer.hardwareAndSettings.updateTime = get_tmr10ms() + 500 /* 5s*/;
|
||||||
}
|
}
|
||||||
|
update();
|
||||||
|
Dialog::checkEvents();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
RadioVersionPage::RadioVersionPage():
|
RadioVersionPage::RadioVersionPage():
|
||||||
@@ -221,65 +255,55 @@ RadioVersionPage::RadioVersionPage():
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
extern uint32_t NV14internalModuleFwVersion;
|
|
||||||
#if defined(PCBNV14)
|
#if defined(PCBNV14)
|
||||||
|
extern uint32_t NV14internalModuleFwVersion;
|
||||||
extern const char* boardLcdType;
|
extern const char* boardLcdType;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void RadioVersionPage::build(FormWindow * window)
|
void RadioVersionPage::build(FormWindow * window)
|
||||||
{
|
{
|
||||||
FormGridLayout grid;
|
window->setFlexLayout(LV_FLEX_FLOW_COLUMN, lv_dpx(8));
|
||||||
grid.setLabelWidth(60);
|
lv_obj_set_style_pad_all(window->getLvObj(), lv_dpx(8), 0);
|
||||||
grid.spacer(PAGE_PADDING);
|
|
||||||
|
|
||||||
// Radio type
|
std::string nl("\n");
|
||||||
new StaticText(window, grid.getLineSlot(), fw_stamp, 0, COLOR_THEME_PRIMARY1);
|
std::string version;
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
// Firmware version
|
version += fw_stamp + nl;
|
||||||
new StaticText(window, grid.getLineSlot(), vers_stamp, 0, COLOR_THEME_PRIMARY1);
|
version += vers_stamp + nl;
|
||||||
grid.nextLine();
|
version += date_stamp + nl;
|
||||||
|
version += time_stamp + nl;
|
||||||
|
version += cfgv_stamp + nl;
|
||||||
|
version += "OPTS: ";
|
||||||
|
|
||||||
// Firmware date
|
for (uint8_t i = 0; options[i]; i++) {
|
||||||
new StaticText(window, grid.getLineSlot(), date_stamp, 0, COLOR_THEME_PRIMARY1);
|
if (i > 0) version += ", ";
|
||||||
grid.nextLine();
|
version += options[i];
|
||||||
|
}
|
||||||
// Firmware time
|
|
||||||
new StaticText(window, grid.getLineSlot(), time_stamp, 0, COLOR_THEME_PRIMARY1);
|
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
// Configuration version
|
|
||||||
new StaticText(window, grid.getLineSlot(), cfgv_stamp, 0, COLOR_THEME_PRIMARY1);
|
|
||||||
grid.nextLine();
|
|
||||||
|
|
||||||
// Firmware options
|
|
||||||
new StaticText(window, grid.getLabelSlot(), "OPTS:", 0, COLOR_THEME_PRIMARY1);
|
|
||||||
auto options = new OptionsText(window, grid.getFieldSlot(1,0));
|
|
||||||
grid.nextLine(options->height() + 4);
|
|
||||||
|
|
||||||
#if defined(PCBNV14) && !defined(SIMU)
|
#if defined(PCBNV14) && !defined(SIMU)
|
||||||
new StaticText(window, grid.getLabelSlot(), "LCD:");
|
version += nl;
|
||||||
new StaticText(window, grid.getFieldSlot(), boardLcdType);
|
version += "LCD: ";
|
||||||
grid.nextLine();
|
version += boardLcdType;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(AFHDS2)
|
#if defined(AFHDS2)
|
||||||
new StaticText(window, grid.getLabelSlot(), "RF FW:");
|
version += nl;
|
||||||
|
version += "RF FW: ";
|
||||||
sprintf(reusableBuffer.moduleSetup.msg, "%d.%d.%d",
|
sprintf(reusableBuffer.moduleSetup.msg, "%d.%d.%d",
|
||||||
(int)((NV14internalModuleFwVersion >> 16) & 0xFF),
|
(int)((NV14internalModuleFwVersion >> 16) & 0xFF),
|
||||||
(int)((NV14internalModuleFwVersion >> 8) & 0xFF),
|
(int)((NV14internalModuleFwVersion >> 8) & 0xFF),
|
||||||
(int)(NV14internalModuleFwVersion & 0xFF));
|
(int)(NV14internalModuleFwVersion & 0xFF));
|
||||||
new StaticText(window, grid.getFieldSlot(), reusableBuffer.moduleSetup.msg);
|
version += reusableBuffer.moduleSetup.msg;
|
||||||
grid.nextLine();
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX2)
|
auto txt = new StaticText(window, rect_t{}, version, 0, COLOR_THEME_PRIMARY1);
|
||||||
|
lv_obj_set_width(txt->getLvObj(), lv_pct(100));
|
||||||
|
|
||||||
// Module and receivers versions
|
// Module and receivers versions
|
||||||
auto moduleVersions =
|
auto btn = new TextButton(window, rect_t{}, STR_MODULES_RX_VERSION);
|
||||||
new TextButton(window, grid.getLineSlot(), STR_MODULES_RX_VERSION);
|
btn->setPressHandler([=]() -> uint8_t {
|
||||||
moduleVersions->setPressHandler([=]() -> uint8_t {
|
new VersionDialog(window);
|
||||||
new VersionDialog(window, {50, 30, LCD_W - 100, 0});
|
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
#endif
|
lv_obj_set_width(btn->getLvObj(), lv_pct(100));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user