comparison Discovery/Src/t3.c @ 592:f52bc70e380f

MotionCtrl - Sectorview Map sectors directly to custom views: In previous version detection of sector changes lead to a button event which triggered the change of the shown custom view. As result the views shown were depending on the angle which is present while entering focus state. The new implementation maps the primary view to the center sector and assigns the other enabled views around the center => views will always appear at the same angle value.
author Ideenmodellierer
date Sun, 03 Jan 2021 14:43:16 +0100
parents 64bf41faab83
children 5a8f9126e4cb
comparison
equal deleted inserted replaced
591:0172431fbad9 592:f52bc70e380f
36 #include "tHome.h" 36 #include "tHome.h"
37 #include "timer.h" 37 #include "timer.h"
38 #include "unit.h" 38 #include "unit.h"
39 #include "motion.h" 39 #include "motion.h"
40 40
41 #include "logbook_miniLive.h"
42
43
44 #define CV_PROFILE_WIDTH (700U)
45
41 //* Imported function prototypes ---------------------------------------------*/ 46 //* Imported function prototypes ---------------------------------------------*/
42 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); 47 extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium);
43 48
44 /* Exported variables --------------------------------------------------------*/ 49 /* Exported variables --------------------------------------------------------*/
45 50
73 CVIEW_T3_GasList, 78 CVIEW_T3_GasList,
74 CVIEW_T3_Navigation, 79 CVIEW_T3_Navigation,
75 CVIEW_T3_DepthData, 80 CVIEW_T3_DepthData,
76 CVIEW_noneOrDebug, 81 CVIEW_noneOrDebug,
77 CVIEW_T3_DecoTTS, 82 CVIEW_T3_DecoTTS,
83 CVIEW_T3_Profile,
78 CVIEW_T3_END 84 CVIEW_T3_END
79 }; 85 };
80 86
81 /* Private function prototypes -----------------------------------------------*/ 87 /* Private function prototypes -----------------------------------------------*/
82 void t3_refresh_divemode(void); 88 void t3_refresh_divemode(void);
161 t3c2.WindowX0 = 370; 167 t3c2.WindowX0 = 370;
162 t3c2.WindowX1 = 799; 168 t3c2.WindowX1 = 799;
163 t3c2.WindowY0 = t3c1.WindowY0; 169 t3c2.WindowY0 = t3c1.WindowY0;
164 t3c2.WindowY1 = t3c1.WindowY1; 170 t3c2.WindowY1 = t3c1.WindowY1;
165 t3c2.WindowTab = 600; 171 t3c2.WindowTab = 600;
172 }
173
174 void t3_select_customview(uint8_t selectedCustomview)
175 {
176 if(selectedCustomview < CVIEW_T3_END)
177 {
178 t3_selection_customview = selectedCustomview;
179 }
180 }
181
182 void t3_miniLiveLogProfile(void)
183 {
184 SWindowGimpStyle wintemp;
185 uint16_t datalength = 0;
186 uint16_t* pReplayData;
187 uint16_t max_depth = 0;
188
189 point_t start, stop;
190
191 SSettings* pSettings;
192 pSettings = settingsGetPointer();
193
194 wintemp.left = t3c1.WindowX0;
195 wintemp.right = t3c1.WindowX0 + CV_PROFILE_WIDTH;
196 wintemp.top = 480 - BigFontSeperationTopBottom + 5;
197 wintemp.bottom = t3c1.WindowY1 = 479 - 5;
198
199 start.x = CV_PROFILE_WIDTH + 2;
200 start.y = wintemp.top;
201 stop.x = start.x;
202 stop.y = wintemp.bottom;
203
204 GFX_draw_line(&t3screen, start, stop, CLUT_Font020);
205
206 if(getReplayOffset() != 0xFFFF)
207 {
208 getReplayInfo(&pReplayData, &datalength, &max_depth);
209 }
210
211 if(max_depth < (uint16_t)(stateUsed->lifeData.max_depth_meter * 100))
212 {
213 max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 100);
214 }
215 if(datalength != 0)
216 {
217 GFX_graph_print(&t3screen, &wintemp, 0,1,0, max_depth, pReplayData, datalength, CLUT_Font031, NULL);
218 }
219 else
220 {
221 datalength = 750;
222 }
223
224 GFX_graph_print(&t3screen, &wintemp, 0,1,0, max_depth, getMiniLiveReplayPointerToData(), datalength, CLUT_Font030, NULL);
166 } 225 }
167 226
168 227
169 void t3_refresh(void) 228 void t3_refresh(void)
170 { 229 {
953 snprintf(text,100,"\030\003%03i`",heading); 1012 snprintf(text,100,"\030\003%03i`",heading);
954 GFX_write_string(&FontT105,tXc1,text,0); 1013 GFX_write_string(&FontT105,tXc1,text,0);
955 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); 1014 t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading);
956 break; 1015 break;
957 1016
1017 case CVIEW_T3_Profile:
1018 snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile);
1019 GFX_write_string(&FontT42,tXc1,text,0);
1020 t3_miniLiveLogProfile();
1021 break;
958 case CVIEW_T3_DecoTTS: 1022 case CVIEW_T3_DecoTTS:
959 case CVIEW_T3_Decostop: 1023 case CVIEW_T3_Decostop:
960 default: 1024 default:
961 // decostop 1025 // decostop
962 if(pDecoinfo->output_time_to_surface_seconds) 1026 if(pDecoinfo->output_time_to_surface_seconds)