Mercurial > public > ostc4
annotate Discovery/Src/t7.c @ 110:cc8e24374b83 FlipDisplay
Added option to handled mirrored display to existing functions
| author | Ideenmodellierer |
|---|---|
| date | Tue, 01 Jan 2019 21:02:17 +0100 |
| parents | 8f8ea3a32e82 |
| children | 3834b6272ee5 |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Src/t7.c | |
| 5 /// \brief Main Template file for dive mode 7x | |
| 6 /// \author Heinrichs Weikamp gmbh | |
| 7 /// \date 23-April-2014 | |
| 8 /// | |
| 9 /// \details | |
| 10 /// | |
| 11 /// $Id$ | |
| 12 /////////////////////////////////////////////////////////////////////////////// | |
| 13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
| 14 /// | |
| 15 /// This program is free software: you can redistribute it and/or modify | |
| 16 /// it under the terms of the GNU General Public License as published by | |
| 17 /// the Free Software Foundation, either version 3 of the License, or | |
| 18 /// (at your option) any later version. | |
| 19 /// | |
| 20 /// This program is distributed in the hope that it will be useful, | |
| 21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 23 /// GNU General Public License for more details. | |
| 24 /// | |
| 25 /// You should have received a copy of the GNU General Public License | |
| 26 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 27 ////////////////////////////////////////////////////////////////////////////// | |
| 28 | |
| 29 /* Includes ------------------------------------------------------------------*/ | |
| 30 #include "t7.h" | |
| 31 | |
| 32 //#include "bonexConnect.h" | |
| 33 #include "data_exchange_main.h" | |
| 34 #include "decom.h" | |
| 35 #include "gfx_fonts.h" | |
| 36 #include "logbook_miniLive.h" | |
| 37 #include "math.h" | |
| 38 #include "tHome.h" | |
| 39 #include "simulation.h" | |
| 40 #include "timer.h" | |
| 41 #include "unit.h" | |
| 42 | |
| 43 /* Private function prototypes -----------------------------------------------*/ | |
| 44 | |
| 45 void t7_refresh_surface(void); | |
| 46 void t7_refresh_surface_debugmode(void); | |
| 47 void t7_refresh_divemode(void); | |
| 48 void t7_refresh_sleep_design_fun(void); | |
| 49 void t7_refresh_divemode_userselected_left_lower_corner(void); | |
| 50 void t7_refresh_customview(void); | |
| 51 | |
| 52 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide); | |
| 53 | |
| 54 void t7_tissues(const SDiveState * pState); | |
| 55 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading); | |
| 56 void t7_scooter(void); | |
| 57 void t7_SummaryOfLeftCorner(void); | |
| 58 void t7_debug(void); | |
| 59 | |
| 60 void t7_miniLiveLogProfile(void); | |
| 61 //void t7_clock(void); | |
| 62 void t7_logo_OSTC(void); | |
| 63 void t7_colorscheme_mod(char *text); | |
| 64 | |
| 65 uint8_t t7_test_customview_warnings(void); | |
| 66 void t7_show_customview_warnings(void); | |
| 67 | |
| 68 uint8_t t7_test_customview_warnings_surface_mode(void); | |
| 69 void t7_show_customview_warnings_surface_mode(void); | |
| 70 | |
| 71 uint8_t t7_customtextPrepare(char * text); | |
| 72 | |
| 73 /* Importend function prototypes ---------------------------------------------*/ | |
| 74 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); | |
| 75 | |
| 76 /* Exported variables --------------------------------------------------------*/ | |
| 77 | |
| 78 /* Private variables ---------------------------------------------------------*/ | |
| 79 float depthLastCall[9] = { 0,0,0,0,0,0,0,0,0}; | |
| 80 uint8_t idDepthLastCall = 0; | |
| 81 float temperatureLastCall[3] = { 0,0,0}; | |
| 82 uint8_t idTemperatureLastCall = 0; | |
| 83 | |
| 84 GFX_DrawCfgScreen t7screen; | |
| 85 GFX_DrawCfgScreen t7screenCompass; | |
| 86 | |
| 87 /* left 3 fields | |
| 88 * right 3 fields | |
| 89 * centered one field on top of customview, one below | |
| 90 * customview header + customview + warning | |
| 91 */ | |
| 92 GFX_DrawCfgWindow t7l1, t7l2, t7l3; | |
| 93 GFX_DrawCfgWindow t7r1, t7r2, t7r3; | |
| 94 GFX_DrawCfgWindow t7c1, t7batt, t7c2, t7charge, t7voltage; | |
| 95 GFX_DrawCfgWindow t7cH, t7cC, t7cW, t7cY0free; | |
| 96 GFX_DrawCfgWindow t7pCompass; | |
| 97 GFX_DrawCfgWindow t7surfaceL, t7surfaceR; | |
| 98 | |
| 99 uint8_t selection_custom_field = 1; | |
| 100 uint8_t selection_customview = 1; | |
| 101 | |
| 102 uint8_t updateNecessary = 0; | |
| 103 | |
| 104 typedef struct{ | |
| 105 uint32_t pointer; | |
| 106 uint32_t x0; | |
| 107 uint32_t y0; | |
| 108 uint32_t width; | |
| 109 uint32_t height; | |
| 110 } SBackground; | |
| 111 | |
| 112 SBackground background = | |
| 113 { | |
| 114 .pointer = NULL, | |
| 115 }; | |
| 116 | |
| 117 | |
| 118 /* Private types -------------------------------------------------------------*/ | |
| 119 const uint8_t customviewsDiveStandard[] = | |
| 120 { | |
| 121 CVIEW_sensors, | |
| 122 CVIEW_Compass, | |
| 123 CVIEW_Decolist, | |
| 124 CVIEW_Tissues, | |
| 125 CVIEW_Profile, | |
| 126 CVIEW_Gaslist, | |
| 127 CVIEW_sensors_mV, | |
| 128 CVIEW_EADTime, | |
| 129 CVIEW_SummaryOfLeftCorner, | |
| 130 CVIEW_noneOrDebug, | |
| 131 CVIEW_END, | |
| 132 CVIEW_END | |
| 133 }; | |
| 134 | |
| 135 const uint8_t customviewsSurfaceStandard[] = | |
| 136 { | |
| 137 // CVIEW_CompassDebug, | |
| 138 CVIEW_Hello, | |
| 139 CVIEW_sensors, | |
| 140 CVIEW_Compass, | |
| 141 CVIEW_Tissues, | |
| 142 CVIEW_sensors_mV, | |
| 143 CVIEW_END, | |
| 144 CVIEW_END | |
| 145 }; | |
| 146 | |
| 147 const uint8_t customviewsDiveScooter[] = | |
| 148 { | |
| 149 CVIEW_Scooter, | |
| 150 CVIEW_sensors, | |
| 151 CVIEW_Compass, | |
| 152 CVIEW_Decolist, | |
| 153 CVIEW_Tissues, | |
| 154 CVIEW_Profile, | |
| 155 CVIEW_Gaslist, | |
| 156 CVIEW_sensors_mV, | |
| 157 CVIEW_EADTime, | |
| 158 CVIEW_SummaryOfLeftCorner, | |
| 159 CVIEW_noneOrDebug, | |
| 160 CVIEW_END, | |
| 161 CVIEW_END | |
| 162 }; | |
| 163 | |
| 164 const uint8_t customviewsSurfaceScooter[] = | |
| 165 { | |
| 166 // CVIEW_CompassDebug, | |
| 167 CVIEW_Scooter, | |
| 168 CVIEW_Hello, | |
| 169 CVIEW_sensors, | |
| 170 CVIEW_Compass, | |
| 171 CVIEW_Tissues, | |
| 172 CVIEW_sensors_mV, | |
| 173 CVIEW_END, | |
| 174 CVIEW_END | |
| 175 }; | |
| 176 | |
| 177 const uint8_t *customviewsDive = customviewsDiveStandard; | |
| 178 const uint8_t *customviewsSurface = customviewsSurfaceStandard; | |
| 179 | |
| 180 #define TEXTSIZE 16 | |
| 181 /* offset includes line: 2 = line +1 | |
| 182 * box (line) is 300 px | |
| 183 * inside is 296 px | |
| 184 * left of box are 249 px ( 0..248) | |
| 185 * right of box are 249 px (551 .. 799) | |
| 186 */ | |
| 187 | |
| 188 #define CUSTOMBOX_LINE_LEFT (250) | |
| 189 #define CUSTOMBOX_LINE_RIGHT (549) | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
190 #define CUSTOMBOX_LINE_TOP (0) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
191 #define CUSTOMBOX_LINE_MIDDLE (142) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
192 #define CUSTOMBOX_LINE_BOTTOM (318) |
| 38 | 193 #define CUSTOMBOX_INSIDE_OFFSET (2) |
| 194 #define CUSTOMBOX_OUTSIDE_OFFSET (2) | |
| 195 #define CUSTOMBOX_SPACE_INSIDE (CUSTOMBOX_LINE_RIGHT + 1 - (CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + CUSTOMBOX_INSIDE_OFFSET)) | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
196 #define TOP_LINE_HIGHT (25) |
| 38 | 197 |
| 198 /* Exported functions --------------------------------------------------------*/ | |
| 199 | |
| 200 void t7_init(void) | |
| 201 { | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
202 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
203 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
204 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
205 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
206 |
| 38 | 207 if(getLicence() == LICENCEBONEX) |
| 208 { | |
| 209 customviewsDive = customviewsDiveScooter; | |
| 210 customviewsSurface = customviewsSurfaceScooter; | |
| 211 } | |
| 212 | |
| 213 selection_custom_field = 1; | |
| 214 selection_customview = customviewsSurface[0]; | |
| 215 | |
| 216 t7screen.FBStartAdress = 0; | |
| 217 t7screen.ImageHeight = 480; | |
| 218 t7screen.ImageWidth = 800; | |
| 219 t7screen.LayerIndex = 1; | |
| 220 | |
| 221 t7screenCompass.FBStartAdress = 0; | |
| 222 t7screenCompass.ImageHeight = 240; | |
| 223 t7screenCompass.ImageWidth = 1600; | |
| 224 t7screenCompass.LayerIndex = 0; | |
| 225 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
226 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
227 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
228 t7l1.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
229 t7l1.WindowNumberOfTextLines = 2; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
230 t7l1.WindowLineSpacing = 19; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
231 t7l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
232 t7l1.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
233 t7l1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
234 t7l1.WindowY0 = 318; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
235 t7l1.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
236 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
237 t7l2.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
238 t7l2.WindowNumberOfTextLines = 2; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
239 t7l2.WindowLineSpacing = 22; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
240 t7l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
241 t7l2.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
242 t7l2.WindowX1 = t7l1.WindowX1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
243 t7l2.WindowY0 = 142; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
244 t7l2.WindowY1 = t7l1.WindowY0 - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
245 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
246 t7l3.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
247 t7l3.WindowNumberOfTextLines = 2; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
248 t7l3.WindowLineSpacing = 58; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
249 t7l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
250 t7l3.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
251 t7l3.WindowX1 = t7l1.WindowX1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
252 t7l3.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
253 t7l3.WindowY1 = t7l2.WindowY0 - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
254 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
255 t7r1.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
256 t7r1.WindowNumberOfTextLines = 2; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
257 t7r1.WindowLineSpacing = t7l1.WindowLineSpacing; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
258 t7r1.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
259 t7r1.WindowX0 = 550; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
260 t7r1.WindowX1 = 799; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
261 t7r1.WindowY0 = t7l1.WindowY0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
262 t7r1.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
263 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
264 t7r2.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
265 t7r2.WindowNumberOfTextLines = 2; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
266 t7r2.WindowLineSpacing = t7l2.WindowLineSpacing; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
267 t7r2.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
268 t7r2.WindowX0 = 550; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
269 t7r2.WindowX1 = 799; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
270 t7r2.WindowY0 = t7l2.WindowY0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
271 t7r2.WindowY1 = t7l2.WindowY1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
272 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
273 t7r3.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
274 t7r3.WindowNumberOfTextLines = 2; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
275 t7r3.WindowLineSpacing = 0;//t7l3.WindowLineSpacing; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
276 t7r3.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
277 t7r3.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
278 t7r3.WindowX1 = 799; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
279 t7r3.WindowY0 = t7l3.WindowY0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
280 t7r3.WindowY1 = t7l3.WindowY1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
281 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
282 t7cC.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
283 t7cC.WindowNumberOfTextLines = 3; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
284 t7cC.WindowLineSpacing = 95; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
285 t7cC.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
286 t7cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
287 t7cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
288 t7cC.WindowY0 = 90; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
289 t7cC.WindowY1 = 434 - 95; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
290 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
291 t7cH.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
292 t7cH.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
293 t7cH.WindowLineSpacing = 95; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
294 t7cH.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
295 t7cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
296 t7cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
297 t7cH.WindowY0 = 434 - 94; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
298 t7cH.WindowY1 = 434; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
299 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
300 t7cW.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
301 t7cW.WindowNumberOfTextLines = 3; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
302 t7cW.WindowLineSpacing = 95; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
303 t7cW.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
304 t7cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
305 t7cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
306 t7cW.WindowY0 = 90; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
307 t7cW.WindowY1 = 434 - 95; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
308 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
309 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
310 t7surfaceL.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
311 t7surfaceL.WindowNumberOfTextLines = 9; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
312 t7surfaceL.WindowLineSpacing = 53; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
313 t7surfaceL.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
314 t7surfaceL.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
315 t7surfaceL.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
316 t7surfaceL.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
317 t7surfaceL.WindowY1 = 480; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
318 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
319 t7surfaceR.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
320 t7surfaceR.WindowNumberOfTextLines = 9; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
321 t7surfaceR.WindowLineSpacing = 53; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
322 t7surfaceR.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
323 t7surfaceR.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
324 t7surfaceR.WindowX1 = 800; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
325 t7surfaceR.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
326 t7surfaceR.WindowY1 = 480; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
327 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
328 t7cY0free.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
329 t7cY0free.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
330 t7cY0free.WindowLineSpacing = 95; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
331 t7cY0free.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
332 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
333 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
334 t7cY0free.WindowY0 = 90; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
335 t7cY0free.WindowY1 = 434 - 95; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
336 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
337 t7batt.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
338 t7batt.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
339 t7batt.WindowLineSpacing = 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
340 t7batt.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
341 t7batt.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
342 t7batt.WindowX0 = t7batt.WindowX1 - (52+52); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
343 t7batt.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
344 t7batt.WindowY0 = t7batt.WindowY1 - 25; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
345 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
346 t7charge.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
347 t7charge.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
348 t7charge.WindowLineSpacing = 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
349 t7charge.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
350 t7charge.WindowX1 = t7batt.WindowX1 - 18; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
351 t7charge.WindowX0 = t7charge.WindowX1 - 14; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
352 t7charge.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
353 t7charge.WindowY0 = t7batt.WindowY1 - 25; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
354 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
355 t7voltage.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
356 t7voltage.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
357 t7voltage.WindowLineSpacing = 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
358 t7voltage.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
359 t7voltage.WindowX0 = t7charge.WindowX0 - 30; //10 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
360 t7voltage.WindowX1 = t7voltage.WindowX0 + (18*3)+ 9; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
361 t7voltage.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
362 t7voltage.WindowY0 = t7batt.WindowY1 - 25; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
363 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
364 t7c1.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
365 t7c1.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
366 t7c1.WindowLineSpacing = 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
367 t7c1.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
368 t7c1.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
369 t7c1.WindowX1 = t7batt.WindowX0 - 18; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
370 t7c1.WindowY0 = 435; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
371 t7c1.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
372 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
373 t7c2.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
374 t7c2.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
375 t7c2.WindowLineSpacing = 0; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
376 t7c2.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
377 t7c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
378 t7c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
379 t7c2.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
380 t7c2.WindowY1 = 69; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
381 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
382 t7pCompass.Image = &t7screenCompass; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
383 t7pCompass.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
384 t7pCompass.WindowLineSpacing = 100; // Abstand von Y0 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
385 t7pCompass.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
386 t7pCompass.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
387 t7pCompass.WindowX1 = 1600-1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
388 t7pCompass.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
389 t7pCompass.WindowY1 = 100-1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
390 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
391 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
392 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
393 /* 6 segments (left / right) used to show data during dive */ |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
394 |
| 38 | 395 t7l1.Image = &t7screen; |
| 396 t7l1.WindowNumberOfTextLines = 2; | |
| 397 t7l1.WindowLineSpacing = 19; // Abstand von Y0 | |
| 398 t7l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
399 t7l1.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
400 t7l1.WindowX1 = 799; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
401 t7l1.WindowY0 = CUSTOMBOX_LINE_TOP; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
402 t7l1.WindowY1 = 150 + TOP_LINE_HIGHT; |
| 38 | 403 |
| 404 t7l2.Image = &t7screen; | |
| 405 t7l2.WindowNumberOfTextLines = 2; | |
| 406 t7l2.WindowLineSpacing = 22; // Abstand von Y0 | |
| 407 t7l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
408 t7l2.WindowX0 = t7l1.WindowX0; |
| 38 | 409 t7l2.WindowX1 = t7l1.WindowX1; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
410 t7l2.WindowY0 = t7l1.WindowY1 + 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
411 t7l2.WindowY1 = t7l2.WindowY0 + 146; |
| 38 | 412 |
| 413 t7l3.Image = &t7screen; | |
| 414 t7l3.WindowNumberOfTextLines = 2; | |
| 415 t7l3.WindowLineSpacing = 58; // Abstand von Y0 | |
| 416 t7l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
417 t7l3.WindowX0 = t7l1.WindowX0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
418 t7l3.WindowX1 = t7l1.WindowX1;; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
419 t7l3.WindowY0 = 479 - 150; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
420 t7l3.WindowY1 = 479; |
| 38 | 421 |
| 422 t7r1.Image = &t7screen; | |
| 423 t7r1.WindowNumberOfTextLines = 2; | |
| 424 t7r1.WindowLineSpacing = t7l1.WindowLineSpacing; | |
| 425 t7r1.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
426 t7r1.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
427 t7r1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
| 38 | 428 t7r1.WindowY0 = t7l1.WindowY0; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
429 t7r1.WindowY1 = t7l1.WindowY1; |
| 38 | 430 |
| 431 t7r2.Image = &t7screen; | |
| 432 t7r2.WindowNumberOfTextLines = 2; | |
| 433 t7r2.WindowLineSpacing = t7l2.WindowLineSpacing; | |
| 434 t7r2.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
435 t7r2.WindowX0 = t7r1.WindowX0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
436 t7r2.WindowX1 = t7r1.WindowX1; |
| 38 | 437 t7r2.WindowY0 = t7l2.WindowY0; |
| 438 t7r2.WindowY1 = t7l2.WindowY1; | |
| 439 | |
| 440 t7r3.Image = &t7screen; | |
| 441 t7r3.WindowNumberOfTextLines = 2; | |
| 442 t7r3.WindowLineSpacing = 0;//t7l3.WindowLineSpacing; | |
| 443 t7r3.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
444 t7r3.WindowX0 = t7r1.WindowX0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
445 t7r3.WindowX1 = t7r1.WindowX1; |
| 38 | 446 t7r3.WindowY0 = t7l3.WindowY0; |
| 447 t7r3.WindowY1 = t7l3.WindowY1; | |
| 448 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
449 /* screen for CustomText / serial number */ |
| 38 | 450 t7cC.Image = &t7screen; |
| 451 t7cC.WindowNumberOfTextLines = 3; | |
| 452 t7cC.WindowLineSpacing = 95; // Abstand von Y0 | |
| 453 t7cC.WindowTab = 100; | |
| 454 t7cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 455 t7cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
456 t7cC.WindowY0 = 165; //90; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
457 t7cC.WindowY1 = 415; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
458 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
459 /* used by warning message box */ |
| 38 | 460 t7cH.Image = &t7screen; |
| 461 t7cH.WindowNumberOfTextLines = 1; | |
| 462 t7cH.WindowLineSpacing = 95; // Abstand von Y0 | |
| 463 t7cH.WindowTab = 100; | |
| 464 t7cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 465 t7cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
466 t7cH.WindowY0 = 46; //480 - 434; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
467 t7cH.WindowY1 = 390 - 46;// - 90; //46 + 390; //480 - (434 - 94); //434; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
468 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
469 /* used by warning custom box */ |
| 38 | 470 t7cW.Image = &t7screen; |
| 471 t7cW.WindowNumberOfTextLines = 3; | |
| 472 t7cW.WindowLineSpacing = 95; // Abstand von Y0 | |
| 473 t7cW.WindowTab = 100; | |
| 474 t7cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 475 t7cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
476 t7cW.WindowY0 = 480 - (434 - 90); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
477 t7cW.WindowY1 = 480 - 90; //434 - 95; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
478 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
479 /* time and environment */ |
| 38 | 480 t7surfaceL.Image = &t7screen; |
| 481 t7surfaceL.WindowNumberOfTextLines = 9; | |
| 482 t7surfaceL.WindowLineSpacing = 53; | |
| 483 t7surfaceL.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
484 t7surfaceL.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
485 t7surfaceL.WindowX1 = 799; |
| 38 | 486 t7surfaceL.WindowY0 = 0; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
487 t7surfaceL.WindowY1 = 479; |
| 38 | 488 |
| 489 t7surfaceR.Image = &t7screen; | |
| 490 t7surfaceR.WindowNumberOfTextLines = 9; | |
| 491 t7surfaceR.WindowLineSpacing = 53; | |
| 492 t7surfaceR.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
493 t7surfaceR.WindowX0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
494 t7surfaceR.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET; |
| 38 | 495 t7surfaceR.WindowY0 = 0; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
496 t7surfaceR.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
497 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
498 /* info screen in the middle */ |
| 38 | 499 t7cY0free.Image = &t7screen; |
| 500 t7cY0free.WindowNumberOfTextLines = 1; | |
| 501 t7cY0free.WindowLineSpacing = 95; | |
| 502 t7cY0free.WindowTab = 100; | |
| 503 t7cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 504 t7cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
505 t7cY0free.WindowY0 = 115; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
506 t7cY0free.WindowY1 = 365; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
507 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
508 /* voltage value (V or %) */ |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
509 t7voltage.Image = &t7screen; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
510 t7voltage.WindowNumberOfTextLines = 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
511 t7voltage.WindowLineSpacing = 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
512 t7voltage.WindowTab = 100; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
513 t7voltage.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
514 t7voltage.WindowX1 = t7voltage.WindowX0 + (18*3) +9; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
515 t7voltage.WindowY1 = TOP_LINE_HIGHT; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
516 t7voltage.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
517 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
518 /* battery symbol */ |
| 38 | 519 t7batt.Image = &t7screen; |
| 520 t7batt.WindowNumberOfTextLines = 1; | |
| 521 t7batt.WindowLineSpacing = 10; | |
| 522 t7batt.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
523 t7batt.WindowX0 = t7voltage.WindowX1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
524 t7batt.WindowX1 = t7batt.WindowX0 + (52); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
525 t7batt.WindowY1 = TOP_LINE_HIGHT; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
526 t7batt.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
527 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
528 /* charger symbol */ |
| 38 | 529 t7charge.Image = &t7screen; |
| 530 t7charge.WindowNumberOfTextLines = 1; | |
| 531 t7charge.WindowLineSpacing = 10; | |
| 532 t7charge.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
533 t7charge.WindowX1 = t7batt.WindowX0 - 18; |
| 38 | 534 t7charge.WindowX0 = t7charge.WindowX1 - 14; |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
535 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
536 t7charge.WindowY1 = TOP_LINE_HIGHT; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
537 t7charge.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
538 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
539 /* show dive mode OC / CC */ |
| 38 | 540 t7c1.Image = &t7screen; |
| 541 t7c1.WindowNumberOfTextLines = 1; | |
| 542 t7c1.WindowLineSpacing = 10; | |
| 543 t7c1.WindowTab = 100; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
544 t7c1.WindowX0 = t7batt.WindowX1 + 18; //CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
545 t7c1.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; //t7batt.WindowX1 + 18; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
546 t7c1.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
547 t7c1.WindowY1 = 479 - 435; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
548 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
549 /* Gas warnings and exit Sim*/ |
| 38 | 550 t7c2.Image = &t7screen; |
| 551 t7c2.WindowNumberOfTextLines = 1; | |
| 552 t7c2.WindowLineSpacing = 0; // Abstand von Y0 | |
| 553 t7c2.WindowTab = 100; | |
| 554 t7c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 555 t7c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
556 t7c2.WindowY0 = 480 - 69; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
557 t7c2.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
558 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
559 /* Rotating compass */ |
| 38 | 560 t7pCompass.Image = &t7screenCompass; |
| 561 t7pCompass.WindowNumberOfTextLines = 1; | |
| 562 t7pCompass.WindowLineSpacing = 100; // Abstand von Y0 | |
| 563 t7pCompass.WindowTab = 100; | |
| 564 t7pCompass.WindowX0 = 0; | |
| 565 t7pCompass.WindowX1 = 1600-1; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
566 t7pCompass.WindowY0 = 479 - 75; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
567 t7pCompass.WindowY1 = 479; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
568 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
569 } |
| 38 | 570 |
| 571 init_t7_compass(); | |
| 572 } | |
| 573 | |
| 574 | |
| 575 void t7_refresh_sleepmode_fun(void) | |
| 576 { | |
| 577 uint32_t oldScreen; | |
| 578 | |
| 579 oldScreen = t7screen.FBStartAdress; | |
| 580 t7screen.FBStartAdress = getFrame(22); | |
| 581 | |
| 582 t7_refresh_sleep_design_fun(); | |
| 583 | |
| 584 if(get_globalState() == StStop) | |
| 585 { | |
| 586 GFX_SetFramesTopBottom(t7screen.FBStartAdress, NULL,480); | |
| 587 } | |
| 588 releaseFrame(22,oldScreen); | |
| 589 } | |
| 590 | |
| 591 | |
| 592 void t7_refresh(void) | |
| 593 { | |
| 594 static uint8_t last_mode = MODE_SURFACE; | |
| 595 | |
| 596 // uint32_t oldScreen;//, oldPlugin; | |
| 597 SStateList status; | |
| 598 get_globalStateList(&status); | |
| 599 | |
| 600 t7screen.FBStartAdress = getFrame(22); | |
| 601 | |
| 602 background.pointer = 0; | |
| 603 | |
| 604 if(stateUsed->mode == MODE_DIVE) | |
| 605 { | |
| 606 if(last_mode != MODE_DIVE) | |
| 607 { | |
| 608 last_mode = MODE_DIVE; | |
| 609 /* lower left corner primary */ | |
| 610 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
| 611 /* custom view primary OR debug if automatic return is off */ | |
| 612 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo)) | |
| 613 selection_customview = CVIEW_noneOrDebug; | |
| 614 else | |
| 615 selection_customview = settingsGetPointer()->tX_customViewPrimary; | |
| 616 } | |
| 617 | |
| 618 if(status.page == PageSurface) | |
| 619 set_globalState(StD); | |
| 620 | |
| 621 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) | |
| 622 { | |
| 623 settingsGetPointer()->design = 5; | |
| 624 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
| 625 releaseFrame(22,t7screen.FBStartAdress); | |
| 626 return; | |
| 627 } | |
| 628 else if(stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) | |
| 629 { | |
| 630 settingsGetPointer()->design = 6; | |
| 631 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
| 632 releaseFrame(22,t7screen.FBStartAdress); | |
| 633 return; | |
| 634 } | |
| 635 else if(DataEX_scooterFoundAndValidLicence()) // new for t9 hw 160711 | |
| 636 { | |
| 637 settingsGetPointer()->design = 9; | |
| 638 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
| 639 releaseFrame(22,t7screen.FBStartAdress); | |
| 640 return; | |
| 641 } | |
| 642 else | |
| 643 { | |
| 644 t7_refresh_divemode(); | |
| 645 } | |
| 646 } | |
| 647 else // from if(stateUsed->mode == MODE_DIVE) | |
| 648 { | |
| 649 if(last_mode != MODE_SURFACE) | |
| 650 { | |
| 651 last_mode = MODE_SURFACE; | |
| 652 selection_customview = customviewsSurface[0]; | |
| 653 } | |
| 654 if(status.page == PageDive) | |
| 655 set_globalState(StS); | |
| 656 | |
| 657 if(settingsGetPointer()->showDebugInfo) | |
| 658 t7_refresh_surface_debugmode(); | |
| 659 else | |
| 660 t7_refresh_surface(); | |
| 661 } | |
| 662 | |
| 663 tHome_show_lost_connection_count(&t7screen); | |
| 664 | |
| 665 if(status.base == BaseHome) | |
| 666 { | |
| 667 if(background.pointer) | |
| 668 { | |
| 669 GFX_SetFrameTop(t7screen.FBStartAdress); | |
| 670 GFX_SetFrameBottom(background.pointer,background.x0 , background.y0, background.width, background.height); | |
| 671 } | |
| 672 else | |
| 673 GFX_SetFramesTopBottom(t7screen.FBStartAdress, NULL,480); | |
| 674 } | |
| 675 | |
| 676 releaseAllFramesExcept(22,t7screen.FBStartAdress); | |
| 677 } | |
| 678 | |
| 679 /* Private functions ---------------------------------------------------------*/ | |
| 680 | |
| 681 void t7_fill_surfacetime_helper(SSurfacetime *outArray, uint32_t inputMinutes, uint32_t inputSeconds) | |
| 682 { | |
| 683 inputSeconds += inputMinutes * 60; | |
| 684 | |
| 685 outArray->Total = inputSeconds; | |
| 686 | |
| 687 outArray->Days = inputSeconds / 86400;// (24*60*60); | |
| 688 inputSeconds -= 86400 * (uint32_t)outArray->Days; | |
| 689 | |
| 690 outArray->Hours = inputSeconds / 3600;// (60*60); | |
| 691 inputSeconds -= 3600 * (uint32_t)outArray->Hours; | |
| 692 | |
| 693 outArray->Minutes = inputSeconds / 60;; | |
| 694 inputSeconds -= 60 * (uint32_t)outArray->Minutes; | |
| 695 | |
| 696 outArray->Seconds = inputSeconds; | |
| 697 } | |
| 698 | |
| 699 void t7_refresh_sleep_design_fun(void) | |
| 700 { | |
| 701 static uint16_t state = 0; | |
| 702 uint16_t ytop = 0; | |
| 703 | |
| 704 state +=1; | |
| 705 if(state > 800) | |
| 706 state = 1; | |
| 707 | |
| 708 if(state > 400) | |
| 709 ytop = 800 - state; | |
| 710 else | |
| 711 ytop = 0 + state; | |
| 712 Gfx_write_label_var(&t7screen, 300,800, ytop,&FontT48,CLUT_Font020,"SLEEP SLEEP SLEEP"); | |
| 713 } | |
| 714 | |
| 715 void t7_refresh_surface(void) | |
| 716 { | |
| 717 char text[256]; | |
| 718 uint8_t date[3], year,month,day; | |
| 719 uint32_t color; | |
| 720 uint8_t customview_warnings = 0; | |
| 721 | |
| 722 RTC_DateTypeDef Sdate; | |
| 723 RTC_TimeTypeDef Stime; | |
| 724 RTC_DateTypeDef SdateFirmware; | |
| 725 | |
| 726 uint8_t dateNotSet = 0; | |
| 727 | |
| 728 uint8_t oxygen_percentage, gasOffset, actualGasID; | |
| 729 // uint16_t bottleFirstGas_bar; | |
| 730 point_t start, stop;//, other; | |
| 731 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
732 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
733 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
734 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
735 |
| 38 | 736 // update in all customview modes |
| 737 if(DataEX_check_RTE_version__needs_update() || font_update_required()) | |
| 738 updateNecessary = 1; | |
| 739 else | |
| 740 updateNecessary = 0; | |
| 741 | |
| 742 /* buttons */ | |
| 743 text[0] = TXT_2BYTE; | |
| 744 text[1] = TXT2BYTE_ButtonLogbook; | |
| 745 text[2] = 0; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
746 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
| 38 | 747 |
| 748 text[0] = '\001'; | |
| 749 text[1] = TXT_2BYTE; | |
| 750 text[2] = TXT2BYTE_ButtonView; | |
| 751 text[3] = 0; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
752 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
| 38 | 753 |
| 754 text[0] = '\002'; | |
| 755 text[1] = TXT_2BYTE; | |
| 756 text[2] = TXT2BYTE_ButtonMenu; | |
| 757 text[3] = 0; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
758 write_content_simple(&t7screen, 0, 799, 479-TOP_LINE_HIGHT, &FontT24,text,CLUT_ButtonSurfaceScreen); |
| 38 | 759 |
| 760 /* | |
| 761 // scooter connected? | |
| 762 if(bC_getData(0,0,0,0) == BC_CONNECTED) | |
| 763 { | |
| 764 text[0] = '\f'; | |
| 765 text[1] = '\002'; | |
| 766 memcpy(&text[2],&settingsGetPointer()->scooterDeviceName,19); | |
| 767 text[21] = 0; | |
| 768 GFX_write_string_color(&FontT24,&t7r1,text,0,CLUT_NiceGreen); | |
| 769 } | |
| 770 */ | |
| 771 | |
| 772 /* was power on reset */ | |
| 773 //..... | |
| 774 /* removed hw 160802 in V1.1.1 | |
| 775 if(errorsInSettings) | |
| 776 { | |
| 777 sprintf(text,"Settings: %u",errorsInSettings); | |
| 778 GFX_write_string_color(&FontT42,&t7surfaceR,text,4,CLUT_WarningRed); | |
| 779 } | |
| 780 else | |
| 781 */ | |
| 782 if(DataEX_was_power_on()) | |
| 783 GFX_write_string_color(&FontT42,&t7surfaceR,"cold start",4,CLUT_WarningRed); | |
| 784 | |
| 785 /* time and date */ | |
| 786 translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); | |
| 787 translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); | |
| 788 | |
| 789 firmwareGetDate(&SdateFirmware); | |
| 790 if(tHome_DateCode(&Sdate) < tHome_DateCode(&SdateFirmware)) | |
| 791 dateNotSet = 1; | |
| 792 else | |
| 793 dateNotSet = 0; | |
| 794 /* | |
| 795 if(Stime.Seconds % 2) | |
| 796 snprintf(text,255,"\001%02d:%02d",Stime.Hours,Stime.Minutes); | |
| 797 else | |
| 798 snprintf(text,255,"\001%02d\021:\020%02d",Stime.Hours,Stime.Minutes); | |
| 799 GFX_write_string(&FontT54,&t7surfaceR,text,3); | |
| 800 */ | |
| 801 // debug version: | |
| 802 if(Stime.Seconds % 2) | |
| 803 snprintf(text,255,"\001%02d:%02d:%02d",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
| 804 else if(dateNotSet) | |
| 805 snprintf(text,255,"\001\021%02d:%02d:%02d\020",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
| 806 else | |
| 807 snprintf(text,255,"\001%02d\021:\020%02d:%02d",Stime.Hours,Stime.Minutes,Stime.Seconds); | |
| 808 GFX_write_string(&FontT54,&t7surfaceR,text,3); | |
| 809 | |
| 810 if(settingsGetPointer()->date_format == DDMMYY) | |
| 811 { | |
| 812 day = 0; | |
| 813 month = 1; | |
| 814 year = 2; | |
| 815 } | |
| 816 else | |
| 817 if(settingsGetPointer()->date_format == MMDDYY) | |
| 818 { | |
| 819 day = 1; | |
| 820 month = 0; | |
| 821 year = 2; | |
| 822 } | |
| 823 else | |
| 824 { | |
| 825 day = 2; | |
| 826 month = 1; | |
| 827 year = 0; | |
| 828 } | |
| 829 date[day] = Sdate.Date; | |
| 830 date[month] = Sdate.Month; | |
| 831 date[year] = Sdate.Year; | |
| 832 | |
| 833 if((Stime.Seconds % 2) || (dateNotSet == 0)) | |
| 834 snprintf(text,255,"\001%02d.%02d.%02d",date[0],date[1],date[2]); | |
| 835 else | |
| 836 snprintf(text,255,"\001\021%02d.%02d.%02d",date[0],date[1],date[2]); | |
| 837 | |
| 838 GFX_write_string(&FontT54,&t7surfaceR,text,5); | |
| 839 | |
| 840 if(!DataEX_was_power_on() && !errorsInSettings) | |
| 841 { | |
| 842 text[0] = '\001'; | |
| 843 text[1] = '\004'; | |
| 844 text[2] = TXT_2BYTE; | |
| 845 text[3] = TXT2BYTE_Sunday; | |
| 846 text[4] = 0; | |
| 847 if(Sdate.WeekDay != RTC_WEEKDAY_SUNDAY) | |
| 848 text[3] += Sdate.WeekDay; | |
| 849 | |
| 850 if(!(Stime.Seconds % 2) && (dateNotSet == 1)) | |
| 851 text[1] = '\021'; | |
| 852 | |
| 853 GFX_write_string(&FontT24,&t7surfaceR,text,4); | |
| 854 } | |
| 855 | |
| 856 /* DEBUG uTick Pressure and Compass */ | |
| 857 /* | |
| 858 snprintf(text,255,"\001%u",stateRealGetPointer()->pressure_uTick_new - stateRealGetPointer()->pressure_uTick_old); | |
| 859 GFX_write_string(&FontT42,&t7surfaceR,text,1); | |
| 860 snprintf(text,255,"\001%u",HAL_GetTick() - stateRealGetPointer()->pressure_uTick_local_new); | |
| 861 GFX_write_string(&FontT42,&t7surfaceR,text,2); | |
| 862 | |
| 863 snprintf(text,255,"\001%u",stateRealGetPointer()->compass_uTick_new - stateRealGetPointer()->compass_uTick_old); | |
| 864 GFX_write_string(&FontT42,&t7surfaceR,text,6); | |
| 865 snprintf(text,255,"\001%u",HAL_GetTick() - stateRealGetPointer()->compass_uTick_local_new); | |
| 866 GFX_write_string(&FontT42,&t7surfaceR,text,7); | |
| 867 | |
| 868 static uint32_t bildschirmRefresh = 0; | |
| 869 snprintf(text,255,"\001%u",HAL_GetTick() - bildschirmRefresh); | |
| 870 GFX_write_string(&FontT42,&t7surfaceR,text,8); | |
| 871 bildschirmRefresh = HAL_GetTick(); | |
| 872 | |
| 873 static uint16_t bildschirmRefreshCount = 1; | |
| 874 if(bildschirmRefreshCount>10) | |
| 875 bildschirmRefreshCount = 1; | |
| 876 for(int i=0;i<bildschirmRefreshCount;i++) | |
| 877 text[i] = '.'; | |
| 878 text[bildschirmRefreshCount++] = 0; | |
| 879 GFX_write_string(&FontT42,&t7surfaceR,text,4); | |
| 880 */ | |
| 881 | |
| 882 /* noFlyTime or DesaturationTime */ | |
| 883 | |
| 884 if((!display_count_high_time) && (stateUsed->lifeData.no_fly_time_minutes)) | |
| 885 { | |
| 886 SSurfacetime NoFlyTime = {0,0,0,0}; | |
| 887 t7_fill_surfacetime_helper(&NoFlyTime,stateUsed->lifeData.no_fly_time_minutes, 0); | |
| 888 | |
| 889 if(NoFlyTime.Days) | |
| 890 { | |
| 891 snprintf(text,30,"\001%02d\016\016d\017 %02d\016\016h\017",NoFlyTime.Days, NoFlyTime.Hours); | |
| 892 } | |
| 893 else | |
| 894 { | |
| 895 snprintf(text,20,"\001%02d:%02d",NoFlyTime.Hours, NoFlyTime.Minutes); | |
| 896 } | |
| 897 | |
| 898 GFX_write_string(&FontT54,&t7surfaceR,text,7); | |
| 899 | |
| 900 text[0] = '\001'; | |
| 901 text[1] = '\022'; | |
| 902 text[2] = '\016'; | |
| 903 text[3] = '\016'; | |
| 904 text[4] = TXT_2BYTE; | |
| 905 text[5] = TXT2BYTE_noFly; | |
| 906 text[6] = 0; | |
| 907 GFX_write_string(&FontT48,&t7surfaceR,text,6); | |
| 908 } | |
| 909 else | |
| 910 if(stateUsed->lifeData.desaturation_time_minutes) | |
| 911 { | |
| 912 SSurfacetime DesatTime = {0,0,0,0}; | |
| 913 t7_fill_surfacetime_helper(&DesatTime,stateUsed->lifeData.desaturation_time_minutes, 0); | |
| 914 | |
| 915 if(DesatTime.Days) | |
| 916 { | |
| 917 snprintf(text,30,"\001%02d\016\016d\017 %02d\016\016h\017",DesatTime.Days, DesatTime.Hours); | |
| 918 } | |
| 919 else | |
| 920 { | |
| 921 snprintf(text,20,"\001%02d:%02d",DesatTime.Hours, DesatTime.Minutes); | |
| 922 } | |
| 923 GFX_write_string(&FontT54,&t7surfaceR,text,7); | |
| 924 | |
| 925 text[0] = '\001'; | |
| 926 text[1] = '\022'; | |
| 927 text[2] = '\016'; | |
| 928 text[3] = '\016'; | |
| 929 text[4] = TXT_2BYTE; | |
| 930 text[5] = TXT2BYTE_Desaturation; | |
| 931 text[6] = 0; | |
| 932 GFX_write_string(&FontT48,&t7surfaceR,text,6); | |
| 933 } | |
| 934 | |
| 935 /* Time since last dive */ | |
| 936 if(stateUsed->lifeData.surface_time_seconds) | |
| 937 { | |
| 938 SSurfacetime SurfTime = {0,0,0,0}; | |
| 939 t7_fill_surfacetime_helper(&SurfTime, 0, stateUsed->lifeData.surface_time_seconds); | |
| 940 | |
| 941 if(SurfTime.Days == 0) | |
| 942 { | |
| 943 snprintf(text,20,"\001\022%02d:%02d",SurfTime.Hours, SurfTime.Minutes); | |
| 944 } | |
| 945 else | |
| 946 { | |
| 947 snprintf(text,30,"\001\022%02d\016\016d\017 %02d\016\016h\017",SurfTime.Days, SurfTime.Hours); | |
| 948 } | |
| 949 | |
| 950 GFX_write_string(&FontT54,&t7surfaceR,text,2); | |
| 951 | |
| 952 | |
| 953 text[0] = '\001'; | |
| 954 text[1] = '\022'; | |
| 955 text[2] = '\016'; | |
| 956 text[3] = '\016'; | |
| 957 text[4] = TXT_2BYTE; | |
| 958 text[5] = TXT2BYTE_TimeSinceLastDive; | |
| 959 text[6] = 0; | |
| 960 GFX_write_string(&FontT48,&t7surfaceR,text,1); | |
| 961 } | |
| 962 | |
| 963 /* beta version */ | |
| 964 if( firmwareDataGetPointer()->versionBeta ) | |
| 965 { | |
| 966 snprintf(text,255,"\025 BETA"); | |
| 967 GFX_write_string(&FontT48,&t7surfaceL,text,2); | |
| 968 } | |
| 969 | |
| 970 /* surface pressure and temperature */ | |
| 971 if(stateUsed->sensorErrorsRTE == 0) | |
| 972 { | |
| 973 snprintf(text,30,"%01.0f\022\016\016 mbar", stateUsed->lifeData.pressure_surface_bar * 1000.0f); | |
| 974 GFX_write_string(&FontT48,&t7surfaceL,text,3); | |
| 975 | |
| 976 if(settingsGetPointer()->nonMetricalSystem) | |
| 977 snprintf(text,40,"%01.0f\140\022\016\016 fahrenheit",unit_temperature_float(stateUsed->lifeData.temperature_celsius)); | |
| 978 else | |
| 979 snprintf(text,30,"%01.0f\140\022\016\016 celsius",stateUsed->lifeData.temperature_celsius); | |
| 980 GFX_write_string(&FontT48,&t7surfaceL,text,4); | |
| 981 } | |
| 982 else | |
| 983 { | |
| 984 snprintf(text,30,"ERR\022\016\016 mbar"); | |
| 985 GFX_write_string(&FontT48,&t7surfaceL,text,3); | |
| 986 | |
| 987 if(settingsGetPointer()->nonMetricalSystem) | |
| 988 snprintf(text,40,"ERR\022\016\016 fahrenheit"); | |
| 989 else | |
| 990 snprintf(text,30,"ERR\022\016\016 celsius"); | |
| 991 GFX_write_string(&FontT48,&t7surfaceL,text,4); | |
| 992 } | |
| 993 | |
| 994 | |
| 995 /* gas mix and selection */ | |
| 996 if((stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea)) | |
| 997 { | |
| 998 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) | |
| 999 text[0] = TXT_Gauge; | |
| 1000 else | |
| 1001 text[0] = TXT_Apnoe; | |
| 1002 | |
| 1003 text[1] = 0; | |
| 1004 GFX_write_string(&FontT48,&t7surfaceL,text,6); | |
| 1005 } | |
| 1006 else | |
| 1007 { | |
| 1008 text[0] = '\021'; | |
| 1009 text[1] = '1'; | |
| 1010 text[2] = '\177'; | |
| 1011 text[3] = '\177'; | |
| 1012 text[4] = 10; | |
| 1013 text[5] = '\021'; | |
| 1014 text[6] = '2'; | |
| 1015 text[7] = '\177'; | |
| 1016 text[8] = '\177'; | |
| 1017 text[9] = 10; | |
| 1018 text[10] = '\021'; | |
| 1019 text[11] = '3'; | |
| 1020 text[12] = '\177'; | |
| 1021 text[13] = '\177'; | |
| 1022 text[14] = 10; | |
| 1023 text[15] = '\021'; | |
| 1024 text[16] = '4'; | |
| 1025 text[17] = '\177'; | |
| 1026 text[18] = '\177'; | |
| 1027 text[19] = 10; | |
| 1028 text[20] = '\021'; | |
| 1029 text[21] = '5'; | |
| 1030 text[22] = 0; | |
| 1031 | |
| 1032 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
| 1033 gasOffset = NUM_OFFSET_DILUENT; | |
| 1034 else | |
| 1035 gasOffset = 0; | |
| 1036 for(int i=1;i<=5;i++) | |
| 1037 { | |
| 1038 if(stateUsed->diveSettings.gas[i+gasOffset].note.ub.active) | |
| 1039 text[(i-1)*5] -= 1; | |
| 1040 } | |
| 1041 GFX_write_string(&FontT48,&t7surfaceL,text,6); | |
| 1042 | |
| 1043 | |
| 1044 oxygen_percentage = 100; | |
| 1045 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
| 1046 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
| 1047 | |
| 1048 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[0]); | |
| 1049 GFX_write_string(&FontT48,&t7surfaceL,text,7); | |
| 1050 | |
| 1051 actualGasID = stateUsed->lifeData.actualGas.GasIdInSettings; | |
| 1052 /* | |
| 1053 bottleFirstGas_bar = stateUsed->lifeData.bottle_bar[actualGasID]; | |
| 1054 if(bottleFirstGas_bar) | |
| 1055 { | |
| 1056 snprintf(text,255,"%3u\022\016\016 bar",bottleFirstGas_bar); | |
| 1057 GFX_write_string(&FontT48,&t7surfaceL,text,8); | |
| 1058 } | |
| 1059 */ | |
| 1060 // after gas name :-) | |
| 1061 if(actualGasID > gasOffset) // security | |
| 1062 { | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1063 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1064 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1065 start.y = t7surfaceL.WindowY0 + (3 * t7surfaceL.WindowLineSpacing); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1066 start.x = t7surfaceL.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1067 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1068 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1069 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1070 start.y = t7surfaceR.WindowY0 + (3 * t7surfaceR.WindowLineSpacing); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1071 start.x = t7surfaceR.WindowX0 + ((stateUsed->lifeData.actualGas.GasIdInSettings - gasOffset - 1) * 35); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1072 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1073 |
| 38 | 1074 stop.x = start.x + 25; |
| 1075 stop.y = start.y + 52; | |
| 1076 GFX_draw_box2(&t7screen, start, stop, CLUT_Font020, 1); | |
| 1077 } | |
| 1078 } | |
| 1079 | |
| 1080 /* dive mode */ | |
| 1081 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
| 1082 GFX_write_string(&FontT24,&t7c1,"\f\002" "CCR",0); | |
| 1083 else | |
| 1084 GFX_write_string(&FontT24,&t7c1,"\f\002" "OC",0); | |
| 1085 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80" "CCR",0); | |
| 1086 | |
| 1087 /*battery */ | |
| 1088 | |
| 1089 text[0] = '3'; | |
| 1090 text[1] = '1'; | |
| 1091 text[2] = '1'; | |
| 1092 text[3] = '1'; | |
| 1093 text[4] = '1'; | |
| 1094 text[5] = '1'; | |
| 1095 text[6] = '1'; | |
| 1096 text[7] = '1'; | |
| 1097 text[8] = '1'; | |
| 1098 text[9] = '1'; | |
| 1099 text[10] = '1'; | |
| 1100 text[11] = '0'; | |
| 1101 text[12] = 0; | |
| 1102 | |
| 1103 for(int i=1;i<=10;i++) | |
| 1104 { | |
| 1105 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
| 1106 text[i] += 1; | |
| 1107 } | |
| 1108 | |
| 1109 if(stateUsed->chargeStatus == CHARGER_off) | |
| 1110 { | |
| 1111 if(stateUsed->warnings.lowBattery) | |
| 1112 { | |
| 1113 if(warning_count_high_time) | |
| 1114 { | |
| 1115 for(int i=1;i<=10;i++) | |
| 1116 text[i] = '1'; | |
| 1117 } | |
| 1118 else | |
| 1119 { | |
| 1120 text[1] = '2'; | |
| 1121 } | |
| 1122 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_WarningRed); | |
| 1123 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
| 1124 { | |
| 1125 snprintf(text,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
| 1126 if(warning_count_high_time) | |
| 1127 text[0] = '\a'; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1128 GFX_write_string(&FontT24,&t7voltage,text,0); |
| 38 | 1129 } |
| 1130 else | |
| 1131 { | |
| 1132 snprintf(text,6,"\f%.1fV",stateUsed->lifeData.battery_voltage); | |
| 1133 GFX_write_string(&FontT24,&t7voltage,text,0); | |
| 1134 } | |
| 1135 } | |
| 1136 else | |
| 1137 { | |
| 1138 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_BatteryStandard); | |
| 1139 | |
| 1140 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
| 1141 { | |
| 1142 snprintf(text,16,"\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1143 // GFX_write_string(&FontT24,&t7batt,text,0); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1144 GFX_write_string(&FontT24,&t7voltage,text,0); |
| 38 | 1145 } |
| 1146 else | |
| 1147 { | |
| 1148 snprintf(text,6,"\f%.1fV",stateUsed->lifeData.battery_voltage); | |
| 1149 GFX_write_string(&FontT24,&t7voltage,text,0); | |
| 1150 } | |
| 1151 } | |
| 1152 } | |
| 1153 else | |
| 1154 { | |
| 1155 GFX_write_string_color(&Batt24,&t7batt,text,0,CLUT_BatteryCharging); | |
| 1156 | |
| 1157 switch(stateUsed->chargeStatus) | |
| 1158 { | |
| 1159 case CHARGER_running: | |
| 1160 default: | |
| 1161 color = CLUT_BatteryStandard; | |
| 1162 break; | |
| 1163 case CHARGER_complete: | |
| 1164 color = CLUT_BatteryCharging; | |
| 1165 break; | |
| 1166 case CHARGER_lostConnection: | |
| 1167 color = CLUT_BatteryProblem; | |
| 1168 break; | |
| 1169 } | |
| 1170 text[0] = '4'; | |
| 1171 text[1] = 0; | |
| 1172 GFX_write_string_color(&Batt24,&t7charge,text,0,color); | |
| 1173 } | |
| 1174 | |
| 1175 | |
| 1176 | |
| 1177 customview_warnings = t7_test_customview_warnings_surface_mode(); | |
| 1178 if(customview_warnings && warning_count_high_time) | |
| 1179 t7_show_customview_warnings_surface_mode(); | |
| 1180 else | |
| 1181 t7_refresh_customview(); | |
| 1182 draw_frame(0,0, CLUT_pluginboxSurface, CLUT_Font020); | |
| 1183 } | |
| 1184 | |
| 1185 | |
| 1186 void t7_refresh_surface_debugmode_wireless_info(void) | |
| 1187 { | |
| 1188 char text[400]; | |
| 1189 uint8_t colorDataLost = 0; | |
| 1190 int txtPointer = 0; | |
| 1191 uint8_t numberOfBytes = 0; | |
| 1192 | |
| 1193 GFX_DrawCfgWindow textWindow = | |
| 1194 { | |
| 1195 .Image = &t7screen, | |
| 1196 .WindowNumberOfTextLines = 5, | |
| 1197 .WindowLineSpacing = 70, | |
| 1198 .WindowTab = 220, | |
| 1199 .WindowX0 = 10, | |
| 1200 .WindowX1 = 790, | |
| 1201 .WindowY0 = 10, | |
| 1202 .WindowY1 = 380 | |
| 1203 }; | |
| 1204 | |
| 1205 Gfx_write_label_var(&t7screen, 10,600, 10,&FontT42,CLUT_DiveMainLabel,"Wireless Data"); | |
| 1206 | |
| 1207 if(stateUsed->data_old__lost_connection_to_slave) | |
| 1208 { | |
| 1209 Gfx_write_label_var(&t7screen, 600,800,10,&FontT42,CLUT_Font020,"CPU2?"); | |
| 1210 colorDataLost = 1; | |
| 1211 } | |
| 1212 | |
| 1213 txtPointer = 0; | |
| 1214 for(int i=0;i<4;i++) | |
| 1215 { | |
| 1216 if((!stateUsed->lifeData.wireless_data[i].ageInMilliSeconds) || colorDataLost) | |
| 1217 text[txtPointer++] = '\021'; | |
| 1218 | |
| 1219 numberOfBytes = stateUsed->lifeData.wireless_data[i].numberOfBytes; | |
| 1220 if((numberOfBytes > 0) && (numberOfBytes <= 10)) | |
| 1221 { | |
| 1222 txtPointer += snprintf(&text[txtPointer],20,"%02u s %02u\t" | |
| 1223 ,(stateUsed->lifeData.wireless_data[i].ageInMilliSeconds)/1000 | |
| 1224 ,stateUsed->lifeData.wireless_data[i].status | |
| 1225 ); | |
| 1226 if(numberOfBytes > 8) ///< lifeData.wireless_data[i].data[j] has only size of 8 | |
| 1227 numberOfBytes = 8; | |
| 1228 for(int j=0;j<numberOfBytes;j++) | |
| 1229 { | |
| 1230 txtPointer += snprintf(&text[txtPointer],4," %02X" | |
| 1231 ,stateUsed->lifeData.wireless_data[i].data[j] | |
| 1232 ); | |
| 1233 } | |
| 1234 } | |
| 1235 text[txtPointer++] = '\n'; | |
| 1236 text[txtPointer++] = '\r'; | |
| 1237 text[txtPointer++] = '\020'; | |
| 1238 text[txtPointer] = 0; | |
| 1239 } | |
| 1240 GFX_write_string(&FontT48,&textWindow,text,1); | |
| 1241 | |
| 1242 } | |
| 1243 | |
| 1244 | |
| 1245 void t7_refresh_surface_debugmode(void) | |
| 1246 { | |
| 1247 if(selection_customview%2 == 1) | |
| 1248 { | |
| 1249 t7_refresh_surface_debugmode_wireless_info(); | |
| 1250 return; | |
| 1251 } | |
| 1252 | |
| 1253 // could be warning, now just to set RTE variables | |
| 1254 DataEX_check_RTE_version__needs_update(); | |
| 1255 | |
| 1256 | |
| 1257 char TextL1[4*TEXTSIZE]; | |
| 1258 uint32_t color; | |
| 1259 // uint8_t gasIdFirst; | |
| 1260 SSettings* pSettings = settingsGetPointer(); | |
| 1261 extern SDataExchangeSlaveToMaster dataIn; | |
| 1262 | |
| 1263 SWindowGimpStyle windowGimp; | |
| 1264 | |
| 1265 RTC_DateTypeDef Sdate; | |
| 1266 RTC_TimeTypeDef Stime; | |
| 1267 | |
| 1268 translateDate(stateUsed->lifeData.dateBinaryFormat, &Sdate); | |
| 1269 translateTime(stateUsed->lifeData.timeBinaryFormat, &Stime); | |
| 1270 | |
| 1271 | |
| 1272 if(stateUsed->data_old__lost_connection_to_slave) | |
| 1273 { | |
| 1274 Gfx_write_label_var(&t7screen, 500,800, 0,&FontT42,CLUT_DiveMainLabel,"old"); | |
| 1275 snprintf(TextL1,TEXTSIZE,"%X %X %X %X",dataIn.header.checkCode[0],dataIn.header.checkCode[1],dataIn.header.checkCode[2],dataIn.header.checkCode[3]); | |
| 1276 Gfx_write_label_var(&t7screen, 500,800, 45,&FontT48,CLUT_Font020,TextL1); | |
| 1277 } | |
| 1278 else | |
| 1279 if(DataEX_lost_connection_count()) | |
| 1280 { | |
| 1281 snprintf(TextL1,TEXTSIZE,"\002%i",DataEX_lost_connection_count()); | |
| 1282 Gfx_write_label_var(&t7screen, 600,800, 45,&FontT48,CLUT_Font020,TextL1); | |
| 1283 } | |
| 1284 | |
| 1285 snprintf(TextL1,TEXTSIZE,"\002%i",blockedFramesCount()); | |
| 1286 Gfx_write_label_var(&t7screen, 600,800, 0,&FontT48,CLUT_Font020,TextL1); | |
| 1287 | |
| 1288 if(stateUsed->lifeData.compass_DX_f | stateUsed->lifeData.compass_DY_f | stateUsed->lifeData.compass_DZ_f) | |
| 1289 { | |
| 1290 snprintf(TextL1,TEXTSIZE,"X %i",stateUsed->lifeData.compass_DX_f); | |
| 1291 Gfx_write_label_var(&t7screen, 0,400, 45,&FontT48,CLUT_Font020,TextL1); | |
| 1292 snprintf(TextL1,TEXTSIZE,"Y %i",stateUsed->lifeData.compass_DY_f); | |
| 1293 Gfx_write_label_var(&t7screen, 0,400,145,&FontT48,CLUT_Font020,TextL1); | |
| 1294 snprintf(TextL1,TEXTSIZE,"Z %i",stateUsed->lifeData.compass_DZ_f); | |
| 1295 Gfx_write_label_var(&t7screen, 0,400,255,&FontT48,CLUT_Font020,TextL1); | |
| 1296 return; | |
| 1297 } | |
| 1298 snprintf(TextL1,TEXTSIZE,"%01.0f mbar",stateUsed->lifeData.pressure_ambient_bar * 1000.0f); | |
| 1299 Gfx_write_label_var(&t7screen, 0,400, 0,&FontT42,CLUT_DiveMainLabel,"Ambient Pressure"); | |
| 1300 Gfx_write_label_var(&t7screen, 0,400, 45,&FontT48,CLUT_Font020,TextL1); | |
| 1301 | |
| 1302 snprintf(TextL1,TEXTSIZE,"%01.2f C",stateUsed->lifeData.temperature_celsius); | |
| 1303 Gfx_write_label_var(&t7screen, 0,400,100,&FontT42,CLUT_DiveMainLabel,"Temperature"); | |
| 1304 Gfx_write_label_var(&t7screen, 0,400,145,&FontT48,CLUT_Font020,TextL1); | |
| 1305 | |
| 1306 snprintf(TextL1,TEXTSIZE,"%03.0f %03.0f %03.0f",stateUsed->lifeData.compass_heading,stateUsed->lifeData.compass_roll,stateUsed->lifeData.compass_pitch); | |
| 1307 Gfx_write_label_var(&t7screen, 0,400,200,&FontT42,CLUT_DiveMainLabel,"Heading Roll Pitch"); | |
| 1308 Gfx_write_label_var(&t7screen, 0,400,255,&FontT48,CLUT_Font020,TextL1); | |
| 1309 | |
| 1310 snprintf(TextL1,TEXTSIZE,"%01.0f mbar",stateUsed->lifeData.pressure_surface_bar * 1000.0f); | |
| 1311 Gfx_write_label_var(&t7screen, 0,400,310,&FontT42,CLUT_DiveMainLabel,"Surface Pressure"); | |
| 1312 Gfx_write_label_var(&t7screen, 0,400,355,&FontT48,CLUT_Font020,TextL1); | |
| 1313 | |
| 1314 // gasIdFirst = stateUsed->lifeData.actualGas.GasIdInSettings; | |
| 1315 snprintf(TextL1,TEXTSIZE,"%u.%u",dataIn.RTE_VERSION_high,dataIn.RTE_VERSION_low); | |
| 1316 Gfx_write_label_var(&t7screen, 320,500,100,&FontT42,CLUT_DiveMainLabel,"RTE"); | |
| 1317 Gfx_write_label_var(&t7screen, 320,500,145,&FontT48,CLUT_Font020,TextL1); | |
| 1318 | |
| 1319 Gfx_write_label_var(&t7screen, 500,800,100,&FontT42,CLUT_DiveMainLabel,"Battery"); | |
| 1320 snprintf(TextL1,TEXTSIZE,"%01.4f V",stateUsed->lifeData.battery_voltage); | |
| 1321 Gfx_write_label_var(&t7screen, 500,800,145,&FontT48,CLUT_Font020,TextL1); | |
| 1322 snprintf(TextL1,TEXTSIZE,"%03.1f %%",stateUsed->lifeData.battery_charge); | |
| 1323 Gfx_write_label_var(&t7screen, 500,800,200,&FontT48,CLUT_Font020,TextL1); | |
| 1324 if(stateUsed->chargeStatus != CHARGER_off) | |
| 1325 { | |
| 1326 switch(stateUsed->chargeStatus) | |
| 1327 { | |
| 1328 case CHARGER_running: | |
| 1329 default: | |
| 1330 color = CLUT_BatteryStandard; | |
| 1331 break; | |
| 1332 case CHARGER_complete: | |
| 1333 color = CLUT_BatteryCharging; | |
| 1334 break; | |
| 1335 case CHARGER_lostConnection: | |
| 1336 color = CLUT_BatteryProblem; | |
| 1337 break; | |
| 1338 } | |
| 1339 TextL1[0] = '4'; | |
| 1340 TextL1[1] = 0; | |
| 1341 Gfx_write_label_var(&t7screen, 660,800,200,&Batt24,color,TextL1); | |
| 1342 } | |
| 1343 | |
| 1344 extern uint32_t base_tempLightLevel; | |
| 1345 | |
| 1346 snprintf(TextL1,TEXTSIZE,"# %u (%u)",stateUsed->lifeData.ambient_light_level, base_tempLightLevel); | |
| 1347 Gfx_write_label_var(&t7screen, 401,600,310,&FontT42,CLUT_DiveMainLabel,"Light"); | |
| 1348 Gfx_write_label_var(&t7screen, 401,800,355,&FontT48,CLUT_Font020,TextL1); | |
| 1349 | |
| 1350 // snprintf(TextL1,TEXTSIZE,"# %u",stateUsed->lifeData.ambient_light_level); | |
| 1351 // Gfx_write_label_var(&t7screen, 601,800,310,&FontT42,CLUT_DiveMainLabel,"Light"); | |
| 1352 // Gfx_write_label_var(&t7screen, 601,800,355,&FontT48,CLUT_Font020,TextL1); | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 if(Sdate.Year < 15) | |
| 1357 { | |
| 1358 if(warning_count_high_time) | |
| 1359 { | |
| 1360 snprintf(TextL1,4*TEXTSIZE,"\017 %02d-%02d-%02d %02d:%02d:%02d", Sdate.Date, Sdate.Month, 2000 + Sdate.Year,Stime.Hours, Stime.Minutes, Stime.Seconds); | |
| 1361 Gfx_write_label_var(&t7screen, 0,800,420,&FontT48,CLUT_Font020,TextL1); | |
| 1362 } | |
| 1363 } | |
| 1364 else | |
| 1365 { | |
| 1366 if(pSettings->customtext[0]) | |
| 1367 { | |
| 1368 if(pSettings->customtext[59]) | |
| 1369 pSettings->customtext[59] = 0; | |
| 1370 Gfx_write_label_var(&t7screen, 0,400,420,&FontT24,CLUT_Font020,pSettings->customtext); | |
| 1371 } | |
| 1372 else | |
| 1373 { | |
| 1374 snprintf(TextL1,4*TEXTSIZE,"\017 %02d-%02d-%02d %02d:%02d:%02d Dives: %u", Sdate.Date, Sdate.Month, 2000 + Sdate.Year,Stime.Hours, Stime.Minutes, Stime.Seconds,pSettings->totalDiveCounter ); | |
| 1375 Gfx_write_label_var(&t7screen, 0,800,420,&FontT48,CLUT_Font020,TextL1); | |
| 1376 } | |
| 1377 } | |
| 1378 | |
| 1379 windowGimp.left = 400; | |
| 1380 windowGimp.top = 0; | |
| 1381 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
| 1382 } | |
| 1383 | |
| 1384 /* CUSTOMVIEW | |
| 1385 * in the middle of the screen | |
| 1386 */ | |
| 1387 | |
| 1388 uint8_t t7_test_customview_warnings(void) | |
| 1389 { | |
| 1390 uint8_t count = 0; | |
| 1391 | |
| 1392 count = 0; | |
| 1393 count += stateUsed->warnings.decoMissed; | |
| 1394 count += stateUsed->warnings.ppO2Low; | |
| 1395 count += stateUsed->warnings.ppO2High; | |
| 1396 //count += stateUsed->warnings.lowBattery; | |
| 1397 count += stateUsed->warnings.sensorLinkLost; | |
| 1398 count += stateUsed->warnings.fallback; | |
| 1399 return count; | |
| 1400 } | |
| 1401 | |
| 1402 | |
| 1403 uint8_t t7_test_customview_warnings_surface_mode(void) | |
| 1404 { | |
| 1405 uint8_t count = 0; | |
| 1406 count = 0; | |
| 1407 count += stateUsed->cnsHigh_at_the_end_of_dive; | |
| 1408 count += stateUsed->decoMissed_at_the_end_of_dive; | |
| 1409 return count; | |
| 1410 } | |
| 1411 | |
| 1412 | |
| 1413 void t7_show_customview_warnings_surface_mode(void) | |
| 1414 { | |
| 1415 char text[256]; | |
| 1416 uint8_t textpointer, lineFree; | |
| 1417 | |
| 1418 text[0] = '\025'; | |
| 1419 text[1] = '\f'; | |
| 1420 text[2] = '\001'; | |
| 1421 text[3] = TXT_Warning; | |
| 1422 text[4] = 0; | |
| 1423 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1424 | |
| 1425 textpointer = 0; | |
| 1426 lineFree = 5; | |
| 1427 | |
| 1428 if(stateUsed->decoMissed_at_the_end_of_dive) | |
| 1429 { | |
| 1430 text[textpointer++] = TXT_2BYTE; | |
| 1431 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
| 1432 text[textpointer++] = '\n'; | |
| 1433 text[textpointer++] = '\r'; | |
| 1434 text[textpointer] = 0; | |
| 1435 lineFree--; | |
| 1436 } | |
| 1437 | |
| 1438 if(stateUsed->cnsHigh_at_the_end_of_dive) | |
| 1439 { | |
| 1440 text[textpointer++] = TXT_2BYTE; | |
| 1441 text[textpointer++] = TXT2BYTE_WarnCnsHigh; | |
| 1442 text[textpointer++] = '\n'; | |
| 1443 text[textpointer++] = '\r'; | |
| 1444 text[textpointer] = 0; | |
| 1445 lineFree--; | |
| 1446 } | |
| 1447 if(textpointer != 0) | |
| 1448 GFX_write_string(&FontT48,&t7cW,text,1); | |
| 1449 } | |
| 1450 | |
| 1451 | |
| 1452 void t7_show_customview_warnings(void) | |
| 1453 { | |
| 1454 char text[256]; | |
| 1455 uint8_t textpointer, lineFree; | |
| 1456 | |
| 1457 text[0] = '\025'; | |
| 1458 text[1] = '\f'; | |
| 1459 text[2] = '\001'; | |
| 1460 text[3] = TXT_Warning; | |
| 1461 text[4] = 0; | |
| 1462 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1463 | |
| 1464 textpointer = 0; | |
| 1465 lineFree = 5; | |
| 1466 | |
| 1467 if(lineFree && stateUsed->warnings.decoMissed) | |
| 1468 { | |
| 1469 text[textpointer++] = TXT_2BYTE; | |
| 1470 text[textpointer++] = TXT2BYTE_WarnDecoMissed; | |
| 1471 text[textpointer++] = '\n'; | |
| 1472 text[textpointer++] = '\r'; | |
| 1473 text[textpointer] = 0; | |
| 1474 lineFree--; | |
| 1475 } | |
| 1476 | |
| 1477 if(lineFree && stateUsed->warnings.fallback) | |
| 1478 { | |
| 1479 text[textpointer++] = TXT_2BYTE; | |
| 1480 text[textpointer++] = TXT2BYTE_WarnFallback; | |
| 1481 text[textpointer++] = '\n'; | |
| 1482 text[textpointer++] = '\r'; | |
| 1483 text[textpointer] = 0; | |
| 1484 lineFree--; | |
| 1485 } | |
| 1486 | |
| 1487 if(lineFree && stateUsed->warnings.ppO2Low) | |
| 1488 { | |
| 1489 text[textpointer++] = TXT_2BYTE; | |
| 1490 text[textpointer++] = TXT2BYTE_WarnPPO2Low; | |
| 1491 text[textpointer++] = '\n'; | |
| 1492 text[textpointer++] = '\r'; | |
| 1493 text[textpointer] = 0; | |
| 1494 lineFree--; | |
| 1495 } | |
| 1496 | |
| 1497 if(lineFree && stateUsed->warnings.ppO2High) | |
| 1498 { | |
| 1499 text[textpointer++] = TXT_2BYTE; | |
| 1500 text[textpointer++] = TXT2BYTE_WarnPPO2High; | |
| 1501 text[textpointer++] = '\n'; | |
| 1502 text[textpointer++] = '\r'; | |
| 1503 text[textpointer] = 0; | |
| 1504 lineFree--; | |
| 1505 } | |
| 1506 | |
| 1507 if(lineFree && stateUsed->warnings.sensorLinkLost) | |
| 1508 { | |
| 1509 text[textpointer++] = TXT_2BYTE; | |
| 1510 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost; | |
| 1511 text[textpointer++] = '\n'; | |
| 1512 text[textpointer++] = '\r'; | |
| 1513 text[textpointer] = 0; | |
| 1514 lineFree--; | |
| 1515 } | |
| 1516 /* | |
| 1517 if(lineFree && stateUsed->warnings.lowBattery) | |
| 1518 { | |
| 1519 text[textpointer++] = TXT_2BYTE; | |
| 1520 text[textpointer++] = TXT2BYTE_WarnBatteryLow; | |
| 1521 text[textpointer++] = '\n'; | |
| 1522 text[textpointer++] = '\r'; | |
| 1523 text[textpointer] = 0; | |
| 1524 lineFree--; | |
| 1525 } | |
| 1526 */ | |
| 1527 GFX_write_string(&FontT48,&t7cW,text,1); | |
| 1528 } | |
| 1529 | |
| 1530 | |
| 1531 void t7_set_customview_to_primary(void) | |
| 1532 { | |
| 1533 if(stateUsed->mode == MODE_DIVE) | |
| 1534 selection_customview = settingsGetPointer()->tX_customViewPrimary; | |
| 1535 } | |
| 1536 | |
| 1537 | |
| 1538 // for CVIEW_END is none_or_debug | |
| 1539 void t7_change_customview(void) | |
| 1540 { | |
| 1541 const uint8_t *pViews; | |
| 1542 _Bool cv_disabled = 0; | |
| 1543 | |
| 1544 if(stateUsed->mode == MODE_DIVE) | |
| 1545 pViews = customviewsDive; | |
| 1546 else | |
| 1547 pViews = customviewsSurface; | |
| 1548 | |
| 1549 while((*pViews != CVIEW_END) && (*pViews != selection_customview)) | |
| 1550 {pViews++;} | |
| 1551 | |
| 1552 if(*pViews < CVIEW_END) | |
| 1553 pViews++; | |
| 1554 | |
| 1555 | |
| 1556 if(*pViews == CVIEW_END) | |
| 1557 { | |
| 1558 if(stateUsed->mode == MODE_DIVE) | |
| 1559 pViews = customviewsDive; | |
| 1560 else | |
| 1561 pViews = customviewsSurface; | |
| 1562 } | |
| 1563 | |
| 1564 if(stateUsed->mode == MODE_DIVE) | |
| 1565 { | |
| 1566 do | |
| 1567 { | |
| 1568 cv_disabled = 0; | |
| 1569 for(int i=0;i<6;i++) | |
| 1570 { | |
| 1571 if((*pViews == cv_changelist[i]) && !CHECK_BIT_THOME(cv_configuration, cv_changelist[i])) | |
| 1572 { | |
| 1573 cv_disabled = 1; | |
| 1574 break; | |
| 1575 } | |
| 1576 } | |
| 1577 if(cv_disabled) | |
| 1578 { | |
| 1579 if(*pViews < CVIEW_END) | |
| 1580 { | |
| 1581 pViews++; | |
| 1582 } | |
| 1583 else | |
| 1584 { | |
| 1585 pViews = customviewsDive; | |
| 1586 } | |
| 1587 } | |
| 1588 } while(cv_disabled); | |
| 1589 } | |
| 1590 | |
| 1591 | |
| 1592 // if((*pViews == CVIEW_Scooter) && (getLicence() != LICENCEBONEX)) | |
| 1593 // pViews++; | |
| 1594 | |
| 1595 selection_customview = *pViews; | |
| 1596 } | |
| 1597 | |
| 1598 | |
| 1599 uint8_t t7_get_length_of_customtext(void) | |
| 1600 { | |
| 1601 uint8_t i = 0; | |
| 1602 settingsGetPointer()->customtext[60-1] = 0; | |
| 1603 while(settingsGetPointer()->customtext[i] > 0) | |
| 1604 i++; | |
| 1605 return i; | |
| 1606 } | |
| 1607 | |
| 1608 | |
| 1609 void t7_refresh_customview(void) | |
| 1610 { | |
| 1611 | |
| 1612 char text[256]; | |
| 1613 uint16_t textpointer = 0; | |
| 1614 int16_t start; | |
|
51
8f8ea3a32e82
Resolved warnings pointing to possible invalid memory access
Ideenmodellierer
parents:
38
diff
changeset
|
1615 uint8_t lineCountCustomtext = 0; |
| 38 | 1616 int16_t shiftWindowY0; |
| 1617 RTC_DateTypeDef Sdate; | |
| 1618 RTC_TimeTypeDef Stime; | |
| 1619 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; // CVIEW_Gaslist | |
| 1620 const SGasLine * pGasLine; // CVIEW_Gaslist | |
| 1621 uint8_t oxygen, helium; // CVIEW_Gaslist | |
| 1622 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime | |
| 1623 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1624 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1625 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1626 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1627 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1628 if((selection_customview == CVIEW_Scooter) && (getLicence() != LICENCEBONEX)) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1629 t7_change_customview(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1630 if((selection_customview == CVIEW_Scooter) && (!DataEX_scooterFoundAndValidLicence() && (stateRealGetPointer()->mode == MODE_DIVE))) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1631 t7_change_customview(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1632 if((selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0)) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1633 t7_change_customview(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1634 if((selection_customview == CVIEW_sensors_mV) &&(stateUsed->diveSettings.ccrOption == 0)) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1635 t7_change_customview(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1636 if((selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0)) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1637 t7_change_customview(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1638 |
| 38 | 1639 switch(selection_customview) |
| 1640 { | |
| 1641 case CVIEW_noneOrDebug: | |
| 1642 if(settingsGetPointer()->showDebugInfo) | |
| 1643 { | |
| 1644 // header | |
| 1645 strcpy(text,"\032\f\001Debug"); | |
| 1646 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1647 // content | |
| 1648 t7_debug(); | |
| 1649 } | |
| 1650 break; | |
| 1651 | |
| 1652 case CVIEW_SummaryOfLeftCorner: | |
| 1653 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Summary); | |
| 1654 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1655 // content | |
| 1656 t7_SummaryOfLeftCorner(); | |
| 1657 break; | |
| 1658 | |
| 1659 case CVIEW_CompassDebug: | |
| 1660 snprintf(text,100,"\032\f\001Compass raw"); | |
| 1661 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1662 /* | |
| 1663 pStateReal->lifeData.compass_heading = dataIn.data[dataIn.boolCompassData].compass_heading; | |
| 1664 pStateReal->lifeData.compass_roll = dataIn.data[dataIn.boolCompassData].compass_roll; | |
| 1665 pStateReal->lifeData.compass_pitch = dataIn.data[dataIn.boolCompassData].compass_pitch; | |
| 1666 | |
| 1667 pStateReal->lifeData.compass_DX_f = dataIn.data[dataIn.boolCompassData].compass_DX_f; | |
| 1668 pStateReal->lifeData.compass_DY_f = dataIn.data[dataIn.boolCompassData].compass_DY_f; | |
| 1669 pStateReal->lifeData.compass_DZ_f = dataIn.data[dataIn.boolCompassData].compass_DZ_f; | |
| 1670 */ | |
| 1671 snprintf(text,255,"%1.1f\n\r%1.1f\n\r%1.1f\n\r%i\n\r%i\n\r%i" | |
| 1672 ,stateUsed->lifeData.compass_heading | |
| 1673 ,stateUsed->lifeData.compass_roll | |
| 1674 ,stateUsed->lifeData.compass_pitch | |
| 1675 ,stateUsed->lifeData.compass_DX_f | |
| 1676 ,stateUsed->lifeData.compass_DY_f | |
| 1677 ,stateUsed->lifeData.compass_DZ_f | |
| 1678 ); | |
| 1679 | |
| 1680 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
| 1681 t7cY0free.WindowLineSpacing = 48; | |
| 1682 t7cY0free.WindowNumberOfTextLines = 6; | |
| 1683 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 1684 break; | |
| 1685 | |
| 1686 case CVIEW_Hello: | |
| 1687 t7_logo_OSTC(); | |
| 1688 t7cC.WindowLineSpacing = 53; | |
| 1689 t7cC.WindowNumberOfTextLines = 5; | |
| 1690 shiftWindowY0 = 18; | |
| 1691 | |
| 1692 if(updateNecessary)//if(DataEX_check_RTE_version__needs_update() || font_update_required()) | |
| 1693 { | |
| 1694 if(warning_count_high_time) | |
| 1695 { | |
| 1696 shiftWindowY0 += 20; | |
| 1697 t7cC.WindowY0 -= shiftWindowY0; | |
| 1698 textpointer = 0; | |
| 1699 text[textpointer++] = TXT_2BYTE; | |
| 1700 text[textpointer++] = TXT2BYTE_PleaseUpdate; | |
| 1701 text[textpointer++] = '\n'; | |
| 1702 text[textpointer++] = '\r'; | |
| 1703 if(DataEX_check_RTE_version__needs_update()) | |
| 1704 { | |
| 1705 text[textpointer++] = TXT_2BYTE; | |
| 1706 text[textpointer++] = TXT2BYTE_RTE; | |
| 1707 text[textpointer++] = '\n'; | |
| 1708 text[textpointer++] = '\r'; | |
| 1709 } | |
| 1710 if(font_update_required()) | |
| 1711 { | |
| 1712 text[textpointer++] = TXT_2BYTE; | |
| 1713 text[textpointer++] = TXT2BYTE_Fonts; | |
| 1714 } | |
| 1715 text[textpointer++] = 0; | |
| 1716 GFX_write_string_color(&FontT42,&t7cC,text,1, CLUT_WarningRed); | |
| 1717 t7cC.WindowY0 += shiftWindowY0; | |
| 1718 } | |
| 1719 t7cC.WindowNumberOfTextLines = 3; | |
| 1720 } | |
| 1721 else // customtext | |
| 1722 { | |
| 1723 lineCountCustomtext = t7_customtextPrepare(text); | |
| 1724 if(lineCountCustomtext <= 2) | |
| 1725 shiftWindowY0 += 20+26; // nach unten | |
| 1726 else | |
| 1727 if(lineCountCustomtext <= 3) | |
| 1728 shiftWindowY0 += 20; // nach unten | |
| 1729 t7cC.WindowY0 -= shiftWindowY0; | |
| 1730 | |
| 1731 GFX_write_string(&FontT42,&t7cC,text,1); | |
| 1732 t7cC.WindowNumberOfTextLines = 3; | |
| 1733 t7cC.WindowY0 += shiftWindowY0; | |
| 1734 } | |
| 1735 if(lineCountCustomtext <= 4) | |
| 1736 { | |
| 1737 snprintf(text,100,"\001#%0u V%01u.%01u.%01u", | |
| 1738 settingsGetPointer()->serialLow + (256 * settingsGetPointer()->serialHigh), | |
| 1739 firmwareDataGetPointer()->versionFirst, | |
| 1740 firmwareDataGetPointer()->versionSecond, | |
| 1741 firmwareDataGetPointer()->versionThird | |
| 1742 ); | |
| 1743 GFX_write_string(&FontT24,&t7cC,text,0); | |
| 1744 } | |
| 1745 break; | |
| 1746 | |
| 1747 case CVIEW_Scooter: | |
| 1748 snprintf(text,100,"\032\f\001Scooter"); | |
| 1749 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1750 t7_scooter(); | |
| 1751 break; | |
| 1752 | |
| 1753 case CVIEW_Gaslist: | |
| 1754 // a lot of code taken from tMenuGas.c | |
| 1755 // header | |
| 1756 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Gaslist); | |
| 1757 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1758 // content | |
| 1759 textpointer = 0; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1760 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1761 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1762 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1763 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1764 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1765 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1766 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1767 t7cY0free.WindowY1 = 400; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1768 } |
| 38 | 1769 t7cY0free.WindowLineSpacing = 48+9; |
| 1770 t7cY0free.WindowNumberOfTextLines = 5; // NUM_GASES == 5 | |
| 1771 t7cY0free.WindowTab = 420; | |
| 1772 | |
| 1773 pGasLine = settingsGetPointer()->gas; | |
| 1774 if(actualLeftMaxDepth(stateUsed)) | |
| 1775 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100; | |
| 1776 else | |
| 1777 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100; | |
| 1778 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100; | |
| 1779 for(int gasId=1;gasId<=NUM_GASES;gasId++) | |
| 1780 { | |
| 1781 textpointer = 0; | |
| 1782 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100; | |
| 1783 if(pGasLine[gasId].note.ub.active == 0) | |
| 1784 strcpy(&text[textpointer++],"\021"); | |
| 1785 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow)) | |
| 1786 strcpy(&text[textpointer++],"\025"); | |
| 1787 else | |
| 1788 strcpy(&text[textpointer++],"\030"); | |
| 1789 | |
| 1790 text[textpointer++] = ' '; | |
| 1791 oxygen = pGasLine[gasId].oxygen_percentage; | |
| 1792 helium = pGasLine[gasId].helium_percentage; | |
| 1793 textpointer += write_gas(&text[textpointer], oxygen, helium); | |
| 1794 // Wechseltiefe | |
| 1795 if(pGasLine[gasId].depth_meter) | |
| 1796 { | |
| 1797 textpointer += snprintf(&text[textpointer],7,"\t%u %c%c",unit_depth_integer(pGasLine[gasId].depth_meter), unit_depth_char1(), unit_depth_char2()); | |
| 1798 } | |
| 1799 GFX_write_string(&FontT42, &t7cY0free, text, gasId); | |
| 1800 } | |
| 1801 break; | |
| 1802 | |
| 1803 case CVIEW_EADTime: | |
| 1804 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Info ); | |
| 1805 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1806 textpointer = 0; | |
| 1807 | |
| 1808 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1809 if(pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1810 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1811 t7cY0free.WindowY1 = 400; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1812 } |
| 38 | 1813 t7cY0free.WindowLineSpacing = 48; |
| 1814 t7cY0free.WindowNumberOfTextLines = 6; | |
| 1815 | |
| 1816 // time | |
| 1817 snprintf(text,100,"\032\001%c%c",TXT_2BYTE,TXT2BYTE_Clock ); | |
| 1818 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 1819 | |
| 1820 translateDate(stateRealGetPointer()->lifeData.dateBinaryFormat, &Sdate); | |
| 1821 translateTime(stateRealGetPointer()->lifeData.timeBinaryFormat, &Stime); | |
| 1822 if(Stime.Seconds % 2) | |
| 1823 textpointer += snprintf(&text[textpointer],100,"\030\001%02d:%02d",Stime.Hours,Stime.Minutes); | |
| 1824 else | |
| 1825 textpointer += snprintf(&text[textpointer],100,"\030\001%02d\031:\030%02d",Stime.Hours,Stime.Minutes); | |
| 1826 GFX_write_string(&FontT42, &t7cY0free, text, 2); | |
| 1827 | |
| 1828 // EAD / END | |
| 1829 // The equivalent air depth can be calculated for depths in metres as follows: | |
| 1830 // EAD = (Depth + 10) � Fraction of N2 / 0.79 - 10 (wikipedia) | |
| 1831 // The equivalent narcotic depth can be calculated for depths in metres as follows: | |
| 1832 // END = (Depth + 10) � (1 - Fraction of helium) - 10 (wikipedia) | |
| 1833 decom_get_inert_gases((float)stateUsed->lifeData.pressure_ambient_bar,&(stateUsed->lifeData.actualGas),&fraction_nitrogen,&fraction_helium); | |
| 1834 depth = stateUsed->lifeData.pressure_ambient_bar; | |
| 1835 surface = stateUsed->lifeData.pressure_surface_bar; | |
| 1836 ead = 10.f * ((depth * fraction_nitrogen/0.79f) - surface); | |
| 1837 end = 10.0f * ((depth * (1.f - fraction_helium)) - surface); | |
| 1838 if(ead < 0) | |
| 1839 ead = 0; | |
| 1840 if(end < 0) | |
| 1841 end = 0; | |
| 1842 | |
| 1843 snprintf(text,100,"\032\001EAD"); | |
| 1844 GFX_write_string(&FontT42, &t7cY0free, text, 3); | |
| 1845 snprintf(text,100,"\030\001%01.1f %c%c" | |
| 1846 , unit_depth_float(ead) | |
| 1847 , unit_depth_char1() | |
| 1848 , unit_depth_char2() | |
| 1849 ); | |
| 1850 GFX_write_string(&FontT42, &t7cY0free, text, 4); | |
| 1851 | |
| 1852 snprintf(text,100,"\032\001END"); | |
| 1853 GFX_write_string(&FontT42, &t7cY0free, text, 5); | |
| 1854 snprintf(text,100,"\030\001%01.1f %c%c" | |
| 1855 , unit_depth_float(ead) | |
| 1856 , unit_depth_char1() | |
| 1857 , unit_depth_char2() | |
| 1858 ); | |
| 1859 GFX_write_string(&FontT42, &t7cY0free, text, 6); | |
| 1860 break; | |
| 1861 | |
| 1862 case CVIEW_Profile: | |
| 1863 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile); | |
| 1864 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1865 textpointer = 0; | |
| 1866 t7_miniLiveLogProfile(); | |
| 1867 break; | |
| 1868 | |
| 1869 case CVIEW_Tissues: | |
| 1870 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Tissues); | |
| 1871 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1872 textpointer = 0; | |
| 1873 t7_tissues(stateUsed); | |
| 1874 break; | |
| 1875 | |
| 1876 case CVIEW_sensors: | |
| 1877 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2monitor); | |
| 1878 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1879 textpointer = 0; | |
| 1880 text[textpointer++] = '\030'; // main color | |
| 1881 for(int i=0;i<3;i++) | |
| 1882 { | |
| 1883 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
| 1884 { | |
| 1885 text[textpointer++] = '\031'; // labelcolor | |
| 1886 text[textpointer++] = '\001'; | |
| 1887 text[textpointer++] = '-'; | |
| 1888 text[textpointer++] = '\n'; | |
| 1889 text[textpointer++] = '\r'; | |
| 1890 text[textpointer++] = '\030'; // main color | |
| 1891 text[textpointer] = 0; | |
| 1892 } | |
| 1893 else | |
| 1894 { | |
| 1895 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
| 1896 text[textpointer++] = '\025'; // Warning Red | |
| 1897 textpointer += snprintf(&text[textpointer],100,"\001%01.2f\n\r\030",stateUsed->lifeData.ppO2Sensor_bar[i]); | |
| 1898 } | |
| 1899 } | |
| 1900 t7cC.WindowLineSpacing = 95; | |
| 1901 t7cC.WindowNumberOfTextLines = 3; | |
| 1902 text[textpointer] = 0; | |
| 1903 GFX_write_string(&FontT105,&t7cC,text,1); | |
| 1904 break; | |
| 1905 | |
| 1906 case CVIEW_sensors_mV: | |
| 1907 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2voltage); | |
| 1908 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1909 textpointer = 0; | |
| 1910 text[textpointer++] = '\030'; | |
| 1911 for(int i=0;i<3;i++) | |
| 1912 { | |
| 1913 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i)) | |
| 1914 { | |
| 1915 text[textpointer++] = '\031'; | |
| 1916 text[textpointer++] = '\001'; | |
| 1917 text[textpointer++] = '-'; | |
| 1918 text[textpointer++] = '\n'; | |
| 1919 text[textpointer++] = '\r'; | |
| 1920 text[textpointer++] = '\030'; | |
| 1921 text[textpointer] = 0; | |
| 1922 } | |
| 1923 else | |
| 1924 { | |
| 1925 if(stateUsed->warnings.sensorOutOfBounds[i]) | |
| 1926 text[textpointer++] = '\025'; | |
| 1927 textpointer += snprintf(&text[textpointer],100,"\001%01.1f mV\n\r\030",(stateUsed->lifeData.sensorVoltage_mV[i])); | |
| 1928 } | |
| 1929 } | |
| 1930 t7cC.WindowLineSpacing = 95; | |
| 1931 t7cC.WindowNumberOfTextLines = 3; | |
| 1932 text[textpointer] = 0; | |
| 1933 GFX_write_string(&FontT48,&t7cC,text,1); | |
| 1934 break; | |
| 1935 | |
| 1936 case CVIEW_Compass: | |
| 1937 default: | |
| 1938 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE, TXT2BYTE_Compass); | |
| 1939 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1940 t7_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1941 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1942 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1943 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1944 t7cY0free.WindowX0 += 15; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1945 t7cY0free.WindowY0 = 230; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1946 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1947 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1948 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1949 t7cY0free.WindowX0 -= 15; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1950 t7cY0free.WindowY0 = 0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1951 t7cY0free.WindowY1 = 250; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1952 } |
| 38 | 1953 snprintf(text,100,"\030\001%03i`",(uint16_t)stateUsed->lifeData.compass_heading); |
| 1954 GFX_write_string(&FontT54,&t7cY0free,text,0); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1955 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1956 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1957 t7cY0free.WindowX0 -= 15; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1958 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1959 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1960 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1961 t7cY0free.WindowX0 += 15; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
1962 } |
| 38 | 1963 break; |
| 1964 | |
| 1965 case CVIEW_Decolist: | |
| 1966 snprintf(text,100,"\032\f\001 %c%c", TXT_2BYTE, TXT2BYTE_Decolist); | |
| 1967 GFX_write_string(&FontT42,&t7cH,text,0); | |
| 1968 | |
| 1969 const SDecoinfo * pDecoinfo; | |
| 1970 uint8_t depthNext, depthLast, depthSecond, depthInc; | |
| 1971 | |
| 1972 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
| 1973 pDecoinfo = &stateUsed->decolistBuehlmann; | |
| 1974 else | |
| 1975 pDecoinfo = &stateUsed->decolistVPM; | |
| 1976 | |
| 1977 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10); | |
| 1978 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10); | |
| 1979 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10); | |
| 1980 | |
| 1981 if(settingsGetPointer()->nonMetricalSystem) | |
| 1982 { | |
| 1983 depthLast = (uint8_t)unit_depth_integer(depthLast); | |
| 1984 depthSecond = (uint8_t)unit_depth_integer(depthSecond); | |
| 1985 depthInc = (uint8_t)unit_depth_integer(depthInc); | |
| 1986 } | |
| 1987 | |
| 1988 for(start=DECOINFO_STRUCT_MAX_STOPS-1; start>0; start--) | |
| 1989 if(pDecoinfo->output_stop_length_seconds[start]) break; | |
| 1990 start -= 6; | |
| 1991 if(start < 0) start = 0; | |
| 1992 | |
| 1993 textpointer = 0; | |
| 1994 for(int i=start;i<6+start;i++) | |
| 1995 { | |
| 1996 if(i == 0) | |
| 1997 depthNext = depthLast; | |
| 1998 else | |
| 1999 depthNext = depthSecond + (( i - 1 )* depthInc); | |
| 2000 | |
| 2001 if(pDecoinfo->output_stop_length_seconds[i]) | |
| 2002 textpointer += snprintf(&text[textpointer],20,"\030\034 %2u\016\016%c%c\017%3i'\n\r",depthNext, unit_depth_char1(), unit_depth_char2(), (pDecoinfo->output_stop_length_seconds[i]+59)/60); | |
| 2003 else | |
| 2004 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016%c%c\017\n\r",depthNext, unit_depth_char1(), unit_depth_char2()); | |
| 2005 if(textpointer > 200) break; | |
| 2006 } | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2007 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2008 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2009 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2010 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2011 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2012 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2013 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2014 t7cY0free.WindowY1 = 400; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2015 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2016 |
| 38 | 2017 t7cY0free.WindowLineSpacing = 48; |
| 2018 t7cY0free.WindowNumberOfTextLines = 6; | |
| 2019 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 2020 break; | |
| 2021 } | |
| 2022 } | |
| 2023 | |
| 2024 | |
| 2025 | |
| 2026 /* DIVE MODE | |
| 2027 */ | |
| 2028 void t7_refresh_divemode(void) | |
| 2029 { | |
| 2030 char TextL1[TEXTSIZE]; | |
| 2031 char TextL2[TEXTSIZE]; | |
| 2032 | |
| 2033 char TextR1[TEXTSIZE]; | |
| 2034 char TextR2[TEXTSIZE]; | |
| 2035 char TextR3[TEXTSIZE]; | |
| 2036 | |
| 2037 char TextC1[2*TEXTSIZE]; | |
| 2038 char TextC2[TEXTSIZE]; | |
| 2039 uint8_t textPointer; | |
| 2040 | |
| 2041 point_t start, stop; | |
| 2042 uint8_t color; | |
| 2043 int textlength; | |
| 2044 | |
| 2045 uint16_t nextstopLengthSeconds = 0; | |
| 2046 uint8_t nextstopDepthMeter = 0; | |
| 2047 uint8_t oxygen_percentage = 0; | |
| 2048 SDivetime Divetime = {0,0,0, 0}; | |
| 2049 SDivetime SafetyStopTime = {0,0,0,0}; | |
| 2050 SDivetime TimeoutTime = {0,0,0,0}; | |
| 2051 uint8_t customview_warnings = 0; | |
| 2052 const SDecoinfo * pDecoinfo; | |
| 2053 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2054 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2055 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2056 |
| 38 | 2057 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time; |
| 2058 Divetime.Minutes = Divetime.Total / 60; | |
| 2059 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 ); | |
| 2060 | |
| 2061 SafetyStopTime.Total = timer_Safetystop_GetCountDown(); | |
| 2062 SafetyStopTime.Minutes = SafetyStopTime.Total / 60; | |
| 2063 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60); | |
| 2064 | |
| 2065 TimeoutTime.Total = settingsGetPointer()->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth; | |
| 2066 if(TimeoutTime.Total > settingsGetPointer()->timeoutDiveReachedZeroDepth) | |
| 2067 { | |
| 2068 TimeoutTime.Total = 0; | |
| 2069 } | |
| 2070 TimeoutTime.Minutes = TimeoutTime.Total / 60; | |
| 2071 TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60); | |
| 2072 | |
| 2073 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
| 2074 pDecoinfo = &stateUsed->decolistBuehlmann; | |
| 2075 else | |
| 2076 pDecoinfo = &stateUsed->decolistVPM; | |
| 2077 | |
| 2078 if(pDecoinfo->output_time_to_surface_seconds) | |
| 2079 { | |
| 2080 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds); | |
| 2081 } | |
| 2082 else | |
| 2083 { | |
| 2084 nextstopDepthMeter = 0; | |
| 2085 nextstopLengthSeconds = 0; | |
| 2086 } | |
| 2087 | |
| 2088 /* depth */ | |
| 2089 float depth = 0; | |
| 2090 float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter); | |
| 2091 if(is_stateUsedSetToSim()) | |
| 2092 { | |
| 2093 depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2] + depthLastCall[3] + depthLastCall[4] + depthLastCall[5] + depthLastCall[6] + depthLastCall[7] + depthLastCall[8]) / 10.0f; | |
| 2094 | |
| 2095 idDepthLastCall++; | |
| 2096 if(idDepthLastCall >= 9) | |
| 2097 idDepthLastCall = 0; | |
| 2098 depthLastCall[idDepthLastCall] = depthThisCall; | |
| 2099 } | |
| 2100 else | |
| 2101 { | |
| 2102 depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2]) / 4.0f; | |
| 2103 | |
| 2104 idDepthLastCall++; | |
| 2105 if(idDepthLastCall >= 3) | |
| 2106 idDepthLastCall = 0; | |
| 2107 depthLastCall[idDepthLastCall] = depthThisCall; | |
| 2108 } | |
| 2109 | |
| 2110 if(depth <= 0.3f) | |
| 2111 depth = 0; | |
| 2112 | |
| 2113 if(settingsGetPointer()->nonMetricalSystem) | |
| 2114 snprintf(TextL1,TEXTSIZE,"\032\f[feet]"); | |
| 2115 else | |
| 2116 snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth); | |
| 2117 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
| 2118 | |
| 2119 if((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10)) | |
| 2120 { | |
| 2121 snprintf(TextL1,TEXTSIZE,"\f\002%.0f %c%c/min " | |
| 2122 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min) | |
| 2123 , unit_depth_char1() | |
| 2124 , unit_depth_char2() | |
| 2125 ); | |
| 2126 GFX_write_string(&FontT24,&t7l1,TextL1,0); | |
| 2127 } | |
| 2128 | |
| 2129 if( depth < 100) | |
| 2130 snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth); | |
| 2131 else | |
| 2132 snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth); | |
| 2133 | |
| 2134 t7_colorscheme_mod(TextL1); | |
| 2135 GFX_write_string(&FontT144,&t7l1,TextL1,1); | |
| 2136 | |
| 2137 /* max depth */ | |
| 2138 snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth); | |
| 2139 GFX_write_string(&FontT42,&t7l2,TextL2,0); | |
| 2140 | |
| 2141 if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100) | |
| 2142 snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
| 2143 else | |
| 2144 snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter)); | |
| 2145 | |
| 2146 t7_colorscheme_mod(TextL2); | |
| 2147 GFX_write_string(&FontT105,&t7l2,TextL2,1); | |
| 2148 | |
| 2149 /* ascentrate graph */ | |
| 2150 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0) | |
| 2151 { | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2152 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2153 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2154 start.y = t7l1.WindowY0 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2155 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2156 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2157 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2158 start.y = t7l3.WindowY0 - 25; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2159 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2160 |
| 38 | 2161 for(int i = 0; i<4;i++) |
| 2162 { | |
| 2163 start.y += 5*6; | |
| 2164 stop.y = start.y; | |
| 2165 start.x = CUSTOMBOX_LINE_LEFT - 1; | |
| 2166 stop.x = start.x - 17; | |
| 2167 GFX_draw_line(&t7screen, start, stop, 0); | |
| 2168 // start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too | |
| 2169 // stop.x = start.x + 17; | |
| 2170 // GFX_draw_line(&t7screen, start, stop, 0); | |
| 2171 } | |
| 2172 // new thick bar design Sept. 2015 | |
| 2173 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5; | |
| 2174 stop.x = start.x; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2175 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2176 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2177 start.y = t7l1.WindowY0 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2178 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2179 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2180 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2181 start.y = t7l3.WindowY0 - 25; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2182 } |
| 38 | 2183 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6); |
| 2184 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9 | |
| 2185 if(stop.y >= 470) | |
| 2186 stop.y = 470; | |
| 2187 start.y += 7; // starte etwas weiter oben | |
| 2188 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10) | |
| 2189 color = CLUT_EverythingOkayGreen; | |
| 2190 else | |
| 2191 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15) | |
| 2192 color = CLUT_WarningYellow; | |
| 2193 else | |
| 2194 color = CLUT_WarningRed; | |
| 2195 | |
| 2196 GFX_draw_thick_line(12,&t7screen, start, stop, color); | |
| 2197 } | |
| 2198 //snprintf(TextL2,TEXTSIZE,"\f%.1f m/min",stateUsed->lifeData.ascent_rate_meter_per_min); | |
| 2199 | |
| 2200 /* divetime */ | |
| 2201 if(stateUsed->lifeData.counterSecondsShallowDepth) | |
| 2202 { | |
| 2203 snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds); | |
| 2204 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
| 2205 } | |
| 2206 else | |
| 2207 { | |
| 2208 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime); | |
| 2209 GFX_write_string(&FontT42,&t7r1,TextR1,0); | |
| 2210 } | |
| 2211 | |
| 2212 if(Divetime.Minutes < 1000) | |
| 2213 snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds); | |
| 2214 else | |
| 2215 snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes); | |
| 2216 t7_colorscheme_mod(TextR1); | |
| 2217 GFX_write_string(&FontT105,&t7r1,TextR1,1); | |
| 2218 | |
| 2219 /* next deco stop */ | |
| 2220 if(nextstopDepthMeter) | |
| 2221 { | |
| 2222 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop); | |
| 2223 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
| 2224 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%u%c%c %u'" | |
| 2225 , unit_depth_integer(nextstopDepthMeter) | |
| 2226 , unit_depth_char1_T105() | |
| 2227 , unit_depth_char2_T105() | |
| 2228 , (nextstopLengthSeconds+59)/60); | |
| 2229 t7_colorscheme_mod(TextR2); | |
| 2230 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
| 2231 TextR2[0] = '\021'; | |
| 2232 if(textlength <= 9) | |
| 2233 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
| 2234 else | |
| 2235 GFX_write_string(&FontT54,&t7r2,TextR2,1); | |
| 2236 } | |
| 2237 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit())) | |
| 2238 { | |
| 2239 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2); | |
| 2240 GFX_write_string(&FontT42,&t7r2,TextR2,0); | |
| 2241 snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds); | |
| 2242 t7_colorscheme_mod(TextR2); | |
| 2243 GFX_write_string(&FontT105,&t7r2,TextR2,1); | |
| 2244 } | |
| 2245 | |
| 2246 /* tts - option 1 | |
| 2247 * ndl - option 2 | |
| 2248 * empty - option 3 */ | |
| 2249 if(pDecoinfo->output_time_to_surface_seconds) | |
| 2250 { | |
| 2251 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS); | |
| 2252 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
| 2253 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60) | |
| 2254 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60); | |
| 2255 else | |
| 2256 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600); | |
| 2257 t7_colorscheme_mod(TextR3); | |
| 2258 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
| 2259 TextR2[0] = '\021'; | |
| 2260 GFX_write_string(&FontT105,&t7r3,TextR3,1); | |
| 2261 } | |
| 2262 else if(pDecoinfo->output_ndl_seconds) | |
| 2263 { | |
| 2264 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit); | |
| 2265 GFX_write_string(&FontT42,&t7r3,TextR3,0); | |
| 2266 if(pDecoinfo->output_ndl_seconds < 1000 * 60) | |
| 2267 snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60); | |
| 2268 else | |
| 2269 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600); | |
| 2270 t7_colorscheme_mod(TextR3); | |
| 2271 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS) | |
| 2272 TextR2[0] = '\021'; | |
| 2273 GFX_write_string(&FontT105,&t7r3,TextR3,1); | |
| 2274 } | |
| 2275 | |
| 2276 /* Menu Selection (and gas mix) */ | |
| 2277 if(get_globalState() == StDMGAS) | |
| 2278 { | |
| 2279 textPointer = 0; | |
| 2280 TextR1[textPointer++] = '\a'; | |
| 2281 // TextR1[textPointer++] = '\f'; | |
| 2282 TextR1[textPointer++] = '\001'; | |
| 2283 TextR1[textPointer++] = ' '; | |
| 2284 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&TextR1[textPointer]); | |
| 2285 TextR1[textPointer++] = '?'; | |
| 2286 TextR1[textPointer++] = ' '; | |
| 2287 TextR1[textPointer++] = 0; | |
| 2288 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2289 } | |
| 2290 else if(get_globalState() == StDMSPT) | |
| 2291 { | |
| 2292 textPointer = 0; | |
| 2293 TextR1[textPointer++] = '\a'; | |
| 2294 TextR1[textPointer++] = '\001'; | |
| 2295 TextR1[textPointer++] = ' '; | |
| 2296 textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100); | |
| 2297 TextR1[textPointer++] = '?'; | |
| 2298 TextR1[textPointer++] = ' '; | |
| 2299 TextR1[textPointer++] = 0; | |
| 2300 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2301 } | |
| 2302 else if(get_globalState() == StDMENU) | |
| 2303 { | |
| 2304 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ); | |
| 2305 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2306 } | |
| 2307 else if(get_globalState() == StDSIM1) | |
| 2308 { | |
| 2309 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ); | |
| 2310 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2311 } | |
| 2312 else if(get_globalState() == StDSIM2) | |
| 2313 { | |
| 2314 if(settingsGetPointer()->nonMetricalSystem) | |
| 2315 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-3.33ft "); | |
| 2316 else | |
| 2317 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m "); | |
| 2318 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2319 | |
| 2320 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
| 2321 , unit_depth_integer(simulation_get_aim_depth()) | |
| 2322 , unit_depth_char1() | |
| 2323 , unit_depth_char2() | |
| 2324 ); | |
| 2325 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
| 2326 | |
| 2327 } | |
| 2328 else if(get_globalState() == StDSIM3) | |
| 2329 { | |
| 2330 if(settingsGetPointer()->nonMetricalSystem) | |
| 2331 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+3.33ft "); | |
| 2332 else | |
| 2333 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m "); | |
| 2334 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2335 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
| 2336 , unit_depth_integer(simulation_get_aim_depth()) | |
| 2337 , unit_depth_char1() | |
| 2338 , unit_depth_char2() | |
| 2339 ); | |
| 2340 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
| 2341 } | |
| 2342 else if(get_globalState() == StDSIM4) | |
| 2343 { | |
| 2344 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' "); | |
| 2345 GFX_write_string_color(&FontT48,&t7c2,TextR1,0,CLUT_WarningYellow); | |
| 2346 snprintf(TextR1,TEXTSIZE,"\a\f %u %c%c" | |
| 2347 , unit_depth_integer(simulation_get_aim_depth()) | |
| 2348 , unit_depth_char1() | |
| 2349 , unit_depth_char2() | |
| 2350 ); | |
| 2351 GFX_write_string_color(&FontT42,&t7l1,TextR1,0,CLUT_WarningYellow); | |
| 2352 } | |
| 2353 else | |
| 2354 { | |
| 2355 /* gas mix */ | |
| 2356 oxygen_percentage = 100; | |
| 2357 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage; | |
| 2358 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage; | |
| 2359 | |
| 2360 textPointer = 0; | |
| 2361 TextC2[textPointer++] = '\020'; | |
| 2362 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
| 2363 { | |
| 2364 TextC2[textPointer++] = '\a'; | |
| 2365 } | |
| 2366 else | |
| 2367 { | |
| 2368 float fPpO2limitHigh, fPpO2now; | |
| 2369 | |
| 2370 if(actualLeftMaxDepth(stateUsed)) | |
| 2371 fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco; | |
| 2372 else | |
| 2373 fPpO2limitHigh = settingsGetPointer()->ppO2_max_std; | |
| 2374 | |
| 2375 fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage; | |
| 2376 | |
| 2377 if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min))) | |
| 2378 TextC2[textPointer++] = '\025'; | |
| 2379 } | |
| 2380 TextC2[textPointer++] = '\002'; | |
| 2381 textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]); | |
| 2382 | |
| 2383 if(stateUsed->warnings.betterGas && warning_count_high_time) | |
| 2384 { | |
| 2385 if(TextC2[0] == '\020') | |
| 2386 { | |
| 2387 TextC2[0] = '\004'; // NOP | |
| 2388 } | |
| 2389 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
| 2390 } | |
| 2391 else | |
| 2392 { | |
| 2393 t7_colorscheme_mod(TextC2); | |
| 2394 GFX_write_string(&FontT48,&t7c2,TextC2,0); // T54 has only numbers | |
| 2395 } | |
| 2396 | |
| 2397 if(stateUsed->diveSettings.ccrOption) | |
| 2398 { | |
| 2399 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
| 2400 { | |
| 2401 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
| 2402 if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR)) | |
| 2403 { | |
| 2404 TextC2[0] = '\a'; // inverse instead of color \020 | |
| 2405 GFX_write_string_color(&FontT48,&t7c2,TextC2,0,CLUT_WarningYellow); | |
| 2406 } | |
| 2407 else | |
| 2408 { | |
| 2409 t7_colorscheme_mod(TextC2); | |
| 2410 GFX_write_string(&FontT48,&t7c2,TextC2,0); | |
| 2411 } | |
| 2412 } | |
| 2413 } | |
| 2414 else if(settingsGetPointer()->alwaysShowPPO2) | |
| 2415 { | |
| 2416 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
| 2417 t7_colorscheme_mod(TextC2); | |
| 2418 GFX_write_string(&FontT48,&t7c2,TextC2,0); | |
| 2419 } | |
| 2420 } | |
| 2421 | |
| 2422 /* algorithm, ccr, bailout and battery */ | |
| 2423 /* and permanent warnings (CNS) */ | |
| 2424 | |
| 2425 if((stateUsed->warnings.cnsHigh) && display_count_high_time) | |
| 2426 { | |
| 2427 TextC2[0] = '\f'; | |
| 2428 TextC2[1] = TXT_2BYTE; | |
| 2429 TextC2[2] = TXT2BYTE_WarnCnsHigh; | |
| 2430 TextC2[3] = 0; | |
| 2431 GFX_write_string_color(&FontT48,&t7c1,TextC2,0,CLUT_WarningRed); | |
| 2432 } | |
| 2433 else | |
| 2434 { | |
| 2435 if(stateUsed->warnings.aGf) | |
| 2436 { | |
| 2437 GFX_write_string_color(&FontT48,&t7c1,"\f" "aGF",0,CLUT_WarningYellow); | |
| 2438 } | |
| 2439 else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
| 2440 { | |
| 2441 GFX_write_string(&FontT48,&t7c1,"\027\f" "GF",0); | |
| 2442 } | |
| 2443 else | |
| 2444 { | |
| 2445 GFX_write_string(&FontT48,&t7c1,"\027\f" "VPM",0); | |
| 2446 } | |
| 2447 | |
| 2448 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR) | |
| 2449 GFX_write_string(&FontT24,&t7c1,"\027\f\002" "CCR",0); | |
| 2450 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80" "CCR",0); | |
| 2451 else | |
| 2452 if(stateUsed->diveSettings.ccrOption) | |
| 2453 GFX_write_string(&FontT24,&t7c1,"\f\002\024" "Bailout",0); | |
| 2454 // GFX_write_string(&FontT24,&t7c1,"\f\177\177\x80\024" "Bailout",0); | |
| 2455 } | |
| 2456 TextC1[0] = '\020'; | |
| 2457 TextC1[1] = '3'; | |
| 2458 TextC1[2] = '1'; | |
| 2459 TextC1[3] = '1'; | |
| 2460 TextC1[4] = '1'; | |
| 2461 TextC1[5] = '1'; | |
| 2462 TextC1[6] = '1'; | |
| 2463 TextC1[7] = '1'; | |
| 2464 TextC1[8] = '1'; | |
| 2465 TextC1[9] = '1'; | |
| 2466 TextC1[10] = '1'; | |
| 2467 TextC1[11] = '1'; | |
| 2468 TextC1[12] = '0'; | |
| 2469 TextC1[13] = 0; | |
| 2470 | |
| 2471 for(int i=1;i<=10;i++) | |
| 2472 { | |
| 2473 if( stateUsed->lifeData.battery_charge > (9 * i)) | |
| 2474 TextC1[i+1] += 1; | |
| 2475 } | |
| 2476 | |
| 2477 if(stateUsed->warnings.lowBattery) | |
| 2478 { | |
| 2479 TextC1[0] = '\025'; | |
| 2480 if(warning_count_high_time) | |
| 2481 { | |
| 2482 for(int i=2;i<=11;i++) | |
| 2483 TextC1[i] = '1'; | |
| 2484 } | |
| 2485 else | |
| 2486 { | |
| 2487 TextC1[2] = '2'; | |
| 2488 } | |
| 2489 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
| 2490 | |
| 2491 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
| 2492 { | |
| 2493 snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
| 2494 if(warning_count_high_time) | |
| 2495 TextC1[0] = '\a'; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2496 GFX_write_string(&FontT24,&t7voltage,TextC1,0); |
| 38 | 2497 } |
| 2498 } | |
| 2499 else | |
| 2500 { | |
| 2501 t7_colorscheme_mod(TextC1); | |
| 2502 GFX_write_string(&Batt24,&t7batt,TextC1,0); | |
| 2503 | |
| 2504 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140)) | |
| 2505 { | |
| 2506 snprintf(TextC1,16,"\020\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge); | |
| 2507 t7_colorscheme_mod(TextC1); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2508 GFX_write_string(&FontT24,&t7voltage,TextC1,0); // t7batt |
| 38 | 2509 } |
| 2510 } | |
| 2511 | |
| 2512 /* customizable left lower corner */ | |
| 2513 t7_refresh_divemode_userselected_left_lower_corner(); | |
| 2514 | |
| 2515 | |
| 2516 /* customview - option 1 | |
| 2517 * warning - option 2 */ | |
| 2518 if(stateUsed->warnings.numWarnings) | |
| 2519 customview_warnings = t7_test_customview_warnings(); | |
| 2520 | |
| 2521 background.pointer = NULL; | |
| 2522 if(customview_warnings && warning_count_high_time) | |
| 2523 t7_show_customview_warnings(); | |
| 2524 else | |
| 2525 t7_refresh_customview(); | |
| 2526 | |
| 2527 /* the frame */ | |
| 2528 draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines); | |
| 2529 } | |
| 2530 | |
| 2531 void t7_set_field_to_primary(void) | |
| 2532 { | |
| 2533 if(stateUsed->mode == MODE_DIVE) | |
| 2534 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary; | |
| 2535 } | |
| 2536 | |
| 2537 void t7_change_field(void) | |
| 2538 { | |
| 2539 const uint8_t minVal = 0; | |
| 2540 const uint8_t maxValGF = 8; | |
| 2541 const uint8_t maxValVPM = 7; | |
| 2542 uint8_t maxNow = maxValGF; | |
| 2543 | |
| 2544 selection_custom_field++; | |
| 2545 | |
| 2546 if(stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) | |
| 2547 maxNow = maxValVPM; | |
| 2548 | |
| 2549 if(selection_custom_field > maxNow) | |
| 2550 selection_custom_field = minVal; | |
| 2551 } | |
| 2552 | |
| 2553 | |
| 2554 void t7_refresh_divemode_userselected_left_lower_corner(void) | |
| 2555 { | |
| 2556 if(!selection_custom_field) | |
| 2557 return; | |
| 2558 | |
| 2559 char headerText[10]; | |
| 2560 char text[TEXTSIZE]; | |
| 2561 uint8_t textpointer = 0; | |
| 2562 _Bool tinyHeaderFont = 0; | |
| 2563 uint8_t line = 0; | |
| 2564 | |
| 2565 SDivetime Stopwatch = {0,0,0,0}; | |
| 2566 float fAverageDepth, fAverageDepthAbsolute; | |
| 2567 const SDecoinfo * pDecoinfoStandard; | |
| 2568 const SDecoinfo * pDecoinfoFuture; | |
| 2569 float fCNS; | |
| 2570 | |
| 2571 float temperatureThisCall; | |
| 2572 float temperature; | |
| 2573 | |
| 2574 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
| 2575 { | |
| 2576 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
| 2577 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
| 2578 } | |
| 2579 else | |
| 2580 { | |
| 2581 pDecoinfoStandard = &stateUsed->decolistVPM; | |
| 2582 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
| 2583 } | |
| 2584 | |
| 2585 Stopwatch.Total = timer_Stopwatch_GetTime(); | |
| 2586 Stopwatch.Minutes = Stopwatch.Total / 60; | |
| 2587 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 ); | |
| 2588 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter(); | |
| 2589 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter; | |
| 2590 | |
| 2591 headerText[0] = '\032'; | |
| 2592 headerText[1] = '\f'; | |
| 2593 | |
| 2594 switch(selection_custom_field) | |
| 2595 { | |
| 2596 /* Temperature */ | |
| 2597 case 1: | |
| 2598 default: | |
| 2599 // mean value | |
| 2600 temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius); | |
| 2601 temperature = (temperatureThisCall + temperatureLastCall[0] + temperatureLastCall[1] + temperatureLastCall[2]) / 4.0f; | |
| 2602 idTemperatureLastCall++; | |
| 2603 if(idTemperatureLastCall >= 3) | |
| 2604 idTemperatureLastCall = 0; | |
| 2605 temperatureLastCall[idTemperatureLastCall] = temperatureThisCall; | |
| 2606 // output | |
| 2607 headerText[2] = TXT_Temperature; | |
| 2608 textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F | |
| 2609 if(settingsGetPointer()->nonMetricalSystem == 0) | |
| 2610 text[textpointer++] = 'C'; | |
| 2611 else | |
| 2612 text[textpointer++] = 'F'; | |
| 2613 text[textpointer++] = 0; | |
| 2614 tinyHeaderFont = 0; | |
| 2615 break; | |
| 2616 | |
| 2617 /* Average Depth */ | |
| 2618 case 2: | |
| 2619 headerText[2] = TXT_AvgDepth; | |
| 2620 if(settingsGetPointer()->nonMetricalSystem) | |
| 2621 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(fAverageDepthAbsolute)); | |
| 2622 else | |
| 2623 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute); | |
| 2624 break; | |
| 2625 | |
| 2626 /* ppO2 */ | |
| 2627 case 3: | |
| 2628 headerText[2] = TXT_ppO2; | |
| 2629 snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2); | |
| 2630 break; | |
| 2631 | |
| 2632 /* Stop Uhr */ | |
| 2633 case 4: | |
| 2634 headerText[2] = TXT_Stopwatch; | |
| 2635 if(settingsGetPointer()->nonMetricalSystem) | |
| 2636 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.0f",Stopwatch.Minutes, Stopwatch.Seconds,unit_depth_float(fAverageDepth)); | |
| 2637 else | |
| 2638 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth); | |
| 2639 tinyHeaderFont = 1; | |
| 2640 line = 1; | |
| 2641 break; | |
| 2642 | |
| 2643 /* Ceiling */ | |
| 2644 case 5: | |
| 2645 headerText[2] = TXT_Ceiling; | |
| 2646 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | |
| 2647 snprintf(text,TEXTSIZE,"\020%01.0f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); | |
| 2648 else | |
| 2649 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter); | |
| 2650 break; | |
| 2651 | |
| 2652 /* Future TTS */ | |
| 2653 case 6: | |
| 2654 headerText[2] = TXT_FutureTTS; | |
| 2655 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, pDecoinfoFuture->output_time_to_surface_seconds / 60); | |
| 2656 tinyHeaderFont = 1; | |
| 2657 line = 1; | |
| 2658 break; | |
| 2659 | |
| 2660 /* CNS */ | |
| 2661 case 7: | |
| 2662 headerText[2] = TXT_CNS; | |
| 2663 fCNS = stateUsed->lifeData .cns; | |
| 2664 if(fCNS > 999) | |
| 2665 fCNS = 999; | |
| 2666 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS); | |
| 2667 break; | |
| 2668 | |
| 2669 /* actual GF */ | |
| 2670 case 8: | |
| 2671 headerText[2] = TXT_ActualGradient; | |
| 2672 snprintf(text,TEXTSIZE,"\020%.0f",100 * pDecoinfoStandard->output_relative_gradient); | |
| 2673 break; | |
| 2674 } | |
| 2675 headerText[3] = 0; | |
| 2676 | |
| 2677 if(tinyHeaderFont) | |
| 2678 GFX_write_string(&FontT24,&t7l3,headerText,0); | |
| 2679 else | |
| 2680 GFX_write_string(&FontT42,&t7l3,headerText,0); | |
| 2681 | |
| 2682 t7_colorscheme_mod(text); | |
| 2683 GFX_write_string(&FontT105,&t7l3,text,line); | |
| 2684 } | |
| 2685 | |
| 2686 /* Private functions ---------------------------------------------------------*/ | |
| 2687 | |
| 2688 uint8_t t7_customtextPrepare(char * text) | |
| 2689 { | |
| 2690 uint8_t i, j, textptr, lineCount; | |
| 2691 char nextChar; | |
| 2692 | |
| 2693 textptr = 0; | |
| 2694 lineCount = 0; | |
| 2695 | |
| 2696 text[textptr++] = TXT_MINIMAL; | |
| 2697 | |
| 2698 j = 0; | |
| 2699 i = 0; | |
| 2700 do | |
| 2701 { | |
| 2702 j += i; | |
| 2703 i = 0; | |
| 2704 do | |
| 2705 { | |
| 2706 nextChar = settingsGetPointer()->customtext[i+j]; | |
| 2707 i++; | |
| 2708 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r')) | |
| 2709 break; | |
| 2710 text[textptr++] = nextChar; | |
| 2711 } while (i < 12); | |
| 2712 | |
| 2713 if(!nextChar) | |
| 2714 break; | |
| 2715 | |
| 2716 if(lineCount < 3) | |
| 2717 { | |
| 2718 text[textptr++] = '\n'; | |
| 2719 text[textptr++] = '\r'; | |
| 2720 } | |
| 2721 lineCount++; | |
| 2722 for(uint8_t k=0;k<2;k++) | |
| 2723 { | |
| 2724 nextChar = settingsGetPointer()->customtext[i+j+k]; | |
| 2725 if((nextChar =='\n') || (nextChar =='\r')) | |
| 2726 i++; | |
| 2727 else | |
| 2728 break; | |
| 2729 } | |
| 2730 | |
| 2731 } while (lineCount < 4); | |
| 2732 | |
| 2733 text[textptr] = 0; | |
| 2734 return lineCount; | |
| 2735 } | |
| 2736 | |
| 2737 /* could be extended to search for \020 inside | |
| 2738 */ | |
| 2739 void t7_colorscheme_mod(char *text) | |
| 2740 { | |
| 2741 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard()) | |
| 2742 { | |
| 2743 text[0] = '\027'; | |
| 2744 } | |
| 2745 } | |
| 2746 | |
| 2747 | |
| 2748 void draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide) | |
| 2749 { | |
| 2750 point_t LeftLow, WidthHeight; | |
| 2751 point_t start, stop; | |
| 2752 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2753 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2754 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2755 |
| 38 | 2756 // plugin box |
| 2757 LeftLow.x = CUSTOMBOX_LINE_LEFT; | |
| 2758 WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT; | |
| 2759 LeftLow.y = 60; | |
| 2760 WidthHeight.y = 440 - LeftLow.y; | |
| 2761 GFX_draw_box(&t7screen, LeftLow, WidthHeight, 1, colorBox); | |
| 2762 | |
| 2763 if(PluginBoxHeader) | |
| 2764 { | |
| 2765 // plugin box - header | |
| 2766 start.x = CUSTOMBOX_LINE_LEFT; | |
| 2767 stop.x = CUSTOMBOX_LINE_RIGHT; | |
| 2768 stop.y = start.y = 440 - 60; | |
| 2769 GFX_draw_line(&t7screen, start, stop, colorBox); | |
| 2770 } | |
| 2771 | |
| 2772 if(LinesOnTheSides) | |
| 2773 { | |
| 2774 // aufteilung links | |
| 2775 start.x = 0; | |
| 2776 stop.x = CUSTOMBOX_LINE_LEFT; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2777 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2778 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2779 stop.y = start.y = t7l1.WindowY0 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2780 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2781 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2782 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2783 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2784 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2785 |
| 38 | 2786 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2787 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2788 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2789 stop.y = start.y = t7l2.WindowY0 -1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2790 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2791 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2792 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2793 stop.y = start.y = 480 - t7l2.WindowY1 -1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2794 } |
| 38 | 2795 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
| 2796 | |
| 2797 // aufteilung rechts | |
| 2798 start.x = CUSTOMBOX_LINE_RIGHT; | |
| 2799 stop.x = 799; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2800 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2801 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2802 stop.y = start.y = t7l1.WindowY0 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2803 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2804 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2805 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2806 stop.y = start.y = 480 - t7l1.WindowY1 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2807 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2808 |
| 38 | 2809 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2810 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2811 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2812 stop.y = start.y = t7l2.WindowY0 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2813 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2814 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2815 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2816 stop.y = start.y = 480 - t7l2.WindowY1 - 1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2817 } |
| 38 | 2818 GFX_draw_line(&t7screen, start, stop, colorLinesOnTheSide); |
| 2819 } | |
| 2820 } | |
| 2821 | |
| 2822 | |
| 2823 /* Compass like TCOS shellfish | |
| 2824 * input is 0 to 359 | |
| 2825 * 2 px / 1 degree | |
| 2826 * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296 | |
| 2827 * one side is 74 degree (less than 90 degree) | |
| 2828 * internal 360 + 180 degree of freedom | |
| 2829 * use positive values only, shift by 360 below 90 mid position | |
| 2830 */ | |
| 2831 | |
| 2832 | |
| 2833 point_t t7_compass_circle(uint8_t id, uint16_t degree) | |
| 2834 { | |
| 2835 float fCos, fSin; | |
| 2836 const float piMult = ((2 * 3.14159) / 360); | |
| 2837 // const int radius[4] = {95,105,115,60}; | |
| 2838 const int radius[4] = {95,105,115,100}; | |
| 2839 const point_t offset = {.x = 400, .y = 250}; | |
| 2840 | |
| 2841 static point_t r[4][360] = { 0 }; | |
| 2842 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2843 if(r[0][0].y == 0) /* calc table at first call only */ |
| 38 | 2844 { |
| 2845 for(int i=0;i<360;i++) | |
| 2846 { | |
| 2847 fCos = cos(i * piMult); | |
| 2848 fSin = sin(i * piMult); | |
| 2849 for(int j=0;j<4;j++) | |
| 2850 { | |
| 2851 r[j][i].x = offset.x + (int)(fSin * radius[j]); | |
| 2852 r[j][i].y = offset.y + (int)(fCos * radius[j]); | |
| 2853 } | |
| 2854 } | |
| 2855 } | |
| 2856 if(id > 3) id = 0; | |
| 2857 if(degree > 359) degree = 0; | |
| 2858 return r[id][degree]; | |
| 2859 } | |
| 2860 | |
| 2861 /* range should be 0 to 30 bar if 300 meter with 100% of nitrogen or helium | |
| 2862 * T24 is 28 high | |
| 2863 */ | |
| 2864 void t7_tissues(const SDiveState * pState) | |
| 2865 { | |
| 2866 point_t start, change, stop; | |
| 2867 float value; | |
| 2868 uint16_t front, cns100pixel; | |
| 2869 char text[256]; | |
| 2870 uint8_t textpointer = 0; | |
| 2871 uint8_t color; | |
| 2872 | |
| 2873 float percent_N2; | |
| 2874 float percent_He; | |
| 2875 float partial_pressure_N2; | |
| 2876 float partial_pressure_He; | |
| 2877 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2878 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2879 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2880 |
| 38 | 2881 |
| 2882 /* N2 */ | |
| 2883 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2884 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2885 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2886 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2887 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2888 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2889 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2890 t7cY0free.WindowY0 = t7cH.WindowY0 + 15; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2891 t7cY0free.WindowY1 = t7cY0free.WindowY0 + 250; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2892 } |
| 38 | 2893 t7cY0free.WindowNumberOfTextLines = 3; |
| 2894 | |
| 2895 text[textpointer++] = '\030'; | |
| 2896 text[textpointer++] = TXT_2BYTE; | |
| 2897 text[textpointer++] = TXT2BYTE_Nitrogen; | |
| 2898 text[textpointer++] = '\n'; | |
| 2899 text[textpointer++] = '\r'; | |
| 2900 text[textpointer++] = TXT_2BYTE; | |
| 2901 text[textpointer++] = TXT2BYTE_Helium; | |
| 2902 text[textpointer++] = '\n'; | |
| 2903 text[textpointer++] = '\r'; | |
| 2904 text[textpointer++] = TXT_2BYTE; | |
| 2905 text[textpointer++] = TXT2BYTE_CNS; | |
| 2906 text[textpointer++] = 0; | |
| 2907 | |
| 2908 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 2909 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2910 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2911 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2912 start.y = t7cH.WindowY0 - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2913 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2914 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2915 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2916 start.y = t7cH.WindowY1 - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
2917 } |
| 38 | 2918 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
| 2919 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE; | |
| 2920 | |
| 2921 for(int i=0;i<16;i++) | |
| 2922 { | |
| 2923 stop.y = start.y; | |
| 2924 change.y = start.y; | |
| 2925 | |
| 2926 value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f; | |
| 2927 value *= 80;//20 | |
| 2928 | |
| 2929 if(value < 0) | |
| 2930 front = 0; | |
| 2931 else | |
| 2932 if(value > CUSTOMBOX_SPACE_INSIDE) | |
| 2933 front = CUSTOMBOX_SPACE_INSIDE; | |
| 2934 else | |
| 2935 front = (uint16_t)value; | |
| 2936 | |
| 2937 change.x = start.x + front; | |
| 2938 if(change.x != start.x) | |
| 2939 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
| 2940 if(change.x != stop.x) | |
| 2941 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
| 2942 | |
| 2943 start.y -= 3; | |
| 2944 } | |
| 2945 | |
| 2946 /* He */ | |
| 2947 start.y -= 28 + 14; | |
| 2948 for(int i=0;i<16;i++) | |
| 2949 { | |
| 2950 stop.y = start.y; | |
| 2951 change.y = start.y; | |
| 2952 | |
| 2953 value = pState->lifeData.tissue_helium_bar[i]; | |
| 2954 value *= 80;//20 | |
| 2955 | |
| 2956 if(value < 0) | |
| 2957 front = 0; | |
| 2958 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
| 2959 front = CUSTOMBOX_SPACE_INSIDE; | |
| 2960 else | |
| 2961 front = (uint16_t)value; | |
| 2962 | |
| 2963 change.x = start.x + front; | |
| 2964 if(change.x != start.x) | |
| 2965 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font030); | |
| 2966 if(change.x != stop.x) | |
| 2967 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
| 2968 | |
| 2969 start.y -= 3; | |
| 2970 } | |
| 2971 | |
| 2972 /* CNS == Oxygen */ | |
| 2973 start.y -= 28 + 14; | |
| 2974 | |
| 2975 cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10; | |
| 2976 value = pState->lifeData.cns; | |
| 2977 value *= cns100pixel; | |
| 2978 value /= 100; | |
| 2979 | |
| 2980 if(value < 0) | |
| 2981 front = 0; | |
| 2982 else if(value > CUSTOMBOX_SPACE_INSIDE) | |
| 2983 front = CUSTOMBOX_SPACE_INSIDE; | |
| 2984 else | |
| 2985 front = (uint16_t)value; | |
| 2986 | |
| 2987 if(pState->lifeData.cns < 95) | |
| 2988 color = CLUT_Font030; | |
| 2989 else if(pState->lifeData.cns < 100) | |
| 2990 color = CLUT_WarningYellow; | |
| 2991 else | |
| 2992 color = CLUT_WarningRed; | |
| 2993 | |
| 2994 for(int i=0;i<16;i++) | |
| 2995 { | |
| 2996 stop.y = start.y; | |
| 2997 change.y = start.y; | |
| 2998 | |
| 2999 change.x = start.x + front; | |
| 3000 if(change.x != start.x) | |
| 3001 GFX_draw_thick_line(1,&t7screen, start, change, color); | |
| 3002 if(change.x != stop.x) | |
| 3003 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font031); | |
| 3004 | |
| 3005 start.y -= 3; | |
| 3006 } | |
| 3007 | |
| 3008 /* where is the onload/offload limit for N2 and He */ | |
| 3009 decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He); | |
| 3010 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2; | |
| 3011 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He; | |
| 3012 | |
| 3013 // Nitrogen vertical bar | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3014 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3015 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3016 start.y = t7cH.WindowY0 + 1 - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3017 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3018 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3019 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3020 start.y = t7cH.WindowY1 - 5; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3021 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3022 |
| 38 | 3023 stop.y = start.y - (3 * 15) - 1; |
| 3024 if((percent_N2 > 0) && (partial_pressure_N2 > 0.8f))//(0.8f + 0.5f))) | |
| 3025 { | |
| 3026 value = partial_pressure_N2; | |
| 3027 value *= 80;//20 | |
| 3028 | |
| 3029 if(value < 0) | |
| 3030 front = 3; | |
| 3031 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
| 3032 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
| 3033 else | |
| 3034 front = (uint16_t)value; | |
| 3035 } | |
| 3036 else | |
| 3037 { | |
| 3038 front = 1; | |
| 3039 } | |
| 3040 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
| 3041 stop.x = start.x; | |
| 3042 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
| 3043 | |
| 3044 | |
| 3045 // Helium vertical bar | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3046 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3047 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3048 start.y = t7cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3049 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3050 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3051 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3052 start.y = t7cH.WindowY1 - 5 - 3*16 - 28 - 14; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3053 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3054 |
| 38 | 3055 stop.y = start.y - (3 * 15) - 1; |
| 3056 if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f | |
| 3057 { | |
| 3058 | |
| 3059 value = partial_pressure_He; | |
| 3060 value *= 80;//20 | |
| 3061 | |
| 3062 if(value < 0) | |
| 3063 front = 3; | |
| 3064 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
| 3065 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
| 3066 else | |
| 3067 front = (uint16_t)value; | |
| 3068 } | |
| 3069 else | |
| 3070 { | |
| 3071 front = 1; | |
| 3072 } | |
| 3073 | |
| 3074 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
| 3075 stop.x = start.x; | |
| 3076 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
| 3077 | |
| 3078 // Oxygen vertical bar | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3079 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3080 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3081 start.y = t7cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3082 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3083 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3084 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3085 start.y = t7cH.WindowY1 - 5 - 6*16 - 2*28 - 2*14; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3086 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3087 |
| 38 | 3088 stop.y = start.y - (3 * 15) - 1; |
| 3089 | |
| 3090 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel; | |
| 3091 stop.x = start.x; | |
| 3092 GFX_draw_thick_line(2, &t7screen, start, stop, CLUT_WarningRed); | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3093 |
| 38 | 3094 } |
| 3095 | |
| 3096 | |
| 3097 void t7_debug(void) | |
| 3098 { | |
| 3099 char text[256+50]; | |
| 3100 uint8_t textpointer = 0; | |
| 3101 | |
| 3102 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
| 3103 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
| 3104 t7cY0free.WindowNumberOfTextLines = 3; | |
| 3105 | |
| 3106 textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r"); | |
| 3107 textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r"); | |
| 3108 // textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r"); | |
| 3109 textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r"); | |
| 3110 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 3111 | |
| 3112 t7cY0free.WindowY0 -= 52; | |
| 3113 // snprintf(text,60,"%0.2f\n\r%0.2f %u%%\n\r%0.0f",stateUsed->lifeData.pressure_ambient_bar, stateUsed->lifeData.pressure_surface_bar, settingsGetPointer()->salinity, 1000 * (stateUsed->lifeData.pressure_ambient_bar-stateUsed->lifeData.pressure_surface_bar)); | |
| 3114 snprintf(text,60, | |
| 3115 "%0.2f\n\r" | |
| 3116 "%0.2f %u%%\n\r" | |
| 3117 "%u" | |
| 3118 ,stateUsed->lifeData.pressure_ambient_bar | |
| 3119 ,stateUsed->lifeData.pressure_surface_bar | |
| 3120 ,settingsGetPointer()->salinity | |
| 3121 ,stateUsed->lifeData.counterSecondsShallowDepth); | |
| 3122 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 3123 } | |
| 3124 | |
| 3125 | |
| 3126 void t7_SummaryOfLeftCorner(void) | |
| 3127 { | |
| 3128 char text[256+60]; | |
| 3129 uint8_t textpointer = 0; | |
| 3130 | |
| 3131 const SDecoinfo * pDecoinfoStandard; | |
| 3132 const SDecoinfo * pDecoinfoFuture; | |
| 3133 float fCNS; | |
| 3134 | |
| 3135 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE) | |
| 3136 { | |
| 3137 pDecoinfoStandard = &stateUsed->decolistBuehlmann; | |
| 3138 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann; | |
| 3139 } | |
| 3140 else | |
| 3141 { | |
| 3142 pDecoinfoStandard = &stateUsed->decolistVPM; | |
| 3143 pDecoinfoFuture = &stateUsed->decolistFutureVPM; | |
| 3144 } | |
| 3145 | |
| 3146 fCNS = stateUsed->lifeData .cns; | |
| 3147 if(fCNS > 999) | |
| 3148 fCNS = 999; | |
| 3149 | |
| 3150 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | |
| 3151 t7cY0free.WindowLineSpacing = 48; | |
| 3152 t7cY0free.WindowNumberOfTextLines = 6; | |
| 3153 t7cY0free.WindowTab = 420; | |
| 3154 | |
| 3155 // header | |
| 3156 textpointer = 0; | |
| 3157 text[textpointer++] = '\032'; | |
| 3158 text[textpointer++] = '\016'; | |
| 3159 text[textpointer++] = '\016'; | |
| 3160 text[textpointer++] = TXT_ppO2; | |
| 3161 text[textpointer++] = '\n'; | |
| 3162 text[textpointer++] = '\r'; | |
| 3163 text[textpointer++] = TXT_Ceiling; | |
| 3164 text[textpointer++] = '\n'; | |
| 3165 text[textpointer++] = '\r'; | |
| 3166 text[textpointer++] = TXT_ActualGradient; | |
| 3167 text[textpointer++] = '\n'; | |
| 3168 text[textpointer++] = '\r'; | |
| 3169 text[textpointer++] = TXT_CNS; | |
| 3170 text[textpointer++] = '\n'; | |
| 3171 text[textpointer++] = '\r'; | |
| 3172 text[textpointer++] = TXT_FutureTTS; | |
| 3173 text[textpointer++] = '\017'; | |
| 3174 text[textpointer++] = 0; | |
| 3175 t7cY0free.WindowX0 += 10; | |
| 3176 t7cY0free.WindowY0 += 10; | |
| 3177 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 3178 t7cY0free.WindowX0 -= 10; | |
| 3179 t7cY0free.WindowY0 -= 10; | |
| 3180 | |
| 3181 textpointer = 0; | |
| 3182 text[textpointer++] = '\t'; | |
| 3183 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2); | |
| 3184 text[textpointer++] = '\n'; | |
| 3185 text[textpointer++] = '\r'; | |
| 3186 text[textpointer++] = '\t'; | |
| 3187 if((pDecoinfoStandard->output_ceiling_meter > 99.9f) || (settingsGetPointer()->nonMetricalSystem)) | |
| 3188 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",unit_depth_float(pDecoinfoStandard->output_ceiling_meter)); | |
| 3189 else | |
| 3190 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter); | |
| 3191 text[textpointer++] = '\n'; | |
| 3192 text[textpointer++] = '\r'; | |
| 3193 text[textpointer++] = '\t'; | |
| 3194 textpointer += snprintf(&text[textpointer],10,"\020%.0f", 100 * pDecoinfoStandard->output_relative_gradient); | |
| 3195 text[textpointer++] = '\n'; | |
| 3196 text[textpointer++] = '\r'; | |
| 3197 text[textpointer++] = '\t'; | |
| 3198 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS); | |
| 3199 text[textpointer++] = '\n'; | |
| 3200 text[textpointer++] = '\r'; | |
| 3201 text[textpointer++] = '\t'; | |
| 3202 textpointer += snprintf(&text[textpointer],10,"\020%i'", pDecoinfoFuture->output_time_to_surface_seconds / 60); | |
| 3203 text[textpointer++] = 0; | |
| 3204 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 3205 } | |
| 3206 | |
| 3207 | |
| 3208 void t7_scooter(void) | |
| 3209 { | |
| 3210 float scooterTemperatureLocal; | |
| 3211 uint16_t scooterSpeedLocal; | |
| 3212 // uint16_t scooterDrehzhl; | |
| 3213 uint8_t scooterResidualCapacity; | |
| 3214 // float scooterVoltage; | |
| 3215 // uint8_t scooterCurrent; | |
| 3216 //uint16_t scooterWattHours; | |
| 3217 // uint16_t bkpX0, bkpX1; | |
| 3218 uint16_t ageInMilliSeconds; | |
| 3219 | |
| 3220 uint8_t textSize; | |
| 3221 | |
| 3222 scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f); | |
| 3223 scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed); | |
| 3224 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity(); | |
| 3225 | |
| 3226 // scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl; | |
| 3227 // scooterVoltage = stateUsed->lifeData.scooterSpannung; | |
| 3228 // scooterCurrent = stateUsed->lifeData.scooterAmpere; | |
| 3229 // scooterWattHours = stateUsed->lifeData.scooterWattstunden; | |
| 3230 | |
| 3231 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds; | |
| 3232 if(!ageInMilliSeconds) | |
| 3233 ageInMilliSeconds = 9999; | |
| 3234 | |
| 3235 char text[256+60]; | |
| 3236 uint8_t textpointer = 0; | |
| 3237 | |
| 3238 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
| 3239 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
| 3240 t7cY0free.WindowNumberOfTextLines = 3; | |
| 3241 | |
| 3242 // header | |
| 3243 // text[textpointer++] = '\032'; | |
| 3244 text[textpointer++] = TXT_2BYTE; | |
| 3245 text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet; | |
| 3246 text[textpointer++] = '\n'; | |
| 3247 text[textpointer++] = '\r'; | |
| 3248 text[textpointer++] = TXT_2BYTE; | |
| 3249 text[textpointer++] = TXT2BYTE_ScooterTemperature; | |
| 3250 text[textpointer++] = '\n'; | |
| 3251 text[textpointer++] = '\r'; | |
| 3252 text[textpointer++] = TXT_2BYTE; | |
| 3253 text[textpointer++] = TXT2BYTE_ScooterSpeed; | |
| 3254 text[textpointer++] = 0; | |
| 3255 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 3256 | |
| 3257 /* | |
| 3258 snprintf(text,60, | |
| 3259 "\032" | |
| 3260 "%0u" "\016\016 Wh used\017" | |
| 3261 ,stateUsed->lifeData.scooterWattstunden); | |
| 3262 */ | |
| 3263 | |
| 3264 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 3265 | |
| 3266 /* | |
| 3267 snprintf(text,60, | |
| 3268 "\030" | |
| 3269 "\n\r" | |
| 3270 "\n\r" | |
| 3271 "%0u" "\022\016\016 rpm\017\030" | |
| 3272 ,stateUsed->lifeData.scooterDrehzahl); | |
| 3273 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 3274 */ | |
| 3275 // data | |
| 3276 t7cY0free.WindowY0 -= 52; | |
| 3277 if(settingsGetPointer()->nonMetricalSystem == 0) | |
| 3278 { | |
| 3279 textSize = snprintf(text,60, | |
| 3280 "\030" | |
| 3281 "%0u" "\022\016\016 %%\017\030" | |
| 3282 "\n\r" | |
| 3283 "%0.0f\140" "\022\016\016 C\017\030" | |
| 3284 "\n\r" | |
| 3285 "%u" "\022\016\016 m/min\017\030" | |
| 3286 ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal); | |
| 3287 } | |
| 3288 else | |
| 3289 { | |
| 3290 textSize = snprintf(text,60, | |
| 3291 "\030" | |
| 3292 "%0u" "\022\016\016 %%\017\030" | |
| 3293 "\n\r" | |
| 3294 "%0.0f\140" "\022\016\016 Fht\017\030" | |
| 3295 "\n\r" | |
| 3296 "%u" "\022\016\016 ft/min\017\030" | |
| 3297 ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal); | |
| 3298 } | |
| 3299 // connection active | |
| 3300 if(ageInMilliSeconds > 1500) | |
| 3301 { | |
| 3302 for(int i=0; i < textSize -2; i++) | |
| 3303 { | |
| 3304 if(text[i] == '\030') | |
| 3305 text[i] = '\031'; | |
| 3306 } | |
| 3307 } | |
| 3308 // write data | |
| 3309 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 3310 | |
| 3311 // age stamp | |
| 3312 if(ageInMilliSeconds < 9999) | |
| 3313 { | |
| 3314 t7cY0free.WindowY0 -= 30; | |
| 3315 snprintf(text,60, | |
| 3316 "\021\001%u" | |
| 3317 ,ageInMilliSeconds); | |
| 3318 GFX_write_string(&FontT24, &t7cY0free, text, 0); | |
| 3319 } | |
| 3320 } | |
| 3321 | |
| 3322 | |
| 3323 void t7_scooter_May2016_01(void) | |
| 3324 { | |
| 3325 float scooterTemperature; | |
| 3326 uint16_t scooterDrehzhl; | |
| 3327 uint8_t scooterResidualCapacity; | |
| 3328 float scooterSpeed; | |
| 3329 float scooterVoltage; | |
| 3330 uint8_t scooterCurrent; | |
| 3331 // uint16_t scooterWattHours; | |
| 3332 uint16_t bkpX0, bkpX1; | |
| 3333 | |
| 3334 uint16_t ageInMilliSeconds; | |
| 3335 uint8_t textSize; | |
| 3336 // old scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity); | |
| 3337 | |
| 3338 scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl; | |
| 3339 scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f; | |
| 3340 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity(); | |
| 3341 | |
| 3342 scooterVoltage = stateUsed->lifeData.scooterSpannung; | |
| 3343 scooterCurrent = stateUsed->lifeData.scooterAmpere; | |
| 3344 // scooterWattHours = stateUsed->lifeData.scooterWattstunden; | |
| 3345 | |
| 3346 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds; | |
| 3347 | |
| 3348 scooterSpeed = scooterDrehzhl * 80 / 3300; | |
| 3349 | |
| 3350 char text[256+60]; | |
| 3351 | |
| 3352 t7cY0free.WindowLineSpacing = (28 + 48 + 14)/2; | |
| 3353 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 5 * t7cY0free.WindowLineSpacing; | |
| 3354 t7cY0free.WindowNumberOfTextLines = 6; | |
| 3355 | |
| 3356 t7cY0free.WindowY0 -= 7; | |
| 3357 | |
| 3358 bkpX0 = t7cY0free.WindowX0; | |
| 3359 bkpX1 = t7cY0free.WindowX1; | |
| 3360 t7cY0free.WindowX0 = 430; | |
| 3361 | |
| 3362 textSize = snprintf(text,120, | |
| 3363 "\022\016\016" | |
| 3364 "%%" | |
| 3365 "\n\r" | |
| 3366 "celsius" | |
| 3367 "\n\r" | |
| 3368 "rpm" | |
| 3369 "\n\r" | |
| 3370 "m/min" | |
| 3371 "\n\r" | |
| 3372 "Ampere" | |
| 3373 "\n\r" | |
| 3374 "Volt" | |
| 3375 // "\n\r" | |
| 3376 // "Wh" | |
| 3377 ); | |
| 3378 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 3379 | |
| 3380 t7cY0free.WindowX0 = bkpX0; | |
| 3381 t7cY0free.WindowX1 = 420; | |
| 3382 | |
| 3383 textSize = snprintf(text,120, | |
| 3384 "\030" | |
| 3385 "\002" | |
| 3386 "%0u" | |
| 3387 "\n\r" | |
| 3388 "\002" | |
| 3389 "%0.0f" | |
| 3390 "\n\r" | |
| 3391 "\002" | |
| 3392 "%0u" | |
| 3393 "\n\r" | |
| 3394 "\002" | |
| 3395 "%0.0f" | |
| 3396 "\n\r" | |
| 3397 "\002" | |
| 3398 "%0u" | |
| 3399 "\n\r" | |
| 3400 "\002" | |
| 3401 "%0.1f" | |
| 3402 // "\n\r" | |
| 3403 // "%0u" "\022\016\016 Wh\017\030" | |
| 3404 ,scooterResidualCapacity,scooterTemperature,scooterDrehzhl,scooterSpeed | |
| 3405 ,scooterCurrent,scooterVoltage);//,scooterWattHours); | |
| 3406 | |
| 3407 if((ageInMilliSeconds > 1500) || (stateUsed->lifeData.scooterType == 0xFF)) | |
| 3408 { | |
| 3409 for(int i=0; i < textSize -2; i++) | |
| 3410 { | |
| 3411 if(text[i] == '\030') | |
| 3412 text[i] = '\031'; | |
| 3413 } | |
| 3414 } | |
| 3415 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 3416 | |
| 3417 t7cY0free.WindowX0 = bkpX0; | |
| 3418 t7cY0free.WindowX1 = bkpX1; | |
| 3419 | |
| 3420 t7cY0free.WindowY0 -= 30; | |
| 3421 snprintf(text,60, | |
| 3422 "\021\001%u" | |
| 3423 ,ageInMilliSeconds); | |
| 3424 GFX_write_string(&FontT24, &t7cY0free, text, 0); | |
| 3425 | |
| 3426 } | |
| 3427 | |
| 3428 void t7_scooter_alt(void) | |
| 3429 { | |
| 3430 float scooterTemperature; | |
| 3431 uint16_t scooterDrehzhl; | |
| 3432 uint8_t scooterStatus; | |
| 3433 uint8_t scooterResidualCapacity; | |
| 3434 float scooterSpeed; | |
| 3435 uint16_t ageInMilliSeconds; | |
| 3436 uint8_t textSize; | |
| 3437 // old scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity); | |
| 3438 | |
| 3439 scooterStatus = 2;//BC_CONNECTED; | |
| 3440 scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl; | |
| 3441 scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f; | |
| 3442 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity(); | |
| 3443 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds; | |
| 3444 if(!ageInMilliSeconds) | |
| 3445 ageInMilliSeconds = 9999; | |
| 3446 | |
| 3447 scooterSpeed = scooterDrehzhl * 80 / 3300; | |
| 3448 | |
| 3449 char text[256+60]; | |
| 3450 uint8_t textpointer = 0; | |
| 3451 | |
| 3452 //float percent_N2; | |
| 3453 //float percent_He; | |
| 3454 //float partial_pressure_N2; | |
| 3455 //float partial_pressure_He; | |
| 3456 | |
| 3457 t7cY0free.WindowLineSpacing = 28 + 48 + 14; | |
| 3458 t7cY0free.WindowY0 = t7cH.WindowY0 - 5 - 2 * t7cY0free.WindowLineSpacing; | |
| 3459 t7cY0free.WindowNumberOfTextLines = 3; | |
| 3460 | |
| 3461 text[textpointer++] = '\032'; | |
| 3462 text[textpointer++] = TXT_2BYTE; | |
| 3463 text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet; | |
| 3464 text[textpointer++] = '\n'; | |
| 3465 text[textpointer++] = '\r'; | |
| 3466 text[textpointer++] = TXT_2BYTE; | |
| 3467 text[textpointer++] = TXT2BYTE_ScooterTemperature; | |
| 3468 text[textpointer++] = '\n'; | |
| 3469 text[textpointer++] = '\r'; | |
| 3470 text[textpointer++] = TXT_2BYTE; | |
| 3471 text[textpointer++] = TXT2BYTE_ScooterSpeed; | |
| 3472 text[textpointer++] = 0; | |
| 3473 | |
| 3474 GFX_write_string(&FontT24, &t7cY0free, text, 1); | |
| 3475 | |
| 3476 if(scooterStatus == 2)//BC_CONNECTED) | |
| 3477 { | |
| 3478 t7cY0free.WindowY0 -= 52; | |
| 3479 textSize = snprintf(text,60, | |
| 3480 "\030" | |
| 3481 "%0u" "\022\016\016 %%\017\030" | |
| 3482 "\n\r" | |
| 3483 "%0.0f\140" "\022\016\016 celsius\017\030" | |
| 3484 "\n\r" | |
| 3485 "%0.0f" "\022\016\016 m/min\017\030" | |
| 3486 ,scooterResidualCapacity,scooterTemperature,scooterSpeed); | |
| 3487 | |
| 3488 if(ageInMilliSeconds > 1500) | |
| 3489 { | |
| 3490 for(int i=0; i < textSize -2; i++) | |
| 3491 { | |
| 3492 if(text[i] == '\030') | |
| 3493 text[i] = '\031'; | |
| 3494 } | |
| 3495 } | |
| 3496 // snprintf(text,60,"\031%0.2f\n\r%0.2f\n\r%u",scooterWatt,scooterTemperature,scooterDrehzhl); | |
| 3497 GFX_write_string(&FontT42, &t7cY0free, text, 1); | |
| 3498 | |
| 3499 t7cY0free.WindowY0 -= 30; | |
| 3500 snprintf(text,60, | |
| 3501 "\021\001%u" | |
| 3502 ,ageInMilliSeconds); | |
| 3503 GFX_write_string(&FontT24, &t7cY0free, text, 0); | |
| 3504 | |
| 3505 } | |
| 3506 } | |
| 3507 | |
| 3508 | |
| 3509 /* | |
| 3510 point_t start, change, stop; | |
| 3511 float value; | |
| 3512 uint16_t front; | |
| 3513 uint8_t color; | |
| 3514 | |
| 3515 | |
| 3516 start.y = t7cH.WindowY0 - 5; | |
| 3517 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
| 3518 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE; | |
| 3519 | |
| 3520 | |
| 3521 for(int i=0;i<16;i++) | |
| 3522 { | |
| 3523 stop.y = start.y; | |
| 3524 change.y = start.y; | |
| 3525 | |
| 3526 value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f; | |
| 3527 value *= 20; | |
| 3528 | |
| 3529 if(value < 0) | |
| 3530 front = 0; | |
| 3531 else | |
| 3532 if(value > CUSTOMBOX_SPACE_INSIDE) | |
| 3533 front = CUSTOMBOX_SPACE_INSIDE; | |
| 3534 else | |
| 3535 front = (uint16_t)value; | |
| 3536 | |
| 3537 change.x = start.x + front; | |
| 3538 if(change.x != start.x) | |
| 3539 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font020); | |
| 3540 if(change.x != stop.x) | |
| 3541 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font021); | |
| 3542 | |
| 3543 start.y -= 3; | |
| 3544 } | |
| 3545 | |
| 3546 // He | |
| 3547 start.y -= 28 + 14; | |
| 3548 for(int i=0;i<16;i++) | |
| 3549 { | |
| 3550 stop.y = start.y; | |
| 3551 change.y = start.y; | |
| 3552 | |
| 3553 value = pState->lifeData.tissue_helium_bar[i]; | |
| 3554 value *= 20; | |
| 3555 | |
| 3556 if(value < 0) | |
| 3557 front = 0; | |
| 3558 else | |
| 3559 if(value > CUSTOMBOX_SPACE_INSIDE) | |
| 3560 front = CUSTOMBOX_SPACE_INSIDE; | |
| 3561 else | |
| 3562 front = (uint16_t)value; | |
| 3563 | |
| 3564 change.x = start.x + front; | |
| 3565 if(change.x != start.x) | |
| 3566 GFX_draw_thick_line(1,&t7screen, start, change, CLUT_Font020); | |
| 3567 if(change.x != stop.x) | |
| 3568 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font021); | |
| 3569 | |
| 3570 start.y -= 3; | |
| 3571 } | |
| 3572 | |
| 3573 // CNS == Oxygen | |
| 3574 start.y -= 28 + 14; | |
| 3575 | |
| 3576 value = pState->lifeData.cns; | |
| 3577 value *= (CUSTOMBOX_SPACE_INSIDE/2); | |
| 3578 value /= 100; | |
| 3579 | |
| 3580 if(value < 0) | |
| 3581 front = 0; | |
| 3582 else | |
| 3583 if(value > CUSTOMBOX_SPACE_INSIDE) | |
| 3584 front = CUSTOMBOX_SPACE_INSIDE; | |
| 3585 else | |
| 3586 front = (uint16_t)value; | |
| 3587 | |
| 3588 if(pState->lifeData.cns < 95) | |
| 3589 color = CLUT_Font020; | |
| 3590 else | |
| 3591 if(pState->lifeData.cns < 100) | |
| 3592 color = CLUT_WarningYellow; | |
| 3593 else | |
| 3594 color = CLUT_WarningRed; | |
| 3595 | |
| 3596 for(int i=0;i<16;i++) | |
| 3597 { | |
| 3598 stop.y = start.y; | |
| 3599 change.y = start.y; | |
| 3600 | |
| 3601 change.x = start.x + front; | |
| 3602 if(change.x != start.x) | |
| 3603 GFX_draw_thick_line(1,&t7screen, start, change, color); | |
| 3604 if(change.x != stop.x) | |
| 3605 GFX_draw_thick_line(1,&t7screen, change, stop, CLUT_Font021); | |
| 3606 | |
| 3607 start.y -= 3; | |
| 3608 } | |
| 3609 | |
| 3610 // where is the onload/offload limit for N2 and He | |
| 3611 decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He); | |
| 3612 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2; | |
| 3613 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He; | |
| 3614 | |
| 3615 if((percent_N2 > 0) && (partial_pressure_N2 > (0.8f + 0.5f))) | |
| 3616 { | |
| 3617 start.y = t7cH.WindowY0 + 1 - 5; | |
| 3618 stop.y = start.y - (3 * 15) - 1; | |
| 3619 | |
| 3620 value = partial_pressure_N2; | |
| 3621 value *= 20; | |
| 3622 | |
| 3623 if(value < 0) | |
| 3624 front = 3; | |
| 3625 else | |
| 3626 if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
| 3627 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
| 3628 else | |
| 3629 front = (uint16_t)value; | |
| 3630 | |
| 3631 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
| 3632 stop.x = start.x; | |
| 3633 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
| 3634 } | |
| 3635 | |
| 3636 if((percent_He > 0) && (partial_pressure_He > 0.5f)) | |
| 3637 { | |
| 3638 start.y = t7cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14; | |
| 3639 stop.y = start.y - (3 * 15) - 1; | |
| 3640 | |
| 3641 value = partial_pressure_He; | |
| 3642 value *= 20; | |
| 3643 | |
| 3644 if(value < 0) | |
| 3645 front = 3; | |
| 3646 else | |
| 3647 if(value + 5 > CUSTOMBOX_SPACE_INSIDE) | |
| 3648 front = CUSTOMBOX_SPACE_INSIDE - 3; | |
| 3649 else | |
| 3650 front = (uint16_t)value; | |
| 3651 | |
| 3652 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front; | |
| 3653 stop.x = start.x; | |
| 3654 GFX_draw_thick_line(2,&t7screen, start, stop, CLUT_EverythingOkayGreen); | |
| 3655 } | |
| 3656 | |
| 3657 start.y = t7cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14; | |
| 3658 stop.y = start.y - (3 * 15) - 1; | |
| 3659 | |
| 3660 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + CUSTOMBOX_SPACE_INSIDE/2; | |
| 3661 stop.x = start.x; | |
| 3662 GFX_draw_thick_line(2, &t7screen, start, stop, CLUT_WarningRed); | |
| 3663 */ | |
| 3664 | |
| 3665 /* | |
| 3666 void t7_clock(void) | |
| 3667 { | |
| 3668 point_t start, stop; | |
| 3669 | |
| 3670 | |
| 3671 for(uint16_t i=0;i<360;i+=30) | |
| 3672 { | |
| 3673 start = t7_compass_circle(1,i); | |
| 3674 stop = t7_compass_circle(2,i); | |
| 3675 start.x += 280; // standard center is 400, 250 | |
| 3676 stop.x += 280; | |
| 3677 GFX_draw_thick_line(5,&t7screen, start, stop, CLUT_CompassSubTick); | |
| 3678 | |
| 3679 start.x = 400+280; | |
| 3680 start.y = 250; | |
| 3681 stop = t7_compass_circle(2,58); | |
| 3682 stop.x += 280; | |
| 3683 GFX_draw_thick_line(3,&t7screen, start, stop, CLUT_CompassNorthTick); | |
| 3684 stop = t7_compass_circle(0,302); | |
| 3685 stop.x += 280; | |
| 3686 GFX_draw_thick_line(3,&t7screen, start, stop, CLUT_CompassNorthTick); | |
| 3687 } | |
| 3688 } | |
| 3689 */ | |
| 3690 | |
| 3691 //static float testCC = 180; | |
| 3692 void t7_compass(uint16_t ActualHeading, uint16_t UserSetHeading) | |
| 3693 { | |
| 3694 | |
| 3695 /* | |
| 3696 static uint16_t lastHeading = 0; | |
| 3697 float differenceCompass, resultKalman; | |
| 3698 | |
| 3699 if(testCC > lastHeading) | |
| 3700 differenceCompass = testCC - lastHeading; | |
| 3701 else | |
| 3702 differenceCompass = lastHeading - testCC; | |
| 3703 | |
| 3704 resultKalman = Kalman_getAngle(differenceCompass, 2, 0.1); | |
| 3705 if(testCC > lastHeading) | |
| 3706 ActualHeading = lastHeading + resultKalman; | |
| 3707 else | |
| 3708 ActualHeading = lastHeading - resultKalman; | |
| 3709 | |
| 3710 lastHeading = ActualHeading; | |
| 3711 */ | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3712 uint16_t ActualHeadingRose; |
| 38 | 3713 uint16_t LeftBorderHeading, LineHeading; |
| 3714 uint32_t offsetPicture; | |
| 3715 point_t start, stop, center; | |
| 3716 static int32_t LastHeading = 0; | |
| 3717 int32_t newHeading = 0; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3718 int32_t FlipHeading = 0; |
| 38 | 3719 int32_t diff = 0; |
| 3720 int32_t diff2 = 0; | |
| 3721 | |
| 3722 int32_t diffAbs = 0; | |
| 3723 int32_t diffAbs2 = 0; | |
| 3724 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3725 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3726 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3727 |
| 38 | 3728 newHeading = ActualHeading; |
| 3729 | |
| 3730 diff = newHeading - LastHeading; | |
| 3731 | |
| 3732 if(newHeading < LastHeading) | |
| 3733 diff2 = newHeading + 360 - LastHeading; | |
| 3734 else | |
| 3735 diff2 = newHeading - 360 - LastHeading; | |
| 3736 | |
| 3737 diffAbs = diff; | |
| 3738 if(diffAbs < 0) | |
| 3739 diffAbs *= -1; | |
| 3740 | |
| 3741 diffAbs2 = diff2; | |
| 3742 if(diffAbs2 < 0) | |
| 3743 diffAbs2 *= -1; | |
| 3744 | |
| 3745 | |
| 3746 if(diffAbs <= diffAbs2) | |
| 3747 newHeading = LastHeading + (diff / 2); | |
| 3748 else | |
| 3749 newHeading = LastHeading + (diff2 / 2); | |
| 3750 | |
| 3751 if(newHeading < 0) | |
| 3752 newHeading += 360; | |
| 3753 else | |
| 3754 if(newHeading >= 360) | |
| 3755 newHeading -= 360; | |
| 3756 | |
| 3757 LastHeading = newHeading; | |
| 3758 ActualHeading = newHeading; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3759 ActualHeadingRose = ActualHeading; |
| 38 | 3760 /* |
| 3761 if (ActualHeading < 90) | |
| 3762 ActualHeading += 360; | |
| 3763 | |
| 3764 if(ActualHeading > LastHeading) | |
| 3765 { | |
| 3766 if((ActualHeading - LastHeading) < 25) | |
| 3767 ActualHeading = LastHeading + 1; | |
| 3768 } | |
| 3769 else | |
| 3770 if(ActualHeading < LastHeading) | |
| 3771 { | |
| 3772 if((LastHeading - ActualHeading) < 25) | |
| 3773 ActualHeading = LastHeading - 1; | |
| 3774 } | |
| 3775 */ | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3776 if(pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3777 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3778 ActualHeadingRose = 360 - ActualHeadingRose; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3779 if (ActualHeadingRose < 170) ActualHeadingRose += 360; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3780 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3781 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3782 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3783 if (ActualHeadingRose < 90) ActualHeadingRose += 360; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3784 ActualHeading = ActualHeadingRose; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3785 } |
| 38 | 3786 |
| 3787 // new hw 160822 | |
| 3788 // if (ActualHeading >= 360 + 90) | |
| 3789 // ActualHeading = 360; | |
| 3790 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3791 LeftBorderHeading = 2 * (ActualHeadingRose - (CUSTOMBOX_SPACE_INSIDE/4)); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3792 |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3793 if(pSettings->FlipDisplay) /* add offset caused by mirrowed drawing */ |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3794 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3795 LeftBorderHeading += 2 * 80; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3796 } |
| 38 | 3797 |
| 3798 offsetPicture = LeftBorderHeading * t7screenCompass.ImageHeight * 2; | |
| 3799 | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3800 /* the background is used to draw the rotating compass rose */ |
| 38 | 3801 background.pointer = t7screenCompass.FBStartAdress+offsetPicture; |
| 3802 background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3803 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3804 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3805 background.y0 = 65; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3806 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3807 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3808 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3809 background.y0 = 480 - t7screenCompass.ImageHeight - 65; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3810 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
3811 |
| 38 | 3812 background.width = CUSTOMBOX_SPACE_INSIDE; |
| 3813 background.height = t7screenCompass.ImageHeight; | |
| 3814 | |
| 3815 | |
| 3816 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2); | |
| 3817 stop.x = start.x; | |
| 3818 start.y = 65; | |
| 3819 stop.y = start.y + 55; | |
| 3820 GFX_draw_line(&t7screen, start, stop, CLUT_Font030); | |
| 3821 | |
| 3822 | |
| 3823 center.x = start.x; | |
| 3824 center.y = 300; | |
| 3825 | |
| 3826 stop.x = center.x + 44; | |
| 3827 stop.y = center.y + 24; | |
| 3828 | |
| 3829 | |
| 3830 while(ActualHeading > 359) ActualHeading -= 360; | |
| 3831 | |
| 3832 LineHeading = 360 - ActualHeading; | |
| 3833 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(0,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font030); // North | |
| 3834 LineHeading += 90; | |
| 3835 if(LineHeading > 359) LineHeading -= 360; | |
| 3836 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Maintick | |
| 3837 LineHeading += 90; | |
| 3838 if(LineHeading > 359) LineHeading -= 360; | |
| 3839 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3840 LineHeading += 90; | |
| 3841 if(LineHeading > 359) LineHeading -= 360; | |
| 3842 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3843 | |
| 3844 LineHeading = 360 - ActualHeading; | |
| 3845 LineHeading += 45; | |
| 3846 if(LineHeading > 359) LineHeading -= 360; | |
| 3847 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
| 3848 LineHeading += 90; | |
| 3849 if(LineHeading > 359) LineHeading -= 360; | |
| 3850 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3851 LineHeading += 90; | |
| 3852 if(LineHeading > 359) LineHeading -= 360; | |
| 3853 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3854 LineHeading += 90; | |
| 3855 if(LineHeading > 359) LineHeading -= 360; | |
| 3856 GFX_draw_thick_line(5,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3857 | |
| 3858 LineHeading = 360 - ActualHeading; | |
| 3859 LineHeading += 22; | |
| 3860 if(LineHeading > 359) LineHeading -= 360; | |
| 3861 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
| 3862 LineHeading += 45; | |
| 3863 if(LineHeading > 359) LineHeading -= 360; | |
| 3864 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3865 LineHeading += 45; | |
| 3866 if(LineHeading > 359) LineHeading -= 360; | |
| 3867 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3868 LineHeading += 45; | |
| 3869 if(LineHeading > 359) LineHeading -= 360; | |
| 3870 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3871 LineHeading += 45; | |
| 3872 if(LineHeading > 359) LineHeading -= 360; | |
| 3873 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); // Subtick | |
| 3874 LineHeading += 45; | |
| 3875 if(LineHeading > 359) LineHeading -= 360; | |
| 3876 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3877 LineHeading += 45; | |
| 3878 if(LineHeading > 359) LineHeading -= 360; | |
| 3879 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3880 LineHeading += 45; | |
| 3881 if(LineHeading > 359) LineHeading -= 360; | |
| 3882 GFX_draw_thick_line(3,&t7screen, t7_compass_circle(1,LineHeading), t7_compass_circle(2,LineHeading), CLUT_Font031); | |
| 3883 | |
| 3884 if(UserSetHeading) | |
| 3885 { | |
| 3886 LineHeading = UserSetHeading + 360 - ActualHeading; | |
| 3887 if(LineHeading > 359) LineHeading -= 360; | |
| 3888 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick); | |
| 3889 | |
| 3890 // R�ckpeilung, User Back Heading | |
| 3891 LineHeading = UserSetHeading + 360 + 180 - ActualHeading; | |
| 3892 if(LineHeading > 359) LineHeading -= 360; | |
| 3893 if(LineHeading > 359) LineHeading -= 360; | |
| 3894 GFX_draw_thick_line(9,&t7screen, t7_compass_circle(3,LineHeading), t7_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick); | |
| 3895 } | |
| 3896 | |
| 3897 center.x = start.x; | |
| 3898 center.y = 250; | |
| 3899 GFX_draw_circle(&t7screen, center, 116, CLUT_Font030); | |
| 3900 GFX_draw_circle(&t7screen, center, 118, CLUT_Font030); | |
| 3901 GFX_draw_circle(&t7screen, center, 117, CLUT_Font030); | |
| 3902 | |
| 3903 | |
| 3904 } | |
| 3905 | |
| 3906 | |
| 3907 /* Font_T42: N is 27 px, S is 20 px, W is 36 px, E is 23 px | |
| 3908 * max is NW with 63 px | |
| 3909 * Font_T24: N is 15 px, S is 12 px, W is 20 px, E is 13 px | |
| 3910 * max is NW with 35 px | |
| 3911 * NE is 28 px | |
| 3912 * SW is 32 px | |
| 3913 * SE is 25 px | |
| 3914 * space between each is 45 px * 2 | |
| 3915 * FirstItem List | |
| 3916 * \177 \177 prepare for size | |
| 3917 */ | |
| 3918 void init_t7_compass(void) | |
| 3919 { | |
| 3920 t7screenCompass.FBStartAdress = getFrame(21); | |
| 3921 | |
| 3922 char text[256]; | |
| 3923 uint8_t textpointer = 0; | |
| 3924 | |
| 3925 text[textpointer++] = '\030'; | |
| 3926 text[textpointer++] = '\177'; | |
| 3927 text[textpointer++] = '\177'; | |
| 3928 text[textpointer++] = 76; // 90 - 14 | |
| 3929 text[textpointer++] = '\016'; | |
| 3930 text[textpointer++] = '\016'; | |
| 3931 text[textpointer++] = 'N'; | |
| 3932 text[textpointer++] = 'E'; // 96 + 28 = 124 total | |
| 3933 text[textpointer++] = '\017'; | |
| 3934 text[textpointer++] = '\177'; | |
| 3935 text[textpointer++] = '\177'; | |
| 3936 text[textpointer++] = 64; // 90 - 14 - 12 | |
| 3937 text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total | |
| 3938 text[textpointer++] = '\177'; | |
| 3939 text[textpointer++] = '\177'; | |
| 3940 text[textpointer++] = 66; // 90 - 11 - 13 | |
| 3941 text[textpointer++] = '\016'; | |
| 3942 text[textpointer++] = '\016'; | |
| 3943 text[textpointer++] = 'S'; | |
| 3944 text[textpointer++] = 'E'; | |
| 3945 text[textpointer++] = '\017'; | |
| 3946 text[textpointer++] = '\177'; | |
| 3947 text[textpointer++] = '\177'; | |
| 3948 text[textpointer++] = 68; // 90 - 12 - 10 | |
| 3949 text[textpointer++] = 'S'; | |
| 3950 text[textpointer++] = '\177'; | |
| 3951 text[textpointer++] = '\177'; | |
| 3952 text[textpointer++] = 64; // 90 - 10 - 16 | |
| 3953 text[textpointer++] = '\016'; | |
| 3954 text[textpointer++] = '\016'; | |
| 3955 text[textpointer++] = 'S'; | |
| 3956 text[textpointer++] = 'W'; | |
| 3957 text[textpointer++] = '\017'; | |
| 3958 text[textpointer++] = '\177'; | |
| 3959 text[textpointer++] = '\177'; | |
| 3960 text[textpointer++] = 56; // 90 - 16 - 18 | |
| 3961 text[textpointer++] = 'W'; | |
| 3962 text[textpointer++] = '\177'; | |
| 3963 text[textpointer++] = '\177'; | |
| 3964 text[textpointer++] = 54; // 90 - 18 - 18 | |
| 3965 text[textpointer++] = '\016'; | |
| 3966 text[textpointer++] = '\016'; | |
| 3967 text[textpointer++] = 'N'; | |
| 3968 text[textpointer++] = 'W'; | |
| 3969 text[textpointer++] = '\017'; | |
| 3970 text[textpointer++] = '\177'; | |
| 3971 text[textpointer++] = '\177'; | |
| 3972 text[textpointer++] = 59; // 90 - 17 - 14 | |
| 3973 text[textpointer++] = 'N'; | |
| 3974 text[textpointer++] = '\177'; | |
| 3975 text[textpointer++] = '\177'; | |
| 3976 text[textpointer++] = 63; // 90 - 13 - 14 | |
| 3977 text[textpointer++] = '\016'; | |
| 3978 text[textpointer++] = '\016'; | |
| 3979 text[textpointer++] = 'N'; | |
| 3980 text[textpointer++] = 'E'; | |
| 3981 text[textpointer++] = '\017'; | |
| 3982 text[textpointer++] = '\177'; | |
| 3983 text[textpointer++] = '\177'; | |
| 3984 text[textpointer++] = 64; // 90 - 14 - 12 | |
| 3985 text[textpointer++] = 'E'; | |
| 3986 text[textpointer++] = '\177'; | |
| 3987 text[textpointer++] = '\177'; | |
| 3988 text[textpointer++] = 66; // 90 - 11 - 13 | |
| 3989 text[textpointer++] = '\016'; | |
| 3990 text[textpointer++] = '\016'; | |
| 3991 text[textpointer++] = 'S'; | |
| 3992 text[textpointer++] = 'E'; | |
| 3993 text[textpointer++] = '\017'; | |
| 3994 text[textpointer++] = '\177'; | |
| 3995 text[textpointer++] = '\177'; | |
| 3996 text[textpointer++] = 68; // 90 - 12 - 10 | |
| 3997 text[textpointer++] = 'S'; | |
| 3998 text[textpointer++] = '\177'; | |
| 3999 text[textpointer++] = '\177'; | |
| 4000 text[textpointer++] = 64; // 90 - 10 - 16 | |
| 4001 text[textpointer++] = '\016'; | |
| 4002 text[textpointer++] = '\016'; | |
| 4003 text[textpointer++] = 'S'; | |
| 4004 text[textpointer++] = 'W'; | |
| 4005 text[textpointer++] = '\017'; | |
| 4006 text[textpointer++] = 0; // end | |
| 4007 | |
| 4008 GFX_write_string(&FontT42,&t7pCompass,text,1); | |
| 4009 | |
| 4010 releaseAllFramesExcept(21,t7screenCompass.FBStartAdress); | |
| 4011 } | |
| 4012 | |
| 4013 | |
| 4014 void t7_miniLiveLogProfile(void) | |
| 4015 { | |
| 4016 SWindowGimpStyle wintemp; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4017 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4018 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4019 |
| 38 | 4020 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET; |
| 4021 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4022 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4023 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4024 wintemp.top = 480 - t7l1.WindowY0; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4025 wintemp.bottom = wintemp. top + 200; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4026 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4027 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4028 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4029 wintemp.top = t7l1.WindowY1; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4030 wintemp.bottom = wintemp. top + 200; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4031 } |
| 38 | 4032 |
| 4033 uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10); | |
| 4034 | |
| 4035 GFX_graph_print(&t7screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL); | |
| 4036 } | |
| 4037 | |
| 4038 void t7_logo_OSTC(void) | |
| 4039 { | |
| 4040 SWindowGimpStyle windowGimp; | |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4041 SSettings* pSettings; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4042 pSettings = settingsGetPointer(); |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4043 |
| 38 | 4044 /* OSTC logo */ |
|
110
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4045 if(!pSettings->FlipDisplay) |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4046 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4047 windowGimp.left = t7l1.WindowX1 + 32; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4048 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4049 else |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4050 { |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4051 windowGimp.left = t7r1.WindowX1 + 32; |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4052 } |
|
cc8e24374b83
Added option to handled mirrored display to existing functions
Ideenmodellierer
parents:
51
diff
changeset
|
4053 |
| 38 | 4054 windowGimp.top = 40 + 32; |
| 4055 GFX_draw_image_monochrome(&t7screen, windowGimp, &ImgOSTC, 0); | |
| 4056 } |
