annotate Discovery/Src/t9.c @ 54:321df89d5710

Added missing ENTRY point
author Ideenmodellierer
date Sun, 05 Aug 2018 12:57:49 +0200
parents 5f11787b4f42
children b364c75005bb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 /// -*- coding: UTF-8 -*-
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 /// \file Discovery/Src/t9.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Template for screen with 4+1+4 screen layout with plugin
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 /// \author Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 /// \date 23-April-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 /// \details
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 /// Bonex t9 -> sp�ter auch andere Pro Anzeigen
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// Nur Tauchmodus, sonst Umschaltung t7
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 /// frames used 26 for compass laufband und 23 f�r t9screen
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "t9.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "data_exchange_main.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "decom.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "logbook_miniLive.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #include "math.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 #include "simulation.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #include "timer.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 #include "unit.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 void t9_refresh_divemode(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 void t9_refresh_divemode_userselected_left_lower_corner(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 void t9_refresh_customview(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 void t9_draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 void t9_tissues(const SDiveState * pState);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 void t9_compass(uint16_t ActualHeading, uint16_t UserSetHeading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 void t9_scooter(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 void t9_debug(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 void t9_SummaryOfLeftCorner(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 void t9_miniLiveLogProfile(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 void t9_colorscheme_mod(char *text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62 uint8_t t9_test_customview_warnings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 void t9_show_customview_warnings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 void t9_show_customview_warnings_surface_mode(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 uint8_t t9_customtextPrepare(char * text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 /* Importend function prototypes ---------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 /* Exported variables --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 float t9_depthLastCall[9] = { 0,0,0,0,0,0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 uint8_t idt9_depthLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 float t9_temperatureLastCall[3] = { 0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 uint8_t idt9_temperatureLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 GFX_DrawCfgScreen t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 GFX_DrawCfgScreen t9screenCompass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 /* left 3 fields
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 * right 3 fields
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85 * centered one field on top of customview, one below
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 * customview header + customview + warning
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88 GFX_DrawCfgWindow t9l1, t9l2, t9l3, t9l4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 GFX_DrawCfgWindow t9r1, t9r2, t9r3, t9r4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 GFX_DrawCfgWindow t9c1, t9batt, t9c2, t9charge;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91 GFX_DrawCfgWindow t9cH, t9cC, t9cW, t9cY0free;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 GFX_DrawCfgWindow t9pCompass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 GFX_DrawCfgWindow t9surfaceL, t9surfaceR;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 uint8_t t9_selection_custom_field = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 uint8_t t9_selection_customview = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 typedef struct{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 uint32_t pointer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 uint32_t x0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 uint32_t y0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 uint32_t width;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 uint32_t height;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 } S9Background;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 S9Background t9_background =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 .pointer = NULL,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 const uint8_t t9_customviewsDiveStandard[] =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114 CVIEW_sensors,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 CVIEW_Compass,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 CVIEW_Decolist,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117 CVIEW_Tissues,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 CVIEW_Profile,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 CVIEW_Gaslist,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 CVIEW_sensors_mV,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 CVIEW_EADTime,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122 // CVIEW_SummaryOfLeftCorner, da hier der scooter drin ist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 CVIEW_noneOrDebug,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 CVIEW_END,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125 CVIEW_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 const uint8_t t9_customviewsDiveScooter[] =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 CVIEW_Scooter,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131 CVIEW_sensors,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 CVIEW_Compass,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 CVIEW_Decolist,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 CVIEW_Tissues,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 CVIEW_Profile,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 CVIEW_Gaslist,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 CVIEW_sensors_mV,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 CVIEW_EADTime,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 CVIEW_SummaryOfLeftCorner,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 CVIEW_noneOrDebug,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 CVIEW_END,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 CVIEW_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 const uint8_t *t9_customviewsDive = t9_customviewsDiveStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148 #define TEXTSIZE 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 /* offset includes line: 2 = line +1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 * box (line) is 300 px
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151 * inside is 296 px
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 * left of box are 249 px ( 0..248)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 * right of box are 249 px (551 .. 799)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 #define CUSTOMBOX_LINE_LEFT (250)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 #define CUSTOMBOX_LINE_RIGHT (549)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 #define CUSTOMBOX_INSIDE_OFFSET (2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 #define CUSTOMBOX_OUTSIDE_OFFSET (2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 #define CUSTOMBOX_SPACE_INSIDE (CUSTOMBOX_LINE_RIGHT + 1 - (CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + CUSTOMBOX_INSIDE_OFFSET))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165 void t9_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 if(getLicence() == LICENCEBONEX)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 t9_customviewsDive = t9_customviewsDiveScooter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 t9_selection_custom_field = 0; // 0 is the new scooter temperature
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 t9_selection_customview = t9_customviewsDive[0];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175 t9screen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 t9screen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 t9screen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 t9screen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 t9screenCompass.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 t9screenCompass.ImageHeight = 240;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182 t9screenCompass.ImageWidth = 1600;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 t9screenCompass.LayerIndex = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 t9l1.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186 t9l1.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 t9l1.WindowLineSpacing = 5; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188 t9l1.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 t9l1.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190 t9l1.WindowX1 = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 t9l1.WindowY1 = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 t9l1.WindowY0 = t9l1.WindowY1 - 119;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 t9l2.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 t9l2.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 t9l2.WindowLineSpacing = 5; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 t9l2.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198 t9l2.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 t9l2.WindowX1 = t9l1.WindowX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200 t9l2.WindowY1 = t9l1.WindowY0 - 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 t9l2.WindowY0 = t9l2.WindowY1 - 119;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 t9l3.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 t9l3.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 t9l3.WindowLineSpacing = 5; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 t9l3.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 t9l3.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208 t9l3.WindowX1 = t9l1.WindowX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 t9l3.WindowY1 = t9l2.WindowY0 - 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 t9l3.WindowY0 = t9l3.WindowY1 - 119;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 t9l4.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 t9l4.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 t9l4.WindowLineSpacing = 50; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 t9l4.WindowTab = 100; // vermtl. ohne Verwendung in diesem Fenster
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 t9l4.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 t9l4.WindowX1 = t9l1.WindowX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 t9l4.WindowY1 = t9l3.WindowY0 - 4;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 t9l4.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 t9r1.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 t9r1.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 t9r1.WindowLineSpacing = t9l1.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 t9r1.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 t9r1.WindowX0 = 550;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 t9r1.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 t9r1.WindowY0 = t9l1.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 t9r1.WindowY1 = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 t9r2.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 t9r2.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 t9r2.WindowLineSpacing = t9l2.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 t9r2.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 t9r2.WindowX0 = 550;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 t9r2.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 t9r2.WindowY0 = t9l2.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 t9r2.WindowY1 = t9l2.WindowY1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 t9r3.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 t9r3.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 t9r3.WindowLineSpacing = t9l3.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 t9r3.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 t9r3.WindowX0 = 550;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 t9r3.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 t9r3.WindowY0 = t9l3.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 t9r3.WindowY1 = t9l3.WindowY1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 t9r4.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 t9r4.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 t9r4.WindowLineSpacing = t9l4.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 t9r4.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 t9r4.WindowX0 = 550;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 t9r4.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 t9r4.WindowY0 = t9l4.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 t9r4.WindowY1 = t9l4.WindowY1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 t9r3.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 t9r3.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 t9r3.WindowLineSpacing = 0;//t9l3.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 t9r3.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 t9r3.WindowX0 = CUSTOMBOX_LINE_RIGHT + CUSTOMBOX_OUTSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 t9r3.WindowX1 = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 t9r3.WindowY0 = t9l3.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 t9r3.WindowY1 = t9l3.WindowY1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 t9cC.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 t9cC.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 t9cC.WindowLineSpacing = 95; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 t9cC.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 t9cC.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 t9cC.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 t9cC.WindowY0 = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 t9cC.WindowY1 = 434 - 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 t9cH.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278 t9cH.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 t9cH.WindowLineSpacing = 95; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 t9cH.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 t9cH.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282 t9cH.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 t9cH.WindowY0 = 434 - 94;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 t9cH.WindowY1 = 434;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 t9cW.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 t9cW.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 t9cW.WindowLineSpacing = 95; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 t9cW.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 t9cW.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 t9cW.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292 t9cW.WindowY0 = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 t9cW.WindowY1 = 434 - 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 t9cY0free.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296 t9cY0free.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 t9cY0free.WindowLineSpacing = 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 t9cY0free.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 t9cY0free.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 t9cY0free.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 t9cY0free.WindowY0 = 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 t9cY0free.WindowY1 = 434 - 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 t9batt.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 t9batt.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 t9batt.WindowLineSpacing = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 t9batt.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 t9batt.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 t9batt.WindowX0 = t9batt.WindowX1 - (52+52);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 t9batt.WindowY1 = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 t9batt.WindowY0 = t9batt.WindowY1 - 25;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 t9charge.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 t9charge.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 t9charge.WindowLineSpacing = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 t9charge.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 t9charge.WindowX1 = t9batt.WindowX1 - 18;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 t9charge.WindowX0 = t9charge.WindowX1 - 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 t9charge.WindowY1 = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 t9charge.WindowY0 = t9batt.WindowY1 - 25;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 t9c1.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 t9c1.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 t9c1.WindowLineSpacing = 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 t9c1.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 t9c1.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 t9c1.WindowX1 = t9batt.WindowX0 - 18;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 t9c1.WindowY0 = 435;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 t9c1.WindowY1 = 479;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 t9c2.Image = &t9screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 t9c2.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 t9c2.WindowLineSpacing = 0; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 t9c2.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 t9c2.WindowX0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 t9c2.WindowX1 = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 t9c2.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 t9c2.WindowY1 = 69;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 t9pCompass.Image = &t9screenCompass;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 t9pCompass.WindowNumberOfTextLines = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342 t9pCompass.WindowLineSpacing = 100; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 t9pCompass.WindowTab = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 t9pCompass.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 t9pCompass.WindowX1 = 1600-1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346 t9pCompass.WindowY0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347 t9pCompass.WindowY1 = 100-1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 init_t9_compass();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 uint8_t t9_test_customview_warnings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 uint8_t count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357 count += stateUsed->warnings.decoMissed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 count += stateUsed->warnings.ppO2Low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 count += stateUsed->warnings.ppO2High;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 //count += stateUsed->warnings.lowBattery;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 count += stateUsed->warnings.sensorLinkLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 count += stateUsed->warnings.fallback;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363 return count;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 void t9_refresh(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 static uint8_t last_mode = MODE_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 SStateList status;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 get_globalStateList(&status);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373 if(stateUsed->mode != MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 last_mode = MODE_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 settingsGetPointer()->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 if(t9screen.FBStartAdress)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 releaseFrame(23,t9screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 t9screen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 if(status.base != BaseHome)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388 t9screen.FBStartAdress = getFrame(23);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 t9_background.pointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 if(last_mode != MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 last_mode = MODE_DIVE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 /* lower left corner primary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 // t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 t9_selection_custom_field = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 /* custom view primary OR debug if automatic return is off */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 t9_selection_customview = CVIEW_noneOrDebug;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 t9_selection_customview = settingsGetPointer()->tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 if(status.page == PageSurface)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 set_globalState(StD);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 t9_refresh_divemode();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 if(t9_background.pointer)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 GFX_SetFrameTop(t9screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 GFX_SetFrameBottom(t9_background.pointer,t9_background.x0 , t9_background.y0, t9_background.width, t9_background.height);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 GFX_SetFramesTopBottom(t9screen.FBStartAdress, NULL,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 releaseAllFramesExcept(23,t9screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 void original_t9_refresh(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 static uint8_t last_mode = MODE_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 // uint32_t oldScreen;//, oldPlugin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 SStateList status;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430 get_globalStateList(&status);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 if(last_mode != MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 last_mode = MODE_DIVE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 /* lower left corner primary */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 /* custom view primary OR debug if automatic return is off */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 t9_selection_customview = CVIEW_noneOrDebug;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 t9_selection_customview = settingsGetPointer()->tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 if(status.page == PageSurface)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 set_globalState(StD);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 t9_refresh_divemode();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 if(last_mode != MODE_SURFACE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 last_mode = MODE_SURFACE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 // CHANGE HERE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 if(status.page == PageDive)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 set_globalState(StS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 if(status.base == BaseHome)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 if(t9_background.pointer)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 GFX_SetFrameTop(t9screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 GFX_SetFrameBottom(t9_background.pointer,t9_background.x0 , t9_background.y0, t9_background.width, t9_background.height);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 GFX_SetFramesTopBottom(t9screen.FBStartAdress, NULL,480);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 releaseAllFramesExcept(23,t9screen.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 void t9_show_customview_warnings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 uint8_t textpointer, lineFree;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 text[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 text[1] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 text[2] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 text[3] = TXT_Warning;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 text[4] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 lineFree = 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 if(lineFree && stateUsed->warnings.decoMissed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 text[textpointer++] = TXT2BYTE_WarnDecoMissed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 if(lineFree && stateUsed->warnings.fallback)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 text[textpointer++] = TXT2BYTE_WarnFallback;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 if(lineFree && stateUsed->warnings.ppO2Low)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 text[textpointer++] = TXT2BYTE_WarnPPO2Low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 if(lineFree && stateUsed->warnings.ppO2High)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 text[textpointer++] = TXT2BYTE_WarnPPO2High;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 if(lineFree && stateUsed->warnings.sensorLinkLost)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 if(lineFree && stateUsed->warnings.lowBattery)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 text[textpointer++] = TXT2BYTE_WarnBatteryLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 GFX_write_string(&FontT48,&t9cW,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 void t9_set_customview_to_primary(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 t9_selection_customview = settingsGetPointer()->tX_customViewPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 void t9_change_customview(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 const uint8_t *pViews;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 pViews = t9_customviewsDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 while((*pViews != CVIEW_END) && (*pViews != t9_selection_customview))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 {pViews++;}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 if(*pViews < CVIEW_END)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 pViews++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 pViews = t9_customviewsDive;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 // if((*pViews == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 // pViews++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 t9_selection_customview = *pViews;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 uint8_t t9_get_length_of_customtext(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 uint8_t i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 settingsGetPointer()->customtext[60-1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 while(settingsGetPointer()->customtext[i] > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 return i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 void t9_refresh_customview(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 if((t9_selection_customview == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 if((t9_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 if((t9_selection_customview == CVIEW_sensors_mV) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 if((t9_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 uint16_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 int16_t start;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 // int16_t shiftWindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 RTC_DateTypeDef Sdate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 RTC_TimeTypeDef Stime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; // CVIEW_Gaslist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 const SGasLine * pGasLine; // CVIEW_Gaslist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 uint8_t oxygen, helium; // CVIEW_Gaslist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 switch(t9_selection_customview)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 case CVIEW_noneOrDebug:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 if(settingsGetPointer()->showDebugInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 strcpy(text,"\032\f\001Debug");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 // content
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 t9_debug();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 case CVIEW_SummaryOfLeftCorner:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Summary);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 // content
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 t9_SummaryOfLeftCorner();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 case CVIEW_Scooter:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 snprintf(text,100,"\032\f\001Scooter");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 t9_scooter();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 case CVIEW_Gaslist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 // a lot of code taken from tMenuGas.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Gaslist);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 // content
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 t9cY0free.WindowLineSpacing = 48+9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 t9cY0free.WindowNumberOfTextLines = 5; // NUM_GASES == 5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 t9cY0free.WindowTab = 420;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 pGasLine = settingsGetPointer()->gas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 if(actualLeftMaxDepth(stateUsed))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 for(int gasId=1;gasId<=NUM_GASES;gasId++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 if(pGasLine[gasId].note.ub.active == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 strcpy(&text[textpointer++],"\021");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 strcpy(&text[textpointer++],"\025");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 strcpy(&text[textpointer++],"\030");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 text[textpointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 oxygen = pGasLine[gasId].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 helium = pGasLine[gasId].helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 textpointer += write_gas(&text[textpointer], oxygen, helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 // Wechseltiefe
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 if(pGasLine[gasId].depth_meter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 textpointer += snprintf(&text[textpointer],6,"\t%u m",pGasLine[gasId].depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 GFX_write_string(&FontT42, &t9cY0free, text, gasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 case CVIEW_EADTime:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Info );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 t9cY0free.WindowLineSpacing = 48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 // time
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 snprintf(text,100,"\032\001%c%c",TXT_2BYTE,TXT2BYTE_Clock );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 translateDate(stateRealGetPointer()->lifeData.dateBinaryFormat, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 translateTime(stateRealGetPointer()->lifeData.timeBinaryFormat, &Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 if(Stime.Seconds % 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 textpointer += snprintf(&text[textpointer],100,"\030\001%02d:%02d",Stime.Hours,Stime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 textpointer += snprintf(&text[textpointer],100,"\030\001%02d\031:\030%02d",Stime.Hours,Stime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 GFX_write_string(&FontT42, &t9cY0free, text, 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 // EAD / END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 // The equivalent air depth can be calculated for depths in metres as follows:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 // EAD = (Depth + 10) � Fraction of N2 / 0.79 - 10 (wikipedia)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 // The equivalent narcotic depth can be calculated for depths in metres as follows:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711 // END = (Depth + 10) � (1 - Fraction of helium) - 10 (wikipedia)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 decom_get_inert_gases((float)stateUsed->lifeData.pressure_ambient_bar,&(stateUsed->lifeData.actualGas),&fraction_nitrogen,&fraction_helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 depth = stateUsed->lifeData.pressure_ambient_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 surface = stateUsed->lifeData.pressure_surface_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 ead = 10.f * ((depth * fraction_nitrogen/0.79f) - surface);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 end = 10.0f * ((depth * (1.f - fraction_helium)) - surface);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 if(ead < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 ead = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 if(end < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 end = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 snprintf(text,100,"\032\001EAD");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 GFX_write_string(&FontT42, &t9cY0free, text, 3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 snprintf(text,100,"\030\001%01.1fm", ead);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 GFX_write_string(&FontT42, &t9cY0free, text, 4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 snprintf(text,100,"\032\001END");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 GFX_write_string(&FontT42, &t9cY0free, text, 5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 snprintf(text,100,"\030\001%01.1fm", end);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 GFX_write_string(&FontT42, &t9cY0free, text, 6);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 case CVIEW_Profile:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 t9_miniLiveLogProfile();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 case CVIEW_Tissues:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Tissues);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 t9_tissues(stateUsed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 case CVIEW_sensors:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2monitor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 text[textpointer++] = '\030'; // main color
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 text[textpointer++] = '\031'; // labelcolor
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 text[textpointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 text[textpointer++] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 text[textpointer++] = '\030'; // main color
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 if(stateUsed->warnings.sensorOutOfBounds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 text[textpointer++] = '\025'; // Warning Red
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 textpointer += snprintf(&text[textpointer],100,"\001%01.2f\n\r\030",stateUsed->lifeData.ppO2Sensor_bar[i]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 t9cC.WindowLineSpacing = 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 t9cC.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 GFX_write_string(&FontT105,&t9cC,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 case CVIEW_sensors_mV:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2voltage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 text[textpointer++] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 text[textpointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 text[textpointer++] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 if(stateUsed->warnings.sensorOutOfBounds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 text[textpointer++] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 textpointer += snprintf(&text[textpointer],100,"\001%01.1f mV\n\r\030",(stateUsed->lifeData.sensorVoltage_mV[i]));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 t9cC.WindowLineSpacing = 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 t9cC.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 GFX_write_string(&FontT48,&t9cC,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 case CVIEW_Compass:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE, TXT2BYTE_Compass);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 t9_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 t9cY0free.WindowY0 = 230;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 t9cY0free.WindowX0 += 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 snprintf(text,100,"\030\001%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 GFX_write_string(&FontT54,&t9cY0free,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 t9cY0free.WindowX0 -= 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 case CVIEW_Decolist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 snprintf(text,100,"\032\f\001%c%c", TXT_2BYTE, TXT2BYTE_Decolist);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 const SDecoinfo * pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 uint8_t depthNext, depthLast, depthSecond, depthInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821 pDecoinfo = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 pDecoinfo = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829 for(start=DECOINFO_STRUCT_MAX_STOPS-1; start>0; start--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 if(pDecoinfo->output_stop_length_seconds[start]) break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 start -= 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 if(start < 0) start = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 for(int i=start;i<6+start;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 if(i == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 depthNext = depthLast;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 depthNext = depthSecond + (( i - 1 )* depthInc);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 if(pDecoinfo->output_stop_length_seconds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 textpointer += snprintf(&text[textpointer],20,"\030\034 %2u\016\016m\017%3i'\n\r",depthNext, (pDecoinfo->output_stop_length_seconds[i]+59)/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016m\017\n\r",depthNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846 if(textpointer > 200) break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 t9cY0free.WindowLineSpacing = 48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 /* DIVE MODE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 void t9_refresh_divemode(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 char TextL1[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 char TextL2[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 char TextR1[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 char TextR2[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 char TextR3[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 char TextC1[2*TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 char TextC2[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 uint8_t textPointer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 point_t start, stop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 uint8_t color;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 int textlength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875 uint16_t nextstopLengthSeconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 uint8_t nextstopDepthMeter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 uint8_t oxygen_percentage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 SDivetime Divetime = {0,0,0, 0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879 SDivetime SafetyStopTime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 SDivetime TimeoutTime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 uint8_t customview_warnings = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 const SDecoinfo * pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 Divetime.Minutes = Divetime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 SafetyStopTime.Total = timer_Safetystop_GetCountDown();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 SafetyStopTime.Minutes = SafetyStopTime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 TimeoutTime.Total = settingsGetPointer()->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 if(TimeoutTime.Total > settingsGetPointer()->timeoutDiveReachedZeroDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 TimeoutTime.Total = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 TimeoutTime.Minutes = TimeoutTime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 pDecoinfo = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903 pDecoinfo = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 if(pDecoinfo->output_time_to_surface_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 nextstopDepthMeter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912 nextstopLengthSeconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915 /* depth */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 float depth = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 if(is_stateUsedSetToSim())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 depth = (depthThisCall + t9_depthLastCall[0] + t9_depthLastCall[1] + t9_depthLastCall[2] + t9_depthLastCall[3] + t9_depthLastCall[4] + t9_depthLastCall[5] + t9_depthLastCall[6] + t9_depthLastCall[7] + t9_depthLastCall[8]) / 10.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 idt9_depthLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 if(idt9_depthLastCall >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 idt9_depthLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 t9_depthLastCall[idt9_depthLastCall] = depthThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 depth = (depthThisCall + t9_depthLastCall[0] + t9_depthLastCall[1] + t9_depthLastCall[2]) / 4.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 idt9_depthLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 if(idt9_depthLastCall >= 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 idt9_depthLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 t9_depthLastCall[idt9_depthLastCall] = depthThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 if(depth <= 0.3f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938 depth = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941 GFX_write_string(&FontT24,&t9l2,TextL1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 if( depth < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944 snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 t9_colorscheme_mod(TextL1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 GFX_write_string(&FontT105,&t9l2,TextL1,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 /* max depth */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952 snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 GFX_write_string(&FontT24,&t9l3,TextL2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955 if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 t9_colorscheme_mod(TextL2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 GFX_write_string(&FontT105,&t9l3,TextL2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 /* ascentrate graph */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967 for(int i = 0; i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969 start.y += 5*6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971 start.x = CUSTOMBOX_LINE_LEFT - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972 stop.x = start.x - 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973 GFX_draw_line(&t9screen, start, stop, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974 // start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 // stop.x = start.x + 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 // GFX_draw_line(&t9screen, start, stop, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 // new thick bar design Sept. 2015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 if(stop.y >= 470)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 stop.y = 470;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 start.y += 7; // starte etwas weiter oben
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 color = CLUT_EverythingOkayGreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 color = CLUT_WarningYellow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 color = CLUT_WarningRed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 GFX_draw_thick_line(12,&t9screen, start, stop, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 snprintf(TextL2,TEXTSIZE,"\f%.1f m/min",stateUsed->lifeData.ascent_rate_meter_per_min);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 /* divetime */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 if(stateUsed->lifeData.counterSecondsShallowDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 GFX_write_string(&FontT24,&t9r2,TextR1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1008 GFX_write_string(&FontT24,&t9r2,TextR1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1009 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1010
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 if(Divetime.Minutes < 1000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015 t9_colorscheme_mod(TextR1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 GFX_write_string(&FontT105,&t9r2,TextR1,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 /* next deco stop */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 if(nextstopDepthMeter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022 GFX_write_string(&FontT24,&t9r3,TextR2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 t9_colorscheme_mod(TextR2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 TextR2[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 if(textlength <= 8)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 GFX_write_string(&FontT105,&t9r3,TextR2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 GFX_write_string(&FontT54,&t9r3,TextR2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 GFX_write_string(&FontT24,&t9r3,TextR2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 t9_colorscheme_mod(TextR2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 GFX_write_string(&FontT105,&t9r3,TextR2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 /* tts - option 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 * ndl - option 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 * empty - option 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 if(pDecoinfo->output_time_to_surface_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 GFX_write_string(&FontT24,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055 TextR2[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 GFX_write_string(&FontT105,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 if(pDecoinfo->output_ndl_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 GFX_write_string(&FontT24,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063 if(pDecoinfo->output_ndl_seconds < 1000 * 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 TextR2[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 GFX_write_string(&FontT105,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 uint16_t scooterSpeedLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 uint8_t scooterResidualCapacity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 /* scooter global for both */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085 /* scooter battery */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 snprintf(TextR1,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE, TXT2BYTE_ScooterRestkapazitaet);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 GFX_write_string(&FontT24,&t9r1,TextR1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 snprintf(TextR3,TEXTSIZE,"\020\002%u\016\016%%\017",scooterResidualCapacity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 if(TextR3[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 TextR3[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 GFX_write_string(&FontT105,&t9r1,TextR3,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 /* scooter speed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 textlength = snprintf(TextR3,TEXTSIZE-7,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_ScooterSpeed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105 snprintf(&TextR3[textlength],8," m/min");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 snprintf(&TextR3[textlength],8," ft/min");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 GFX_write_string(&FontT24,&t9l1,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 snprintf(TextR3,TEXTSIZE,"\020%u",scooterSpeedLocal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 if(TextR3[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 TextR3[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 GFX_write_string(&FontT105,&t9l1,TextR3,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 /* Menu Selection (and gas mix) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 if(get_globalState() == StDMGAS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 TextR1[textPointer++] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 // TextR1[textPointer++] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 TextR1[textPointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 textPointer += tHome_gas_writer(stateUsed->diveSettings.gas[actualBetterGasId()].oxygen_percentage,stateUsed->diveSettings.gas[actualBetterGasId()].helium_percentage,&TextR1[textPointer]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 TextR1[textPointer++] = '?';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 TextR1[textPointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1141 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 if(get_globalState() == StDMSPT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 TextR1[textPointer++] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 TextR1[textPointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 TextR1[textPointer++] = '?';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 TextR1[textPointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 if(get_globalState() == StDMENU)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 if(get_globalState() == StDSIM1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 if(get_globalState() == StDSIM2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176 if(get_globalState() == StDSIM3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 if(get_globalState() == StDSIM4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 /* gas mix */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 oxygen_percentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 TextC2[textPointer++] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 if(stateUsed->warnings.betterGas && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 TextC2[textPointer++] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 float fPpO2limitHigh, fPpO2now;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 if(actualLeftMaxDepth(stateUsed))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 fPpO2limitHigh = settingsGetPointer()->ppO2_max_std;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 TextC2[textPointer++] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 TextC2[textPointer++] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 if(stateUsed->warnings.betterGas && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 if(TextC2[0] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 TextC2[0] = '\004'; // NOP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 GFX_write_string_color(&FontT48,&t9c2,TextC2,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 t9_colorscheme_mod(TextC2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 GFX_write_string(&FontT48,&t9c2,TextC2,0); // T54 has only numbers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 if(stateUsed->diveSettings.ccrOption)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 TextC2[0] = '\a'; // inverse instead of color \020
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 GFX_write_string_color(&FontT48,&t9c2,TextC2,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 t9_colorscheme_mod(TextC2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 GFX_write_string(&FontT48,&t9c2,TextC2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 else if(settingsGetPointer()->alwaysShowPPO2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 t9_colorscheme_mod(TextC2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 GFX_write_string(&FontT48,&t9c2,TextC2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 /* algorithm, ccr, bailout and battery */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 /* and permanent warnings (CNS) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 if((stateUsed->warnings.cnsHigh) && display_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 TextC2[0] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 TextC2[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 TextC2[2] = TXT2BYTE_WarnCnsHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 TextC2[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 GFX_write_string_color(&FontT48,&t9c1,TextC2,0,CLUT_WarningRed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 if(stateUsed->warnings.aGf)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 GFX_write_string_color(&FontT48,&t9c1,"\f" "aGF",0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 GFX_write_string(&FontT48,&t9c1,"\027\f" "GF",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 GFX_write_string(&FontT48,&t9c1,"\027\f" "VPM",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 GFX_write_string(&FontT24,&t9c1,"\027\f\002" "CCR",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 // GFX_write_string(&FontT24,&t9c1,"\f\177\177\x80" "CCR",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290 if(stateUsed->diveSettings.ccrOption)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 GFX_write_string(&FontT24,&t9c1,"\f\002\024" "Bailout",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 // GFX_write_string(&FontT24,&t9c1,"\f\177\177\x80\024" "Bailout",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 TextC1[0] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 TextC1[1] = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 TextC1[2] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297 TextC1[3] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 TextC1[4] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 TextC1[5] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 TextC1[6] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301 TextC1[7] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 TextC1[8] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303 TextC1[9] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 TextC1[10] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 TextC1[11] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 TextC1[12] = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 TextC1[13] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 for(int i=1;i<=10;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 if( stateUsed->lifeData.battery_charge > (9 * i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 TextC1[i+1] += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 if(stateUsed->warnings.lowBattery)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 TextC1[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 if(warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 for(int i=2;i<=11;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 TextC1[i] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325 TextC1[2] = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 GFX_write_string(&Batt24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331 snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 if(warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333 TextC1[0] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 GFX_write_string(&FontT24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 t9_colorscheme_mod(TextC1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 GFX_write_string(&Batt24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 snprintf(TextC1,16,"\020\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 t9_colorscheme_mod(TextC1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346 GFX_write_string(&FontT24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 /* customizable left lower corner */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 t9_refresh_divemode_userselected_left_lower_corner();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1353
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1354 /* customview - option 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 * warning - option 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356 if(stateUsed->warnings.numWarnings)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357 customview_warnings = t9_test_customview_warnings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 t9_background.pointer = NULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 if(customview_warnings && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 t9_show_customview_warnings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363 t9_refresh_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366 /* the frame */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 t9_draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1369
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1370
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1371 void t9_set_field_to_primary(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374 t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 void t9_change_field(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 const uint8_t minVal = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1381 const uint8_t maxVal = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383 t9_selection_custom_field++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 if(t9_selection_custom_field > maxVal)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385 t9_selection_custom_field = minVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1389 void t9_refresh_divemode_userselected_left_lower_corner(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 // zero is scooter temperature :-)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393 char headerText[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 char text[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396 _Bool tinyHeaderFont = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397 uint8_t line = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 SDivetime Stopwatch = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 float fAverageDepth, fAverageDepthAbsolute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 const SDecoinfo * pDecoinfoStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 const SDecoinfo * pDecoinfoFuture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 float fCNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 float temperatureThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406 float temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408 float scooterTemperatureLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 pDecoinfoStandard = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1417 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418 pDecoinfoStandard = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 pDecoinfoFuture = &stateUsed->decolistFutureVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 Stopwatch.Total = timer_Stopwatch_GetTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 Stopwatch.Minutes = Stopwatch.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 headerText[0] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429 headerText[1] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1430
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1431 switch(t9_selection_custom_field)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1432 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 /* scooter temp. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 case 0:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435 scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 headerText[2] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437 headerText[3] = TXT2BYTE_ScooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",scooterTemperatureLocal); // "\016\016%01.1f `" + C or F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1443 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444 tinyHeaderFont = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 // connection active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 if(text[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1459 /* Temperature */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1462 // mean value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463 temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464 temperature = (temperatureThisCall + t9_temperatureLastCall[0] + t9_temperatureLastCall[1] + t9_temperatureLastCall[2]) / 4.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1465 idt9_temperatureLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466 if(idt9_temperatureLastCall >= 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1467 idt9_temperatureLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1468 t9_temperatureLastCall[idt9_temperatureLastCall] = temperatureThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1469 // output
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1470 headerText[2] = TXT_Temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1471 textpointer = snprintf(text,TEXTSIZE,"\020\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1472 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1473 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1474 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1475 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1476 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1477 tinyHeaderFont = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1478 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1479
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480 /* Average Depth */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1481 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1482 headerText[2] = TXT_AvgDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1483 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1484 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1485
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1486 /* ppO2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1487 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1488 headerText[2] = TXT_ppO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1489 snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1490 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1491
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1492 /* Stop Uhr */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1493 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1494 headerText[2] = TXT_Stopwatch;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1495 snprintf(text,TEXTSIZE,"\020\016\016%u:%02u\n\r%01.1f",Stopwatch.Minutes, Stopwatch.Seconds,fAverageDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1496 tinyHeaderFont = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1497 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1498 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1499
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1500 /* Ceiling */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1501 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1502 headerText[2] = TXT_Ceiling;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1503 if(pDecoinfoStandard->output_ceiling_meter <= 99.9f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1505 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1506 snprintf(text,TEXTSIZE,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1507 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1508
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1509 /* Future TTS */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1510 case 6:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1511 headerText[2] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1512 snprintf(text,TEXTSIZE,"\020\016\016@+%u'\n\r" "%i' TTS",settingsGetPointer()->future_TTS, pDecoinfoFuture->output_time_to_surface_seconds / 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1513 tinyHeaderFont = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1514 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1515 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1516
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 /* CNS */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518 case 7:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519 headerText[2] = TXT_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520 fCNS = stateUsed->lifeData .cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521 if(fCNS > 999)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1522 fCNS = 999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 /* scooter voltage*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527 case 77: // used as 7: alternative for Bonex
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1528 headerText[2] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1529 headerText[3] = TXT2BYTE_ScooterVolt;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1530 if(stateUsed->lifeData.scooterSpannung < 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 snprintf(text,TEXTSIZE,"\020\016%01.2f",stateUsed->lifeData.scooterSpannung);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1535 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1536 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1537 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1538 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1539 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1540 if(text[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1541 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1542 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1543 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1544 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1545 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1546 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1547 text[0] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1549 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1550
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552 if(headerText[2] == TXT_2BYTE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553 headerText[4] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555 headerText[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1556
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557 if(!tinyHeaderFont)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 GFX_write_string(&FontT24,&t9l4,headerText,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560 t9_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561 GFX_write_string(&FontT105,&t9l4,text,line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566 uint8_t t9_customtextPrepare(char * text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568 uint8_t i, j, textptr, lineCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 char nextChar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571 textptr = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572 lineCount = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 text[textptr++] = TXT_MINIMAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576 j = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578 do
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1579 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1580 j += i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1581 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582 do
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 nextChar = settingsGetPointer()->customtext[i+j];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1588 text[textptr++] = nextChar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1589 } while (i < 12);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1590
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1591 if(!nextChar)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1592 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 if(lineCount < 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596 text[textptr++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1597 text[textptr++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 lineCount++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 for(uint8_t k=0;k<2;k++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1601 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1602 nextChar = settingsGetPointer()->customtext[i+j+k];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1603 if((nextChar =='\n') || (nextChar =='\r'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1604 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1605 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1606 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1607 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1608
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1609 } while (lineCount < 4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1610
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1611 text[textptr] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612 return lineCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1613 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615 /* could be extended to search for \020 inside
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1617 void t9_colorscheme_mod(char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1618 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1619 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1620 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1621 text[0] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1622 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1623 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1624
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1625 void t9_draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627 point_t LeftLow, WidthHeight;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628 point_t start, stop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1630 // plugin box
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1631 LeftLow.x = CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1632 WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1633 LeftLow.y = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634 WidthHeight.y = 440 - LeftLow.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 GFX_draw_box(&t9screen, LeftLow, WidthHeight, 1, colorBox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637 if(PluginBoxHeader)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1638 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1639 // plugin box - header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1640 start.x = CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1641 stop.x = CUSTOMBOX_LINE_RIGHT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1642 stop.y = start.y = 440 - 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1643 GFX_draw_line(&t9screen, start, stop, colorBox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1644 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1645
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1646 if(LinesOnTheSides)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1647 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1648 // aufteilung links
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1649 start.x = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1650 stop.x = CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651 stop.y = start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653 stop.y = start.y = t9l2.WindowY0 -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1654 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655 stop.y = start.y = t9l3.WindowY0 -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1656 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1657
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1658 // aufteilung rechts
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1659 start.x = CUSTOMBOX_LINE_RIGHT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1660 stop.x = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1661 stop.y = start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1662 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1663 stop.y = start.y = t9l2.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1664 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1665 stop.y = start.y = t9l3.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1666 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1667 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1668 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1669
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1670
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1671 /* Compass like TCOS shellfish
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1672 * input is 0 to 359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1673 * 2 px / 1 degree
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1674 * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1675 * one side is 74 degree (less than 90 degree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1676 * internal 360 + 180 degree of freedom
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1677 * use positive values only, shift by 360 below 90 mid position
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1678 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681 point_t t9_compass_circle(uint8_t id, uint16_t degree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683 float fCos, fSin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1684 const float piMult = ((2 * 3.14159) / 360);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1685 // const int radius[4] = {95,105,115,60};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1686 const int radius[4] = {95,105,115,100};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1687 const point_t offset = {.x = 400, .y = 250};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1688
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1689 static point_t r[4][360] = { 0 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1690
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1691 if(r[0][0].y == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1692 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1693 for(int i=0;i<360;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1694 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1695 fCos = cos(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1696 fSin = sin(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1697 for(int j=0;j<4;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1698 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1699 r[j][i].x = offset.x + (int)(fSin * radius[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1700 r[j][i].y = offset.y + (int)(fCos * radius[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1701 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1702 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1703 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1704 if(id > 3) id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1705 if(degree > 359) degree = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1706 return r[id][degree];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1707 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1708
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1709 /* range should be 0 to 30 bar if 300 meter with 100% of nitrogen or helium
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1710 * T24 is 28 high
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1711 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1712 void t9_tissues(const SDiveState * pState)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1713 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1714 point_t start, change, stop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1715 float value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1716 uint16_t front, cns100pixel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1717 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1718 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1719 uint8_t color;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1720
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1721 float percent_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1722 float percent_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1723 float partial_pressure_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1724 float partial_pressure_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1726
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1727 /* N2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1728 t9cY0free.WindowLineSpacing = 28 + 48 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1729 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1730 t9cY0free.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1732 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1733 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1734 text[textpointer++] = TXT2BYTE_Nitrogen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1735 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1736 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1737 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1738 text[textpointer++] = TXT2BYTE_Helium;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1739 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1740 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1741 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1742 text[textpointer++] = TXT2BYTE_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1743 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1744
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1745 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1746
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1747 start.y = t9cH.WindowY0 - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1748 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1749 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1750
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1751 for(int i=0;i<16;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1752 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1753 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1754 change.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1755
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1756 value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1757 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1758
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1759 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1760 front = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1761 else if(value > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1762 front = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1763 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1764 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1766 change.x = start.x + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1767 if(change.x != start.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1768 GFX_draw_thick_line(1,&t9screen, start, change, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1769 if(change.x != stop.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1770 GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1771
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1772 start.y -= 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1773 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1774
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1775 /* He */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1776 start.y -= 28 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1777 for(int i=0;i<16;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1778 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1779 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1780 change.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1781
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1782 value = pState->lifeData.tissue_helium_bar[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1783 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1784
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1785 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1786 front = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1787 else if(value > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1788 front = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1789 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1790 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1791
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1792 change.x = start.x + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1793 if(change.x != start.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1794 GFX_draw_thick_line(1,&t9screen, start, change, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1795 if(change.x != stop.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1796 GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1798 start.y -= 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1799 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1800
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1801 /* CNS == Oxygen */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1802 start.y -= 28 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1803
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1804 cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1805 value = pState->lifeData.cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1806 value *= cns100pixel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1807 value /= 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1809 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1810 front = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1811 else if(value > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1812 front = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1813 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1814 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1815
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1816 if(pState->lifeData.cns < 95)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1817 color = CLUT_Font030;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1818 else if(pState->lifeData.cns < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1819 color = CLUT_WarningYellow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1820 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1821 color = CLUT_WarningRed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1822
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1823 for(int i=0;i<16;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1824 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1825 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1826 change.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1828 change.x = start.x + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1829 if(change.x != start.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1830 GFX_draw_thick_line(1,&t9screen, start, change, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1831 if(change.x != stop.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1832 GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1834 start.y -= 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1835 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1836
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1837 /* where is the onload/offload limit for N2 and He */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1838 decom_get_inert_gases(pState->lifeData.pressure_ambient_bar, &pState->lifeData.actualGas, &percent_N2, &percent_He);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1839 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1840 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1842 // Nitrogen vertical bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1843 start.y = t9cH.WindowY0 + 1 - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1844 stop.y = start.y - (3 * 15) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1845 if((percent_N2 > 0) && (partial_pressure_N2 > 0.8f))//(0.8f + 0.5f)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1846 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1847 value = partial_pressure_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1848 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1849
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1850 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1851 front = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1852 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1853 front = CUSTOMBOX_SPACE_INSIDE - 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1854 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1855 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1856 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1857 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1858 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1859 front = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1860 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1861 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1862 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1863 GFX_draw_thick_line(2,&t9screen, start, stop, CLUT_EverythingOkayGreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1864
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1865
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1866 // Helium vertical bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1867 start.y = t9cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1868 stop.y = start.y - (3 * 15) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1869 if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1870 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1871
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1872 value = partial_pressure_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1873 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1874
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1875 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1876 front = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1877 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1878 front = CUSTOMBOX_SPACE_INSIDE - 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1879 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1880 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1881 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1882 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1883 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1884 front = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1885 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1886
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1887 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1888 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1889 GFX_draw_thick_line(2,&t9screen, start, stop, CLUT_EverythingOkayGreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1890
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1891 // Oxygen vertical bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1892 start.y = t9cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1893 stop.y = start.y - (3 * 15) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1894
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1895 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1896 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1897 GFX_draw_thick_line(2, &t9screen, start, stop, CLUT_WarningRed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1898 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1899
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1900
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1901 void t9_debug(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1902 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1903 char text[256+50];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1904 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1905
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1906 t9cY0free.WindowLineSpacing = 28 + 48 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1907 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1908 t9cY0free.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1909
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1910 textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1911 textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1912 // textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1913 textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1914 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1915
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1916 t9cY0free.WindowY0 -= 52;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1917 // 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));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1918 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1919 "%0.2f\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1920 "%0.2f %u%%\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1921 "%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1922 ,stateUsed->lifeData.pressure_ambient_bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1923 ,stateUsed->lifeData.pressure_surface_bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1924 ,settingsGetPointer()->salinity
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1925 ,stateUsed->lifeData.counterSecondsShallowDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1926 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1927 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1928
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1929
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1930 void t9_SummaryOfLeftCorner(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1931 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1932 char text[256+60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1933 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1934
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1935 const SDecoinfo * pDecoinfoStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1936 const SDecoinfo * pDecoinfoFuture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1937 float fCNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1938
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1939 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1940 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1941 pDecoinfoStandard = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1942 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1943 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1944 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1945 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1946 pDecoinfoStandard = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1947 pDecoinfoFuture = &stateUsed->decolistFutureVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1948 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1949
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1950 fCNS = stateUsed->lifeData .cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1951 if(fCNS > 999)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1952 fCNS = 999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1953
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1954 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1955 t9cY0free.WindowLineSpacing = 48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1956 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1957 t9cY0free.WindowTab = 420;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1958
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1959 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1960 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1961 text[textpointer++] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1962 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1963 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1964 text[textpointer++] = TXT_ppO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1965 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1966 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1967 text[textpointer++] = TXT_Ceiling;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1968 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1969 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1970 text[textpointer++] = TXT_ActualGradient;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1971 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1972 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1973 text[textpointer++] = TXT_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1974 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1975 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1976 text[textpointer++] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1977 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1978 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1979 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1980 text[textpointer++] = TXT2BYTE_ScooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1981 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1982 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1983 t9cY0free.WindowX0 += 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1984 t9cY0free.WindowY0 += 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1985 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1986 t9cY0free.WindowX0 -= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1987 t9cY0free.WindowY0 -= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1988
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1989 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1990 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1991 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1992 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1993 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1994 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1995 if(pDecoinfoStandard->output_ceiling_meter <= 99.9f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1996 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1997 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1998 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1999 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2000 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2001 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2002 textpointer += snprintf(&text[textpointer],10,"\020%.0f", 100 * pDecoinfoStandard->output_relative_gradient);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2003 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2004 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2005 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2006 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2007 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2008 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2009 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2010 textpointer += snprintf(&text[textpointer],10,"\020%i'", pDecoinfoFuture->output_time_to_surface_seconds / 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2011 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2012 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2013 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2014 textpointer += snprintf(&text[textpointer],15,"\020\016%01.0f \140",unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f)); // "\016\016%01.1f `" + C or F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2015 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2016 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2017 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2018 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2019 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2020 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2021 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2022 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2023
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2024
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2025 void t9_scooter(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2026 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2027 float scooterTemperatureLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2028 uint16_t scooterSpeedLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2029 // uint16_t scooterDrehzhl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2030 uint8_t scooterResidualCapacity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2031 // float scooterVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2032 // uint8_t scooterCurrent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2033 //uint16_t scooterWattHours;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2034 // uint16_t bkpX0, bkpX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2035
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2036 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2037 uint8_t textSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2038
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2039 scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2040 scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2041 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2042
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2043 // scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2044 // scooterVoltage = stateUsed->lifeData.scooterSpannung;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2045 // scooterCurrent = stateUsed->lifeData.scooterAmpere;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2046 // scooterWattHours = stateUsed->lifeData.scooterWattstunden;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2047
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2048 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2049 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2050 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2051
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2052 char text[256+60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2053 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2054
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2055 t9cY0free.WindowLineSpacing = 28 + 48 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2056 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2057 t9cY0free.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2058
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2059 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2060 text[textpointer++] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2061 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2062 text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2063 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2064 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2065 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2066 text[textpointer++] = TXT2BYTE_ScooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2067 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2068 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2069 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2070 text[textpointer++] = TXT2BYTE_ScooterSpeed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2071 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2072 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2073
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2074 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2075 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2076 "\032"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2077 "%0u" "\016\016 Wh used\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2078 ,stateUsed->lifeData.scooterWattstunden);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2079 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2080 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2081 text[0] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2082 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2083
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2084 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2085 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2086 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2087 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2088 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2089 "%0u" "\022\016\016 rpm\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2090 ,stateUsed->lifeData.scooterDrehzahl);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2091 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2092 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2093 // data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2094 t9cY0free.WindowY0 -= 52;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2095 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2096 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2097 textSize = snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2098 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2099 "%0u" "\022\016\016 %%\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2100 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2101 "%0.0f\140" "\022\016\016 C\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2102 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2103 "%u" "\022\016\016 m/min\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2104 ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2105 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2106 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2107 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2108 textSize = snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2109 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2110 "%0u" "\022\016\016 %%\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2111 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2112 "%0.0f\140" "\022\016\016 Fht\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2113 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2114 "%u" "\022\016\016 ft/min\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2115 ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2116 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2117 // connection active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2118 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2119 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2120 for(int i=0; i < textSize -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2121 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2122 if(text[i] == '\030')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2123 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2124 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2125 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2126 // write data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2127 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2128
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2129 // age stamp
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2130 if(ageInMilliSeconds < 9999)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2131 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2132 t9cY0free.WindowY0 -= 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2133 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2134 "\021\001%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2135 ,ageInMilliSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2136 GFX_write_string(&FontT24, &t9cY0free, text, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2137 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2138 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2139
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2141 void t9_scooter_May2016_01(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2142 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2143 float scooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2144 uint16_t scooterDrehzhl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2145 uint8_t scooterResidualCapacity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2146 float scooterSpeed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2147 float scooterVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2148 uint8_t scooterCurrent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2149 // uint16_t scooterWattHours;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2150 uint16_t bkpX0, bkpX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2152 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2153 uint8_t textSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2154 // old scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2155
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2156 scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2157 scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2158 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2159
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2160 scooterVoltage = stateUsed->lifeData.scooterSpannung;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2161 scooterCurrent = stateUsed->lifeData.scooterAmpere;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2162 // scooterWattHours = stateUsed->lifeData.scooterWattstunden;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2164 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2165 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2166 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2167
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2168 scooterSpeed = scooterDrehzhl * 80 / 3300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2170 char text[256+60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2172 t9cY0free.WindowLineSpacing = (28 + 48 + 14)/2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2173 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 5 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2174 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2175
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2176 t9cY0free.WindowY0 -= 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2177
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2178 bkpX0 = t9cY0free.WindowX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2179 bkpX1 = t9cY0free.WindowX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2180 t9cY0free.WindowX0 = 430;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2181
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2182 textSize = snprintf(text,120,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2183 "\022\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2184 "%%"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2185 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2186 "celsius"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2187 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2188 "rpm"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2189 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2190 "m/min"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2191 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2192 "Ampere"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2193 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2194 "Volt"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2195 // "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2196 // "Wh"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2197 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2198 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2199
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2200 t9cY0free.WindowX0 = bkpX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2201 t9cY0free.WindowX1 = 420;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2203 textSize = snprintf(text,120,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2204 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2205 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2206 "%0u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2207 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2208 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2209 "%0.0f"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2210 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2211 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2212 "%0u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2213 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2214 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2215 "%0.0f"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2216 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2217 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2218 "%0u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2219 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2220 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2221 "%0.1f"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2222 // "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2223 // "%0u" "\022\016\016 Wh\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2224 ,scooterResidualCapacity,scooterTemperature,scooterDrehzhl,scooterSpeed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2225 ,scooterCurrent,scooterVoltage);//,scooterWattHours);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2226
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2227 if((ageInMilliSeconds > 1500) || (stateUsed->lifeData.scooterType == 0xFF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2228 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2229 for(int i=0; i < textSize -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2230 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2231 if(text[i] == '\030')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2232 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2234 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2235 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2236
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2237 t9cY0free.WindowX0 = bkpX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2238 t9cY0free.WindowX1 = bkpX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2239
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2240 t9cY0free.WindowY0 -= 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2241 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2242 "\021\001%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2243 ,ageInMilliSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2244 GFX_write_string(&FontT24, &t9cY0free, text, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2246 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2247
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2248
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2249 void t9_compass(uint16_t ActualHeading, uint16_t UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2250 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2251 uint16_t LeftBorderHeading, LineHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2252 uint32_t offsetPicture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2253 point_t start, stop, center;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2254 static int32_t LastHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2255 int32_t newHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2256 int32_t diff = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2257 int32_t diff2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2258
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2259 int32_t diffAbs = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2260 int32_t diffAbs2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2261
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2262 newHeading = ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2264 diff = newHeading - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2265
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2266 if(newHeading < LastHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2267 diff2 = newHeading + 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2268 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2269 diff2 = newHeading - 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2270
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2271 diffAbs = diff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2272 if(diffAbs < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2273 diffAbs *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2274
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2275 diffAbs2 = diff2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2276 if(diffAbs2 < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2277 diffAbs2 *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2278
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2280 if(diffAbs <= diffAbs2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2281 newHeading = LastHeading + (diff / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2282 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2283 newHeading = LastHeading + (diff2 / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2285 if(newHeading < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2286 newHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2287 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2288 if(newHeading >= 360)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2289 newHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2290
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2291 LastHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2292 ActualHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2293
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2294 if (ActualHeading < 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2295 ActualHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2297 LeftBorderHeading = 2 * (ActualHeading - (CUSTOMBOX_SPACE_INSIDE/4));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2299 offsetPicture = LeftBorderHeading * t9screenCompass.ImageHeight * 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2300
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2301 t9_background.pointer = t9screenCompass.FBStartAdress+offsetPicture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2302 t9_background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2303 t9_background.y0 = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2304 t9_background.width = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2305 t9_background.height = t9screenCompass.ImageHeight;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2306
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2307 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2308 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2309 start.y = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2310 stop.y = start.y + 55;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2311 GFX_draw_line(&t9screen, start, stop, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2313
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2314 center.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2315 center.y = 300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2317 stop.x = center.x + 44;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2318 stop.y = center.y + 24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2319
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2321 while(ActualHeading > 359) ActualHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2322 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2323 GFX_draw_thick_line(9,&t9screen, t9_compass_circle(0,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font030); // North
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2324 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2325 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2326 GFX_draw_thick_line(9,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031); // Maintick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2327 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2328 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2329 GFX_draw_thick_line(9,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2330 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2331 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2332 GFX_draw_thick_line(9,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2334 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2335 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2336 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2337 GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2338 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2339 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2340 GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2341 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2342 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2343 GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2344 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2345 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2346 GFX_draw_thick_line(5,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2347
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2348 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2349 LineHeading += 22;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2350 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2351 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2352 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2353 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2354 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2355 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2356 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2357 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2358 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2359 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2360 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2361 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2362 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2363 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031); // Subtick
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2364 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2365 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2366 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2367 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2368 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2369 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2370 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2371 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2372 GFX_draw_thick_line(3,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2374 if(UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2375 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2376 LineHeading = UserSetHeading + 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2377 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2378 GFX_draw_thick_line(9,&t9screen, t9_compass_circle(3,LineHeading), t9_compass_circle(2,LineHeading), CLUT_CompassUserHeadingTick);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2379
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2380 // R�ckpeilung, User Back Heading
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2381 LineHeading = UserSetHeading + 360 + 180 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2382 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2383 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2384 GFX_draw_thick_line(9,&t9screen, t9_compass_circle(3,LineHeading), t9_compass_circle(2,LineHeading), CLUT_CompassUserBackHeadingTick);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2385 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2386
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2387 center.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2388 center.y = 250;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2389 GFX_draw_circle(&t9screen, center, 116, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2390 GFX_draw_circle(&t9screen, center, 118, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2391 GFX_draw_circle(&t9screen, center, 117, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2392 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2393
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2394
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2395 void init_t9_compass(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2396 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2397 t9screenCompass.FBStartAdress = getFrame(26);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2399 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2400 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2401
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2402 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2403 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2404 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2405 text[textpointer++] = 76; // 90 - 14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2406 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2407 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2408 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2409 text[textpointer++] = 'E'; // 96 + 28 = 124 total
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2410 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2411 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2412 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2413 text[textpointer++] = 64; // 90 - 14 - 12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2414 text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2415 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2416 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2417 text[textpointer++] = 66; // 90 - 11 - 13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2418 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2419 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2420 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2421 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2422 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2423 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2424 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2425 text[textpointer++] = 68; // 90 - 12 - 10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2426 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2427 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2428 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2429 text[textpointer++] = 64; // 90 - 10 - 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2430 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2431 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2432 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2433 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2434 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2435 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2436 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2437 text[textpointer++] = 56; // 90 - 16 - 18
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2438 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2439 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2440 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2441 text[textpointer++] = 54; // 90 - 18 - 18
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2442 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2443 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2444 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2445 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2446 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2447 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2448 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2449 text[textpointer++] = 59; // 90 - 17 - 14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2450 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2451 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2452 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2453 text[textpointer++] = 63; // 90 - 13 - 14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2454 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2455 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2456 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2457 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2458 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2459 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2460 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2461 text[textpointer++] = 64; // 90 - 14 - 12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2462 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2463 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2464 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2465 text[textpointer++] = 66; // 90 - 11 - 13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2466 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2467 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2468 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2469 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2470 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2471 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2472 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2473 text[textpointer++] = 68; // 90 - 12 - 10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2474 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2475 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2476 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2477 text[textpointer++] = 64; // 90 - 10 - 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2478 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2479 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2480 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2481 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2482 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2483 text[textpointer++] = 0; // end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2485 GFX_write_string(&FontT42,&t9pCompass,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2487 releaseAllFramesExcept(26,t9screenCompass.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2488 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2490
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2491 void t9_miniLiveLogProfile(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2492 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2493 SWindowGimpStyle wintemp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2494 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2495 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2496 wintemp.top = 480 - t9l1.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2497 wintemp.bottom = wintemp. top + 200;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2498
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2499 uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2500
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2501 GFX_graph_print(&t9screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2502 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2503