Mercurial > public > ostc4
diff Discovery/Src/tMenuEditSystem.c @ 368:50ea68c7a153 MotionDetection
Added menu item for motion detection. There are several possibility to use motion detection for user action input. To select of the a new menu entry has been added to the Sys2 =>Custom View Menu (Variables in german)
author | ideenmodellierer |
---|---|
date | Tue, 13 Aug 2019 21:10:46 +0200 |
parents | 26c874cdde0d |
children | 7b981f8bdd41 |
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditSystem.c Sat Jul 20 21:42:45 2019 +0200 +++ b/Discovery/Src/tMenuEditSystem.c Tue Aug 13 21:10:46 2019 +0200 @@ -36,9 +36,9 @@ #include "settings.h" // for getLicence() #include "tHome.h" // for enum CUSTOMVIEWS and init_t7_compass() #include "tMenuEdit.h" +#include "Motion.h" /* Private variables ---------------------------------------------------------*/ - uint8_t infoPage = 0; /* Private function prototypes -----------------------------------------------*/ @@ -77,6 +77,7 @@ 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); @@ -732,9 +733,10 @@ 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_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); @@ -743,6 +745,7 @@ setEvent(StMSYS4_CornerStandard, (uint32_t)OnAction_CornerStandard); setEvent(StMSYS4_ExtraDisplay, (uint32_t)OnAction_ExtraDisplay); + setEvent(StMSYS4_MotionCtrl, (uint32_t)OnAction_MotionCtrl); } @@ -904,6 +907,31 @@ 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; + 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); } @@ -1042,6 +1070,28 @@ } +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 0: + newValue = 1; + break; + case 1: + newValue = 2; + break; + case 2: + newValue = 0; + break; + default: + newValue = 0; + break; + } + settingsGetPointer()->MotionDetection = newValue; + return UNSPECIFIC_RETURN; +} + void openEdit_Information(void) { char text[70];