Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditSystem.c @ 379:0dbf550dc743 MotionDetection
Added missing customerview selection
In the previous version only 6 out of 10 custom views could be configurated => Added a second page for the dive menu system tab
In case all views are deactivated the none / debug page will be set as default
| author | ideenmodellierer |
|---|---|
| date | Mon, 16 Sep 2019 22:49:34 +0200 |
| parents | 7b981f8bdd41 |
| children | 14fd5f35cb50 |
comparison
equal
deleted
inserted
replaced
| 378:834e087505ec | 379:0dbf550dc743 |
|---|---|
| 33 #include "externLogbookFlash.h" | 33 #include "externLogbookFlash.h" |
| 34 #include "gfx_fonts.h" | 34 #include "gfx_fonts.h" |
| 35 #include "ostc.h" | 35 #include "ostc.h" |
| 36 #include "settings.h" // for getLicence() | 36 #include "settings.h" // for getLicence() |
| 37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() | 37 #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() |
| 38 #include "tMenu.h" | |
| 38 #include "tMenuEdit.h" | 39 #include "tMenuEdit.h" |
| 40 #include "tMenuSystem.h" | |
| 39 #include "Motion.h" | 41 #include "Motion.h" |
| 40 | 42 #include "t7.h" |
| 43 | |
| 44 | |
| 45 #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */ | |
| 41 /* Private variables ---------------------------------------------------------*/ | 46 /* Private variables ---------------------------------------------------------*/ |
| 42 uint8_t infoPage = 0; | 47 static uint8_t infoPage = 0; |
| 48 | |
| 49 | |
| 43 | 50 |
| 44 /* Private function prototypes -----------------------------------------------*/ | 51 /* Private function prototypes -----------------------------------------------*/ |
| 45 void openEdit_DateTime(void); | 52 void openEdit_DateTime(void); |
| 46 void openEdit_Language(void); | 53 void openEdit_Language(void); |
| 47 void openEdit_Design(void); | 54 void openEdit_Design(void); |
| 148 | 155 |
| 149 /* Private functions ---------------------------------------------------------*/ | 156 /* Private functions ---------------------------------------------------------*/ |
| 150 | 157 |
| 151 void openEdit_CustomviewDivemode(uint8_t line) | 158 void openEdit_CustomviewDivemode(uint8_t line) |
| 152 { | 159 { |
| 160 static uint8_t customviewsSubpage = 0; | |
| 153 SSettings *pSettings = settingsGetPointer(); | 161 SSettings *pSettings = settingsGetPointer(); |
| 154 extern _Bool WriteSettings; | 162 extern _Bool WriteSettings; |
| 155 | 163 char text[MAX_PAGE_TEXTSIZE]; |
| 156 pSettings->cv_configuration ^= 1 << (cv_changelist[line-1]); | 164 uint16_t tabPosition; |
| 157 WriteSettings = 1; | 165 uint32_t id; |
| 158 InitMotionDetection(); /* consider new view setup for view selection by motion */ | 166 |
| 159 exitMenuEdit_to_Menu_with_Menu_Update(); | 167 |
| 168 if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */ | |
| 169 { | |
| 170 customviewsSubpage++; | |
| 171 if(customviewsSubpage == CV_SUBPAGE_MAX) | |
| 172 { | |
| 173 customviewsSubpage = 0; | |
| 174 } | |
| 175 set_CustomsviewsSubpage(customviewsSubpage); | |
| 176 /* rebuild the selection page with the next set of customer views */ | |
| 177 id = tMSystem_refresh(0, text, &tabPosition, NULL); | |
| 178 tM_build_page(id, text, tabPosition, NULL); | |
| 179 openMenu(0); | |
| 180 } | |
| 181 else | |
| 182 { | |
| 183 pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]); | |
| 184 if(t7_GetEnabled_customviews() == 0) | |
| 185 { | |
| 186 pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug); | |
| 187 } | |
| 188 WriteSettings = 1; | |
| 189 InitMotionDetection(); /* consider new view setup for view selection by motion */ | |
| 190 exitMenuEdit_to_Menu_with_Menu_Update(); | |
| 191 } | |
| 160 } | 192 } |
| 161 | 193 |
| 162 | 194 |
| 163 void openEdit_DateTime(void) | 195 void openEdit_DateTime(void) |
| 164 { | 196 { |
