comparison Discovery/Src/tMenuCvOption.c @ 999:ac25c35a3c97 GasConsumption

New Tab for dynamic configuration: since more and more functions are added to the OSTC the space in the menus is getting short. To avoid problems a new Tab within the SYS menu has been added which shall focus an functions / views which are configuration dependend. In future this menu may have dynamic content dependend on which views are active or which sensors are connected. The Cview for compass and Timer have been moved to the new tab in the first step
author Ideenmodellierer
date Mon, 28 Apr 2025 19:47:41 +0200
parents
children 21142f4fa968
comparison
equal deleted inserted replaced
998:5a690195b6b7 999:ac25c35a3c97
1 ///////////////////////////////////////////////////////////////////////////////
2 /// -*- coding: UTF-8 -*-
3 ///
4 /// \file Discovery/Src/tMenuCvOption.c
5 /// \brief Main Template file for Menu Page System settings
6 /// \author heinrichs weikamp gmbh
7 /// \date 24-Apr-2025
8 ///
9 /// \details
10 ///
11 /// $Id$
12 ///////////////////////////////////////////////////////////////////////////////
13 /// \par Copyright (c) 2014-2025 Heinrichs Weikamp gmbh
14 ///
15 /// This program is free software: you can redistribute it and/or modify
16 /// it under the terms of the GNU General Public License as published by
17 /// the Free Software Foundation, either version 3 of the License, or
18 /// (at your option) any later version.
19 ///
20 /// This program is distributed in the hope that it will be useful,
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 /// GNU General Public License for more details.
24 ///
25 /// You should have received a copy of the GNU General Public License
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
27 //////////////////////////////////////////////////////////////////////////////
28
29 /* Includes ------------------------------------------------------------------*/
30 #include "tMenu.h"
31 #include "tMenuCvOption.h"
32 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass()
33 #include "t7.h"
34
35 /* Private function prototypes -----------------------------------------------*/
36
37 /* Exported functions --------------------------------------------------------*/
38
39 uint32_t tMCvOption_refresh(uint8_t line, char *text, uint16_t *tab, char *subtext)
40 {
41 SSettings *data;
42 uint8_t textPointer;
43
44 data = settingsGetPointer();
45 textPointer = 0;
46 *tab = 300;
47 *subtext = 0;
48
49 resetLineMask(StMOption);
50
51 if((line == 0) || (line == 1))
52 {
53 text[textPointer++] = TXT_2BYTE;
54 text[textPointer++] = TXT2BYTE_Compass;
55 text[textPointer++] = '\t';
56
57 if(settingsGetPointer()->compassBearing != 0)
58 {
59 textPointer += snprintf(&text[textPointer], 20, "(%03u`)", settingsGetPointer()->compassBearing % 360);
60 }
61 text[textPointer] = 0;
62 }
63 nextline(text,&textPointer);
64 if (line == 0 || line == 2)
65 {
66 if(t7_customview_disabled(CVIEW_Timer))
67 {
68 text[textPointer++] = '\031'; /* change text color */
69 textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60);
70 disableLine(StMOption_Timer);
71 text[textPointer++] = '\020'; /* restore text color */
72 }
73 else
74 {
75 textPointer += snprintf(&text[textPointer], 21, "%c%c\t%u:%02u \016\016[m:ss]\017", TXT_2BYTE, TXT2BYTE_Timer, data->timerDurationS / 60, data->timerDurationS % 60);
76 }
77 }
78 nextline(text,&textPointer);
79
80 return StMOption;
81 }
82 void tMCvOption_checkLineStatus(void)
83 {
84 uint8_t localLineMask = 0;
85 uint8_t lineMask = getLineMask(StMSYS);
86 #if 0
87 if(t7_customview_disabled(CVIEW_Timer))
88 {
89 localLineMask |= 1 << 2;
90 }
91 #endif
92 if(lineMask != localLineMask)
93 {
94 updateMenu();
95 }
96 }
97
98 /* Private functions ---------------------------------------------------------*/