Mercurial > public > ostc4
comparison Discovery/Src/tMenuXtra.c @ 654:890440ab993a
Introduced new menu tab for addition CCR options:
The Xtra menu tab was only used in dive mode before. The tab is now enabled in surface mode and provide access to scrubber timer functionality. To enables this infrastructure (structure, multilanguage strings etc.) have been added to the sourcecode.
author | Ideenmodellierer |
---|---|
date | Sun, 25 Apr 2021 20:41:19 +0200 |
parents | 1b243c6c7067 |
children | 1b995079c045 |
comparison
equal
deleted
inserted
replaced
653:269e57ac4e56 | 654:890440ab993a |
---|---|
45 | 45 |
46 textPointer = 0; | 46 textPointer = 0; |
47 *tab = 500; | 47 *tab = 500; |
48 *subtext = 0; | 48 *subtext = 0; |
49 | 49 |
50 if((line == 0) || (line == 1)) | 50 /* DIVE MODE */ |
51 if(actual_menu_content != MENU_SURFACE) | |
51 { | 52 { |
52 text[textPointer++] = TXT_2BYTE; | 53 if((line == 0) || (line == 1)) |
53 text[textPointer++] = TXT2BYTE_ResetStopwatch; | 54 { |
54 } | 55 text[textPointer++] = TXT_2BYTE; |
55 strcpy(&text[textPointer],"\n\r"); | 56 text[textPointer++] = TXT2BYTE_ResetStopwatch; |
56 textPointer += 2; | 57 } |
57 /* | 58 strcpy(&text[textPointer],"\n\r"); |
58 if((line == 0) || (line == 2)) | 59 textPointer += 2; |
59 { | 60 /* |
60 text[textPointer++] = TXT_2BYTE; | 61 if((line == 0) || (line == 2)) |
61 text[textPointer++] = TXT2BYTE_ResetAvgDepth; | 62 { |
62 } | 63 text[textPointer++] = TXT_2BYTE; |
63 strcpy(&text[textPointer],"\n\r"); | 64 text[textPointer++] = TXT2BYTE_ResetAvgDepth; |
64 textPointer += 2; | 65 } |
65 */ | 66 strcpy(&text[textPointer],"\n\r"); |
66 if((line == 0) || (line == 2)) | 67 textPointer += 2; |
67 { | 68 */ |
68 text[textPointer++] = TXT_2BYTE; | 69 if((line == 0) || (line == 2)) |
69 text[textPointer++] = TXT2BYTE_CompassHeading; | 70 { |
70 } | 71 text[textPointer++] = TXT_2BYTE; |
71 strcpy(&text[textPointer],"\n\r"); | 72 text[textPointer++] = TXT2BYTE_CompassHeading; |
72 textPointer += 2; | 73 } |
74 strcpy(&text[textPointer],"\n\r"); | |
75 textPointer += 2; | |
73 | 76 |
74 if((line == 0) || (line == 3)) | 77 if((line == 0) || (line == 3)) |
75 { | 78 { |
76 text[textPointer++] = TXT_2BYTE; | 79 text[textPointer++] = TXT_2BYTE; |
77 text[textPointer++] = TXT2BYTE_SetMarker; | 80 text[textPointer++] = TXT2BYTE_SetMarker; |
78 } | 81 } |
79 strcpy(&text[textPointer],"\n\r"); | 82 strcpy(&text[textPointer],"\n\r"); |
80 textPointer += 2; | 83 textPointer += 2; |
81 | 84 |
82 #ifdef ENABLE_MOTION_CONTROL | 85 #ifdef ENABLE_MOTION_CONTROL |
83 if((line == 0) || (line == 4)) | 86 if((line == 0) || (line == 4)) |
84 { | 87 { |
85 text[textPointer++] = TXT_2BYTE; | 88 text[textPointer++] = TXT_2BYTE; |
86 text[textPointer++] = TXT2BYTE_CalibView; | 89 text[textPointer++] = TXT2BYTE_CalibView; |
87 } | 90 } |
88 strcpy(&text[textPointer],"\n\r"); | 91 strcpy(&text[textPointer],"\n\r"); |
89 textPointer += 2; | 92 textPointer += 2; |
90 #endif | 93 #endif |
91 | 94 |
92 if(is_stateUsedSetToSim()) | 95 if(is_stateUsedSetToSim()) |
96 { | |
97 if((line == 0) || (line == 5)) | |
98 { | |
99 text[textPointer++] = TXT_2BYTE; | |
100 text[textPointer++] = TXT2BYTE_SimFollowDecoStops; | |
101 text[textPointer++] = ' '; | |
102 text[textPointer++] = ' '; | |
103 if(simulation_get_heed_decostops()) | |
104 text[textPointer++] = '\005'; | |
105 else | |
106 text[textPointer++] = '\006'; | |
107 } | |
108 strcpy(&text[textPointer],"\n\r"); | |
109 textPointer += 2; | |
110 } | |
111 else | |
112 { | |
113 if((line == 0) || (line == 5)) /* end dive mode only used during real dives */ | |
114 { | |
115 text[textPointer++] = TXT_2BYTE; | |
116 text[textPointer++] = TXT2BYTE_EndDiveMode; | |
117 } | |
118 strcpy(&text[textPointer],"\n\r"); | |
119 textPointer += 2; | |
120 } | |
121 } | |
122 else /* Surface MODE */ | |
93 { | 123 { |
94 if((line == 0) || (line == 5)) | 124 if((line == 0) || (line == 1)) |
95 { | 125 { |
96 text[textPointer++] = TXT_2BYTE; | 126 textPointer += snprintf(&text[textPointer], 60,\ |
97 text[textPointer++] = TXT2BYTE_SimFollowDecoStops; | 127 "%c" |
98 text[textPointer++] = ' '; | 128 "\016\016(%c)\17" |
99 text[textPointer++] = ' '; | 129 "\002" |
100 if(simulation_get_heed_decostops()) | 130 "%u" |
101 text[textPointer++] = '\005'; | 131 "\016\016" |
102 else | 132 " %c" |
103 text[textPointer++] = '\006'; | 133 "\017" |
134 ,TXT_ScrubTime | |
135 ,TXT_Maximum | |
136 ,settingsGetPointer()->scrubTimerMax | |
137 ,TXT_Minutes | |
138 ); | |
104 } | 139 } |
105 strcpy(&text[textPointer],"\n\r"); | 140 strcpy(&text[textPointer],"\n\r"); |
106 textPointer += 2; | 141 textPointer += 2; |
142 if((line == 0) || (line == 2)) | |
143 { | |
144 textPointer += snprintf(&text[textPointer], 60,\ | |
145 "%c\002%03u\016\016 %c\017" | |
146 ,TXT_ScrubTimeReset | |
147 ,settingsGetPointer()->scrubTimerCur | |
148 ,TXT_Minutes); | |
149 } | |
150 strcpy(&text[textPointer],"\n\r"); | |
151 textPointer += 2; | |
152 if((line == 0) || (line == 3)) | |
153 { | |
154 switch(settingsGetPointer()->scrubTimerMode) | |
155 { | |
156 case SCRUB_TIMER_OFF: | |
157 default: textPointer += snprintf(&text[textPointer], 60,"%c\002%c%c",TXT_ScrubTimeMode, TXT_2BYTE, TXT2BYTE_MoCtrlNone ); | |
158 break; | |
159 case SCRUB_TIMER_MINUTES: textPointer += snprintf(&text[textPointer], 60,"%c\002%c",TXT_ScrubTimeMode, TXT_Minutes ); | |
160 break; | |
161 case SCRUB_TIMER_PERCENT: textPointer += snprintf(&text[textPointer], 60,"%c\002%c",TXT_ScrubTimeMode, TXT_Percent ); | |
162 break; | |
163 } | |
164 } | |
165 strcpy(&text[textPointer],"\n\r"); | |
166 textPointer += 2; | |
167 | |
107 } | 168 } |
108 else | |
109 { | |
110 if((line == 0) || (line == 5)) /* end dive mode only used during real dives */ | |
111 { | |
112 text[textPointer++] = TXT_2BYTE; | |
113 text[textPointer++] = TXT2BYTE_EndDiveMode; | |
114 } | |
115 strcpy(&text[textPointer],"\n\r"); | |
116 textPointer += 2; | |
117 } | |
118 | |
119 return StMXTRA; | 169 return StMXTRA; |
120 } | 170 } |
121 | 171 |