annotate Discovery/Src/t3.c @ 515:218ac999e96b

Added missing display of button labels in refresh function: Back, select and next were not shown on screen => added write call
author Ideenmodellierer
date Sun, 06 Sep 2020 21:09:37 +0200
parents 5185ade91096
children 0a09afac969f
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/t3.c
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 /// \brief Main Template file for dive mode special scree t3
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 10-Nov-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 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 /// $Id$
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ///////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 /// This program is free software: you can redistribute it and/or modify
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 /// it under the terms of the GNU General Public License as published by
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 /// the Free Software Foundation, either version 3 of the License, or
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 /// (at your option) any later version.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 /// This program is distributed in the hope that it will be useful,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 /// GNU General Public License for more details.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 ///
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 /// You should have received a copy of the GNU General Public License
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 //////////////////////////////////////////////////////////////////////////////
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 #include "t3.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 #include "data_exchange_main.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 #include "decom.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 #include "gfx_fonts.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 #include "math.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 #include "tHome.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 #include "timer.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 #include "unit.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39
237
ec16fd26e280 Bugfix: do not show NDL in bigscreen mode when zero
Jan Mulder <jlmulder@xs4all.nl>
parents: 214
diff changeset
40 //* Imported function prototypes ---------------------------------------------*/
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 /* Exported variables --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 const uint16_t BigFontSeperationLeftRight = 399;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 const uint16_t BigFontSeperationTopBottom = 240;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 GFX_DrawCfgScreen t3screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 GFX_DrawCfgWindow t3l1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 GFX_DrawCfgWindow t3r1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 GFX_DrawCfgWindow t3c1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53 GFX_DrawCfgWindow t3c2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 uint8_t t3_selection_customview = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57 /* TEM HAS TO MOVE TO GLOBAL--------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 #define TEXTSIZE 16
384
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
61 #define NUMBER_OF_VIEWS 7 /* number of views defined in the array below */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 const uint8_t t3_customviewsStandard[] =
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 CVIEW_T3_Decostop,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 CVIEW_sensors,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 CVIEW_Compass,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 CVIEW_T3_MaxDepth,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 CVIEW_T3_StopWatch,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 CVIEW_T3_TTS,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 CVIEW_T3_ppO2andGas,
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
72 CVIEW_T3_Navigation,
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
73 CVIEW_T3_DepthData,
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 CVIEW_T3_END
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77 /* Private function prototypes -----------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 void t3_refresh_divemode(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 uint8_t t3_test_customview_warnings(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 void t3_refresh_customview(float depth);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
82 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, point_t center, uint16_t ActualHeading, uint16_t UserSetHeading);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 void t3_init(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 {
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
88 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
89 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
90
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
91 t3_selection_customview = t3_customviewsStandard[0];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 t3screen.FBStartAdress = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94 t3screen.ImageHeight = 480;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 t3screen.ImageWidth = 800;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 t3screen.LayerIndex = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 t3l1.Image = &t3screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 t3l1.WindowNumberOfTextLines = 2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100 t3l1.WindowLineSpacing = 19; // Abstand von Y0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 t3l1.WindowTab = 100;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
102
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
103 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
104 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
105 t3l1.WindowX0 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
106 t3l1.WindowX1 = BigFontSeperationLeftRight - 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
107 t3l1.WindowY0 = BigFontSeperationTopBottom + 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
108 t3l1.WindowY1 = 479;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
109 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
110 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
111 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
112 t3l1.WindowX0 = 800 - BigFontSeperationLeftRight + 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
113 t3l1.WindowX1 = 799;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
114 t3l1.WindowY0 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
115 t3l1.WindowY1 = 479 - BigFontSeperationTopBottom + 5 ;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
116 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 t3r1.Image = &t3screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 t3r1.WindowNumberOfTextLines = t3l1.WindowNumberOfTextLines;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 t3r1.WindowLineSpacing = t3l1.WindowLineSpacing;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 t3r1.WindowTab = t3l1.WindowTab;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
122 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
123 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
124 t3r1.WindowX0 = BigFontSeperationLeftRight + 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
125 t3r1.WindowX1 = 799;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
126 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
127 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
128 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
129 t3r1.WindowX0 = 0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
130 t3r1.WindowX1 = BigFontSeperationLeftRight - 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
131 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
132
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 t3r1.WindowY0 = t3l1.WindowY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134 t3r1.WindowY1 = t3l1.WindowY1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 t3c1.Image = &t3screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 t3c1.WindowNumberOfTextLines = 2;
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
138 t3c1.WindowLineSpacing = 100;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 t3c1.WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140 t3c1.WindowX1 = 799;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
141 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
142 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
143 t3c1.WindowY0 = 5;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
144 t3c1.WindowY1 = BigFontSeperationTopBottom - 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
145 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
146 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
147 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
148 t3c1.WindowY0 = 480 - BigFontSeperationTopBottom + 5;
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
149 t3c1.WindowY1 = 479 - 5;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
150 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 t3c2.Image = &t3screen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 t3c2.WindowNumberOfTextLines = 3;
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
154 t3c2.WindowLineSpacing = t3c1.WindowLineSpacing ;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 t3c2.WindowX0 = 370;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156 t3c2.WindowX1 = 799;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
157 t3c2.WindowY0 = t3c1.WindowY0;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
158 t3c2.WindowY1 = t3c1.WindowY1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 t3c2.WindowTab = 600;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160 }
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 void t3_refresh(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 {
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
165 static uint8_t last_mode = MODE_SURFACE;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
166
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 SStateList status;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168 get_globalStateList(&status);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 if(stateUsed->mode != MODE_DIVE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 settingsGetPointer()->design = 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 if(status.base != BaseHome)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 return;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
179 if(last_mode != MODE_DIVE) /* Select customview */
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
180 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
181 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
182 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
183 t3_selection_customview = CVIEW_noneOrDebug;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
184 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
185 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
186 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
187 t3_selection_customview = settingsGetPointer()->tX_customViewPrimary;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
188 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
189 t3_change_customview(ACTION_END);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
190 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 t3screen.FBStartAdress = getFrame(24);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192 t3_refresh_divemode();
166
255eedad4155 cleanup: get rid of some compile warnings
Jan Mulder <jlmulder@xs4all.nl>
parents: 138
diff changeset
193 GFX_SetFramesTopBottom(t3screen.FBStartAdress, 0,480);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194 releaseAllFramesExcept(24,t3screen.FBStartAdress);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
195 last_mode = stateUsed->mode;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 float t3_basics_lines_depth_and_divetime(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 char text[512];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204 uint8_t color;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 uint8_t depthChangeRate;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206 uint8_t depthChangeAscent;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 point_t start, stop, startZeroLine;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
209 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
210 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
211
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 start.x = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 stop.x = 799;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 stop.y = start.y = BigFontSeperationTopBottom;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215 GFX_draw_line(tXscreen, start, stop, CLUT_Font020);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217 start.y = BigFontSeperationTopBottom;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 stop.y = 479;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
219
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 stop.x = start.x = BigFontSeperationLeftRight;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221 GFX_draw_line(tXscreen, start, stop, CLUT_Font020);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 /* depth */
174
ecb71521d004 Bugfix: make max depth move with current depth (part 2)
Jan Mulder <jlmulder@xs4all.nl>
parents: 166
diff changeset
224 float depth = unit_depth_float(stateUsed->lifeData.depth_meter);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 if(depth <= 0.3f)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 depth = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 if(settingsGetPointer()->nonMetricalSystem)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 snprintf(text,TEXTSIZE,"\032\f[feet]");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 GFX_write_string(&FontT42,tXl1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 if( ((mode == DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4 )))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 || ((mode != DIVEMODE_Apnea) && ((stateUsed->lifeData.ascent_rate_meter_per_min > 8) || (stateUsed->lifeData.ascent_rate_meter_per_min < -10)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 )
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239 snprintf(text,TEXTSIZE,"\f\002%.0f %c%c/min "
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 , unit_depth_float(stateUsed->lifeData.ascent_rate_meter_per_min)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 , unit_depth_char1()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 , unit_depth_char2()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 GFX_write_string(&FontT42,tXl1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 if( depth < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 snprintf(text,TEXTSIZE,"\020\003\016%01.0f",depth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 t3_basics_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 GFX_write_string(&FontT105,tXl1,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256 /* ascentrate graph */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 if(mode == DIVEMODE_Apnea)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 /* ascentrate graph - apnea mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 depthChangeAscent = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 if(stateUsed->lifeData.ascent_rate_meter_per_min < 200)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 depthChangeRate = (uint8_t)stateUsed->lifeData.ascent_rate_meter_per_min;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 depthChangeRate = 200;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 depthChangeAscent = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 if(stateUsed->lifeData.ascent_rate_meter_per_min > -200)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272 depthChangeRate = (uint8_t)(0 - stateUsed->lifeData.ascent_rate_meter_per_min);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 depthChangeRate = 200;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 }
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
276
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
277 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
278 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
279 start.y = tXl1->WindowY0 - 1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
280 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
281 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
282 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
283 start.y = tXl1->WindowY1 + 1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
284 }
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
285 startZeroLine.y = start.y;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 for(int i = 0; i<5;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 start.y += 40;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 stop.y = start.y;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
290 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
291 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
292 start.x = tXl1->WindowX1 - 1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
293 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
294 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
295 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
296 start.x = tXr1->WindowX1 - 1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
297 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 stop.x = start.x - 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 if(depthChangeRate <= 6)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302 if(i == 2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 startZeroLine.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 stop.x = start.x - 34;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 if(((i == 1) && depthChangeAscent) || ((i == 3) && !depthChangeAscent))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312 startZeroLine.y = start.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 stop.x = start.x - 34;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316 GFX_draw_line(tXscreen, start, stop, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 // new thick bar design Sept. 2015
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 if((stateUsed->lifeData.ascent_rate_meter_per_min > 4) || (stateUsed->lifeData.ascent_rate_meter_per_min < -4))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 start.y = startZeroLine.y;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322 if(depthChangeAscent)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 color = CLUT_EverythingOkayGreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 start.y += 7; // starte etwas weiter oben
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326 stop.y = start.y + (uint16_t)(depthChangeRate * 4) - 9; // - x; // wegen der Liniendicke
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 if(stop.y > 475)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 stop.y = 475;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332 color = CLUT_Font023;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 start.y -= 7;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 stop.y = start.y - (uint16_t)(depthChangeRate * 4) + 9;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 if(stop.y <= tXl1->WindowY0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336 stop.y = tXl1->WindowY0 + 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 }
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
338 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
339 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
340 start.x = tXl1->WindowX1 - 3 - 5;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
341 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
342 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
343 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
344 start.x = tXr1->WindowX1 - 3 - 5;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
345 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
346
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
347 stop.x = start.x;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 GFX_draw_thick_line(12,tXscreen, start, stop, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353 /* ascentrate graph -standard mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 if(stateUsed->lifeData.ascent_rate_meter_per_min > 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 {
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
356 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
357 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
358 start.y = tXl1->WindowY0 - 1;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
359 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
360 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
361 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
362 start.y = tXl1->WindowY1 + 1;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
363 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
364
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 for(int i = 0; i<4;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367 start.y += 5*8;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 stop.y = start.y;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
369 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
370 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
371 start.x = tXl1->WindowX1 - 1;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
372 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
373 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
374 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
375 start.x = tXr1->WindowX1 - 1;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
376 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377 stop.x = start.x - 17;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378 GFX_draw_line(tXscreen, start, stop, 0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 // new thick bar design Sept. 2015
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
381 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
382 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
383 start.x = tXl1->WindowX1 - 3 - 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
384 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
385 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
386 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
387 start.x = tXr1->WindowX1 - 3 - 5;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
388 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
389
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 stop.x = start.x;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
391 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
392 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
393 start.y = tXl1->WindowY0 - 1;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
394 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
395 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
396 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
397 start.y = tXl1->WindowY1 + 1;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
398 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
399
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 stop.y = start.y + (uint16_t)(stateUsed->lifeData.ascent_rate_meter_per_min * 8);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 stop.y -= 3; // wegen der Liniendicke von 12 anstelle von 9
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 if(stop.y >= 470)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 stop.y = 470;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 start.y += 7; // starte etwas weiter oben
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 color = CLUT_EverythingOkayGreen;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 if(stateUsed->lifeData.ascent_rate_meter_per_min <= 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 color = CLUT_WarningYellow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 color = CLUT_WarningRed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 GFX_draw_thick_line(12,tXscreen, start, stop, color);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 // divetime
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 if(mode == DIVEMODE_Apnea)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420 if(stateUsed->lifeData.counterSecondsShallowDepth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 SDivetime SurfaceBreakTime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424 SurfaceBreakTime.Total = stateUsed->lifeData.counterSecondsShallowDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 SurfaceBreakTime.Minutes = SurfaceBreakTime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 SurfaceBreakTime.Seconds = SurfaceBreakTime.Total - (SurfaceBreakTime.Minutes * 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 snprintf(text,TEXTSIZE,"\032\f\002%c%c", TXT_2BYTE,TXT2BYTE_ApneaSurface);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 GFX_write_string(&FontT42,tXr1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",SurfaceBreakTime.Minutes, SurfaceBreakTime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 SDivetime Divetime = {0,0,0, 0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 Divetime.Total = stateUsed->lifeData.dive_time_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 Divetime.Minutes = Divetime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 GFX_write_string(&FontT42,tXr1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 if(Divetime.Minutes < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447 snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 SDivetime Divetime = {0,0,0, 0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 Divetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 Divetime.Minutes = Divetime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456 Divetime.Seconds = Divetime.Total - ( Divetime.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 snprintf(text,TEXTSIZE,"\032\f\002%c",TXT_Divetime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 GFX_write_string(&FontT42,tXr1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 if(Divetime.Minutes < 100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 snprintf(text,TEXTSIZE,"\020\003\016\002%u:%02u",Divetime.Minutes, Divetime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 snprintf(text,TEXTSIZE,"\020\003\016\002%u'",Divetime.Minutes);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466 t3_basics_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 GFX_write_string(&FontT105,tXr1,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 return depth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470 }
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 void t3_refresh_divemode(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 uint8_t customview_warnings = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 float depth_meter = 0.0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 // everything like lines, depth, ascent graph and divetime
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 depth_meter = t3_basics_lines_depth_and_divetime(&t3screen, &t3l1, &t3r1, 0); // 0 could be stateUsed->diveSettings.diveMode for CCR specials
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 // customview
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482 if(stateUsed->warnings.numWarnings)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 customview_warnings = t3_test_customview_warnings();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 if(customview_warnings && warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486 t3_basics_show_customview_warnings(&t3c1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 t3_refresh_customview(depth_meter);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 if(stateUsed->warnings.lowBattery)
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
491 t3_basics_battery_low_customview_extra(&t3r1); //t3c1);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 void t3_basics_battery_low_customview_extra(GFX_DrawCfgWindow* tXc1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497 char TextC1[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
499 TextC1[0] = ' ';//'\002';
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 TextC1[1] = '\f';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501 TextC1[2] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 TextC1[3] = '3';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 TextC1[4] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 TextC1[5] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 TextC1[6] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 TextC1[7] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 TextC1[8] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 TextC1[9] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 TextC1[10] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 TextC1[11] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511 TextC1[12] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 TextC1[13] = '1';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 TextC1[14] = '0';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 TextC1[15] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 if(!warning_count_high_time)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 TextC1[4] = '2';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519 GFX_write_string(&Batt24,tXc1,TextC1,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521
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 void t3_refresh_customview(float depth)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 {
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
526 #if 0
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 if((t3_selection_customview == CVIEW_sensors) &&(stateUsed->diveSettings.ccrOption == 0))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 t3_change_customview();
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
529 #endif
272
74a8296a2318 cleanup: simplify stateUsed usage
Jan Mulder <jlmulder@xs4all.nl>
parents: 237
diff changeset
530 t3_basics_refresh_customview(depth, t3_selection_customview, &t3screen, &t3c1, &t3c2, stateUsedWrite->diveSettings.diveMode);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 }
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 void t3_basics_refresh_apnoeRight(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 char text[512];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 uint16_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 // CVIEW_T3_Temperature
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 float temperature;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
541 SSettings* pSettings;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
542 pSettings = settingsGetPointer();
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 SDivetime TotalDivetime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 SDivetime LastDivetime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 uint16_t tempWinX0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
548 uint16_t tempWinX1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549 uint16_t tempWinY0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
550 uint16_t tempWinY1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 tempWinX0 = tXc1->WindowX0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
553 tempWinX1 = tXc1->WindowX1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 tempWinY0 = tXc1->WindowY0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
555 tempWinY1 = tXc1->WindowY1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 tXc1->WindowX0 = 440; // rechte Seite
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 switch(tX_selection_customview)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561 case CVIEW_T3_Temperature:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564
189
8b8074080d7b Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents: 174
diff changeset
565 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 textpointer = snprintf(text,TEXTSIZE,"\020\003\016%01.0f\016\016\140",temperature); // "\016\016%01.1f `" + C or F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 t3_basics_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 GFX_write_string(&FontT105,tXc1,text,1);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576 case CVIEW_T3_ApnoeSurfaceInfo:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Divetime);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 TotalDivetime.Total = stateUsed->lifeData.dive_time_seconds_without_surface_time;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 TotalDivetime.Minutes = TotalDivetime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 TotalDivetime.Seconds = TotalDivetime.Total - ( TotalDivetime.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 LastDivetime.Total = stateUsed->lifeData.apnea_last_dive_time_seconds;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 LastDivetime.Minutes = LastDivetime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 LastDivetime.Seconds = LastDivetime.Total - ( LastDivetime.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
588 // tXc1->WindowY0 = 100; // obere Zeile
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
589 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
590 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
591 tXc1->WindowY0 = 100;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
592 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
593 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
594 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
595 tXc1->WindowY1 -= 100; /* jump to upper of two lines */
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
596 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 snprintf(text,TEXTSIZE,"\020\016%u:%02u",LastDivetime.Minutes, LastDivetime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599 t3_basics_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 GFX_write_string(&FontT105,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
602 if(pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
603 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
604 tXc1->WindowX0 = 0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
605
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
606 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaLast);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
610 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
611 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
612 tXc1->WindowY0 = tempWinY0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
613 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
614 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
615 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
616 tXc1->WindowX1 = tempWinX1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
617 tXc1->WindowY1 = tempWinY1; /* jump to upper of two lines */
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
618 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 snprintf(text,TEXTSIZE,"\020\016%u:%02u",TotalDivetime.Minutes, TotalDivetime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 t3_basics_colorscheme_mod(text);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 GFX_write_string(&FontT105,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 snprintf(text,TEXTSIZE,"\032\002%c%c",TXT_2BYTE, TXT2BYTE_ApneaTotal);
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
625 if(pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
626 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
627 tXc1->WindowX0 = 0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
628
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
629 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 tXc1->WindowX0 = tempWinX0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
635 tXc1->WindowX1 = tempWinX1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 tXc1->WindowY0 = tempWinY0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 void t3_basics_refresh_customview(float depth, uint8_t tX_selection_customview, GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXc1, GFX_DrawCfgWindow* tXc2, uint8_t mode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 char text[512];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 uint16_t textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
646 SSettings* pSettings;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
647 pSettings = settingsGetPointer();
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
648
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 // CVIEW_T3_Decostop and CVIEW_T3_TTS
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 const SDecoinfo * pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 pDecoinfo = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 pDecoinfo = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 // CVIEW_T3_Decostop
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 uint16_t nextstopLengthSeconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658 uint8_t nextstopDepthMeter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 SDivetime SafetyStopTime = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 // CVIEW_T3_ppO2andGas
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662 uint8_t oxygen_percentage = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 // CVIEW_T3_Temperature
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 float temperature;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667 // CVIEW_T3_GasList
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 float fPpO2limitHigh, fPpO2limitLow, fPpO2ofGasAtThisDepth;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 const SGasLine * pGasLine;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 uint8_t oxygen, helium;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671 uint8_t lineNumber;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
673 /* compass position */
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
674 point_t center;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
675
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676 // CVIEW_T3_StopWatch
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 SDivetime Stopwatch = {0,0,0,0};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 float fAverageDepth, fAverageDepthAbsolute;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680 uint16_t tempWinX0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
681 uint16_t tempWinX1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 uint16_t tempWinY0;
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
683 uint16_t tempWinY1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 uint16_t tempWinC2X0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
685 uint16_t tempWinC2Y0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
686 uint16_t tempWinC2X1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
687 uint16_t tempWinC2Y1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 uint16_t tempWinC2Tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 tempWinX0 = tXc1->WindowX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 tempWinY0 = tXc1->WindowY0;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
692 tempWinX1 = tXc1->WindowX1;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
693 tempWinY1 = tXc1->WindowY1;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
694
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 tempWinC2X0 = tXc2->WindowX0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
696 tempWinC2Y0 = tXc2->WindowY0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
697 tempWinC2X1 = tXc2->WindowX1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
698 tempWinC2Y1 = tXc2->WindowY1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 tempWinC2Tab = tXc2->WindowTab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 switch(tX_selection_customview)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703 case CVIEW_T3_ApnoeSurfaceInfo:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
706 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
707 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
708 GFX_write_string(&FontT42,tXc1,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
709 tXc1->WindowY0 = 100;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
710 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
711 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
712 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
713 GFX_write_string(&FontT42,tXc2,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
714 tXc2->WindowY1 -= 100; /* jump to upper of two lines */
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
715 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_last_max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718 t3_basics_colorscheme_mod(text);
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
719
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
720 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
721 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
722 GFX_write_string(&FontT105,tXc1,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
723 tXc1->WindowY0 = tempWinY0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
724 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
725 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
726 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
727 GFX_write_string(&FontT105,tXc2,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
728 tXc2->WindowY1 = tempWinC2Y1; /* jump to upper of two lines */
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
729 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 snprintf(text,TEXTSIZE,"\020\016%01.1f",unit_depth_float(stateUsed->lifeData.apnea_total_max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733 t3_basics_colorscheme_mod(text);
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
734 if(!pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
735 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
736 GFX_write_string(&FontT105,tXc1,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
737 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
738 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
739 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
740 GFX_write_string(&FontT105,tXc2,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
741 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 case CVIEW_T3_StopWatch:
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
745
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 Stopwatch.Total = timer_Stopwatch_GetTime();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 Stopwatch.Minutes = Stopwatch.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 );
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 snprintf(text,TEXTSIZE,"\032\f%c",TXT_AvgDepth);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 snprintf(text,TEXTSIZE,"\030\003\016%01.1f",unit_depth_float(fAverageDepthAbsolute));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 GFX_write_string(&FontT105,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
757 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
758 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
759 tXc1->WindowX0 = 480;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
760 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
761 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
762 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
763 tXc1->WindowX1 = 320;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
764 tXc1->WindowY0 = t3c1.WindowY0; /* select customer window */
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
765 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 // snprintf(text,TEXTSIZE,"\032\f%c%c - %c",TXT_2BYTE, TXT2BYTE_Clock, TXT_AvgDepth);
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
767
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 snprintf(text,TEXTSIZE,"\032\f%c", TXT_Stopwatch);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 snprintf(text,TEXTSIZE,"\030\016%01.1f",unit_depth_float(fAverageDepth));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771 GFX_write_string(&FontT105,tXc1,text,0);
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
772 if(!pSettings->FlipDisplay)
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
773 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
774 tXc1->WindowY0 = 100;
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
775 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
776 else
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
777 {
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
778 tXc1->WindowY1 -= 100; /* jump to upper of two lines */
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
779 }
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
780
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 snprintf(text,TEXTSIZE,"\030%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782 GFX_write_string(&FontT105,tXc1,text,0);
110
cc8e24374b83 Added option to handled mirrored display to existing functions
Ideenmodellierer
parents: 38
diff changeset
783
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
784 break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786 case CVIEW_T3_GasList:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Gaslist);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 tXc2->WindowX0 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792 tXc2->WindowTab = 800/2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
794 if(pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
795 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
796 tXc2->WindowY1 = 0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
797 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
798
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 pGasLine = settingsGetPointer()->gas;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 if(actualLeftMaxDepth(stateUsed))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_deco) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 fPpO2limitHigh = (float)(settingsGetPointer()->ppO2_max_std) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 fPpO2limitLow = (float)(settingsGetPointer()->ppO2_min) / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 for(int gasId=1;gasId<=NUM_GASES;gasId++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 lineNumber = gasId;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 if(gasId > 3)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 lineNumber = gasId - 3;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814 fPpO2ofGasAtThisDepth = (stateUsed->lifeData.pressure_ambient_bar - WATER_VAPOUR_PRESSURE) * pGasLine[gasId].oxygen_percentage / 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 if(pGasLine[gasId].note.ub.active == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816 strcpy(&text[textpointer++],"\021");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 else if((fPpO2ofGasAtThisDepth > fPpO2limitHigh) || (fPpO2ofGasAtThisDepth < fPpO2limitLow))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
818 strcpy(&text[textpointer++],"\025");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
819 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
820 strcpy(&text[textpointer++],"\030");
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
821
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
822 text[textpointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
823 oxygen = pGasLine[gasId].oxygen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
824 helium = pGasLine[gasId].helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
825 textpointer += write_gas(&text[textpointer], oxygen, helium);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
826 GFX_write_string(&FontT42, tXc2, text, lineNumber);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
827 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
828 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
829
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
830 case CVIEW_T3_Temperature:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
831 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Temperature);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
832 GFX_write_string(&FontT42,tXc1,text,0);
189
8b8074080d7b Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents: 174
diff changeset
833
8b8074080d7b Bugfix: average temperature on arrival from RTE instead of display time
Jan Mulder <jlmulder@xs4all.nl>
parents: 174
diff changeset
834 temperature = unit_temperature_float(stateUsed->lifeData.temperature_celsius);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
835 textpointer = snprintf(text,TEXTSIZE,"\030\003\016%01.1f \140",temperature); // "\016\016%01.1f `" + C or F
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
836 if(settingsGetPointer()->nonMetricalSystem == 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
837 text[textpointer++] = 'C';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
838 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
839 text[textpointer++] = 'F';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
840 text[textpointer++] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
841 GFX_write_string(&FontT105,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
842 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
843
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
844 case CVIEW_Compass:
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
845 center.x = 600;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
846 center.y = 116;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
847 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
848 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
849 snprintf(text,100,"\030\003%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
850 GFX_write_string(&FontT105,tXc1,text,0);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
851 t3_basics_compass(tXscreen, center, (uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
852 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
853
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
854 case CVIEW_T3_Decostop:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
855 default:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
856 // decostop
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
857 if(pDecoinfo->output_time_to_surface_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
858 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
859 tHome_findNextStop(pDecoinfo->output_stop_length_seconds, &nextstopDepthMeter, &nextstopLengthSeconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
860 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
861 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
862 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
863 nextstopDepthMeter = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
864 nextstopLengthSeconds = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
865 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
866
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
867 SafetyStopTime.Total = timer_Safetystop_GetCountDown();
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
868 SafetyStopTime.Minutes = SafetyStopTime.Total / 60;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
869 SafetyStopTime.Seconds = SafetyStopTime.Total - (SafetyStopTime.Minutes * 60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
870
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
871 if(nextstopDepthMeter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
872 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
873 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Decostop);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
874 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
875
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
876 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
877 snprintf(&text[textpointer],TEXTSIZE,"\020\003%u%c%c %u'"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
878 , unit_depth_integer(nextstopDepthMeter)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
879 , unit_depth_char1_T105()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
880 , unit_depth_char2_T105()
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
881 , (nextstopLengthSeconds+59)/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
882 // old without feet hw 170703 snprintf(&text[textpointer],TEXTSIZE,"\020\003%um %u'",nextstopDepthMeter,(nextstopLengthSeconds+59)/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
883 t3_basics_colorscheme_mod(text);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
884 GFX_write_string(&FontT105,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
885 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
886 else if(SafetyStopTime.Total && (depth > timer_Safetystop_GetDepthUpperLimit()))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
887 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
888 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
889 snprintf(&text[textpointer],TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_SafetyStop2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
890 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
891
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
892 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
893 snprintf(&text[textpointer],TEXTSIZE,"\020\003\016%u:%02u",SafetyStopTime.Minutes,SafetyStopTime.Seconds);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
894 t3_basics_colorscheme_mod(text);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
895 GFX_write_string(&FontT105,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
896 }
237
ec16fd26e280 Bugfix: do not show NDL in bigscreen mode when zero
Jan Mulder <jlmulder@xs4all.nl>
parents: 214
diff changeset
897 else if(pDecoinfo->output_ndl_seconds) // NDL
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
898 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
899 snprintf(text,TEXTSIZE,"\032\f%c",TXT_Nullzeit);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
900 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
901 if(pDecoinfo->output_ndl_seconds < 1000 * 60)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
902 snprintf(text,TEXTSIZE,"\020\003%i'",pDecoinfo->output_ndl_seconds/60);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
903 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
904 snprintf(text,TEXTSIZE,"\020\003%ih",pDecoinfo->output_ndl_seconds/3600);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
905 t3_basics_colorscheme_mod(text);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
906 GFX_write_string(&FontT105,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
907 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
908 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
909
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
910 case CVIEW_sensors:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
911 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE,TXT2BYTE_O2monitor);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
912 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
913
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
914 for(int i=0;i<3;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
915 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
916 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
917 text[textpointer++] = '\030';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
918 if(i==1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
919 text[textpointer++] = '\001';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
920 else if(i==2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
921 text[textpointer++] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
922 if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<<i))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
923 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
924 text[textpointer++] = '\031';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
925 text[textpointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
926 text[textpointer++] = '-';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
927 text[textpointer++] = ' ';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
928 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
929 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
930 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
931 if(stateUsed->warnings.sensorOutOfBounds[i])
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
932 text[textpointer++] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
933 textpointer += snprintf(&text[textpointer],TEXTSIZE,"%.1f",stateUsed->lifeData.ppO2Sensor_bar[i]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
934 }
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
935 GFX_write_string(&FontT144,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
936 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
937 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
938
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
939 case CVIEW_T3_MaxDepth:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
940 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
941 if(pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
942 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
943 if(mode == DIVEMODE_Apnea)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
944 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
945 GFX_write_string(&FontT42,tXc2,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
946 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
947 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
948 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
949 GFX_write_string(&FontT42,tXc1,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
950 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
951 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
952 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
953 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
954 GFX_write_string(&FontT42,tXc1,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
955 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
956 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
957 t3_basics_colorscheme_mod(text);
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
958 if(pSettings->FlipDisplay)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
959 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
960 if(mode == DIVEMODE_Apnea)
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
961 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
962 GFX_write_string(&FontT105,tXc2,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
963 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
964 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
965 {
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
966 GFX_write_string(&FontT105,tXc1,text,0);
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
967 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
968 }
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
969 else
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
970 {
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
971 GFX_write_string(&FontT105,tXc1,text,0);
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
972 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
973 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
974
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
975 case CVIEW_T3_TTS:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
976 snprintf(text,TEXTSIZE,"\032\f%c",TXT_TTS);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
977 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
978 if(pDecoinfo->output_time_to_surface_seconds)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
979 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
980 if(pDecoinfo->output_time_to_surface_seconds < 1000 * 60)
214
51a3aeffc6b3 Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents: 189
diff changeset
981 snprintf(text,TEXTSIZE,"\020\003\002%i'",(pDecoinfo->output_time_to_surface_seconds + 59)/ 60);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
982 else
214
51a3aeffc6b3 Bugfix: handle rounding of TTS and future TTS consistently
Jan Mulder <jlmulder@xs4all.nl>
parents: 189
diff changeset
983 snprintf(text,TEXTSIZE,"\020\003\002%ih",(pDecoinfo->output_time_to_surface_seconds + 59)/ 3600);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
984 t3_basics_colorscheme_mod(text);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
985 GFX_write_string(&FontT105,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
986 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
987 break;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
988
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
989 case CVIEW_T3_ppO2andGas:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
990 snprintf(text,TEXTSIZE,"\032\f%c",TXT_ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
991 GFX_write_string(&FontT42,tXc1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
992 snprintf(text,TEXTSIZE,"\020\003%01.2f",stateUsed->lifeData.ppO2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
993 t3_basics_colorscheme_mod(text);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
994 GFX_write_string(&FontT105,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
995
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
996 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
997 text[textpointer++] = '\020';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
998 text[textpointer++] = '\003';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
999 oxygen_percentage = 100;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1000 oxygen_percentage -= stateUsed->lifeData.actualGas.nitrogen_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1001 oxygen_percentage -= stateUsed->lifeData.actualGas.helium_percentage;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1002 text[textpointer++] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1003 tHome_gas_writer(oxygen_percentage,stateUsed->lifeData.actualGas.helium_percentage,&text[textpointer]);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1004 //textpointer = snprintf(&text[textpointer],TEXTSIZE,"\020\002%02u/%02u",oxygen_percentage, stateUsed->lifeData.actualGas.helium_percentage);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1005 t3_basics_colorscheme_mod(text);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1006 GFX_write_string(&FontT48,tXc1,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1007 break;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1008
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1009 case CVIEW_T3_Navigation:
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1010 Stopwatch.Total = timer_Stopwatch_GetTime();
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1011 Stopwatch.Minutes = Stopwatch.Total / 60;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1012 Stopwatch.Seconds = Stopwatch.Total - ( Stopwatch.Minutes * 60 );
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1013 fAverageDepth = timer_Stopwatch_GetAvarageDepth_Meter();
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1014
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1015 if(!pSettings->FlipDisplay)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1016 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1017 tXc2->WindowX0 = 550;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1018 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1019 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1020 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1021 tXc2->WindowX1 = 800;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1022 tXc2->WindowY0 = t3c2.WindowY0; /* select customer window */
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1023 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1024
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1025 snprintf(text,TEXTSIZE,"\032\002\f%c", TXT_Stopwatch);
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1026 GFX_write_string(&FontT42,tXc1,text,0);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1027 snprintf(text,TEXTSIZE,"\030\016\002%01.1f",unit_depth_float(fAverageDepth));
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1028 GFX_write_string(&FontT105,tXc1,text,0);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1029 if(!pSettings->FlipDisplay)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1030 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1031 tXc2->WindowY0 = 100;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1032 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1033 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1034 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1035 tXc2->WindowY1 -= 100; /* jump to upper of two lines */
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1036 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1037
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1038 snprintf(text,TEXTSIZE,"\030\002%u:\016\016%02u",Stopwatch.Minutes, Stopwatch.Seconds);
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1039 GFX_write_string(&FontT105,tXc1,text,1);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1040
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1041
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1042 center.x = 400;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1043 center.y = 116;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1044
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1045 snprintf(text,TEXTSIZE,"\032\f%c%c",TXT_2BYTE, TXT2BYTE_Compass);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1046 GFX_write_string(&FontT42,tXc1,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1047 //snprintf(text,100,"\030\003%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1048 snprintf(text,100,"\030%03i`",(uint16_t)stateUsed->lifeData.compass_heading);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1049 GFX_write_string(&FontT144,tXc1,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1050 t3_basics_compass(tXscreen, center, (uint16_t)stateUsed->lifeData.compass_heading, stateUsed->diveSettings.compassHeading);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1051
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1052 break;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1053
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1054 case CVIEW_T3_DepthData:
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1055 snprintf(text,TEXTSIZE,"\032\f%c",TXT_MaxDepth);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1056 if(pSettings->FlipDisplay)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1057 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1058 if(mode == DIVEMODE_Apnea)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1059 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1060 GFX_write_string(&FontT42,tXc2,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1061 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1062 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1063 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1064 GFX_write_string(&FontT42,tXc1,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1065 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1066 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1067 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1068 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1069 GFX_write_string(&FontT42,tXc1,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1070 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1071 snprintf(text,TEXTSIZE,"\020\003\016%01.1f",unit_depth_float(stateUsed->lifeData.max_depth_meter));
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1072 t3_basics_colorscheme_mod(text);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1073 if(pSettings->FlipDisplay)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1074 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1075 if(mode == DIVEMODE_Apnea)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1076 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1077 GFX_write_string(&FontT105,tXc2,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1078 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1079 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1080 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1081 GFX_write_string(&FontT105,tXc1,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1082 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1083 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1084 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1085 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1086 GFX_write_string(&FontT105,tXc1,text,0);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1087 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1088 fAverageDepthAbsolute = stateUsed->lifeData.average_depth_meter;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1089 snprintf(text,TEXTSIZE,"\032\002\f%c",TXT_AvgDepth);
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1090 GFX_write_string(&FontT42,tXc1,text,0);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1091
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1092 snprintf(text,TEXTSIZE,"\020\003\016\002\%01.1f",unit_depth_float(fAverageDepthAbsolute));
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1093 GFX_write_string(&FontT105,tXc1,text,0);
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1094 break;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1095 }
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1096
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1097
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1098
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1099 tXc1->WindowX0 = tempWinX0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1100 tXc1->WindowY0 = tempWinY0;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1101 tXc1->WindowX1 = tempWinX1;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1102 tXc1->WindowY1 = tempWinY1;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
1103
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1104 tXc2->WindowX0 = tempWinC2X0;
413
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
1105 tXc2->WindowY0 = tempWinC2Y0;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
1106 tXc2->WindowX1 = tempWinC2X1;
65c7b009136f Bugfix Flipdisplay Gauge and Apnoe mode:
ideenmodellierer
parents: 386
diff changeset
1107 tXc2->WindowY1 = tempWinC2Y1;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1108 tXc2->WindowTab = tempWinC2Tab;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1109 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1110
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1111
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1112 uint8_t t3_test_customview_warnings(void)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1113 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1114 uint8_t count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1115
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1116 count = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1117 count += stateUsed->warnings.decoMissed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1118 count += stateUsed->warnings.ppO2Low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1119 count += stateUsed->warnings.ppO2High;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1120 //count += stateUsed->warnings.lowBattery;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1121 count += stateUsed->warnings.sensorLinkLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1122 count += stateUsed->warnings.fallback;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1123
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1124 return count;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1125 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1126
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1127 //void t3_show_customview_warnings(GFX_DrawCfgScreen *tXscreen, GFX_DrawCfgWindow* tXl1, GFX_DrawCfgWindow* tXr1, uint8_t mode)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1128 void t3_basics_show_customview_warnings(GFX_DrawCfgWindow* tXc1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1129 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1130 char text[256], textMain[256];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1131 uint8_t textpointer, textpointerMain, lineFree, more;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1132
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1133 snprintf(text,TEXTSIZE,"\025\f%c",TXT_Warning);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1134 GFX_write_string(&FontT42,&t3c1,text,0);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1135
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1136 lineFree = 1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1137 more = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1138
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1139 textpointerMain = 0;
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1140 textMain[textpointerMain++] = '\025'; /* red */
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1141 textMain[textpointerMain++] = '\003'; /* doublesize */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1142
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1143 textpointer = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1144
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1145 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1146 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1147 text[textpointer++] = TXT2BYTE_WarnDecoMissed;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1148 if(stateUsed->warnings.decoMissed)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1149 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1150 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1151 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1152 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1153 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1154 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1155 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1156 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1157 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1158 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1159 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1160 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1161 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1162 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1163
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1164 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1165 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1166 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1167 text[textpointer++] = TXT2BYTE_WarnPPO2Low;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1168 if(stateUsed->warnings.ppO2Low)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1169 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1170 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1171 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1172 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1173 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1174 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1175 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1176 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1177 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1178 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1179 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1180 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1181 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1182 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1183
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1184 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1185 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1186 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1187 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1188 text[textpointer++] = TXT2BYTE_WarnPPO2High;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1189 if(stateUsed->warnings.ppO2High)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1190 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1191 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1192 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1193 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1194 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1195 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1196 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1197 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1198 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1199 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1200 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1201 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1202 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1203 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1205 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1206 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1207 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1208 text[textpointer++] = TXT2BYTE_WarnFallback;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1209 if(stateUsed->warnings.fallback)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1210 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1211 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1212 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1213 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1214 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1215 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1216 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1217 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1218 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1219 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1220 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1221 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1222 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1223 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1224
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1225 text[textpointer++] = '\n';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1226 text[textpointer++] = '\r';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1227 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1228 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1229 text[textpointer++] = TXT2BYTE_WarnSensorLinkLost;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1230 if(stateUsed->warnings.sensorLinkLost)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1231 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1232 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1233 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1234 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1235 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1236 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1237 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1238 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1239 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1240 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1241 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1242 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1243 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1244 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1245
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1246 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1247 text[textpointer++] = '\t';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1248 text[textpointer++] = '\021';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1249 text[textpointer++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1250 text[textpointer++] = TXT2BYTE_WarnBatteryLow;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1251 if(stateUsed->warnings.lowBattery)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1252 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1253 text[textpointer - 3] = '\025';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1254 if(lineFree)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1255 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1256 textMain[textpointerMain++] = TXT_2BYTE;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1257 textMain[textpointerMain++] = text[textpointer - 1];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1258 textMain[textpointerMain] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1259 lineFree--;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1260 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1261 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1262 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1263 more++;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1264 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1265 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1266 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1267 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1268 /*
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1269 if(more)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1270 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1271 text[textpointer++] = '\002';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1272 text[textpointer++] = '+';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1273 if(more < 10)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1274 text[textpointer++] = '0' + more;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1275 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1276 text[textpointer++] = 'X';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1277 text[textpointer] = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1278 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1279 */
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1280 GFX_write_string(&FontT48,&t3c1,textMain,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1281 if(more)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1282 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1283 GFX_write_string(&FontT48,&t3c2,text,0);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1284 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1285 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1286
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1287 uint8_t t3_customview_disabled(uint8_t view)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1288 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1289 uint8_t i = 0;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1290 uint8_t cv_disabled = 0;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1291 const uint8_t *pcv_changelist;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1292 uint32_t cv_config = settingsGetPointer()->cv_config_BigScreen;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1293
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1294 pcv_changelist = cv_changelist_BS;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1295
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1296 while(pcv_changelist[i] != CVIEW_T3_END)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1297 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1298 if((view == pcv_changelist[i]) && !CHECK_BIT_THOME(cv_config, pcv_changelist[i]))
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1299 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1300 cv_disabled = 1;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1301 break;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1302 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1303 i++;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1304 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1305
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1306 if (((view == CVIEW_sensors) || (view == CVIEW_sensors_mV)) &&
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1307 ((stateUsed->diveSettings.ppo2sensors_deactivated) || (stateUsed->diveSettings.ccrOption == 0)))
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1308 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1309 cv_disabled = 1;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1310 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1311
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1312 return cv_disabled;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1313 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1314
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1315 void t3_change_customview(uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1316 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1317
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1318 t3_basics_change_customview(&t3_selection_customview, t3_customviewsStandard, action);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1319 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1320
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1321
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1322 void t3_basics_change_customview(uint8_t *tX_selection_customview,const uint8_t *tX_customviews, uint8_t action)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1323 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1324 const SDecoinfo * pDecoinfo;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1325 if(stateUsed->diveSettings.deco_type.ub.standard == GF_MODE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1326 pDecoinfo = &stateUsed->decolistBuehlmann;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1327 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1328 pDecoinfo = &stateUsed->decolistVPM;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1329
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1330 uint8_t curViewIdx = 0xff;
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1331 uint8_t index = 0;
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1332 uint8_t lastViewIdx = 0;
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1333 uint8_t iterate = 0; /* set to 1 if a view has to be skipped */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1334
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1335 /* set pointer to currently selected view and count number of entries */
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1336 while((tX_customviews[index] != CVIEW_T3_END))
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1337 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1338 if (tX_customviews[index] == *tX_selection_customview)
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1339 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1340 curViewIdx = index;
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1341 }
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1342 index++;
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1343 }
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1344 if(curViewIdx == 0xff) /* called with unknown view */
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1345 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1346 curViewIdx = 0;
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1347 *tX_selection_customview = tX_customviews[index];
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1348 }
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1349 lastViewIdx = index;
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1350 index = curViewIdx;
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1351 do
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1352 {
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1353 iterate = 0;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1354 switch(action)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1355 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1356 case ACTION_BUTTON_ENTER:
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1357 case ACTION_PITCH_POS:
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1358
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1359 if(tX_customviews[index] != CVIEW_T3_END)
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1360 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1361 index++;
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1362 }
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1363 if(tX_customviews[index] == CVIEW_T3_END)
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1364 {
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1365 index = 0;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1366 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1367 break;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1368 case ACTION_PITCH_NEG:
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1369 if(index == 0)
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1370 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1371 index = lastViewIdx - 1;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1372 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1373 else
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1374 {
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1375 index--;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1376 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1377 break;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1378 default:
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1379 break;
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1380 }
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1381
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1382 if(t3_customview_disabled(tX_customviews[index]))
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1383 {
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1384 iterate = 1;
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1385 }
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1386 if((tX_customviews[index] == CVIEW_T3_TTS) && !pDecoinfo->output_time_to_surface_seconds)
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1387 {
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1388 iterate = 1;
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1389 }
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1390 if((iterate) && (action == ACTION_END))
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1391 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1392 action = ACTION_BUTTON_ENTER;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1393 }
386
39c147e47c1c Added key direction awarness to t3, t5 and t6 views:
ideenmodellierer
parents: 384
diff changeset
1394 }while (iterate == 1);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1395
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1396 *tX_selection_customview = tX_customviews[index];
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1397 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1398
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1399
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1400 void t3_basics_colorscheme_mod(char *text)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1401 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1402 if((text[0] == '\020') && !GFX_is_colorschemeDiveStandard())
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1403 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1404 text[0] = '\027';
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1405 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1406 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1407
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1408
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1409 point_t t3_compass_circle(uint8_t id, uint16_t degree, point_t center)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1410 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1411 float fCos, fSin;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1412 const float piMult = ((2 * 3.14159) / 360);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1413 // const int radius[4] = {95,105,115,60};
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1414 const int radius[4] = {85,95,105,90};
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1415 static point_t forcenter = {.x = 900, .y = 500}; /* used to identify change of circle position */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1416 static point_t r[4][360] = { 0 };
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1417
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1418 if((r[0][0].y == 0) || (forcenter.x != center.x) || (forcenter.y != center.y)) /* calculate values only once during first call or if center position changed */
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1419 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1420 for(int i=0;i<360;i++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1421 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1422 fCos = cos(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1423 fSin = sin(i * piMult);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1424 for(int j=0;j<4;j++)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1425 {
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1426 r[j][i].x = center.x + (int)(fSin * radius[j]);
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1427 r[j][i].y = center.y + (int)(fCos * radius[j]);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1428 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1429 }
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1430 forcenter.x = center.x;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1431 forcenter.y = center.y;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1432 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1433 if(id > 3) id = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1434 if(degree > 359) degree = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1435 return r[id][degree];
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1436 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1437
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1438
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1439 void t3_basics_compass(GFX_DrawCfgScreen *tXscreen, point_t center, uint16_t ActualHeading, uint16_t UserSetHeading)
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1440 {
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1441 uint8_t loop = 0;
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1442 uint16_t LineHeading;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1443
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1444 static int32_t LastHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1445 int32_t newHeading = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1446 int32_t diff = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1447 int32_t diff2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1448
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1449 int32_t diffAbs = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1450 int32_t diffAbs2 = 0;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1451
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1452 newHeading = ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1453
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1454 diff = newHeading - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1455
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1456 if(newHeading < LastHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1457 diff2 = newHeading + 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1458 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1459 diff2 = newHeading - 360 - LastHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1461 diffAbs = diff;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1462 if(diffAbs < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1463 diffAbs *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1464
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1465 diffAbs2 = diff2;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1466 if(diffAbs2 < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1467 diffAbs2 *= -1;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1468
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1469 if(diffAbs <= diffAbs2)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1470 newHeading = LastHeading + (diff / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1471 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1472 newHeading = LastHeading + (diff2 / 2);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1473
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1474 if(newHeading < 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1475 newHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1476 else
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1477 if(newHeading >= 360)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1478 newHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1479
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1480 LastHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1481 ActualHeading = newHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1482
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1483 if (ActualHeading < 90)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1484 ActualHeading += 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1485
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1486 while(ActualHeading > 359) ActualHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1487
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1488 LineHeading = 360 - ActualHeading;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1489
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1490 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font030); // North
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1491 LineHeading += 90;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1492
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1493 for (loop = 0; loop < 3; loop++)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1494 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1495 if(LineHeading > 359) LineHeading -= 360;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1496 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(0,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Main Ticks
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1497 LineHeading += 90;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1498 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1499
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1500 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1501 LineHeading += 45;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1502
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1503 for (loop = 0; loop < 4; loop++)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1504 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1505 if(LineHeading > 359) LineHeading -= 360;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1506 GFX_draw_thick_line(5,tXscreen, t3_compass_circle(1,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Subtick
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1507 LineHeading += 90;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1508 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1509
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1510 LineHeading = 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1511 LineHeading += 22;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1512 for (loop = 0; loop < 8; loop++)
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1513 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1514 if(LineHeading > 359) LineHeading -= 360;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1515 GFX_draw_thick_line(3,tXscreen, t3_compass_circle(1,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_Font031); // Subtick
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1516 LineHeading += 45;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1517 }
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1518 if(UserSetHeading)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1519 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1520 LineHeading = UserSetHeading + 360 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1521 if(LineHeading > 359) LineHeading -= 360;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1522 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_CompassUserHeadingTick);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1523
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1524 // R�ckpeilung, User Back Heading
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1525 LineHeading = UserSetHeading + 360 + 180 - ActualHeading;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1526 if(LineHeading > 359) LineHeading -= 360;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1527 if(LineHeading > 359) LineHeading -= 360;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1528 GFX_draw_thick_line(9,tXscreen, t3_compass_circle(3,LineHeading, center), t3_compass_circle(2,LineHeading, center), CLUT_CompassUserBackHeadingTick);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1529 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1530
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1531 GFX_draw_circle(tXscreen, center, 106, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1532 GFX_draw_circle(tXscreen, center, 107, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1533 GFX_draw_circle(tXscreen, center, 108, CLUT_Font030);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1534 }
384
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1535
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1536 uint8_t t3_GetEnabled_customviews()
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1537 {
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1538 uint8_t *pViews;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1539 uint8_t increment = 1;
384
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1540 uint8_t enabledViewCnt = 0;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1541
511
5185ade91096 Minor adaptions in page layout:
Ideenmodellierer
parents: 503
diff changeset
1542 pViews = (uint8_t*)t3_customviewsStandard;
503
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1543 while((*pViews != CVIEW_T3_END))
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1544 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1545 increment = 1;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1546 /* check if view is enabled */
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1547 if(t3_customview_disabled(*pViews))
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1548 {
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1549 increment = 0;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1550 }
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1551 pViews++;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1552 enabledViewCnt += increment;
734f7ad46bca Bugfix display of disabled screen.
Ideenmodellierer
parents: 413
diff changeset
1553 }
384
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1554 return enabledViewCnt;
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1555 }
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1556
427ae9f8e28e Consider number of available t3 views in sector handling:
ideenmodellierer
parents: 272
diff changeset
1557