Placeholder for hardware diag pages

This commit is contained in:
3djc
2019-12-11 14:45:19 +01:00
parent b7d10dd339
commit 47b0cca0f5
6 changed files with 161 additions and 4 deletions
+2
View File
@@ -48,6 +48,8 @@ set(GUI_SRC
radio_trainer.cpp
radio_version.cpp
radio_hardware.cpp
radio_diagkeys.cpp
radio_diaganas.cpp
radio_calibration.cpp
view_main.cpp
menu_screen.cpp
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "opentx.h"
#include "radio_diaganas.h"
void RadioAnaDiagsPage::buildHeader(Window * window)
{
new StaticText(window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + 10, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, STR_MENU_RADIO_ANALOGS, 0, MENU_COLOR);
}
void RadioAnaDiagsPage::buildBody(Window * window)
{
}
RadioAnaDiagsPage::RadioAnaDiagsPage():
Page(ICON_MODEL_SETUP)
{
buildHeader(&header);
buildBody(&body);
setFocus();
}
+31
View File
@@ -0,0 +1,31 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "page.h"
class RadioAnaDiagsPage: public Page {
public:
explicit RadioAnaDiagsPage();
protected:
void buildHeader(Window * window);
void buildBody(Window * window);
};
+40
View File
@@ -0,0 +1,40 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "opentx.h"
#include "radio_diagkeys.h"
void RadioKeyDiagsPage::buildHeader(Window * window)
{
new StaticText(window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + 10, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, STR_MENU_RADIO_SWITCHES, 0, MENU_COLOR);
}
void RadioKeyDiagsPage::buildBody(Window * window)
{
}
RadioKeyDiagsPage::RadioKeyDiagsPage():
Page(ICON_MODEL_SETUP)
{
buildHeader(&header);
buildBody(&body);
setFocus();
}
+31
View File
@@ -0,0 +1,31 @@
/*
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "page.h"
class RadioKeyDiagsPage: public Page {
public:
explicit RadioKeyDiagsPage();
protected:
void buildHeader(Window * window);
void buildBody(Window * window);
};
+17 -4
View File
@@ -20,6 +20,8 @@
#include "radio_hardware.h"
#include "radio_calibration.h"
#include "radio_diagkeys.h"
#include "radio_diaganas.h"
#include "opentx.h"
#define SET_DIRTY() storageDirty(EE_GENERAL)
@@ -49,6 +51,8 @@ class RTCBattValue: public Window
lastValue = getRTCBatteryVoltage();
invalidate();
}
Window::checkEvents();
}
protected:
@@ -202,13 +206,22 @@ void RadioHardwarePage::build(FormWindow * window)
// Debugs
new StaticText(window, grid.getLabelSlot(), STR_DEBUG, 0, FONT(BOLD));
auto debugAnalogs = new TextButton(window, grid.getFieldSlot(2, 0), STR_ANALOGS_BTN);
debugAnalogs->setPressHandler([=]() -> uint8_t {
//TODO
auto debugAnas = new TextButton(window, grid.getFieldSlot(2, 0), STR_ANALOGS_BTN);
debugAnas->setPressHandler([=]() -> uint8_t {
auto debugAnasPage = new RadioAnaDiagsPage();
debugAnasPage->setCloseHandler([=]() {
calib->setFocus();
});
return 0;
});
auto debugKeys = new TextButton(window, grid.getFieldSlot(2, 1), STR_KEYS_BTN);
debugKeys->setPressHandler([=]() -> uint8_t {
//TODO
auto debugKeysPage = new RadioKeyDiagsPage();
debugKeysPage->setCloseHandler([=]() {
calib->setFocus();
});
return 0;
});
grid.nextLine();