comparison Discovery/Src/tMenuEditPlanner.c @ 567:1c95f811967c

-Add 12HR Time Support -Add firmware image only font extensions -Show english units when required in log's graphs -Show decompression info with Font84 if 10 characters long -Remove usage of ' symbol to denote minutes and instead use min abbreviation -Show english units when required on the simulation configuration screen -Remove usage of ' symbol to denote feet in in non-metric mode and use ft abbrevation
author izzni
date Tue, 24 Nov 2020 13:22:23 -0600
parents 1f557e5f4b5a
children 830de438e0b0
comparison
equal deleted inserted replaced
566:7761dd028386 567:1c95f811967c
47 /* Importend function prototypes ---------------------------------------------*/ 47 /* Importend function prototypes ---------------------------------------------*/
48 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); 48 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
49 49
50 /* Imported variables --------------------------------------------------------*/ 50 /* Imported variables --------------------------------------------------------*/
51 51
52 extern uint16_t tMplan_depth_meter, tMplan_intervall_time_minutes, tMplan_dive_time_minutes; 52 extern uint16_t tMplan_depth_meter, tMplan_intervall_time_minutes, tMplan_dive_time_minutes, tMplan_depth_editor;
53 53
54 /* Private variables ---------------------------------------------------------*/ 54 /* Private variables ---------------------------------------------------------*/
55 uint8_t gasChangeListDepthGasId[40]; 55 uint8_t gasChangeListDepthGasId[40];
56 56
57 /* Private function prototypes -----------------------------------------------*/ 57 /* Private function prototypes -----------------------------------------------*/
121 text[0] = TXT_2BYTE; 121 text[0] = TXT_2BYTE;
122 text[1] = TXT2BYTE_Intervall; 122 text[1] = TXT2BYTE_Intervall;
123 text[2] = 0; 123 text[2] = 0;
124 write_label_var( 20, 550, ME_Y_LINE2, &FontT48, text); 124 write_label_var( 20, 550, ME_Y_LINE2, &FontT48, text);
125 125
126 write_field_udigit(StMPLAN2_Interval, 400, 800, ME_Y_LINE2, &FontT48, "###'", (uint32_t)tMplan_intervall_time_minutes, 0, 0, 0); 126 write_field_udigit(StMPLAN2_Interval, 400, 800, ME_Y_LINE2, &FontT48, "###\016\016min\017", (uint32_t)tMplan_intervall_time_minutes, 0, 0, 0);
127 setEvent(StMPLAN2_Interval, (uint32_t)OnAction_PlanInterval); 127 setEvent(StMPLAN2_Interval, (uint32_t)OnAction_PlanInterval);
128 startEdit(); 128 startEdit();
129 } 129 }
130 130
131 131
142 text[0] = TXT_2BYTE; 142 text[0] = TXT_2BYTE;
143 text[1] = TXT2BYTE_SimDiveTime; 143 text[1] = TXT2BYTE_SimDiveTime;
144 text[2] = 0; 144 text[2] = 0;
145 write_label_var( 20, 550, ME_Y_LINE3, &FontT48, text); 145 write_label_var( 20, 550, ME_Y_LINE3, &FontT48, text);
146 146
147 write_field_udigit(StMPLAN3_DiveTime, 400, 800, ME_Y_LINE3, &FontT48, "###'", (uint32_t)tMplan_dive_time_minutes, 0, 0, 0); 147 write_field_udigit(StMPLAN3_DiveTime, 400, 800, ME_Y_LINE3, &FontT48, "###\016\016min\017", (uint32_t)tMplan_dive_time_minutes, 0, 0, 0);
148 setEvent(StMPLAN3_DiveTime, (uint32_t)OnAction_PlanDiveTime); 148 setEvent(StMPLAN3_DiveTime, (uint32_t)OnAction_PlanDiveTime);
149 startEdit(); 149 startEdit();
150 } 150 }
151 151
152 152
153 void openEdit_PlanMaxDepth(void) 153 void openEdit_PlanMaxDepth(void)
154 { 154 {
155 char text[32]; 155 char text[32];
156 tMplan_depth_editor = unit_depth_integer(tMplan_depth_meter);
156 157
157 text[0] = '\001'; 158 text[0] = '\001';
158 text[1] = TXT_2BYTE; 159 text[1] = TXT_2BYTE;
159 text[2] = TXT2BYTE_Simulator; 160 text[2] = TXT2BYTE_Simulator;
160 text[3] = 0; 161 text[3] = 0;
163 text[0] = TXT_2BYTE; 164 text[0] = TXT_2BYTE;
164 text[1] = TXT2BYTE_SimMaxDepth; 165 text[1] = TXT2BYTE_SimMaxDepth;
165 text[2] = 0; 166 text[2] = 0;
166 write_label_var( 20, 550, ME_Y_LINE4, &FontT48, text); 167 write_label_var( 20, 550, ME_Y_LINE4, &FontT48, text);
167 168
168 write_field_udigit(StMPLAN4_MaxDepth, 400, 800, ME_Y_LINE4, &FontT48, "###\016\016m\017", (uint32_t)tMplan_depth_meter, 0, 0, 0); 169 if(settingsGetPointer()->nonMetricalSystem)
170 {
171 write_field_udigit(StMPLAN4_MaxDepth, 400, 800, ME_Y_LINE4, &FontT48, "###\016\016ft\017", (uint32_t)tMplan_depth_editor, 0, 0, 0);
172 }
173 else
174 {
175 write_field_udigit(StMPLAN4_MaxDepth, 400, 800, ME_Y_LINE4, &FontT48, "###\016\016m\017", (uint32_t)tMplan_depth_editor, 0, 0, 0);
176 }
177
169 setEvent(StMPLAN4_MaxDepth, (uint32_t)OnAction_PlanMaxDepth); 178 setEvent(StMPLAN4_MaxDepth, (uint32_t)OnAction_PlanMaxDepth);
170 startEdit(); 179 startEdit();
171 } 180 }
172 181
173 182
236 uint32_t newValue; 245 uint32_t newValue;
237 246
238 if(action == ACTION_BUTTON_ENTER_FINAL) 247 if(action == ACTION_BUTTON_ENTER_FINAL)
239 { 248 {
240 evaluateNewString(editId, &newValue, 0, 0, 0); 249 evaluateNewString(editId, &newValue, 0, 0, 0);
241 tMplan_depth_meter = newValue; 250 if(settingsGetPointer()->nonMetricalSystem)
251 {
252 tMplan_depth_editor = newValue * 10 / 33;
253 }
254 else
255 {
256 tMplan_depth_editor = newValue;
257 }
258 tMplan_depth_meter = tMplan_depth_editor;
242 return EXIT_TO_MENU; 259 return EXIT_TO_MENU;
243 } 260 }
244 else 261 else
245 if(action == ACTION_BUTTON_NEXT) 262 if(action == ACTION_BUTTON_NEXT)
246 { 263 {