# HG changeset patch # User Ideenmodellierer # Date 1613162270 -3600 # Node ID 3e1a0e267f3816910aa58a5274270dd418b54137 # Parent 028d8f3a94103039cb24836c5a1c48a0adbd9eb9 Added option to select sensitivity of focus detection: Depending on the location the computer is equiped during dive (arm wet/ dry suite, glove...) it is usefull to adapt the sensitivity of the focus detection. Technical it means the radius of the spot in which direction ray is projected may be changed in size. The option has been added to the motion control menu. diff -r 028d8f3a9410 -r 3e1a0e267f38 Common/Inc/settings.h --- a/Common/Inc/settings.h Mon Feb 08 21:35:46 2021 +0100 +++ b/Common/Inc/settings.h Fri Feb 12 21:37:50 2021 +0100 @@ -238,7 +238,7 @@ uint8_t compassInertia; uint8_t tX_customViewPrimaryBF; /* new in 0xFFFF001D */ - uint8_t viewPortMode; + uint8_t viewPortMode; /* 7-Reserve| 6..5 - Focus spot size | 4-Focusframe | 3-Reserve | 2..0-BacklightBoost */ uint16_t viewRoll; uint16_t viewPitch; uint16_t viewYaw; diff -r 028d8f3a9410 -r 3e1a0e267f38 Discovery/Inc/tStructure.h --- a/Discovery/Inc/tStructure.h Mon Feb 08 21:35:46 2021 +0100 +++ b/Discovery/Inc/tStructure.h Fri Feb 12 21:37:50 2021 +0100 @@ -328,9 +328,11 @@ #define StMCustom4_CViewSelection1 _MB(2,9,4,1,0) #define StMCustom5_CViewPortCalib _MB(2,9,5,1,0) -#define StMCustom5_CViewPortLayout _MB(2,9,5,2,0) -#define StMCustom5_CViewPortAmbient _MB(2,9,5,3,0) -#define StMCustom5_CViewPortControl _MB(2,9,5,4,0) +#define StMCustom5_CViewPortSpotSize _MB(2,9,5,2,0) +#define StMCustom5_CViewPortLayout _MB(2,9,5,3,0) +#define StMCustom5_CViewPortAmbient _MB(2,9,5,4,0) +#define StMCustom5_CViewPortControl _MB(2,9,5,5,0) + /* PAGE 10 */ #define StMPLAN _MB(2,10,0,0,0) diff -r 028d8f3a9410 -r 3e1a0e267f38 Discovery/Inc/text_multilanguage.h --- a/Discovery/Inc/text_multilanguage.h Mon Feb 08 21:35:46 2021 +0100 +++ b/Discovery/Inc/text_multilanguage.h Fri Feb 12 21:37:50 2021 +0100 @@ -266,6 +266,7 @@ TXT2BYTE_CornerStandard, TXT2BYTE_IndicateFrame, TXT2BYTE_BoostBacklight, + TXT2BYTE_FocusSpotSize, TXT2BYTE_SetToMOD, /* */ @@ -323,6 +324,11 @@ TXT2BYTE_Navigation, TXT2BYTE_DepthData, TXT2BYTE_DecoTTS, + + TXT2BYTE_Minimum, + TXT2BYTE_Normal, + TXT2BYTE_Maximum, + TXT2BYTE_END }; diff -r 028d8f3a9410 -r 3e1a0e267f38 Discovery/Src/tMenuEditCustom.c --- a/Discovery/Src/tMenuEditCustom.c Mon Feb 08 21:35:46 2021 +0100 +++ b/Discovery/Src/tMenuEditCustom.c Fri Feb 12 21:37:50 2021 +0100 @@ -47,6 +47,8 @@ #define CV_SUBPAGE_MAX (2u) /* max number of customer view selection pages */ #define MAX_BACKLIGHT_BOOST (2u) /* max number of backlight levels which may be increased during focus state */ +#define MAX_FOCUS_LIMITER (2u) /* max number for reducing the spot used for focus detection */ + 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; @@ -67,6 +69,7 @@ uint8_t OnAction_CViewPortLayout(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_CViewPortAmbient(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); uint8_t OnAction_CViewPortControl(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); +uint8_t OnAction_CViewPortSpot(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action); /* Exported functions --------------------------------------------------------*/ @@ -186,6 +189,7 @@ point_t lowerleft = {0,0}; point_t upperright = {799,479}; float localLimit = 0.1; + uint8_t spotSize = (pSettings->viewPortMode >> 5) & 0x03; text[0] = '\001'; text[1] = TXT_2BYTE; @@ -198,19 +202,42 @@ text[2] = 0; write_label_var( 30, 700, ME_Y_LINE2, &FontT48, text); + + textIndex = 0; + text[textIndex++] = TXT_2BYTE; + text[textIndex++] = TXT2BYTE_FocusSpotSize; + text[textIndex++] = 0; + write_label_var( 30, 340, ME_Y_LINE3, &FontT48, text); + + textIndex = 0; + text[textIndex++] = TXT_2BYTE; + switch(spotSize) + { + case 2: text[textIndex++] = TXT2BYTE_Minimum; break; + case 1: text[textIndex++] = TXT2BYTE_Normal; break; + default: + case 0: text[textIndex++] = TXT2BYTE_Maximum; break; + } + text[textIndex++] = 0; + write_label_var( 500, 800, ME_Y_LINE3, &FontT48, text); + textIndex = 0; text[textIndex++] = TXT_2BYTE; text[textIndex++] = TXT2BYTE_IndicateFrame; - text[textIndex++] = ' '; - text[textIndex++] = '\006' - (settingsGetPointer()->viewPortMode >> 4); text[textIndex++] = 0; - write_label_var( 30, 700, ME_Y_LINE3, &FontT48, text); + write_label_var( 30, 340, ME_Y_LINE4, &FontT48, text); + textIndex = 0; + text[textIndex++] = '\006' - ((settingsGetPointer()->viewPortMode >> 4) & 1); + text[textIndex++] = 0; + write_label_var( 500, 800, ME_Y_LINE4, &FontT48, text); textIndex = 0; text[textIndex++] = TXT_2BYTE; text[textIndex++] = TXT2BYTE_BoostBacklight; - text[textIndex++] = ' '; - snprintf(&text[textIndex],32," %d",(settingsGetPointer()->viewPortMode & 0x3)); - write_label_var( 30, 700, ME_Y_LINE4, &FontT48, text); + text[textIndex++] = 0; + write_label_var( 30, 340, ME_Y_LINE5, &FontT48, text); + textIndex = 0; + snprintf(&text[textIndex],32,"%d",(settingsGetPointer()->viewPortMode & 0x3)); + write_label_var( 500, 800, ME_Y_LINE5, &FontT48, text); write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext); @@ -223,19 +250,18 @@ textIndex = 0; text[textIndex++] = '\001'; - if(distance < localLimit) + if(fabs(distance) < localLimit) { text[textIndex++] = '+'; } else { - text[textIndex++] = '-'; while (localLimit < 0.6) { localLimit += 0.1; text[textIndex++] = '-'; text[textIndex++] = '-'; - if(distance < localLimit) + if(fabs(distance) < localLimit) { break; } @@ -249,8 +275,9 @@ text[textIndex++] = TXT_2BYTE; text[textIndex++] = TXT2BYTE_MotionCtrl; - text[textIndex++] = ' '; - text[textIndex++] = ' '; + text[textIndex++] = 0; + write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); + textIndex = 0; text[textIndex++] = TXT_2BYTE; switch(settingsGetPointer()->MotionDetection) { @@ -272,12 +299,13 @@ break; } text[textIndex] = 0; - write_label_var( 30, 700, ME_Y_LINE6, &FontT48, text); + write_label_var(500, 800, ME_Y_LINE6, &FontT48, text); - if(distance < 0.5) + + if(viewInFocus()) { set_Backlight_Boost(settingsGetPointer()->viewPortMode & 0x03); - if(pSettings->viewPortMode >> 4) + if((pSettings->viewPortMode >> 4) & 0x01) { pdrawScreen = getMenuEditScreen(); GFX_draw_box(pdrawScreen,lowerleft,upperright,0,CLUT_NiceGreen); @@ -286,7 +314,7 @@ else { set_Backlight_Boost(0); - if(pSettings->viewPortMode >> 4) + if((pSettings->viewPortMode >> 4) & 0x01) { pdrawScreen = getMenuEditScreen(); GFX_draw_box(pdrawScreen,lowerleft,upperright,0,CLUT_MenuTopBackground); @@ -392,12 +420,13 @@ refresh_ViewPort(); write_field_button(StMCustom5_CViewPortCalib, 400, 700, ME_Y_LINE2, &FontT48, ""); - write_field_button(StMCustom5_CViewPortLayout, 400, 700, ME_Y_LINE3, &FontT48, ""); - write_field_button(StMCustom5_CViewPortAmbient, 400, 700, ME_Y_LINE4, &FontT48, ""); + write_field_button(StMCustom5_CViewPortSpotSize,400, 700, ME_Y_LINE3, &FontT48, ""); + write_field_button(StMCustom5_CViewPortLayout, 400, 700, ME_Y_LINE4, &FontT48, ""); + write_field_button(StMCustom5_CViewPortAmbient, 400, 700, ME_Y_LINE5, &FontT48, ""); write_field_button(StMCustom5_CViewPortControl, 400, 700, ME_Y_LINE6, &FontT48, ""); - setEvent(StMCustom5_CViewPortCalib, (uint32_t)OnAction_CViewPortCalib); + setEvent(StMCustom5_CViewPortSpotSize, (uint32_t)OnAction_CViewPortSpot); setEvent(StMCustom5_CViewPortLayout, (uint32_t)OnAction_CViewPortLayout); setEvent(StMCustom5_CViewPortAmbient, (uint32_t)OnAction_CViewPortAmbient); setEvent(StMCustom5_CViewPortControl, (uint32_t)OnAction_CViewPortControl); @@ -734,6 +763,21 @@ return UPDATE_DIVESETTINGS; } +uint8_t OnAction_CViewPortSpot(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) +{ + uint8_t newValue = 0; + SSettings *pSettings = settingsGetPointer(); + + newValue = ((pSettings->viewPortMode >> 5) + 1) & 0x03; + if(newValue > MAX_FOCUS_LIMITER) + { + newValue = 0; + } + pSettings->viewPortMode &= 0x9F; + pSettings->viewPortMode |= (newValue << 5); + return UPDATE_DIVESETTINGS; +} + void openEdit_CustomviewDivemode(const uint8_t* pcv_changelist) { diff -r 028d8f3a9410 -r 3e1a0e267f38 Discovery/Src/text_multilanguage.c --- a/Discovery/Src/text_multilanguage.c Mon Feb 08 21:35:46 2021 +0100 +++ b/Discovery/Src/text_multilanguage.c Fri Feb 12 21:37:50 2021 +0100 @@ -1348,7 +1348,7 @@ static uint8_t text_ES_MoCtrlNone[] = "Off"; static uint8_t text_EN_MoCtrlPitch[] = "Pitch move"; -static uint8_t text_DE_MoCtrlPitch[] = "Nickbewegung"; +static uint8_t text_DE_MoCtrlPitch[] = "Nicken"; static uint8_t text_FR_MoCtrlPitch[] = "Pitch move"; static uint8_t text_IT_MoCtrlPitch[] = "Pitch move"; static uint8_t text_ES_MoCtrlPitch[] = "Pitch move"; @@ -1449,11 +1449,16 @@ static uint8_t text_ES_IndicateFrame[] = ""; static uint8_t text_EN_BoostBacklight[] = "Boost Backlight:"; -static uint8_t text_DE_BoostBacklight[] = "Helligkeit+:"; +static uint8_t text_DE_BoostBacklight[] = "Helligkeit +:"; static uint8_t text_FR_BoostBacklight[] = ""; static uint8_t text_IT_BoostBacklight[] = ""; static uint8_t text_ES_BoostBacklight[] = ""; +static uint8_t text_EN_FocusSpotSize[] = "Focus detection:"; +static uint8_t text_DE_FocusSpotSize[] = "Fokus Reaktion:"; +static uint8_t text_FR_FocusSpotSize[] = ""; +static uint8_t text_IT_FocusSpotSize[] = ""; +static uint8_t text_ES_FocusSpotSize[] = ""; /* static uint8_t text_EN_ApneaCount[] = ""; static uint8_t text_DE_ApneaCount[] = ""; @@ -1773,6 +1778,7 @@ {(uint8_t)TXT2BYTE_CalibView, {text_EN_CalibView, text_DE_CalibView, text_FR_CalibView, text_IT_CalibView, text_ES_CalibView}}, {(uint8_t)TXT2BYTE_IndicateFrame, {text_EN_IndicateFrame, text_DE_IndicateFrame, text_FR_IndicateFrame, text_IT_IndicateFrame, text_ES_IndicateFrame}}, {(uint8_t)TXT2BYTE_BoostBacklight, {text_EN_BoostBacklight, text_DE_BoostBacklight, text_FR_BoostBacklight, text_IT_BoostBacklight, text_ES_BoostBacklight}}, + {(uint8_t)TXT2BYTE_FocusSpotSize, {text_EN_FocusSpotSize, text_DE_FocusSpotSize, text_FR_FocusSpotSize, text_IT_FocusSpotSize, text_ES_FocusSpotSize}}, {(uint8_t)TXT2BYTE_EndDiveMode, {text_EN_EndDiveMode, text_DE_EndDiveMode, text_FR_EndDiveMode, text_IT_EndDiveMode, text_ES_EndDiveMode}}, {(uint8_t)TXT2BYTE_Simulator, {text_EN_Simulator, text_DE_Simulator, text_FR_Simulator, text_IT_Simulator, text_ES_Simulator}}, {(uint8_t)TXT2BYTE_StartSimulator, {text_EN_StartSimulator, text_DE_StartSimulator, text_FR_StartSimulator, text_IT_StartSimulator, text_ES_StartSimulator}}, @@ -1908,4 +1914,8 @@ {(uint8_t)TXT2BYTE_Navigation, {text_EN_Navigation, text_DE_Navigation, text_FR_Navigation, text_IT_Navigation, text_ES_Navigation}}, {(uint8_t)TXT2BYTE_DepthData, {text_EN_DepthData, text_DE_DepthData, text_FR_DepthData, text_IT_DepthData, text_ES_DepthData}}, {(uint8_t)TXT2BYTE_DecoTTS, {text_EN_DecoTTS, text_DE_DecoTTS, text_FR_DecoTTS, text_IT_DecoTTS, text_ES_DecoTTS}}, + + {(uint8_t)TXT2BYTE_Minimum, {text_EN_Minimum, text_DE_Minimum, text_FR_Minimum, text_IT_Minimum, text_ES_Minimum}}, + {(uint8_t)TXT2BYTE_Normal, {text_EN_Normal, text_DE_Normal, text_FR_Normal, text_IT_Normal, text_ES_Normal}}, + {(uint8_t)TXT2BYTE_Maximum, {text_EN_Maximum, text_DE_Maximum, text_FR_Maximum, text_IT_Maximum, text_ES_Maximum}}, };