From d8d12f0185783cb166e62b0c1c3b9f6e5e6b9afc Mon Sep 17 00:00:00 2001 From: bsongis Date: Sun, 14 Dec 2014 20:08:55 +0100 Subject: [PATCH] MenuModel split - 8th part --- .../opentx/opentxGruvin9xsimulator.cpp | 1 + .../firmwares/opentx/opentxM128simulator.cpp | 1 + .../firmwares/opentx/opentxM64simulator.cpp | 1 + .../firmwares/opentx/opentxSky9xsimulator.cpp | 1 + radio/src/Makefile | 1 + radio/src/gui/menu_model.cpp | 29 --------- radio/src/gui/menu_model_templates.cpp | 65 +++++++++++++++++++ 7 files changed, 70 insertions(+), 29 deletions(-) create mode 100755 radio/src/gui/menu_model_templates.cpp diff --git a/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp b/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp index 232713199..4500892ce 100644 --- a/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp @@ -85,6 +85,7 @@ namespace Open9xGruvin9x { #include "radio/src/gui/menu_model_curves.cpp" #include "radio/src/gui/menu_model_limits.cpp" #include "radio/src/gui/menu_model_telemetry.cpp" +#include "radio/src/gui/menu_model_templates.cpp" #include "radio/src/gui/menu_general.cpp" #include "radio/src/gui/view_main.cpp" #include "radio/src/gui/view_statistics.cpp" diff --git a/companion/src/firmwares/opentx/opentxM128simulator.cpp b/companion/src/firmwares/opentx/opentxM128simulator.cpp index d5900e869..d930f2ebc 100644 --- a/companion/src/firmwares/opentx/opentxM128simulator.cpp +++ b/companion/src/firmwares/opentx/opentxM128simulator.cpp @@ -86,6 +86,7 @@ namespace OpenTxM128 { #include "radio/src/gui/menu_model_custom_functions.cpp" #include "radio/src/gui/menu_model_limits.cpp" #include "radio/src/gui/menu_model_telemetry.cpp" +#include "radio/src/gui/menu_model_templates.cpp" #include "radio/src/gui/menu_general.cpp" #include "radio/src/gui/view_main.cpp" #include "radio/src/gui/view_statistics.cpp" diff --git a/companion/src/firmwares/opentx/opentxM64simulator.cpp b/companion/src/firmwares/opentx/opentxM64simulator.cpp index 073fe1533..78d1620d9 100644 --- a/companion/src/firmwares/opentx/opentxM64simulator.cpp +++ b/companion/src/firmwares/opentx/opentxM64simulator.cpp @@ -91,6 +91,7 @@ namespace OpenTxM64 { #include "radio/src/gui/menu_model_custom_functions.cpp" #include "radio/src/gui/menu_model_limits.cpp" #include "radio/src/gui/menu_model_telemetry.cpp" +#include "radio/src/gui/menu_model_templates.cpp" #include "radio/src/gui/menu_general.cpp" #include "radio/src/gui/view_main.cpp" #include "radio/src/gui/view_statistics.cpp" diff --git a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp index 551e0a8c2..df71ff328 100644 --- a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp @@ -100,6 +100,7 @@ namespace Open9xSky9x { #include "radio/src/gui/menu_model_custom_functions.cpp" #include "radio/src/gui/menu_model_limits.cpp" #include "radio/src/gui/menu_model_telemetry.cpp" +#include "radio/src/gui/menu_model_templates.cpp" #include "radio/src/gui/menu_general.cpp" #include "radio/src/gui/view_main.cpp" #include "radio/src/gui/view_statistics.cpp" diff --git a/radio/src/Makefile b/radio/src/Makefile index 7f74f0841..bc7e5dedf 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -1174,6 +1174,7 @@ ifeq ($(TEMPLATES), YES) ifneq ($(PCB), $(filter $(PCB), TARANIS)) CPPDEFS += -DTEMPLATES CPPSRC += templates.cpp + GUIMODELSRC += gui/menu_model_templates.cpp endif endif diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index bf887c71d..da3bb94df 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -264,33 +264,4 @@ void editSingleName(coord_t x, coord_t y, const pm_char *label, char *name, uint static uint8_t s_currIdx; -#if defined(TEMPLATES) -void menuModelTemplates(uint8_t event) -{ - SIMPLE_MENU(STR_MENUTEMPLATES, menuTabModel, e_Templates, 1+TMPL_COUNT); - - uint8_t sub = m_posVert - 1; - - if (sub < TMPL_COUNT) { - if (s_warning_result) { - s_warning_result = 0; - applyTemplate(sub); - AUDIO_WARNING2(); - } - if (event==EVT_KEY_BREAK(KEY_ENTER)) { - POPUP_CONFIRMATION(STR_VTEMPLATES+1 + (sub * LEN2_VTEMPLATES)); - s_editMode = 0; - } - } - - coord_t y = MENU_TITLE_HEIGHT + 1; - uint8_t k = 0; - for (uint8_t i=0; i + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * 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" + +void menuModelTemplates(uint8_t event) +{ + SIMPLE_MENU(STR_MENUTEMPLATES, menuTabModel, e_Templates, 1+TMPL_COUNT); + + uint8_t sub = m_posVert - 1; + + if (sub < TMPL_COUNT) { + if (s_warning_result) { + s_warning_result = 0; + applyTemplate(sub); + AUDIO_WARNING2(); + } + if (event==EVT_KEY_BREAK(KEY_ENTER)) { + POPUP_CONFIRMATION(STR_VTEMPLATES+1 + (sub * LEN2_VTEMPLATES)); + s_editMode = 0; + } + } + + coord_t y = MENU_TITLE_HEIGHT + 1; + uint8_t k = 0; + for (uint8_t i=0; i