Mercurial > public > ostc4
changeset 520:970d8040c0e3
Moved custom view menu to new tab:
In previous version old location of custom views was kept for easier development. After establishing new tab the old implementation has been removed from MenuSystem unit.
author | Ideenmodellierer |
---|---|
date | Tue, 08 Sep 2020 21:24:14 +0200 |
parents | 2c49561c8062 |
children | e221cf762f45 |
files | Discovery/Src/tMenuEdit.c Discovery/Src/tMenuEditCustom.c Discovery/Src/tMenuEditSystem.c Discovery/Src/tMenuSystem.c |
diffstat | 4 files changed, 161 insertions(+), 574 deletions(-) [+] |
line wrap: on
line diff
--- a/Discovery/Src/tMenuEdit.c Sun Sep 06 22:11:51 2020 +0200 +++ b/Discovery/Src/tMenuEdit.c Tue Sep 08 21:24:14 2020 +0200 @@ -211,7 +211,7 @@ break; case (StMXTRA_CompassHeading & MaskFieldDigit): refreshFct = refresh_CompassHeading; break; - case (StMSYS5_Info & MaskFieldDigit): refreshFct = &refresh_InformationPage; + case (StMSYS4_Info & MaskFieldDigit): refreshFct = &refresh_InformationPage; break; case (StMPLAN5_ExitResult & MaskFieldDigit): refreshFct = refresh_PlanResult; break; @@ -220,8 +220,7 @@ break; case (StMSYS3_Units & MaskFieldDigit): refreshFct = refresh_Design; break; - case (StMCustom1_CViewTimeout & MaskFieldDigit): - case (StMSYS4_CViewTimeout & MaskFieldDigit): refreshFct = refresh_Customviews; + case (StMCustom1_CViewTimeout & MaskFieldDigit):refreshFct = refresh_Customviews; break; case (StMCustom2_CViewSelection1 & MaskFieldDigit) : case StMCustom2_CViewSelection2: @@ -229,7 +228,7 @@ case StMCustom2_CViewSelection4: case StMCustom2_CViewSelection5: case StMCustom2_CViewSelection6: - case (StMCustom2_BFSelection & MaskFieldDigit) : refreshFct = CustomviewDivemode2_refresh; + case (StMCustom2_BFSelection & MaskFieldDigit) : refreshFct = CustomviewDivemode_refresh; break; default: /* no menu has been updated */ break;
--- a/Discovery/Src/tMenuEditCustom.c Sun Sep 06 22:11:51 2020 +0200 +++ b/Discovery/Src/tMenuEditCustom.c Tue Sep 08 21:24:14 2020 +0200 @@ -40,26 +40,27 @@ #include "motion.h" #define CV_PER_PAGE (5u) /* number of cv selections shown at one page */ +#define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */ static uint8_t customviewsSubpage = 0; static uint8_t customviewsSubpageMax = 0; /* number of pages needed to display all selectable views */ static const uint8_t* pcv_curchangelist; /* Private function prototypes -----------------------------------------------*/ -void openEdit_Customview2(void); -void refresh_Customviews2(void); +void openEdit_Customview(void); +void refresh_Customviews(void); /* Announced function prototypes -----------------------------------------------*/ uint8_t OnAction_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); - - +uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); /* Exported functions --------------------------------------------------------*/ -void refresh_Customviews2(void) +void refresh_Customviews(void) { char text[32]; uint8_t textpointer = 0; @@ -262,21 +263,21 @@ { case 1: default: - openEdit_Customview2(); + openEdit_Customview(); break; case 2: - openEdit_CustomviewDivemode2(cv_changelist); + openEdit_CustomviewDivemode(cv_changelist); break; case 3: - openEdit_CustomviewDivemode2(cv_changelist_BS); + openEdit_CustomviewDivemode(cv_changelist_BS); break; } } /* Private functions ---------------------------------------------------------*/ -void openEdit_Customview2(void) +void openEdit_Customview(void) { - refresh_Customviews2(); + refresh_Customviews(); write_field_button(StMCustom1_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, ""); write_field_button(StMCustom1_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, ""); @@ -284,8 +285,8 @@ write_field_button(StMCustom1_CornerTimeout, 400, 700, ME_Y_LINE3, &FontT48, ""); write_field_button(StMCustom1_CornerStandard, 400, 700, ME_Y_LINE4, &FontT48, ""); -// write_field_button(StMCustom1_ExtraDisplay, 400, 700, ME_Y_LINE5, &FontT48, ""); -// write_field_button(StMCustom1_MotionCtrl, 400, 700, ME_Y_LINE6, &FontT48, ""); + write_field_button(StMCustom1_ExtraDisplay, 400, 700, ME_Y_LINE5, &FontT48, ""); + write_field_button(StMCustom1_MotionCtrl, 400, 700, ME_Y_LINE6, &FontT48, ""); setEvent(StMCustom1_CViewTimeout, (uint32_t)OnAction_CViewTimeout); setEvent(StMCustom1_CViewStandard, (uint32_t)OnAction_CViewStandard); @@ -293,11 +294,11 @@ setEvent(StMCustom1_CornerTimeout, (uint32_t)OnAction_CornerTimeout); setEvent(StMCustom1_CornerStandard, (uint32_t)OnAction_CornerStandard); -// setEvent(StMCustom1_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay); -// setEvent(StMCustom1_MotionCtrl, (uint32_t)OnAction_MotionCtrl); + setEvent(StMCustom1_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay); + setEvent(StMCustom1_MotionCtrl, (uint32_t)OnAction_MotionCtrl); } -char customview_TXT2BYTE_helper2(uint8_t customViewId) +char customview_TXT2BYTE_helper(uint8_t customViewId) { char text = 0; @@ -359,7 +360,7 @@ } -uint8_t OnAction_CViewTimeout2(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { uint8_t value; value = settingsGetPointer()->tX_customViewTimeout; @@ -386,7 +387,7 @@ } -uint8_t OnAction_CViewStandard2(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { uint8_t newValue; switch(settingsGetPointer()->tX_customViewPrimary) @@ -428,7 +429,7 @@ } -uint8_t OnAction_CornerTimeout2(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { uint8_t value; value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout; @@ -455,7 +456,7 @@ } -uint8_t OnAction_CornerStandard2(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { uint8_t value; value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; @@ -514,20 +515,19 @@ uint8_t OnAction_Customview_NextPage(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) { - uint8_t id_next = 0; customviewsSubpage++; if(customviewsSubpage == customviewsSubpageMax) { customviewsSubpage = 0; } resetMenuEdit(CLUT_MenuPageCustomView); /* rebuild page */ - openEdit_CustomviewDivemode2(pcv_curchangelist); + openEdit_CustomviewDivemode(pcv_curchangelist); tMenuEdit_select(StMCustom2_CViewSelection6); return UPDATE_DIVESETTINGS; } -void openEdit_CustomviewDivemode2(const uint8_t* pcv_changelist) +void openEdit_CustomviewDivemode(const uint8_t* pcv_changelist) { SSettings *pSettings = settingsGetPointer(); @@ -540,7 +540,7 @@ customviewsSubpageMax = (tHome_getNumberOfAvailableCVs(pcv_changelist) / CV_PER_PAGE) + 1; pcv_curchangelist = pcv_changelist; - CustomviewDivemode2_refresh(pcv_changelist); + CustomviewDivemode_refresh(pcv_changelist); text[0] = '\001'; @@ -568,7 +568,7 @@ text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_config_BigScreen,id); } text[textPointer++] = ' '; - textPointer += snprintf(&text[textPointer], 60, "%c%c\n\r", TXT_2BYTE, customview_TXT2BYTE_helper2(id)); + textPointer += snprintf(&text[textPointer], 60, "%c%c\n\r", TXT_2BYTE, customview_TXT2BYTE_helper(id)); switch(i) { @@ -653,8 +653,87 @@ write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); } +void openEdit_CustomviewDivemodeMenu(uint8_t line) +{ + static uint8_t customviewsSubpage = 0; + SSettings *pSettings = settingsGetPointer(); + extern _Bool WriteSettings; + char text[MAX_PAGE_TEXTSIZE]; + uint16_t tabPosition; + uint32_t id; -void CustomviewDivemode2_refresh() + + if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */ + { + customviewsSubpage++; + if(customviewsSubpage == CV_SUBPAGE_MAX) + { + customviewsSubpage = 0; + } + set_CustomsviewsSubpage(customviewsSubpage); + /* rebuild the selection page with the next set of customer views */ + id = tMSystem_refresh(0, text, &tabPosition, NULL); + tM_build_page(id, text, tabPosition, NULL); + openMenu(0); + } + else + { + pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]); + if(t7_GetEnabled_customviews() == 0) + { + pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug); + } + InitMotionDetection(); /* consider new view setup for view selection by motion */ + exitMenuEdit_to_Menu_with_Menu_Update(); + } +} + +uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + uint8_t newValue; + + newValue = settingsGetPointer()->extraDisplay + 1; + if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */ + { + newValue++; + } + if(newValue >= EXTRADISPLAY_END) + { + newValue = EXTRADISPLAY_none; + } + settingsGetPointer()->extraDisplay = newValue; + return UNSPECIFIC_RETURN; +} + + + +uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + uint8_t newValue; + switch(settingsGetPointer()->MotionDetection) + { + case MOTION_DETECT_OFF: + newValue = MOTION_DETECT_MOVE; + break; + case MOTION_DETECT_MOVE: + newValue = MOTION_DETECT_SECTOR; + break; + case MOTION_DETECT_SECTOR: + newValue = MOTION_DETECT_SCROLL; + break; + case MOTION_DETECT_SCROLL: + newValue = MOTION_DETECT_OFF; + break; + default: + newValue = MOTION_DETECT_OFF; + break; + } + settingsGetPointer()->MotionDetection = newValue; + InitMotionDetection(); + return UNSPECIFIC_RETURN; +} + +void CustomviewDivemode_refresh() { SSettings *pSettings = settingsGetPointer(); char text[MAX_PAGE_TEXTSIZE]; @@ -689,7 +768,7 @@ text[textPointer++] = '\006' - CHECK_BIT_THOME(pSettings->cv_config_BigScreen,id); } text[textPointer++] = ' '; - textPointer += snprintf(&text[textPointer], 60, "%c%c\n\r", TXT_2BYTE, customview_TXT2BYTE_helper2(id)); + textPointer += snprintf(&text[textPointer], 60, "%c%c\n\r", TXT_2BYTE, customview_TXT2BYTE_helper(id)); switch(i) {
--- a/Discovery/Src/tMenuEditSystem.c Sun Sep 06 22:11:51 2020 +0200 +++ b/Discovery/Src/tMenuEditSystem.c Tue Sep 08 21:24:14 2020 +0200 @@ -38,11 +38,11 @@ #include "tMenu.h" #include "tMenuEdit.h" #include "tMenuSystem.h" +#include "tMenuEditCustom.h" #include "motion.h" #include "t7.h" -#define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */ /*#define HAVE_DEBUG_VIEW */ static uint8_t infoPage = 0; @@ -50,10 +50,8 @@ void openEdit_DateTime(void); void openEdit_Language(void); void openEdit_Design(void); -void openEdit_Customview(void); void openEdit_Information(void); void openEdit_Reset(void); -void openEdit_CustomviewDivemode(uint8_t line); //void openEdit_ShowDebugInfo(void); //void openEdit_Salinity(void); @@ -77,13 +75,6 @@ uint8_t OnAction_Colorscheme (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_DebugInfo (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_CViewTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_CViewStandard (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_CornerTimeout (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); -uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); - uint8_t OnAction_Exit (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_Confirm (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_RebootRTE (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); @@ -129,12 +120,9 @@ openEdit_Design(); break; case 4: - openEdit_Customview(); + openEdit_Information(); break; case 5: - openEdit_Information(); - break; - case 6: openEdit_Reset(); break; /* @@ -149,48 +137,13 @@ } else { - openEdit_CustomviewDivemode(line); + openEdit_CustomviewDivemodeMenu(line); } } /* Private functions ---------------------------------------------------------*/ -void openEdit_CustomviewDivemode(uint8_t line) -{ - static uint8_t customviewsSubpage = 0; - SSettings *pSettings = settingsGetPointer(); - extern _Bool WriteSettings; - char text[MAX_PAGE_TEXTSIZE]; - uint16_t tabPosition; - uint32_t id; - - - if((line == 6) || (cv_changelist[customviewsSubpage * 5 + line-1] == CVIEW_END)) /* select next set of views */ - { - customviewsSubpage++; - if(customviewsSubpage == CV_SUBPAGE_MAX) - { - customviewsSubpage = 0; - } - set_CustomsviewsSubpage(customviewsSubpage); - /* rebuild the selection page with the next set of customer views */ - id = tMSystem_refresh(0, text, &tabPosition, NULL); - tM_build_page(id, text, tabPosition, NULL); - openMenu(0); - } - else - { - pSettings->cv_configuration ^= 1 << (cv_changelist[customviewsSubpage * 5 + line-1]); - if(t7_GetEnabled_customviews() == 0) - { - pSettings->cv_configuration ^= (1 << CVIEW_noneOrDebug); - } - InitMotionDetection(); /* consider new view setup for view selection by motion */ - exitMenuEdit_to_Menu_with_Menu_Update(); - } -} - void openEdit_DateTime(void) { @@ -762,380 +715,6 @@ */ -void openEdit_Customview(void) -{ - refresh_Customviews(); - - write_field_button(StMSYS4_CViewTimeout, 400, 700, ME_Y_LINE1, &FontT48, ""); - write_field_button(StMSYS4_CViewStandard, 400, 700, ME_Y_LINE2, &FontT48, ""); - - write_field_button(StMSYS4_CornerTimeout, 400, 700, ME_Y_LINE3, &FontT48, ""); - write_field_button(StMSYS4_CornerStandard, 400, 700, ME_Y_LINE4, &FontT48, ""); - - write_field_button(StMSYS4_ExtraDisplay, 400, 700, ME_Y_LINE5, &FontT48, ""); - write_field_button(StMSYS4_MotionCtrl, 400, 700, ME_Y_LINE6, &FontT48, ""); - - setEvent(StMSYS4_CViewTimeout, (uint32_t)OnAction_CViewTimeout); - setEvent(StMSYS4_CViewStandard, (uint32_t)OnAction_CViewStandard); - - setEvent(StMSYS4_CornerTimeout, (uint32_t)OnAction_CornerTimeout); - setEvent(StMSYS4_CornerStandard, (uint32_t)OnAction_CornerStandard); - - setEvent(StMSYS4_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay); - setEvent(StMSYS4_MotionCtrl, (uint32_t)OnAction_MotionCtrl); -} - - -void refresh_Customviews(void) -{ - char text[32]; - uint8_t textpointer = 0; - - // header - text[0] = '\001'; - text[1] = TXT_2BYTE; - text[2] = TXT2BYTE_Customviews; - text[3] = 0; - write_topline(text); - - // custom view center return - textpointer = 0; - text[textpointer++] = TXT_2BYTE; - text[textpointer++] = TXT2BYTE_CViewTimeout; - textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_customViewTimeout,TXT_Seconds); - write_label_var( 30, 700, ME_Y_LINE1, &FontT48, text); - - // custom view center primary - text[0] = TXT_2BYTE; - text[1] = TXT2BYTE_CViewStandard; - text[2] = ' '; - text[3] = ' '; - switch(settingsGetPointer()->tX_customViewPrimary) - { - case CVIEW_sensors: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_O2monitor; - break; - case CVIEW_sensors_mV: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_O2voltage; - break; - case CVIEW_Compass: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Compass; - break; - case CVIEW_Decolist: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Decolist; - break; - case CVIEW_Tissues: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Tissues; - break; - case CVIEW_Profile: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Profile; - break; - case CVIEW_Gaslist: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Gaslist; - break; - case CVIEW_EADTime: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Info; - break; - case CVIEW_SummaryOfLeftCorner: - text[4] = TXT_2BYTE; - text[5] = TXT2BYTE_Summary; - break; - case CVIEW_noneOrDebug: - text[4] = ' '; - text[5] = '-'; - break; - default: - snprintf(&text[4],3,"%02u",settingsGetPointer()->tX_customViewPrimary); - break; - } - text[6] = 0; - write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text); - - - // field corner return - textpointer = 0; - text[textpointer++] = TXT_2BYTE; - text[textpointer++] = TXT2BYTE_CornerTimeout; - textpointer += snprintf(&text[textpointer],11," %02u\016\016 %c\017",settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout,TXT_Seconds); - write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text); - - // field corner primary - text[0] = TXT_2BYTE; - text[1] = TXT2BYTE_CornerStandard; - text[2] = ' '; - text[3] = ' '; - switch(settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary) - { - /* Temperature */ - case LLC_Temperature: - text[4] = TXT_Temperature; - break; - /* Average Depth */ - case LLC_AverageDepth: - text[4] = TXT_AvgDepth; - break; - /* ppO2 */ - case LLC_ppO2: - text[4] = TXT_ppO2; - break; - /* Stop Uhr */ - case LLC_Stopwatch: - text[4] = TXT_Stopwatch; - break; - /* Ceiling */ - case LLC_Ceiling: - text[4] = TXT_Ceiling; - break; - /* Future TTS */ - case LLC_FutureTTS: - text[4] = TXT_FutureTTS; - break; - /* CNS */ - case LLC_CNS: - text[4] = TXT_CNS; - break; - case LLC_GF: - text[4] = TXT_ActualGradient; - break; -#ifdef ENABLE_BOTTLE_SENSOR - case LCC_BottleBar: - text[4] = TXT_AtemGasVorrat; - break; -#endif - /* none */ - case LLC_Empty: - text[4] = '-'; - break; - default: - snprintf(&text[4],2,"%u",settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary); - break; - } - text[5] = 0; - write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text); - - - // extra display - text[0] = TXT_2BYTE; - text[1] = TXT2BYTE_ExtraDisplay; - text[2] = ' '; - text[3] = ' '; - text[4] = TXT_2BYTE; - switch(settingsGetPointer()->extraDisplay) - { - /* BigFont */ - case EXTRADISPLAY_BIGFONT: - text[5] = TXT2BYTE_ExtraBigFont; - break; - /* DecoGame */ - case EXTRADISPLAY_DECOGAME: - text[5] = TXT2BYTE_ExtraDecoGame; - break; - /* none */ - case EXTRADISPLAY_none: - text[5] = TXT2BYTE_ExtraNone; - break; - - default: - snprintf(&text[4],2,"%u",settingsGetPointer()->extraDisplay); - break; - } - text[6] = 0; - write_label_var( 30, 700, ME_Y_LINE5, &FontT48, text); - - - /* MotionCtrl */ - text[0] = TXT_2BYTE; - text[1] = TXT2BYTE_MotionCtrl; - text[2] = ' '; - text[3] = ' '; - text[4] = TXT_2BYTE; - switch(settingsGetPointer()->MotionDetection) - { - case MOTION_DETECT_OFF: - text[5] = TXT2BYTE_MoCtrlNone; - break; - case MOTION_DETECT_MOVE: - text[5] = TXT2BYTE_MoCtrlPitch; - break; - case MOTION_DETECT_SECTOR: - text[5] = TXT2BYTE_MoCtrlSector; - break; - case MOTION_DETECT_SCROLL: - text[5] = TXT2BYTE_MoCtrlScroll; - break; - default: - snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection); - break; - } - text[6] = 0; - write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text); - - write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); -} - - -uint8_t OnAction_CViewTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t value; - value = settingsGetPointer()->tX_customViewTimeout; - - if(value < 5) - value = 5; - else if(value < 10) - value = 10; - else if(value < 15) - value = 15; - else if(value < 20) - value = 20; - else if(value < 30) - value = 30; - else if(value < 45) - value = 45; - else if(value < 60) - value = 60; - else - value = 0; - - settingsGetPointer()->tX_customViewTimeout = value; - return UPDATE_DIVESETTINGS; -} - - -uint8_t OnAction_CViewStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t newValue; - switch(settingsGetPointer()->tX_customViewPrimary) - { - case CVIEW_sensors: - newValue = CVIEW_sensors_mV; - break; - case CVIEW_sensors_mV: - newValue = CVIEW_Compass; - break; - case CVIEW_Compass: - newValue = CVIEW_Decolist; - break; - case CVIEW_Decolist: - newValue = CVIEW_Tissues; - break; - case CVIEW_Tissues: - newValue = CVIEW_Profile; - break; - case CVIEW_Profile: - newValue = CVIEW_Gaslist; - break; - case CVIEW_Gaslist: - newValue = CVIEW_EADTime; - break; - case CVIEW_EADTime: - newValue = CVIEW_SummaryOfLeftCorner; - break; - case CVIEW_SummaryOfLeftCorner: - newValue = CVIEW_noneOrDebug; - break; - case CVIEW_noneOrDebug: - default: - newValue = CVIEW_sensors; - break; - } - settingsGetPointer()->tX_customViewPrimary = newValue; - return UPDATE_DIVESETTINGS; -} - - -uint8_t OnAction_CornerTimeout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t value; - value = settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout; - - if(value < 5) - value = 5; - else if(value < 10) - value = 10; - else if(value < 15) - value = 15; - else if(value < 20) - value = 20; - else if(value < 30) - value = 30; - else if(value < 45) - value = 45; - else if(value < 60) - value = 60; - else - value = 0; - - settingsGetPointer()->tX_userselectedLeftLowerCornerTimeout = value; - return UPDATE_DIVESETTINGS; -} - - -uint8_t OnAction_CornerStandard(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t value; - value = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; - - value += 1; - - if(value >= LLC_END) - value = 0; - - settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary = value; - return UPDATE_DIVESETTINGS; -} - - -uint8_t OnAction_ExtraDisplay (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t newValue; - - newValue = settingsGetPointer()->extraDisplay + 1; - if(newValue == EXTRADISPLAY_DECOGAME) /* Decogame not yet implemented */ - { - newValue++; - } - if(newValue >= EXTRADISPLAY_END) - { - newValue = EXTRADISPLAY_none; - } - settingsGetPointer()->extraDisplay = newValue; - return UNSPECIFIC_RETURN; -} - - -uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) -{ - uint8_t newValue; - switch(settingsGetPointer()->MotionDetection) - { - case MOTION_DETECT_OFF: - newValue = MOTION_DETECT_MOVE; - break; - case MOTION_DETECT_MOVE: - newValue = MOTION_DETECT_SECTOR; - break; - case MOTION_DETECT_SECTOR: - newValue = MOTION_DETECT_SCROLL; - break; - case MOTION_DETECT_SCROLL: - newValue = MOTION_DETECT_OFF; - break; - default: - newValue = MOTION_DETECT_OFF; - break; - } - settingsGetPointer()->MotionDetection = newValue; - InitMotionDetection(); - return UNSPECIFIC_RETURN; -} void openEdit_Information(void) { @@ -1152,9 +731,9 @@ text[1] = TXT2BYTE_ButtonNext; text[2] = 0; - write_field_button(StMSYS5_Info, 30, 800, ME_Y_LINE6, &FontT48, text); + write_field_button(StMSYS4_Info, 30, 800, ME_Y_LINE6, &FontT48, text); - setEvent(StMSYS5_Info, (uint32_t)OnAction_Information); + setEvent(StMSYS4_Info, (uint32_t)OnAction_Information); } @@ -1340,7 +919,7 @@ } write_topline(text_header); - tMenuEdit_newButtonText(StMSYS5_Info, text_button); + tMenuEdit_newButtonText(StMSYS4_Info, text_button); write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonNext,0); } @@ -1361,45 +940,45 @@ write_label_var( 30, 400, ME_Y_LINE1, &FontT48, text); - write_field_udigit(StMSYS6_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); + write_field_udigit(StMSYS5_LogbookOffset,420, 800, ME_Y_LINE1, &FontT48, "####", settingsGetPointer()->logbookOffset,0,0,0); text[0] = TXT_2BYTE; text[2] = 0; text[1] = TXT2BYTE_ResetAll; - write_field_button(StMSYS6_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); + write_field_button(StMSYS5_ResetAll, 30, 800, ME_Y_LINE2, &FontT48, text); text[1] = TXT2BYTE_ResetDeco; - write_field_button(StMSYS6_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); + write_field_button(StMSYS5_ResetDeco, 30, 800, ME_Y_LINE3, &FontT48, text); text[1] = TXT2BYTE_Reboot; - write_field_button(StMSYS6_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); + write_field_button(StMSYS5_Reboot, 30, 800, ME_Y_LINE4, &FontT48, text); text[1] = TXT2BYTE_Maintenance; - write_field_button(StMSYS6_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); + write_field_button(StMSYS5_Maintenance, 30, 800, ME_Y_LINE5, &FontT48, text); #ifndef RESETLOGBLOCK text[1] = TXT2BYTE_ResetLogbook; - write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); + write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); #else text[0] = '\021'; text[1] = TXT_2BYTE; text[2] = TXT2BYTE_ResetLogbook; text[3] = 0; - write_field_button(StMSYS6_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); + write_field_button(StMSYS5_ResetLogbook,30, 800, ME_Y_LINE6, &FontT48, text); text[0] = TXT_2BYTE; text[2] = 0; #endif - setEvent(StMSYS6_LogbookOffset, (uint32_t)OnAction_LogbookOffset); - setEvent(StMSYS6_ResetAll, (uint32_t)OnAction_Confirm); - setEvent(StMSYS6_ResetDeco, (uint32_t)OnAction_Confirm); - setEvent(StMSYS6_Reboot, (uint32_t)OnAction_Confirm); - setEvent(StMSYS6_Maintenance, (uint32_t)OnAction_Confirm); + setEvent(StMSYS5_LogbookOffset, (uint32_t)OnAction_LogbookOffset); + setEvent(StMSYS5_ResetAll, (uint32_t)OnAction_Confirm); + setEvent(StMSYS5_ResetDeco, (uint32_t)OnAction_Confirm); + setEvent(StMSYS5_Reboot, (uint32_t)OnAction_Confirm); + setEvent(StMSYS5_Maintenance, (uint32_t)OnAction_Confirm); #ifndef RESETLOGBLOCK - setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Confirm); + setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Confirm); #else - setEvent(StMSYS6_ResetLogbook, (uint32_t)OnAction_Nothing); + setEvent(StMSYS5_ResetLogbook, (uint32_t)OnAction_Nothing); #endif write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); @@ -1422,22 +1001,22 @@ text[2] = 0; text[1] = TXT2BYTE_Abort; - write_field_button(StMSYS6_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); + write_field_button(StMSYS5_Exit, 30, 800, ME_Y_LINE1, &FontT48, text); text[2] = 0; text[3] = 0; switch(editIdOfCaller) { - case StMSYS6_Reboot: - case StMSYS6_RebootRTE: - case StMSYS6_RebootMainCPU: + case StMSYS5_Reboot: + case StMSYS5_RebootRTE: + case StMSYS5_RebootMainCPU: text[1] = TXT2BYTE_RebootMainCPU; - write_field_button(StMSYS6_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); + write_field_button(StMSYS5_RebootMainCPU, 30, 800, ME_Y_LINE2, &FontT48, text); text[1] = TXT2BYTE_RebootRTE; - write_field_button(StMSYS6_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); - setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); - setEvent(StMSYS6_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); - setEvent(StMSYS6_RebootRTE, (uint32_t)OnAction_RebootRTE); + write_field_button(StMSYS5_RebootRTE, 30, 800, ME_Y_LINE3, &FontT48, text); + setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); + setEvent(StMSYS5_RebootMainCPU, (uint32_t)OnAction_RebootMainCPU); + setEvent(StMSYS5_RebootRTE, (uint32_t)OnAction_RebootRTE); text[0] = '\025'; text[1] = TXT_2BYTE; text[2] = TXT2BYTE_DecoDataLost; @@ -1445,10 +1024,10 @@ write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); break; - case StMSYS6_ResetDeco: + case StMSYS5_ResetDeco: text[1] = TXT2BYTE_ResetDeco; write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); - setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); + setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); setEvent(editIdOfCaller, (uint32_t)OnAction_ResetDeco); text[0] = '\025'; text[1] = TXT_2BYTE; @@ -1457,33 +1036,33 @@ write_label_var( 30, 800, ME_Y_LINE4, &FontT48, text); break; - case StMSYS6_ResetAll: + case StMSYS5_ResetAll: text[1] = TXT2BYTE_ResetAll; write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); - setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); + setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); setEvent(editIdOfCaller, (uint32_t)OnAction_ResetAll); break; - case StMSYS6_ResetLogbook: + case StMSYS5_ResetLogbook: text[1] = TXT2BYTE_ResetLogbook; write_field_button(editIdOfCaller, 30, 800, ME_Y_LINE2, &FontT48, text); - setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); + setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); setEvent(editIdOfCaller, (uint32_t)OnAction_ResetLogbook); break; - case StMSYS6_Maintenance: - case StMSYS6_SetBattCharge: - case StMSYS6_SetSampleIndx: + case StMSYS5_Maintenance: + case StMSYS5_SetBattCharge: + case StMSYS5_SetSampleIndx: text[0] = TXT_2BYTE; text[1] = TXT2BYTE_SetFactoryDefaults; text[2] = 0; - write_field_button(StMSYS6_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); + write_field_button(StMSYS5_SetFactoryBC, 30, 800, ME_Y_LINE2, &FontT48, text); #ifdef ENABLE_ANALYSE_SAMPLES text[0] = TXT_2BYTE; text[1] = TXT2BYTE_SetSampleIndex; text[2] = 0; - write_field_button(StMSYS6_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); + write_field_button(StMSYS5_SetSampleIndx, 30, 800, ME_Y_LINE3, &FontT48, text); #endif @@ -1494,28 +1073,28 @@ text[2] = 0; snprintf(&text[2],10,": %u%%",settingsGetPointer()->lastKnownBatteryPercentage); #ifdef ENABLE_ANALYSE_SAMPLES - write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text); + write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE4, &FontT48, text); #else - write_field_button(StMSYS6_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); + write_field_button(StMSYS5_SetBattCharge, 30, 800, ME_Y_LINE3, &FontT48, text); #endif - setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); - setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); + setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); + setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); #ifdef ENABLE_ANALYSE_SAMPLES - setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); + setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); #endif - setEvent(StMSYS6_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); + setEvent(StMSYS5_SetBattCharge, (uint32_t)OnAction_SetBatteryCharge); } else { - setEvent(StMSYS6_Exit, (uint32_t)OnAction_Exit); - setEvent(StMSYS6_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); + setEvent(StMSYS5_Exit, (uint32_t)OnAction_Exit); + setEvent(StMSYS5_SetFactoryBC, (uint32_t)OnAction_SetFactoryDefaults); #ifdef ENABLE_ANALYSE_SAMPLES - setEvent(StMSYS6_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); + setEvent(StMSYS5_SetSampleIndx, (uint32_t)OnAction_RecoverSampleIdx); #endif } -// write_field_button(StMSYS6_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); -// setEvent(StMSYS6_ScreenTest, (uint32_t)OnAction_ScreenTest); +// write_field_button(StMSYS5_ScreenTest, 30, 800, ME_Y_LINE3, &FontT48, "Screen Test"); +// setEvent(StMSYS5_ScreenTest, (uint32_t)OnAction_ScreenTest); text[0] = TXT_2BYTE; text[1] = TXT2BYTE_WarnBatteryLow; @@ -1661,7 +1240,7 @@ tTestScreen.ImageWidth = 800; tTestScreen.LayerIndex = 1; - set_globalState(StMSYS6_ScreenTest); + set_globalState(StMSYS5_ScreenTest); tTestScreen.FBStartAdress = getFrameByNumber(FrameCount); if(tTestScreen.FBStartAdress == 0) {
--- a/Discovery/Src/tMenuSystem.c Sun Sep 06 22:11:51 2020 +0200 +++ b/Discovery/Src/tMenuSystem.c Tue Sep 08 21:24:14 2020 +0200 @@ -252,15 +252,6 @@ if((line == 0) || (line == 4)) { - text[textPointer++] = TXT_2BYTE; - text[textPointer++] = TXT2BYTE_Customviews;//TXT2BYTE_ShowDebug; - } - text[textPointer++] = '\n'; - text[textPointer++] = '\r'; - text[textPointer] = 0; - - if((line == 0) || (line == 5)) - { text[textPointer++] = TXT_Information; text[textPointer++] = '\t'; textPointer += snprintf(&text[textPointer],29,"RTE %u.%u OS %i.%i.%i" @@ -274,7 +265,7 @@ strcpy(&text[textPointer],"\n\r"); textPointer += 2; - if((line == 0) || (line == 6)) + if((line == 0) || (line == 5)) { text[textPointer++] = TXT_2BYTE; text[textPointer++] = TXT2BYTE_ResetMenu; @@ -288,64 +279,3 @@ /* Private functions ---------------------------------------------------------*/ - -char customview_TXT2BYTE_helper(uint8_t customViewId) -{ - char text = 0; - - switch(customViewId) - { - case CVIEW_sensors: - text = TXT2BYTE_O2monitor; - break; - case CVIEW_sensors_mV: - text = TXT2BYTE_O2voltage; - break; - case CVIEW_Compass: - text = TXT2BYTE_Compass; - break; - case CVIEW_Decolist: - case CVIEW_T3_Decostop: - text = TXT2BYTE_Decolist; - break; - case CVIEW_Tissues: - text = TXT2BYTE_Tissues; - break; - case CVIEW_Profile: - text = TXT2BYTE_Profile; - break; - case CVIEW_Gaslist: - text = TXT2BYTE_Gaslist; - break; - case CVIEW_EADTime: - text = TXT2BYTE_Info; - break; - case CVIEW_SummaryOfLeftCorner: - text = TXT2BYTE_Summary; - break; - case CVIEW_noneOrDebug: - text = TXT2BYTE_DispNoneDbg; - break; - case CVIEW_T3_MaxDepth: - text = TXT2BYTE_MaxDepth; - break; - case CVIEW_T3_StopWatch: - text = TXT2BYTE_Stopwatch; - break; - case CVIEW_T3_TTS: - text = TXT2BYTE_TTS; - break; - case CVIEW_T3_ppO2andGas: - text = TXT2BYTE_ppoNair; - break; - case CVIEW_T3_Navigation: - text = TXT2BYTE_Navigation; - break; - case CVIEW_T3_DepthData: - text = TXT2BYTE_DepthData; - break; - default: - break; - } - return text; -}