diff --git a/radio/src/gui/colorlcd/CMakeLists.txt b/radio/src/gui/colorlcd/CMakeLists.txt index 8b0fd91d3..bed216b1c 100644 --- a/radio/src/gui/colorlcd/CMakeLists.txt +++ b/radio/src/gui/colorlcd/CMakeLists.txt @@ -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 diff --git a/radio/src/gui/colorlcd/radio_diaganas.cpp b/radio/src/gui/colorlcd/radio_diaganas.cpp new file mode 100644 index 000000000..f3ca49d15 --- /dev/null +++ b/radio/src/gui/colorlcd/radio_diaganas.cpp @@ -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(); +} diff --git a/radio/src/gui/colorlcd/radio_diaganas.h b/radio/src/gui/colorlcd/radio_diaganas.h new file mode 100644 index 000000000..6f8c2e4e3 --- /dev/null +++ b/radio/src/gui/colorlcd/radio_diaganas.h @@ -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); +}; + diff --git a/radio/src/gui/colorlcd/radio_diagkeys.cpp b/radio/src/gui/colorlcd/radio_diagkeys.cpp new file mode 100644 index 000000000..e56c9e80e --- /dev/null +++ b/radio/src/gui/colorlcd/radio_diagkeys.cpp @@ -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(); +} diff --git a/radio/src/gui/colorlcd/radio_diagkeys.h b/radio/src/gui/colorlcd/radio_diagkeys.h new file mode 100644 index 000000000..d142cab0b --- /dev/null +++ b/radio/src/gui/colorlcd/radio_diagkeys.h @@ -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); +}; + diff --git a/radio/src/gui/colorlcd/radio_hardware.cpp b/radio/src/gui/colorlcd/radio_hardware.cpp index 58f815c57..9010d0234 100644 --- a/radio/src/gui/colorlcd/radio_hardware.cpp +++ b/radio/src/gui/colorlcd/radio_hardware.cpp @@ -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();