comparison Discovery/Src/tMenuEditCvOption.c @ 1071:b4a79464caf7 Icon_Integration

Dynamic menu creation for CV views: Because of the increasing features of the OSTC the maintenance of the the menus becomes difficult. Some are not available because of HW version or connected sensors. To keep the "legacy" menus stable the functionality of the cv options page has been increased. Based on enabled cv views and connected sensors the page will be filled dynamically. The page items allow quick acces to the view related options. For the first implementation the views: compass, timer, sensor O2 and sensor CO2 are supported.
author Ideenmodellierer
date Thu, 19 Feb 2026 13:28:37 +0100
parents 195bfbdf961d
children 734f84b72b30
comparison
equal deleted inserted replaced
1070:4499227a2db8 1071:b4a79464caf7
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
27 ////////////////////////////////////////////////////////////////////////////// 27 //////////////////////////////////////////////////////////////////////////////
28 28
29 /* Includes ------------------------------------------------------------------*/ 29 /* Includes ------------------------------------------------------------------*/
30 #include "tMenuEditCvOption.h" 30 #include "tMenuEditCvOption.h"
31 #include "tMenuCvOptionText.h"
31 #include "tMenuEdit.h" 32 #include "tMenuEdit.h"
32 33
33 #include "gfx_fonts.h" 34 #include "gfx_fonts.h"
34 #include "ostc.h" 35 #include "ostc.h"
35 #include "tMenuEdit.h" 36 #include "tMenuEdit.h"
36 #include "tHome.h" 37 #include "tHome.h"
37 38
38 #include "cv_heartbeat.h" 39 #include "cv_heartbeat.h"
40
41
42 static openFunc_t openFctPointerTable[MAXLINES]; /* function pointer for refresh */
39 43
40 /* Private function prototypes -----------------------------------------------*/ 44 /* Private function prototypes -----------------------------------------------*/
41 static void openEdit_Timer(void); 45 static void openEdit_Timer(void);
42 void openEdit_Compass(void); 46 void openEdit_Compass(void);
43 47
49 uint8_t OnAction_InertiaLevel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 53 uint8_t OnAction_InertiaLevel (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
50 static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); 54 static uint8_t OnAction_Timer(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
51 55
52 /* Exported functions --------------------------------------------------------*/ 56 /* Exported functions --------------------------------------------------------*/
53 57
58
59 void tMCvOption_SetOpenFnct(uint8_t cvOptId, uint8_t index)
60 {
61 if(index < MAXLINES)
62 {
63 switch(cvOptId)
64 {
65 case CVOPT_Compass: openFctPointerTable[index] = openEdit_Compass;
66 break;
67 case CVOPT_Timer: openFctPointerTable[index] = openEdit_Timer;
68 break;
69 case CVOPT_END: openFctPointerTable[index] = NULL;
70 break;
71 default: break;
72 }
73 }
74 }
75
76
54 void openEdit_CvOption(uint8_t line) 77 void openEdit_CvOption(uint8_t line)
55 { 78 {
56 set_globalState_Menu_Line(line); 79 if(openFctPointerTable[line - 1] != NULL)
57
58 switch(line)
59 { 80 {
60 case 1: 81 openFctPointerTable[line - 1]();
61 default: resetMenuEdit(CLUT_MenuPageHardware);
62 openEdit_Compass();
63 break;
64 case 2: openEdit_Timer();
65 break;
66 #ifdef ENABLE_PULSE_SENSOR_BT
67 case 3: openEdit_Heartbeat();
68 #endif
69 break;
70 } 82 }
71 } 83 }
72 84
73 /* Private functions ---------------------------------------------------------*/ 85 /* Private functions ---------------------------------------------------------*/
74 86