Mercurial > public > ostc4
comparison Discovery/Src/tMenu.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 | 8507a87f6401 |
| children | 21142f4fa968 |
comparison
equal
deleted
inserted
replaced
| 998:5a690195b6b7 | 999:ac25c35a3c97 |
|---|---|
| 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 "tMenuEditCvOption.h" | |
| 45 #include "tMenuGas.h" | 46 #include "tMenuGas.h" |
| 46 #include "tMenuHardware.h" | 47 #include "tMenuHardware.h" |
| 47 #include "tMenuPlanner.h" | 48 #include "tMenuPlanner.h" |
| 48 #include "tMenuSetpoint.h" | 49 #include "tMenuSetpoint.h" |
| 49 #include "tMenuSystem.h" | 50 #include "tMenuSystem.h" |
| 50 #include "tMenuXtra.h" | 51 #include "tMenuXtra.h" |
| 51 #include "tMenuCustom.h" | 52 #include "tMenuCustom.h" |
| 52 | 53 |
| 53 /* Private types -------------------------------------------------------------*/ | 54 /* Private types -------------------------------------------------------------*/ |
| 54 #define MAXPAGES 11 | 55 #define MAXPAGES 12 |
| 55 #define CURSOR_HIGH 25 | 56 #define CURSOR_HIGH 25 |
| 56 #define TAB_HEADER_HIGH 25 | 57 #define TAB_HEADER_HIGH 25 |
| 57 #define TAB_BAR_HIGH 5 | 58 #define TAB_BAR_HIGH 5 |
| 58 #define MENU_WDW_HIGH 390 | 59 #define MENU_WDW_HIGH 390 |
| 59 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */ | 60 #define KEY_LABEL_HIGH 25 /* Height of the label used for the the user keys */ |
| 61 | |
| 62 #define TAB_BAR_WIDTH 50 | |
| 63 #define TAB_BAR_SPACING 5 | |
| 60 | 64 |
| 61 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */ | 65 #define SLOW_UPDATE_CNT 10 /* Some content shall not be update in short intervals => add prescalar */ |
| 62 #define MAXLINES 6 | 66 #define MAXLINES 6 |
| 63 | 67 |
| 64 typedef struct | 68 typedef struct |
| 578 if(actual_menu_content == MENU_SURFACE) | 582 if(actual_menu_content == MENU_SURFACE) |
| 579 { | 583 { |
| 580 tM_add(StMDECO); | 584 tM_add(StMDECO); |
| 581 tM_add(StMHARD); | 585 tM_add(StMHARD); |
| 582 tM_add(StMCustom); | 586 tM_add(StMCustom); |
| 587 tM_add(StMOption); | |
| 583 // tM_add(StMSYS); now in both modes | 588 // tM_add(StMSYS); now in both modes |
| 584 } | 589 } |
| 585 else | 590 else |
| 586 { | 591 { |
| 587 tM_add(StMXTRA); | 592 tM_add(StMXTRA); |
| 646 | 651 |
| 647 id = tMSystem_refresh(0, text, &tabPosition, subtext); | 652 id = tMSystem_refresh(0, text, &tabPosition, subtext); |
| 648 tM_build_page(id, text, tabPosition, subtext); | 653 tM_build_page(id, text, tabPosition, subtext); |
| 649 | 654 |
| 650 id = tMCustom_refresh(0, text, &tabPosition, subtext); | 655 id = tMCustom_refresh(0, text, &tabPosition, subtext); |
| 656 tM_build_page(id, text, tabPosition, subtext); | |
| 657 | |
| 658 id = tMCvOption_refresh(0, text, &tabPosition, subtext); | |
| 651 tM_build_page(id, text, tabPosition, subtext); | 659 tM_build_page(id, text, tabPosition, subtext); |
| 652 } | 660 } |
| 653 | 661 |
| 654 | 662 |
| 655 void tM_refresh_live_content(void) | 663 void tM_refresh_live_content(void) |
| 1151 openEdit_System(line); | 1159 openEdit_System(line); |
| 1152 break; | 1160 break; |
| 1153 case StMCustom: | 1161 case StMCustom: |
| 1154 openEdit_Custom(line); | 1162 openEdit_Custom(line); |
| 1155 break; | 1163 break; |
| 1164 case StMOption: | |
| 1165 openEdit_CvOption(line); | |
| 1166 break; | |
| 1156 default: | 1167 default: |
| 1157 break; | 1168 break; |
| 1158 } | 1169 } |
| 1159 } | 1170 } |
| 1160 | 1171 |
| 1348 | 1359 |
| 1349 char text8max[MAXPAGES+1][8] = | 1360 char text8max[MAXPAGES+1][8] = |
| 1350 { "", | 1361 { "", |
| 1351 "OC", | 1362 "OC", |
| 1352 "CC", | 1363 "CC", |
| 1353 "SP", | 1364 "", |
| 1354 "DATA", | 1365 "DATA", |
| 1355 "DECO", | 1366 "DECO", |
| 1356 "", | 1367 "", |
| 1357 "SYS", | 1368 "SYS", |
| 1358 "", | 1369 "", |
| 1359 "", | 1370 "", |
| 1371 "", | |
| 1360 "SIM" | 1372 "SIM" |
| 1361 }; | 1373 }; |
| 1362 | 1374 |
| 1363 _Bool spacing[MAXPAGES+1] = | 1375 _Bool spacing[MAXPAGES+1] = |
| 1364 { 0, | 1376 { 0, |
| 1365 0, // behind OC | 1377 1, // behind OC |
| 1366 0, // behind CC | 1378 0, // behind CC |
| 1367 1, // behind SP | 1379 1, // behind SP |
| 1368 1, // behind DATA | 1380 1, // behind DATA |
| 1369 0, // behind DECO1 | 1381 0, // behind DECO1 |
| 1370 1, // behind DECO2 | 1382 1, // behind DECO2 |
| 1371 0, // behind SYS1 | 1383 0, // behind SYS1 |
| 1372 0, // behind SYS2 | 1384 0, // behind SYS2 |
| 1373 1, // behind SYS3 | 1385 0, // behind SYS3 |
| 1386 1, // behind SYS4 | |
| 1374 1, // behind SIM | 1387 1, // behind SIM |
| 1375 0 | 1388 0 |
| 1376 }; | 1389 }; |
| 1377 | 1390 |
| 1378 if(actual_menu_content == MENU_SURFACE) | 1391 if(actual_menu_content == MENU_SURFACE) |
| 1379 { | 1392 { |
| 1380 spacing[3] = 0; /* Display extra menu directly after setpoint */ | 1393 spacing[3] = 0; /* Display extra menu directly after setpoint */ |
| 1381 sprintf(text8max[4],"OP"); | 1394 memset(text8max[4],0,8); |
| 1382 } | 1395 } |
| 1383 | 1396 |
| 1384 pBackup = tMscreen.FBStartAdress; | 1397 pBackup = tMscreen.FBStartAdress; |
| 1385 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; | 1398 tMscreen.FBStartAdress = menu.StartAddressForPage[page]; |
| 1386 pDestination = (uint16_t*) menu.StartAddressForPage[page]; | 1399 pDestination = (uint16_t*) menu.StartAddressForPage[page]; |
| 1428 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k-1],colorText); | 1441 write_content_simple(&tMscreen,positionText,775,0,&FontT42,text8max[k-1],colorText); |
| 1429 */ | 1442 */ |
| 1430 /* Draw color bars */ | 1443 /* Draw color bars */ |
| 1431 if(!settingsGetPointer()->FlipDisplay) | 1444 if(!settingsGetPointer()->FlipDisplay) |
| 1432 { | 1445 { |
| 1433 pDestination += 5 * 480; | 1446 pDestination += TAB_BAR_SPACING * 480; |
| 1434 | 1447 |
| 1435 for(j = 60; j > 0; j--) | 1448 for(j = TAB_BAR_WIDTH; j > 0; j--) |
| 1436 { | 1449 { |
| 1437 pDestination += (390 + 26); | 1450 pDestination += (390 + 26); |
| 1438 | 1451 |
| 1439 for(i = 16; i > 0; i--) | 1452 for(i = 16; i > 0; i--) |
| 1440 { | 1453 { |
| 1441 *(__IO uint16_t*)pDestination++ = color_top.al88; | 1454 *(__IO uint16_t*)pDestination++ = color_top.al88; |
| 1442 } | 1455 } |
| 1443 pDestination += 48; | 1456 pDestination += 48; |
| 1444 } | 1457 } |
| 1445 | 1458 |
| 1446 pDestination += 5 * 480; | 1459 pDestination += TAB_BAR_SPACING * 480; |
| 1447 positionText += 70; | 1460 positionText += TAB_BAR_WIDTH + 2* TAB_BAR_SPACING; |
| 1448 | 1461 |
| 1449 if(((k == 4) && (actual_menu_content != MENU_SURFACE)) || ((k == 6) && (menu.pageCountNumber[5] == 0))) | 1462 if(((k == 4) && (actual_menu_content != MENU_SURFACE)) || ((k == 6) && (menu.pageCountNumber[5] == 0))) |
| 1450 { | 1463 { |
| 1451 pDestination += 70 * 480; | 1464 pDestination += (TAB_BAR_WIDTH + 2* TAB_BAR_SPACING) * 480; |
| 1452 positionText += 70; | 1465 positionText += TAB_BAR_WIDTH + 2* TAB_BAR_SPACING; |
| 1453 } | 1466 } |
| 1454 | 1467 |
| 1455 if(spacing[k]) | 1468 if(spacing[k]) |
| 1456 { | 1469 { |
| 1457 pDestination += 35 * 480; | 1470 pDestination += 35 * 480; |
