Mercurial > public > ostc4
comparison Discovery/Src/tMenu.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 | 36fa1c44e597 |
| children | 734f84b72b30 |
comparison
equal
deleted
inserted
replaced
| 1070:4499227a2db8 | 1071:b4a79464caf7 |
|---|---|
| 40 #include "tMenuEditPlanner.h" | 40 #include "tMenuEditPlanner.h" |
| 41 #include "tMenuEditSetpoint.h" | 41 #include "tMenuEditSetpoint.h" |
| 42 #include "tMenuEditSystem.h" | 42 #include "tMenuEditSystem.h" |
| 43 #include "tMenuEditXtra.h" | 43 #include "tMenuEditXtra.h" |
| 44 #include "tMenuEditCustom.h" | 44 #include "tMenuEditCustom.h" |
| 45 #include "tMenuCvOptionText.h" | |
| 45 #include "tMenuEditCvOption.h" | 46 #include "tMenuEditCvOption.h" |
| 46 #include "tMenuGas.h" | 47 #include "tMenuGas.h" |
| 47 #include "tMenuHardware.h" | 48 #include "tMenuHardware.h" |
| 48 #include "tMenuPlanner.h" | 49 #include "tMenuPlanner.h" |
| 49 #include "tMenuSetpoint.h" | 50 #include "tMenuSetpoint.h" |
| 62 | 63 |
| 63 #define TAB_BAR_WIDTH 50 | 64 #define TAB_BAR_WIDTH 50 |
| 64 #define TAB_BAR_SPACING 5 | 65 #define TAB_BAR_SPACING 5 |
| 65 | 66 |
| 66 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */ | 67 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */ |
| 67 #define MAXLINES 6 | |
| 68 | 68 |
| 69 typedef struct | 69 typedef struct |
| 70 { | 70 { |
| 71 uint32_t StartAddressForPage[MAXPAGES+1]; | 71 uint32_t StartAddressForPage[MAXPAGES+1]; |
| 72 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1]; | 72 uint8_t lineMemoryForNavigationForPage[MAXPAGES+1]; |
| 654 tM_build_page(id, text, tabPosition, subtext); | 654 tM_build_page(id, text, tabPosition, subtext); |
| 655 | 655 |
| 656 id = tMCustom_refresh(0, text, &tabPosition, subtext); | 656 id = tMCustom_refresh(0, text, &tabPosition, subtext); |
| 657 tM_build_page(id, text, tabPosition, subtext); | 657 tM_build_page(id, text, tabPosition, subtext); |
| 658 | 658 |
| 659 tMCvOptText_BuildDynamicContentList(); | |
| 659 id = tMCvOption_refresh(0, text, &tabPosition, subtext); | 660 id = tMCvOption_refresh(0, text, &tabPosition, subtext); |
| 660 tM_build_page(id, text, tabPosition, subtext); | 661 tM_build_page(id, text, tabPosition, subtext); |
| 661 } | 662 } |
| 662 | 663 |
| 663 | 664 |
| 688 { | 689 { |
| 689 tMOG_refresh(0, text, &tabPosition, subtext); | 690 tMOG_refresh(0, text, &tabPosition, subtext); |
| 690 update_content_with_new_frame(page, text, tabPosition, subtext); | 691 update_content_with_new_frame(page, text, tabPosition, subtext); |
| 691 } | 692 } |
| 692 break; | 693 break; |
| 693 case StMCG: if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0)) | 694 case StMCG: |
| 695 #ifndef ENABLE_ADVANCED_GAS | |
| 696 if((actual_menu_content != MENU_SURFACE) && (slowUpdate == 0)) | |
| 697 #else | |
| 698 if(slowUpdate == 0) | |
| 699 #endif | |
| 694 { | 700 { |
| 695 tMCG_refresh(0, text, &tabPosition, subtext); | 701 tMCG_refresh(0, text, &tabPosition, subtext); |
| 696 update_content_with_new_frame(page, text, tabPosition, subtext); | 702 update_content_with_new_frame(page, text, tabPosition, subtext); |
| 697 } | 703 } |
| 704 break; | |
| 705 case StMOption: tMCvOption_refresh(0, text, &tabPosition, subtext); | |
| 706 update_content_with_new_frame(page, text, tabPosition, subtext); | |
| 698 break; | 707 break; |
| 699 default: | 708 default: |
| 700 break; | 709 break; |
| 701 } | 710 } |
| 702 if(slowUpdate == 0) | 711 if(slowUpdate == 0) |
