annotate Discovery/Src/t9.c @ 131:f35e53ef04e0 FlipDisplay

Update of configuration and projectfiles to support new library folder structure
author Ideenmodellierer
date Sun, 17 Feb 2019 21:29:38 +0100
parents b7689d9e888a
children
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 {
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
108 .pointer = 0,
38
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)
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
570 {
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 pViews = t9_customviewsDive;
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
572 while((*pViews != CVIEW_END) && (*pViews != t9_selection_customview))
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
573 {pViews++;}
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
575 if(*pViews < CVIEW_END)
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
576 pViews++;
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
577 else
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
578 {
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
579 if(stateUsed->mode == MODE_DIVE)
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
580 pViews = t9_customviewsDive;
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
581 }
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
582 t9_selection_customview = *pViews;
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
583 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 {
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
586 t9_selection_customview = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 // if((*pViews == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 // pViews++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590
130
b7689d9e888a Minor changes to improved code quality and to eliminate warnings
Ideenmodellierer
parents: 100
diff changeset
591
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595 uint8_t t9_get_length_of_customtext(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 uint8_t i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 settingsGetPointer()->customtext[60-1] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 while(settingsGetPointer()->customtext[i] > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601 return i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605 void t9_refresh_customview(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 if((t9_selection_customview == CVIEW_Scooter) && (getLicence() != LICENCEBONEX))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 if((t9_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 if((t9_selection_customview == CVIEW_sensors_mV) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 if((t9_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614 t9_change_customview();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 uint16_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618 int16_t start;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 // int16_t shiftWindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 RTC_DateTypeDef Sdate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 RTC_TimeTypeDef Stime;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth; // CVIEW_Gaslist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 const SGasLine * pGasLine; // CVIEW_Gaslist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 uint8_t oxygen, helium; // CVIEW_Gaslist
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 float depth, surface, fraction_nitrogen, fraction_helium, ead, end; // CVIEW_EADTime
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 switch(t9_selection_customview)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 case CVIEW_noneOrDebug:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 if(settingsGetPointer()->showDebugInfo)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 strcpy(text,"\032\f\001Debug");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 // content
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 t9_debug();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 case CVIEW_SummaryOfLeftCorner:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Summary);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 // content
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 t9_SummaryOfLeftCorner();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 case CVIEW_Scooter:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 snprintf(text,100,"\032\f\001Scooter");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648 t9_scooter();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 case CVIEW_Gaslist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 // a lot of code taken from tMenuGas.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Gaslist);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 // content
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 t9cY0free.WindowLineSpacing = 48+9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 t9cY0free.WindowNumberOfTextLines = 5; // NUM_GASES == 5
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 t9cY0free.WindowTab = 420;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 pGasLine = settingsGetPointer()->gas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 if(actualLeftMaxDepth(stateUsed))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 for(int gasId=1;gasId<=NUM_GASES;gasId++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 if(pGasLine[gasId].note.ub.active == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 strcpy(&text[textpointer++],"\021");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 strcpy(&text[textpointer++],"\025");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 strcpy(&text[textpointer++],"\030");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 text[textpointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 oxygen = pGasLine[gasId].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 helium = pGasLine[gasId].helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 textpointer += write_gas(&text[textpointer], oxygen, helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 // Wechseltiefe
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 if(pGasLine[gasId].depth_meter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685 {
100
b364c75005bb Stable.fix.
Dmitry Romanov <kitt@bk.ru>
parents: 38
diff changeset
686
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 GFX_write_string(&FontT42, &t9cY0free, text, gasId);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 case CVIEW_EADTime:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Info );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697 t9cY0free.WindowLineSpacing = 48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 // time
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 snprintf(text,100,"\032\001%c%c",TXT_2BYTE,TXT2BYTE_Clock );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 translateDate(stateRealGetPointer()->lifeData.dateBinaryFormat, &Sdate);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 translateTime(stateRealGetPointer()->lifeData.timeBinaryFormat, &Stime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 if(Stime.Seconds % 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 textpointer += snprintf(&text[textpointer],100,"\030\001%02d:%02d",Stime.Hours,Stime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 textpointer += snprintf(&text[textpointer],100,"\030\001%02d\031:\030%02d",Stime.Hours,Stime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 GFX_write_string(&FontT42, &t9cY0free, text, 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 // EAD / END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 // The equivalent air depth can be calculated for depths in metres as follows:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 // EAD = (Depth + 10) � Fraction of N2 / 0.79 - 10 (wikipedia)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 // The equivalent narcotic depth can be calculated for depths in metres as follows:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 // END = (Depth + 10) � (1 - Fraction of helium) - 10 (wikipedia)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 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
718 depth = stateUsed->lifeData.pressure_ambient_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 surface = stateUsed->lifeData.pressure_surface_bar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 ead = 10.f * ((depth * fraction_nitrogen/0.79f) - surface);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721 end = 10.0f * ((depth * (1.f - fraction_helium)) - surface);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 if(ead < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 ead = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724 if(end < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 end = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727 snprintf(text,100,"\032\001EAD");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 GFX_write_string(&FontT42, &t9cY0free, text, 3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 snprintf(text,100,"\030\001%01.1fm", ead);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730 GFX_write_string(&FontT42, &t9cY0free, text, 4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 snprintf(text,100,"\032\001END");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 GFX_write_string(&FontT42, &t9cY0free, text, 5);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 snprintf(text,100,"\030\001%01.1fm", end);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 GFX_write_string(&FontT42, &t9cY0free, text, 6);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 case CVIEW_Profile:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 t9_miniLiveLogProfile();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 case CVIEW_Tissues:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Tissues);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 t9_tissues(stateUsed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 case CVIEW_sensors:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2monitor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 text[textpointer++] = '\030'; // main color
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 text[textpointer++] = '\031'; // labelcolor
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 text[textpointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760 text[textpointer++] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763 text[textpointer++] = '\030'; // main color
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 if(stateUsed->warnings.sensorOutOfBounds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 text[textpointer++] = '\025'; // Warning Red
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 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
771 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773 t9cC.WindowLineSpacing = 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 t9cC.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776 GFX_write_string(&FontT105,&t9cC,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 case CVIEW_sensors_mV:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_O2voltage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 text[textpointer++] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 text[textpointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 text[textpointer++] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797 if(stateUsed->warnings.sensorOutOfBounds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 text[textpointer++] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 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
800 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 t9cC.WindowLineSpacing = 95;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 t9cC.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 GFX_write_string(&FontT48,&t9cC,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 case CVIEW_Compass:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE, TXT2BYTE_Compass);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 t9_compass((uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 t9cY0free.WindowY0 = 230;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 t9cY0free.WindowX0 += 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 snprintf(text,100,"\030\001%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 GFX_write_string(&FontT54,&t9cY0free,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 t9cY0free.WindowX0 -= 15;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 case CVIEW_Decolist:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 snprintf(text,100,"\032\f\001%c%c", TXT_2BYTE, TXT2BYTE_Decolist);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 GFX_write_string(&FontT42,&t9cH,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 const SDecoinfo * pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 uint8_t depthNext, depthLast, depthSecond, depthInc;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 pDecoinfo = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 pDecoinfo = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 depthLast = (uint8_t)(stateUsed->diveSettings.last_stop_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 depthSecond = (uint8_t)(stateUsed->diveSettings.input_second_to_last_stop_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 depthInc = (uint8_t)(stateUsed->diveSettings.input_next_stop_increment_depth_bar * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
833
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
834 for(start=DECOINFO_STRUCT_MAX_STOPS-1; start>0; start--)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 if(pDecoinfo->output_stop_length_seconds[start]) break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 start -= 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 if(start < 0) start = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 for(int i=start;i<6+start;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 if(i == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843 depthNext = depthLast;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
845 depthNext = depthSecond + (( i - 1 )* depthInc);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
846
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 if(pDecoinfo->output_stop_length_seconds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 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
849 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 textpointer += snprintf(&text[textpointer],20,"\031\034 %2u\016\016m\017\n\r",depthNext);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
851 if(textpointer > 200) break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 t9cY0free.WindowLineSpacing = 48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 /* DIVE MODE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 void t9_refresh_divemode(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 char TextL1[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866 char TextL2[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 char TextR1[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 char TextR2[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870 char TextR3[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 char TextC1[2*TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 char TextC2[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 uint8_t textPointer;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 point_t start, stop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 uint8_t color;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 int textlength;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 uint16_t nextstopLengthSeconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 uint8_t nextstopDepthMeter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 uint8_t oxygen_percentage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 SDivetime Divetime = {0,0,0, 0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
884 SDivetime SafetyStopTime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 SDivetime TimeoutTime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 uint8_t customview_warnings = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 const SDecoinfo * pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 Divetime.Minutes = Divetime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 SafetyStopTime.Total = timer_Safetystop_GetCountDown();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 SafetyStopTime.Minutes = SafetyStopTime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
895 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
897 TimeoutTime.Total = settingsGetPointer()->timeoutDiveReachedZeroDepth - stateUsed->lifeData.counterSecondsShallowDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 if(TimeoutTime.Total > settingsGetPointer()->timeoutDiveReachedZeroDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 TimeoutTime.Total = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 TimeoutTime.Minutes = TimeoutTime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903 TimeoutTime.Seconds = TimeoutTime.Total - (TimeoutTime.Minutes * 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
906 pDecoinfo = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 pDecoinfo = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 if(pDecoinfo->output_time_to_surface_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 nextstopDepthMeter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 nextstopLengthSeconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 /* depth */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921 float depth = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 if(is_stateUsedSetToSim())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 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
926
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 idt9_depthLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 if(idt9_depthLastCall >= 9)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 idt9_depthLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930 t9_depthLastCall[idt9_depthLastCall] = depthThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 depth = (depthThisCall + t9_depthLastCall[0] + t9_depthLastCall[1] + t9_depthLastCall[2]) / 4.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
935
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 idt9_depthLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 if(idt9_depthLastCall >= 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938 idt9_depthLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 t9_depthLastCall[idt9_depthLastCall] = depthThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
941
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
942 if(depth <= 0.3f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
943 depth = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
944
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
945 snprintf(TextL1,TEXTSIZE,"\032\f%c",TXT_Depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
946 GFX_write_string(&FontT24,&t9l2,TextL1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
947
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
948 if( depth < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
949 snprintf(TextL1,TEXTSIZE,"\020%01.1f",depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
950 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
951 snprintf(TextL1,TEXTSIZE,"\020%01.0f",depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
952
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
953 t9_colorscheme_mod(TextL1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
954 GFX_write_string(&FontT105,&t9l2,TextL1,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
955
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 /* max depth */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 snprintf(TextL2,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
958 GFX_write_string(&FontT24,&t9l3,TextL2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
959
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
960 if(unit_depth_float(stateUsed->lifeData.max_depth_meter) < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
961 snprintf(TextL2,TEXTSIZE,"\020%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
962 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
963 snprintf(TextL2,TEXTSIZE,"\020%01.0f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
964
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
965 t9_colorscheme_mod(TextL2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
966 GFX_write_string(&FontT105,&t9l3,TextL2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
967
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
968 /* ascentrate graph */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
969 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
970 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
971 start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
972 for(int i = 0; i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974 start.y += 5*6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 start.x = CUSTOMBOX_LINE_LEFT - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 stop.x = start.x - 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 GFX_draw_line(&t9screen, start, stop, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 // start.x = CUSTOMBOX_LINE_RIGHT + 2; old right too
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980 // stop.x = start.x + 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
981 // GFX_draw_line(&t9screen, start, stop, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
983 // new thick bar design Sept. 2015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 3 - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
985 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 6);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 if(stop.y >= 470)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 stop.y = 470;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 start.y += 7; // starte etwas weiter oben
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 color = CLUT_EverythingOkayGreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
994 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 color = CLUT_WarningYellow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 color = CLUT_WarningRed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 GFX_draw_thick_line(12,&t9screen, start, stop, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 snprintf(TextL2,TEXTSIZE,"\f%.1f m/min",stateUsed->lifeData.ascent_rate_meter_per_min);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 /* divetime */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 if(stateUsed->lifeData.counterSecondsShallowDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1006 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 snprintf(TextR1,TEXTSIZE,"\f\002\136 %u:%02u",TimeoutTime.Minutes, TimeoutTime.Seconds);
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 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1011 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1012 snprintf(TextR1,TEXTSIZE,"\032\f\002%c",TXT_Divetime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1013 GFX_write_string(&FontT24,&t9r2,TextR1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1014 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1016 if(Divetime.Minutes < 1000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1017 snprintf(TextR1,TEXTSIZE,"\020\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1018 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1019 snprintf(TextR1,TEXTSIZE,"\020\016\002%u'",Divetime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1020 t9_colorscheme_mod(TextR1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1021 GFX_write_string(&FontT105,&t9r2,TextR1,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1022
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1023 /* next deco stop */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1024 if(nextstopDepthMeter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1025 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1026 snprintf(TextR2,TEXTSIZE,"\032\f\002%c",TXT_Decostop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1027 GFX_write_string(&FontT24,&t9r3,TextR2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1028 textlength = snprintf(TextR2,TEXTSIZE,"\020\002%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1029 t9_colorscheme_mod(TextR2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1030 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1031 TextR2[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1032 if(textlength <= 8)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1033 GFX_write_string(&FontT105,&t9r3,TextR2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1034 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1035 GFX_write_string(&FontT54,&t9r3,TextR2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1036 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1037 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1038 if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1039 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1040 snprintf(TextR2,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1041 GFX_write_string(&FontT24,&t9r3,TextR2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1042 snprintf(TextR2,TEXTSIZE,"\020\016\002%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1043 t9_colorscheme_mod(TextR2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1044 GFX_write_string(&FontT105,&t9r3,TextR2,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1045 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1046
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1047 /* tts - option 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1048 * ndl - option 2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1049 * empty - option 3 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1050 if(pDecoinfo->output_time_to_surface_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1051 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1052 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_TTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1053 GFX_write_string(&FontT24,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1054 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1055 snprintf(TextR3,TEXTSIZE,"\020\002%i'",(pDecoinfo->output_time_to_surface_seconds + 30)/ 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1056 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1057 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_time_to_surface_seconds / 3600);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1058 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1059 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1060 TextR2[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1061 GFX_write_string(&FontT105,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1062 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1063 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1064 if(pDecoinfo->output_ndl_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1065 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1066 snprintf(TextR3,TEXTSIZE,"\032\f\002%c",TXT_Nullzeit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1067 GFX_write_string(&FontT24,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1068 if(pDecoinfo->output_ndl_seconds < 1000 * 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1069 snprintf(TextR3,TEXTSIZE,"\020\002%i'",pDecoinfo->output_ndl_seconds/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1070 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1071 snprintf(TextR3,TEXTSIZE,"\020\002%ih",pDecoinfo->output_ndl_seconds/3600);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1072 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1073 if(time_elapsed_ms(pDecoinfo->tickstamp, HAL_GetTick()) > MAX_AGE_DECOINFO_MS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1074 TextR2[0] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1075 GFX_write_string(&FontT105,&t9r4,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1076 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1077
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1078 uint16_t scooterSpeedLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1079 uint8_t scooterResidualCapacity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1080
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1081 scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1082 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1083
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1084 /* scooter global for both */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1085 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1086 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1087 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1088 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1089
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1090 /* scooter battery */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1091 snprintf(TextR1,TEXTSIZE,"\032\f\002%c%c",TXT_2BYTE, TXT2BYTE_ScooterRestkapazitaet);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1092 GFX_write_string(&FontT24,&t9r1,TextR1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1093 snprintf(TextR3,TEXTSIZE,"\020\002%u\016\016%%\017",scooterResidualCapacity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1094 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1096 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1097 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1098 if(TextR3[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 TextR3[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1101 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1102 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1103 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 GFX_write_string(&FontT105,&t9r1,TextR3,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1106 /* scooter speed */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1107 textlength = snprintf(TextR3,TEXTSIZE-7,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_ScooterSpeed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110 snprintf(&TextR3[textlength],8," m/min");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 snprintf(&TextR3[textlength],8," ft/min");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 GFX_write_string(&FontT24,&t9l1,TextR3,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 snprintf(TextR3,TEXTSIZE,"\020%u",scooterSpeedLocal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 if(TextR3[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123 TextR3[i] = '\031';
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 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 t9_colorscheme_mod(TextR3);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 GFX_write_string(&FontT105,&t9l1,TextR3,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132 /* Menu Selection (and gas mix) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 if(get_globalState() == StDMGAS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 TextR1[textPointer++] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 // TextR1[textPointer++] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138 TextR1[textPointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1140 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
1141 TextR1[textPointer++] = '?';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 TextR1[textPointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 if(get_globalState() == StDMSPT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 TextR1[textPointer++] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 TextR1[textPointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 textPointer += snprintf(&TextR1[textPointer],5,"%f01.2",((float)(stateUsed->diveSettings.setpoint[actualBetterSetpointId()].setpoint_cbar))/100);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 TextR1[textPointer++] = '?';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 TextR1[textPointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 TextR1[textPointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 if(get_globalState() == StDMENU)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveMenuQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 if(get_globalState() == StDSIM1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 snprintf(TextR1,TEXTSIZE,"\a\001%c%c", TXT_2BYTE, TXT2BYTE_DiveQuitQ);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 if(get_globalState() == StDSIM2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:-1m ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176 snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 if(get_globalState() == StDSIM3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+1m ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 if(get_globalState() == StDSIM4)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 snprintf(TextR1,TEXTSIZE,"\a\001" " Sim:+5' ");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 GFX_write_string_color(&FontT48,&t9c2,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 snprintf(TextR1,TEXTSIZE,"\a\f %u m",simulation_get_aim_depth());
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 GFX_write_string_color(&FontT42,&t9l1,TextR1,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 /* gas mix */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 oxygen_percentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 textPointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204 TextC2[textPointer++] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 if(stateUsed->warnings.betterGas && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 TextC2[textPointer++] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 float fPpO2limitHigh, fPpO2now;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 if(actualLeftMaxDepth(stateUsed))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 fPpO2limitHigh = settingsGetPointer()->ppO2_max_deco;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 fPpO2limitHigh = settingsGetPointer()->ppO2_max_std;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 fPpO2now = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 if((fPpO2now > fPpO2limitHigh) || (fPpO2now < (float)(settingsGetPointer()->ppO2_min)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 TextC2[textPointer++] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 TextC2[textPointer++] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224 textPointer += tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&TextC2[textPointer]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 if(stateUsed->warnings.betterGas && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 if(TextC2[0] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 TextC2[0] = '\004'; // NOP
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 GFX_write_string_color(&FontT48,&t9c2,TextC2,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 t9_colorscheme_mod(TextC2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 GFX_write_string(&FontT48,&t9c2,TextC2,0); // T54 has only numbers
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 if(stateUsed->diveSettings.ccrOption)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245 if(stateUsed->warnings.betterSetpoint && warning_count_high_time && (stateUsed->diveSettings.diveMode == DIVEMODE_CCR))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 TextC2[0] = '\a'; // inverse instead of color \020
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 GFX_write_string_color(&FontT48,&t9c2,TextC2,0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 t9_colorscheme_mod(TextC2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 GFX_write_string(&FontT48,&t9c2,TextC2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 else if(settingsGetPointer()->alwaysShowPPO2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 snprintf(TextC2,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 t9_colorscheme_mod(TextC2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 GFX_write_string(&FontT48,&t9c2,TextC2,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 /* algorithm, ccr, bailout and battery */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 /* and permanent warnings (CNS) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 if((stateUsed->warnings.cnsHigh) && display_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 TextC2[0] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 TextC2[1] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 TextC2[2] = TXT2BYTE_WarnCnsHigh;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 TextC2[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 GFX_write_string_color(&FontT48,&t9c1,TextC2,0,CLUT_WarningRed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 if(stateUsed->warnings.aGf)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1280 GFX_write_string_color(&FontT48,&t9c1,"\f" "aGF",0,CLUT_WarningYellow);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 else if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1283 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284 GFX_write_string(&FontT48,&t9c1,"\027\f" "GF",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1287 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1288 GFX_write_string(&FontT48,&t9c1,"\027\f" "VPM",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1289 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1290
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1291 if(stateUsed->diveSettings.diveMode == DIVEMODE_CCR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1292 GFX_write_string(&FontT24,&t9c1,"\027\f\002" "CCR",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1293 // GFX_write_string(&FontT24,&t9c1,"\f\177\177\x80" "CCR",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1294 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1295 if(stateUsed->diveSettings.ccrOption)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1296 GFX_write_string(&FontT24,&t9c1,"\f\002\024" "Bailout",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1297 // GFX_write_string(&FontT24,&t9c1,"\f\177\177\x80\024" "Bailout",0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1298 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1299 TextC1[0] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1300 TextC1[1] = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1301 TextC1[2] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1302 TextC1[3] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1303 TextC1[4] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1304 TextC1[5] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1305 TextC1[6] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1306 TextC1[7] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1307 TextC1[8] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1308 TextC1[9] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1309 TextC1[10] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1310 TextC1[11] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1311 TextC1[12] = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1312 TextC1[13] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1313
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314 for(int i=1;i<=10;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1315 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 if( stateUsed->lifeData.battery_charge > (9 * i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1317 TextC1[i+1] += 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1318 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320 if(stateUsed->warnings.lowBattery)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1322 TextC1[0] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 if(warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325 for(int i=2;i<=11;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 TextC1[i] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1330 TextC1[2] = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1331 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1332 GFX_write_string(&Batt24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1333
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1335 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1336 snprintf(TextC1,16,"\004\025\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1337 if(warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1338 TextC1[0] = '\a';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1339 GFX_write_string(&FontT24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1340 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1341 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1342 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1343 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1344 t9_colorscheme_mod(TextC1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1345 GFX_write_string(&Batt24,&t9batt,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1347 if((stateUsed->lifeData.battery_charge > 0) && (stateUsed->lifeData.battery_charge < 140))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1348 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1349 snprintf(TextC1,16,"\020\f\002%u%%",(uint8_t)stateUsed->lifeData.battery_charge);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1350 t9_colorscheme_mod(TextC1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1351 GFX_write_string(&FontT24,&t9batt,TextC1,0);
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
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1355 /* customizable left lower corner */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1356 t9_refresh_divemode_userselected_left_lower_corner();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1358
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1359 /* customview - option 1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1360 * warning - option 2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1361 if(stateUsed->warnings.numWarnings)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1362 customview_warnings = t9_test_customview_warnings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1364 t9_background.pointer = NULL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1365 if(customview_warnings && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1366 t9_show_customview_warnings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1367 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1368 t9_refresh_customview();
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 /* the frame */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1372 t9_draw_frame(1,1, CLUT_DIVE_pluginbox, CLUT_DIVE_FieldSeperatorLines);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1373 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1374
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1375
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1376 void t9_set_field_to_primary(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1377 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1378 if(stateUsed->mode == MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1379 t9_selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1380 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1381
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1382
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1383 void t9_change_field(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1384 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1385 const uint8_t minVal = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1386 const uint8_t maxVal = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1387
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1388 t9_selection_custom_field++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1389 if(t9_selection_custom_field > maxVal)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1390 t9_selection_custom_field = minVal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1391 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1392
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1393
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1394 void t9_refresh_divemode_userselected_left_lower_corner(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1396 // zero is scooter temperature :-)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398 char headerText[10];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399 char text[TEXTSIZE];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 _Bool tinyHeaderFont = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 uint8_t line = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404 SDivetime Stopwatch = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 float fAverageDepth, fAverageDepthAbsolute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406 const SDecoinfo * pDecoinfoStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407 const SDecoinfo * pDecoinfoFuture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408 float fCNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1409
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 float temperatureThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411 float temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 float scooterTemperatureLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1415
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1417 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1418 pDecoinfoStandard = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 pDecoinfoStandard = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424 pDecoinfoFuture = &stateUsed->decolistFutureVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1426
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1427 Stopwatch.Total = timer_Stopwatch_GetTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 Stopwatch.Minutes = Stopwatch.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1430 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1431 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1432
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 headerText[0] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 headerText[1] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 switch(t9_selection_custom_field)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438 /* scooter temp. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1439 case 0:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440 scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1441 headerText[2] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 headerText[3] = TXT2BYTE_ScooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1443 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
1444 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449 tinyHeaderFont = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 // connection active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458 if(text[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1459 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1462 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464 /* Temperature */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1465 case 1:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1467 // mean value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1468 temperatureThisCall = unit_temperature_float(stateUsed->lifeData.temperature_celsius);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1469 temperature = (temperatureThisCall + t9_temperatureLastCall[0] + t9_temperatureLastCall[1] + t9_temperatureLastCall[2]) / 4.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1470 idt9_temperatureLastCall++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1471 if(idt9_temperatureLastCall >= 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1472 idt9_temperatureLastCall = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1473 t9_temperatureLastCall[idt9_temperatureLastCall] = temperatureThisCall;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1474 // output
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1475 headerText[2] = TXT_Temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1476 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
1477 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1478 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1479 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1481 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1482 tinyHeaderFont = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1483 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1485 /* Average Depth */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1486 case 2:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1487 headerText[2] = TXT_AvgDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1488 snprintf(text,TEXTSIZE,"\020%01.1f",fAverageDepthAbsolute);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1489 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1490
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1491 /* ppO2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1492 case 3:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1493 headerText[2] = TXT_ppO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1494 snprintf(text,TEXTSIZE,"\020%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1495 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1496
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1497 /* Stop Uhr */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1498 case 4:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1499 headerText[2] = TXT_Stopwatch;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1500 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
1501 tinyHeaderFont = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1502 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1503 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1504
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1505 /* Ceiling */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1506 case 5:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1507 headerText[2] = TXT_Ceiling;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1508 if(pDecoinfoStandard->output_ceiling_meter <= 99.9f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1509 snprintf(text,TEXTSIZE,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1510 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1511 snprintf(text,TEXTSIZE,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1512 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1513
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1514 /* Future TTS */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1515 case 6:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1516 headerText[2] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1517 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
1518 tinyHeaderFont = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519 line = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1522 /* CNS */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523 case 7:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524 headerText[2] = TXT_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525 fCNS = stateUsed->lifeData .cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 if(fCNS > 999)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527 fCNS = 999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1528 snprintf(text,TEXTSIZE,"\020%.0f\016\016%%\017",fCNS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1529 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1530
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 /* scooter voltage*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 case 77: // used as 7: alternative for Bonex
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533 headerText[2] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534 headerText[3] = TXT2BYTE_ScooterVolt;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1535 if(stateUsed->lifeData.scooterSpannung < 99)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1536 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1537 snprintf(text,TEXTSIZE,"\020\016%01.2f",stateUsed->lifeData.scooterSpannung);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1538 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1539 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1540 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1541 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1542 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1543 for(int i=0; i < TEXTSIZE -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1544 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1545 if(text[i] == '\020')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1546 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1547 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1548 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1549 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1550 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1551 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1552 text[0] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1553 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1554 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1555
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1556 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1557 if(headerText[2] == TXT_2BYTE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1558 headerText[4] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1559 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1560 headerText[3] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1561
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1562 if(!tinyHeaderFont)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1563 GFX_write_string(&FontT24,&t9l4,headerText,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1564
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1565 t9_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1566 GFX_write_string(&FontT105,&t9l4,text,line);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1567 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1568
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1569 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1570
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1571 uint8_t t9_customtextPrepare(char * text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1572 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1573 uint8_t i, j, textptr, lineCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1574 char nextChar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1576 textptr = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1577 lineCount = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1578
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1579 text[textptr++] = TXT_MINIMAL;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1580
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1581 j = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1582 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1583 do
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1584 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1585 j += i;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1586 i = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1587 do
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1588 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1589 nextChar = settingsGetPointer()->customtext[i+j];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1590 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1591 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1592 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1593 text[textptr++] = nextChar;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1594 } while (i < 12);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1595
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1596 if(!nextChar)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1597 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1598
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1599 if(lineCount < 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1600 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1601 text[textptr++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1602 text[textptr++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1603 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1604 lineCount++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1605 for(uint8_t k=0;k<2;k++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1606 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1607 nextChar = settingsGetPointer()->customtext[i+j+k];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1608 if((nextChar =='\n') || (nextChar =='\r'))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1609 i++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1610 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1611 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1612 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1613
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1614 } while (lineCount < 4);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1615
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1616 text[textptr] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1617 return lineCount;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1618 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1619
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1620 /* could be extended to search for \020 inside
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1621 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1622 void t9_colorscheme_mod(char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1623 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1624 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1625 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1626 text[0] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1627 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1628 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1629
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1630 void t9_draw_frame(_Bool PluginBoxHeader, _Bool LinesOnTheSides, uint8_t colorBox, uint8_t colorLinesOnTheSide)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1631 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1632 point_t LeftLow, WidthHeight;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1633 point_t start, stop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1634
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1635 // plugin box
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1636 LeftLow.x = CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1637 WidthHeight.x = CUSTOMBOX_LINE_RIGHT - CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1638 LeftLow.y = 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1639 WidthHeight.y = 440 - LeftLow.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1640 GFX_draw_box(&t9screen, LeftLow, WidthHeight, 1, colorBox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1641
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1642 if(PluginBoxHeader)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1643 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1644 // plugin box - header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1645 start.x = CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1646 stop.x = CUSTOMBOX_LINE_RIGHT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1647 stop.y = start.y = 440 - 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1648 GFX_draw_line(&t9screen, start, stop, colorBox);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1649 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1650
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1651 if(LinesOnTheSides)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1652 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1653 // aufteilung links
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1654 start.x = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1655 stop.x = CUSTOMBOX_LINE_LEFT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1656 stop.y = start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1657 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1658 stop.y = start.y = t9l2.WindowY0 -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1659 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1660 stop.y = start.y = t9l3.WindowY0 -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1661 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1662
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1663 // aufteilung rechts
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1664 start.x = CUSTOMBOX_LINE_RIGHT;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1665 stop.x = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1666 stop.y = start.y = t9l1.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1667 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1668 stop.y = start.y = t9l2.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1669 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1670 stop.y = start.y = t9l3.WindowY0 - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1671 GFX_draw_line(&t9screen, start, stop, colorLinesOnTheSide);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1672 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1673 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1674
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1675
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1676 /* Compass like TCOS shellfish
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1677 * input is 0 to 359
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1678 * 2 px / 1 degree
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1679 * Range is 148 degree with CUSTOMBOX_SPACE_INSIDE = 296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1680 * one side is 74 degree (less than 90 degree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1681 * internal 360 + 180 degree of freedom
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1682 * use positive values only, shift by 360 below 90 mid position
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1683 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1684
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1685
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1686 point_t t9_compass_circle(uint8_t id, uint16_t degree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1687 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1688 float fCos, fSin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1689 const float piMult = ((2 * 3.14159) / 360);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1690 // const int radius[4] = {95,105,115,60};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1691 const int radius[4] = {95,105,115,100};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1692 const point_t offset = {.x = 400, .y = 250};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1693
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1694 static point_t r[4][360] = { 0 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1695
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1696 if(r[0][0].y == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1697 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1698 for(int i=0;i<360;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1699 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1700 fCos = cos(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1701 fSin = sin(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1702 for(int j=0;j<4;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1703 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1704 r[j][i].x = offset.x + (int)(fSin * radius[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1705 r[j][i].y = offset.y + (int)(fCos * radius[j]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1706 }
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 if(id > 3) id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1710 if(degree > 359) degree = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1711 return r[id][degree];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1712 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1713
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1714 /* 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
1715 * T24 is 28 high
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1716 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1717 void t9_tissues(const SDiveState * pState)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1718 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1719 point_t start, change, stop;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1720 float value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1721 uint16_t front, cns100pixel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1722 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1723 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1724 uint8_t color;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1725
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1726 float percent_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1727 float percent_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1728 float partial_pressure_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1729 float partial_pressure_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1732 /* N2 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1733 t9cY0free.WindowLineSpacing = 28 + 48 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1734 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1735 t9cY0free.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1736
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1737 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1738 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1739 text[textpointer++] = TXT2BYTE_Nitrogen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1740 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1741 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1742 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1743 text[textpointer++] = TXT2BYTE_Helium;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1744 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1745 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1746 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1747 text[textpointer++] = TXT2BYTE_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1748 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1749
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1750 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1752 start.y = t9cH.WindowY0 - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1753 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1754 stop.x = start.x + CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1755
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1756 for(int i=0;i<16;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1757 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1758 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1759 change.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1760
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1761 value = pState->lifeData.tissue_nitrogen_bar[i] - 0.7512f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1762 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1763
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1764 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1765 front = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1766 else if(value > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1767 front = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1768 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1769 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1770
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1771 change.x = start.x + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1772 if(change.x != start.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1773 GFX_draw_thick_line(1,&t9screen, start, change, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1774 if(change.x != stop.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1775 GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1776
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1777 start.y -= 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1778 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1779
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1780 /* He */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1781 start.y -= 28 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1782 for(int i=0;i<16;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1783 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1784 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1785 change.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1787 value = pState->lifeData.tissue_helium_bar[i];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1788 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1790 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1791 front = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1792 else if(value > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1793 front = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1794 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1795 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1796
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1797 change.x = start.x + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1798 if(change.x != start.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1799 GFX_draw_thick_line(1,&t9screen, start, change, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1800 if(change.x != stop.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1801 GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1802
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1803 start.y -= 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1804 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1805
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1806 /* CNS == Oxygen */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1807 start.y -= 28 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1808
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1809 cns100pixel = (8 * CUSTOMBOX_SPACE_INSIDE) / 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1810 value = pState->lifeData.cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1811 value *= cns100pixel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1812 value /= 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1813
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1814 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1815 front = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1816 else if(value > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1817 front = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1818 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1819 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1820
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1821 if(pState->lifeData.cns < 95)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1822 color = CLUT_Font030;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1823 else if(pState->lifeData.cns < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1824 color = CLUT_WarningYellow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1825 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1826 color = CLUT_WarningRed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1827
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1828 for(int i=0;i<16;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1829 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1830 stop.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1831 change.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1832
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1833 change.x = start.x + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1834 if(change.x != start.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1835 GFX_draw_thick_line(1,&t9screen, start, change, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1836 if(change.x != stop.x)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1837 GFX_draw_thick_line(1,&t9screen, change, stop, CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1838
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1839 start.y -= 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1840 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1841
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1842 /* where is the onload/offload limit for N2 and He */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1843 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
1844 partial_pressure_N2 = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1845 partial_pressure_He = (pState->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * percent_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1846
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1847 // Nitrogen vertical bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1848 start.y = t9cH.WindowY0 + 1 - 5;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1849 stop.y = start.y - (3 * 15) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1850 if((percent_N2 > 0) && (partial_pressure_N2 > 0.8f))//(0.8f + 0.5f)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1851 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1852 value = partial_pressure_N2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1853 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1854
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1855 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1856 front = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1857 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1858 front = CUSTOMBOX_SPACE_INSIDE - 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1859 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1860 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1861 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1862 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1863 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1864 front = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1865 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1866 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1867 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1868 GFX_draw_thick_line(2,&t9screen, start, stop, CLUT_EverythingOkayGreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1869
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1871 // Helium vertical bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1872 start.y = t9cH.WindowY0 + 1 - 5 - 3*16 - 28 - 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1873 stop.y = start.y - (3 * 15) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1874 if((percent_He > 0) && (partial_pressure_He > 0.01f)) // 0.5f
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1875 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1876
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1877 value = partial_pressure_He;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1878 value *= 80;//20
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1879
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1880 if(value < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1881 front = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1882 else if(value + 5 > CUSTOMBOX_SPACE_INSIDE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1883 front = CUSTOMBOX_SPACE_INSIDE - 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1884 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1885 front = (uint16_t)value;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1886 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1887 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1888 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1889 front = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1890 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1892 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + front;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1893 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1894 GFX_draw_thick_line(2,&t9screen, start, stop, CLUT_EverythingOkayGreen);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1895
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1896 // Oxygen vertical bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1897 start.y = t9cH.WindowY0 + 1 - 5 - 6*16 - 2*28 - 2*14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1898 stop.y = start.y - (3 * 15) - 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1899
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1900 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + cns100pixel;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1901 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1902 GFX_draw_thick_line(2, &t9screen, start, stop, CLUT_WarningRed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1903 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1904
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1905
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1906 void t9_debug(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1907 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1908 char text[256+50];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1909 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1910
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1911 t9cY0free.WindowLineSpacing = 28 + 48 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1912 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1913 t9cY0free.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1914
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1915 textpointer += snprintf(&text[textpointer],50,"Ambient [bar]\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1916 textpointer += snprintf(&text[textpointer],50,"Surface [bar] + salt\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1917 // textpointer += snprintf(&text[textpointer],50,"Difference [mbar]\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1918 textpointer += snprintf(&text[textpointer],50,"ShallowCounter [s]\n\r");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1919 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1920
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1921 t9cY0free.WindowY0 -= 52;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1922 // 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
1923 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1924 "%0.2f\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1925 "%0.2f %u%%\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1926 "%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1927 ,stateUsed->lifeData.pressure_ambient_bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1928 ,stateUsed->lifeData.pressure_surface_bar
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1929 ,settingsGetPointer()->salinity
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1930 ,stateUsed->lifeData.counterSecondsShallowDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1931 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1932 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1933
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1934
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1935 void t9_SummaryOfLeftCorner(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1936 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1937 char text[256+60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1938 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1939
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1940 const SDecoinfo * pDecoinfoStandard;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1941 const SDecoinfo * pDecoinfoFuture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1942 float fCNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1943
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1944 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1945 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1946 pDecoinfoStandard = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1947 pDecoinfoFuture = &stateUsed->decolistFutureBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1948 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1949 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1950 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1951 pDecoinfoStandard = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1952 pDecoinfoFuture = &stateUsed->decolistFutureVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1953 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1954
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1955 fCNS = stateUsed->lifeData .cns;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1956 if(fCNS > 999)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1957 fCNS = 999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1958
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1959 t9cY0free.WindowY0 = t9cC.WindowY0 - 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1960 t9cY0free.WindowLineSpacing = 48;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1961 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1962 t9cY0free.WindowTab = 420;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1963
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1964 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1965 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1966 text[textpointer++] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1967 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1968 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1969 text[textpointer++] = TXT_ppO2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1970 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1971 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1972 text[textpointer++] = TXT_Ceiling;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1973 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1974 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1975 text[textpointer++] = TXT_ActualGradient;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1976 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1977 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1978 text[textpointer++] = TXT_CNS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1979 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1980 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1981 text[textpointer++] = TXT_FutureTTS;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1982 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1983 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1984 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1985 text[textpointer++] = TXT2BYTE_ScooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1986 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1987 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1988 t9cY0free.WindowX0 += 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1989 t9cY0free.WindowY0 += 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1990 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1991 t9cY0free.WindowX0 -= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1992 t9cY0free.WindowY0 -= 10;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1993
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1994 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1995 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1996 textpointer += snprintf(&text[textpointer],10,"\020%01.2f", stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1997 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1998 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1999 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2000 if(pDecoinfoStandard->output_ceiling_meter <= 99.9f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2001 textpointer += snprintf(&text[textpointer],10,"\020%01.1f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2002 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2003 textpointer += snprintf(&text[textpointer],10,"\020%01.0f",pDecoinfoStandard->output_ceiling_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2004 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2005 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2006 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2007 textpointer += snprintf(&text[textpointer],10,"\020%.0f", 100 * pDecoinfoStandard->output_relative_gradient);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2008 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2009 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2010 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2011 textpointer += snprintf(&text[textpointer],10,"\020%.0f\016\016%%\017",fCNS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2012 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2013 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2014 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2015 textpointer += snprintf(&text[textpointer],10,"\020%i'", pDecoinfoFuture->output_time_to_surface_seconds / 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2016 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2017 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2018 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2019 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
2020 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2021 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2022 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2023 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2024 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2025 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2026 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2027 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2028
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2029
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2030 void t9_scooter(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2031 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2032 float scooterTemperatureLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2033 uint16_t scooterSpeedLocal;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2034 // uint16_t scooterDrehzhl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2035 uint8_t scooterResidualCapacity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2036 // float scooterVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2037 // uint8_t scooterCurrent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2038 //uint16_t scooterWattHours;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2039 // uint16_t bkpX0, bkpX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2040
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2041 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2042 uint8_t textSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2043
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2044 scooterTemperatureLocal = unit_temperature_float(((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2045 scooterSpeedLocal = unit_speed_integer(stateUsed->lifeData.scooterSpeed);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2046 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2047
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2048 // scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2049 // scooterVoltage = stateUsed->lifeData.scooterSpannung;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2050 // scooterCurrent = stateUsed->lifeData.scooterAmpere;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2051 // scooterWattHours = stateUsed->lifeData.scooterWattstunden;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2052
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2053 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2054 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2055 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2056
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2057 char text[256+60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2058 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2059
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2060 t9cY0free.WindowLineSpacing = 28 + 48 + 14;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2061 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 2 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2062 t9cY0free.WindowNumberOfTextLines = 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2063
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2064 // header
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2065 text[textpointer++] = '\032';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2066 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2067 text[textpointer++] = TXT2BYTE_ScooterRestkapazitaet;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2068 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2069 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2070 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2071 text[textpointer++] = TXT2BYTE_ScooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2072 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2073 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2074 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2075 text[textpointer++] = TXT2BYTE_ScooterSpeed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2076 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2077 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2078
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2079 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2080 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2081 "\032"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2082 "%0u" "\016\016 Wh used\017"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2083 ,stateUsed->lifeData.scooterWattstunden);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2084 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2085 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2086 text[0] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2087 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2088
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2089 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2090 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2091 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2092 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2093 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2094 "%0u" "\022\016\016 rpm\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2095 ,stateUsed->lifeData.scooterDrehzahl);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2096 GFX_write_string(&FontT24, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2097 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2098 // data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2099 t9cY0free.WindowY0 -= 52;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2100 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2101 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2102 textSize = snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2103 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2104 "%0u" "\022\016\016 %%\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2105 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2106 "%0.0f\140" "\022\016\016 C\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2107 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2108 "%u" "\022\016\016 m/min\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2109 ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2110 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2111 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2112 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2113 textSize = snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2114 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2115 "%0u" "\022\016\016 %%\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2116 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2117 "%0.0f\140" "\022\016\016 Fht\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2118 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2119 "%u" "\022\016\016 ft/min\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2120 ,scooterResidualCapacity,scooterTemperatureLocal,scooterSpeedLocal);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2121 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2122 // connection active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2123 if(ageInMilliSeconds > 1500)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2124 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2125 for(int i=0; i < textSize -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2126 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2127 if(text[i] == '\030')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2128 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2129 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2130 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2131 // write data
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2132 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2133
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2134 // age stamp
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2135 if(ageInMilliSeconds < 9999)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2136 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2137 t9cY0free.WindowY0 -= 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2138 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2139 "\021\001%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2140 ,ageInMilliSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2141 GFX_write_string(&FontT24, &t9cY0free, text, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2142 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2143 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2146 void t9_scooter_May2016_01(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2147 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2148 float scooterTemperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2149 uint16_t scooterDrehzhl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2150 uint8_t scooterResidualCapacity;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2151 float scooterSpeed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2152 float scooterVoltage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2153 uint8_t scooterCurrent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2154 // uint16_t scooterWattHours;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2155 uint16_t bkpX0, bkpX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2157 uint16_t ageInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2158 uint8_t textSize;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2159 // old scooterStatus = bC_getData(0,&scooterTemperature,&scooterDrehzhl,&scooterResidualCapacity);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2161 scooterDrehzhl = stateUsed->lifeData.scooterDrehzahl;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2162 scooterTemperature = ((float)(stateUsed->lifeData.scooterTemperature)) / 10.0f;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2163 scooterResidualCapacity = stateUsed_scooterRemainingBattCapacity();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2164
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2165 scooterVoltage = stateUsed->lifeData.scooterSpannung;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2166 scooterCurrent = stateUsed->lifeData.scooterAmpere;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2167 // scooterWattHours = stateUsed->lifeData.scooterWattstunden;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2169 ageInMilliSeconds = stateUsed->lifeData.scooterAgeInMilliSeconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2170 if(!ageInMilliSeconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2171 ageInMilliSeconds = 9999;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2172
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2173 scooterSpeed = scooterDrehzhl * 80 / 3300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2174
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2175 char text[256+60];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2176
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2177 t9cY0free.WindowLineSpacing = (28 + 48 + 14)/2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2178 t9cY0free.WindowY0 = t9cH.WindowY0 - 5 - 5 * t9cY0free.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2179 t9cY0free.WindowNumberOfTextLines = 6;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2180
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2181 t9cY0free.WindowY0 -= 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2183 bkpX0 = t9cY0free.WindowX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2184 bkpX1 = t9cY0free.WindowX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2185 t9cY0free.WindowX0 = 430;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2187 textSize = snprintf(text,120,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2188 "\022\016\016"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2189 "%%"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2190 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2191 "celsius"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2192 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2193 "rpm"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2194 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2195 "m/min"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2196 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2197 "Ampere"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2198 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2199 "Volt"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2200 // "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2201 // "Wh"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2202 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2203 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2205 t9cY0free.WindowX0 = bkpX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2206 t9cY0free.WindowX1 = 420;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2207
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2208 textSize = snprintf(text,120,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2209 "\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2210 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2211 "%0u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2212 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2213 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2214 "%0.0f"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2215 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2216 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2217 "%0u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2218 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2219 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2220 "%0.0f"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2221 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2222 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2223 "%0u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2224 "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2225 "\002"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2226 "%0.1f"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2227 // "\n\r"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2228 // "%0u" "\022\016\016 Wh\017\030"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2229 ,scooterResidualCapacity,scooterTemperature,scooterDrehzhl,scooterSpeed
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2230 ,scooterCurrent,scooterVoltage);//,scooterWattHours);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2231
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2232 if((ageInMilliSeconds > 1500) || (stateUsed->lifeData.scooterType == 0xFF))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2233 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2234 for(int i=0; i < textSize -2; i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2235 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2236 if(text[i] == '\030')
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2237 text[i] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2238 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2239 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2240 GFX_write_string(&FontT42, &t9cY0free, text, 1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2241
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2242 t9cY0free.WindowX0 = bkpX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2243 t9cY0free.WindowX1 = bkpX1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2244
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2245 t9cY0free.WindowY0 -= 30;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2246 snprintf(text,60,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2247 "\021\001%u"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2248 ,ageInMilliSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2249 GFX_write_string(&FontT24, &t9cY0free, text, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2250
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2251 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2252
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2253
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2254 void t9_compass(uint16_t ActualHeading, uint16_t UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2255 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2256 uint16_t LeftBorderHeading, LineHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2257 uint32_t offsetPicture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2258 point_t start, stop, center;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2259 static int32_t LastHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2260 int32_t newHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2261 int32_t diff = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2262 int32_t diff2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2263
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2264 int32_t diffAbs = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2265 int32_t diffAbs2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2266
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2267 newHeading = ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2268
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2269 diff = newHeading - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2270
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2271 if(newHeading < LastHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2272 diff2 = newHeading + 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2273 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2274 diff2 = newHeading - 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2275
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2276 diffAbs = diff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2277 if(diffAbs < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2278 diffAbs *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2279
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2280 diffAbs2 = diff2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2281 if(diffAbs2 < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2282 diffAbs2 *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2283
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2284
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2285 if(diffAbs <= diffAbs2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2286 newHeading = LastHeading + (diff / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2287 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2288 newHeading = LastHeading + (diff2 / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2289
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2290 if(newHeading < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2291 newHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2292 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2293 if(newHeading >= 360)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2294 newHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2295
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2296 LastHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2297 ActualHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2298
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2299 if (ActualHeading < 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2300 ActualHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2301
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2302 LeftBorderHeading = 2 * (ActualHeading - (CUSTOMBOX_SPACE_INSIDE/4));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2303
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2304 offsetPicture = LeftBorderHeading * t9screenCompass.ImageHeight * 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2305
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2306 t9_background.pointer = t9screenCompass.FBStartAdress+offsetPicture;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2307 t9_background.x0 = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2308 t9_background.y0 = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2309 t9_background.width = CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2310 t9_background.height = t9screenCompass.ImageHeight;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2311
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2312 start.x = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET + (CUSTOMBOX_SPACE_INSIDE/2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2313 stop.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2314 start.y = 65;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2315 stop.y = start.y + 55;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2316 GFX_draw_line(&t9screen, start, stop, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2317
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2318
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2319 center.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2320 center.y = 300;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2321
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2322 stop.x = center.x + 44;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2323 stop.y = center.y + 24;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2324
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2325
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2326 while(ActualHeading > 359) ActualHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2327 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2328 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
2329 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2330 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2331 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
2332 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2333 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2334 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
2335 LineHeading += 90;
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(9,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2338
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2339 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2340 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2341 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2342 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
2343 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2344 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2345 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
2346 LineHeading += 90;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2347 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2348 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
2349 LineHeading += 90;
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(5,&t9screen, t9_compass_circle(1,LineHeading), t9_compass_circle(2,LineHeading), CLUT_Font031);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2352
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2353 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2354 LineHeading += 22;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2355 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2356 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
2357 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2358 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2359 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
2360 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2361 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2362 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
2363 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2364 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2365 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
2366 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2367 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2368 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
2369 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2370 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2371 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
2372 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2373 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2374 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
2375 LineHeading += 45;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2376 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2377 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
2378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2379 if(UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2380 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2381 LineHeading = UserSetHeading + 360 - 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 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
2384
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2385 // R�ckpeilung, User Back Heading
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2386 LineHeading = UserSetHeading + 360 + 180 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2387 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2388 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2389 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
2390 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2391
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2392 center.x = start.x;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2393 center.y = 250;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2394 GFX_draw_circle(&t9screen, center, 116, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2395 GFX_draw_circle(&t9screen, center, 118, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2396 GFX_draw_circle(&t9screen, center, 117, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2397 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2400 void init_t9_compass(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2401 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2402 t9screenCompass.FBStartAdress = getFrame(26);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2403
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2404 char text[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2405 uint8_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2406
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2407 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2408 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2409 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2410 text[textpointer++] = 76; // 90 - 14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2411 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2412 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2413 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2414 text[textpointer++] = 'E'; // 96 + 28 = 124 total
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2415 text[textpointer++] = '\017';
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++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2418 text[textpointer++] = 64; // 90 - 14 - 12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2419 text[textpointer++] = 'E'; // 124 + 74 + 23 = 221 total
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2420 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2421 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2422 text[textpointer++] = 66; // 90 - 11 - 13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2423 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2424 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2425 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2426 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2427 text[textpointer++] = '\017';
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++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2430 text[textpointer++] = 68; // 90 - 12 - 10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2431 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2432 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2433 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2434 text[textpointer++] = 64; // 90 - 10 - 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2435 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2436 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2437 text[textpointer++] = 'S';
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++] = '\017';
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++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2442 text[textpointer++] = 56; // 90 - 16 - 18
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2443 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2444 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2445 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2446 text[textpointer++] = 54; // 90 - 18 - 18
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2447 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2448 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2449 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2450 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2451 text[textpointer++] = '\017';
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++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2454 text[textpointer++] = 59; // 90 - 17 - 14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2455 text[textpointer++] = 'N';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2456 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2457 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2458 text[textpointer++] = 63; // 90 - 13 - 14
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2459 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2460 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2461 text[textpointer++] = 'N';
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++] = '\017';
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++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2466 text[textpointer++] = 64; // 90 - 14 - 12
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2467 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2468 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2469 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2470 text[textpointer++] = 66; // 90 - 11 - 13
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2471 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2472 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2473 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2474 text[textpointer++] = 'E';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2475 text[textpointer++] = '\017';
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++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2478 text[textpointer++] = 68; // 90 - 12 - 10
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2479 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2480 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2481 text[textpointer++] = '\177';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2482 text[textpointer++] = 64; // 90 - 10 - 16
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2483 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2484 text[textpointer++] = '\016';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2485 text[textpointer++] = 'S';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2486 text[textpointer++] = 'W';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2487 text[textpointer++] = '\017';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2488 text[textpointer++] = 0; // end
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2490 GFX_write_string(&FontT42,&t9pCompass,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2491
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2492 releaseAllFramesExcept(26,t9screenCompass.FBStartAdress);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2493 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2494
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2495
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2496 void t9_miniLiveLogProfile(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2497 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2498 SWindowGimpStyle wintemp;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2499 wintemp.left = CUSTOMBOX_LINE_LEFT + CUSTOMBOX_INSIDE_OFFSET;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2500 wintemp.right = wintemp.left + CUSTOMBOX_SPACE_INSIDE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2501 wintemp.top = 480 - t9l1.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2502 wintemp.bottom = wintemp. top + 200;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2503
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2504 uint16_t max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 10);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2505
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2506 GFX_graph_print(&t9screen, &wintemp, 0,1,0, max_depth, getMiniLiveLogbookPointerToData(), getMiniLiveLogbookActualDataLength(), CLUT_Font030, NULL);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2507 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2508