Mercurial > public > ostc4
comparison Discovery/Src/tMenuEditSystem.c @ 373:7b981f8bdd41 MotionDetection
Add scroll event by pitch angle detection:
Add a function to scroll through the custom view in case the computer is not in the typical center position
Refine Pitch Detection:
Changed implementation to use sectors for detection. Increased detection window
author | ideenmodellierer |
---|---|
date | Sun, 08 Sep 2019 13:45:17 +0200 |
parents | 50ea68c7a153 |
children | 0dbf550dc743 |
comparison
equal
deleted
inserted
replaced
372:75eedde05ff6 | 373:7b981f8bdd41 |
---|---|
153 SSettings *pSettings = settingsGetPointer(); | 153 SSettings *pSettings = settingsGetPointer(); |
154 extern _Bool WriteSettings; | 154 extern _Bool WriteSettings; |
155 | 155 |
156 pSettings->cv_configuration ^= 1 << (cv_changelist[line-1]); | 156 pSettings->cv_configuration ^= 1 << (cv_changelist[line-1]); |
157 WriteSettings = 1; | 157 WriteSettings = 1; |
158 InitMotionDetection(); /* consider new view setup for view selection by motion */ | |
158 exitMenuEdit_to_Menu_with_Menu_Update(); | 159 exitMenuEdit_to_Menu_with_Menu_Update(); |
159 } | 160 } |
160 | 161 |
161 | 162 |
162 void openEdit_DateTime(void) | 163 void openEdit_DateTime(void) |
923 text[5] = TXT2BYTE_MoCtrlPitch; | 924 text[5] = TXT2BYTE_MoCtrlPitch; |
924 break; | 925 break; |
925 case MOTION_DETECT_SECTOR: | 926 case MOTION_DETECT_SECTOR: |
926 text[5] = TXT2BYTE_MoCtrlSector; | 927 text[5] = TXT2BYTE_MoCtrlSector; |
927 break; | 928 break; |
929 case MOTION_DETECT_SCROLL: | |
930 text[5] = TXT2BYTE_MoCtrlScroll; | |
931 break; | |
928 default: | 932 default: |
929 snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection); | 933 snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection); |
930 break; | 934 break; |
931 } | 935 } |
932 text[6] = 0; | 936 text[6] = 0; |
1073 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) | 1077 uint8_t OnAction_MotionCtrl (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) |
1074 { | 1078 { |
1075 uint8_t newValue; | 1079 uint8_t newValue; |
1076 switch(settingsGetPointer()->MotionDetection) | 1080 switch(settingsGetPointer()->MotionDetection) |
1077 { | 1081 { |
1078 case 0: | 1082 case MOTION_DETECT_OFF: |
1079 newValue = 1; | 1083 newValue = MOTION_DETECT_MOVE; |
1080 break; | 1084 break; |
1081 case 1: | 1085 case MOTION_DETECT_MOVE: |
1082 newValue = 2; | 1086 newValue = MOTION_DETECT_SECTOR; |
1083 break; | 1087 break; |
1084 case 2: | 1088 case MOTION_DETECT_SECTOR: |
1085 newValue = 0; | 1089 newValue = MOTION_DETECT_SCROLL; |
1086 break; | 1090 break; |
1091 case MOTION_DETECT_SCROLL: | |
1092 newValue = MOTION_DETECT_OFF; | |
1093 break; | |
1087 default: | 1094 default: |
1088 newValue = 0; | 1095 newValue = MOTION_DETECT_OFF; |
1089 break; | 1096 break; |
1090 } | 1097 } |
1091 settingsGetPointer()->MotionDetection = newValue; | 1098 settingsGetPointer()->MotionDetection = newValue; |
1099 InitMotionDetection(); | |
1092 return UNSPECIFIC_RETURN; | 1100 return UNSPECIFIC_RETURN; |
1093 } | 1101 } |
1094 | 1102 |
1095 void openEdit_Information(void) | 1103 void openEdit_Information(void) |
1096 { | 1104 { |