comparison Discovery/Src/t7.c @ 837:18946846b95b Evo_2_23

Bugfixes and code cleanup for BF views: BF views gauge and apnoe were using "dive computer" T3 view functions which caused some problem because these legacy views were not intended to work with customer view selection. A switch condition has been added to skip these kind of functions in case a design other T3 is in use. Another potential problem was that there were two definitions for T3 and T7 views which were basically the same. If they wold not be the same the switching functionality wold not work properly. To avoid this problem in futur the arrays have been merged => the view are handled sing the (newer) cv_view arrays instead of the standard_views which were in used before the user could the views which should be shown.
author ideenmodellierer
date Wed, 27 Dec 2023 19:37:17 +0100
parents 2a9a47547b05
children 7e714662b93f
comparison
equal deleted inserted replaced
836:8d6c35655d4d 837:18946846b95b
118 .pointer = 0, 118 .pointer = 0,
119 }; 119 };
120 120
121 121
122 /* Private types -------------------------------------------------------------*/ 122 /* Private types -------------------------------------------------------------*/
123 const uint8_t customviewsDiveStandard[] =
124 {
125 CVIEW_sensors,
126 CVIEW_Compass,
127 CVIEW_Decolist,
128 CVIEW_Tissues,
129 CVIEW_Profile,
130 CVIEW_Gaslist,
131 CVIEW_sensors_mV,
132 CVIEW_EADTime,
133 CVIEW_SummaryOfLeftCorner,
134 CVIEW_Timer,
135 CVIEW_noneOrDebug,
136 CVIEW_END,
137 CVIEW_END
138 };
139 123
140 const uint8_t customviewsSurfaceStandard[] = 124 const uint8_t customviewsSurfaceStandard[] =
141 { 125 {
142 // CVIEW_CompassDebug, 126 // CVIEW_CompassDebug,
143 CVIEW_Hello, 127 CVIEW_Hello,
153 }; 137 };
154 138
155 139
156 static uint8_t selection_custom_field = LLC_Temperature; 140 static uint8_t selection_custom_field = LLC_Temperature;
157 141
158 const uint8_t *customviewsDive = customviewsDiveStandard; 142 const uint8_t *customviewsDive = cv_changelist;
159 const uint8_t *customviewsSurface = customviewsSurfaceStandard; 143 const uint8_t *customviewsSurface = customviewsSurfaceStandard;
160 144
161 #define TEXTSIZE 30 145 #define TEXTSIZE 30
162 /* offset includes line: 2 = line +1 146 /* offset includes line: 2 = line +1
163 * box (line) is 300 px 147 * box (line) is 300 px
578 562
579 background.pointer = 0; 563 background.pointer = 0;
580 564
581 if(stateUsed->mode == MODE_DIVE) 565 if(stateUsed->mode == MODE_DIVE)
582 { 566 {
583 if(last_mode != MODE_DIVE) 567 /* T7 refresh is usally called at start of dive. Based on divesettings the design will be changed and T7 no longer called */
584 {
585 last_mode = MODE_DIVE;
586 /* lower left corner primary */
587 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
588 /* custom view primary OR debug if automatic return is off | T7 is default dive view => also initialize big font view */
589 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
590 {
591 selection_customview = CVIEW_noneOrDebug;
592 t3_select_customview(CVIEW_noneOrDebug);
593 }
594 else
595 {
596 selection_customview = settingsGetPointer()->tX_customViewPrimary;
597 t3_set_customview_to_primary();
598 }
599 t7_change_customview(ACTION_END);
600
601 if((settingsGetPointer()->MotionDetection != MOTION_DETECT_OFF))
602 {
603 InitMotionDetection();
604 }
605
606 if(settingsGetPointer()->extraDisplay == EXTRADISPLAY_BFACTIVE)
607 {
608 settingsGetPointer()->design = 3;
609 releaseAllFramesExcept(22,t7screen.FBStartAdress);
610 releaseFrame(22,t7screen.FBStartAdress);
611 set_globalState(StD);
612 return;
613 }
614 }
615
616 if(status.page == PageSurface)
617 set_globalState(StD);
618
619 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) 568 if(stateUsed->diveSettings.diveMode == DIVEMODE_Gauge)
620 { 569 {
621 settingsGetPointer()->design = 5; 570 settingsGetPointer()->design = 5;
622 releaseAllFramesExcept(22,t7screen.FBStartAdress); 571 releaseAllFramesExcept(22,t7screen.FBStartAdress);
623 releaseFrame(22,t7screen.FBStartAdress); 572 releaseFrame(22,t7screen.FBStartAdress);
630 releaseFrame(22,t7screen.FBStartAdress); 579 releaseFrame(22,t7screen.FBStartAdress);
631 return; 580 return;
632 } 581 }
633 else 582 else
634 { 583 {
635 t7_refresh_divemode(); 584 if(last_mode != MODE_DIVE)
636 } 585 {
586 last_mode = MODE_DIVE;
587 /* lower left corner primary */
588 selection_custom_field = settingsGetPointer()->tX_userselectedLeftLowerCornerPrimary;
589 /* custom view primary OR debug if automatic return is off | T7 is default dive view => also initialize big font view */
590 if((settingsGetPointer()->tX_customViewTimeout == 0) && (settingsGetPointer()->showDebugInfo))
591 {
592 selection_customview = CVIEW_noneOrDebug;
593 t3_select_customview(CVIEW_noneOrDebug);
594 }
595 else
596 {
597 selection_customview = settingsGetPointer()->tX_customViewPrimary;
598 }
599 t7_change_customview(ACTION_END);
600
601 if((settingsGetPointer()->MotionDetection != MOTION_DETECT_OFF))
602 {
603 InitMotionDetection();
604 }
605
606 if((settingsGetPointer()->extraDisplay == EXTRADISPLAY_BFACTIVE) && ( settingsGetPointer()->design == 7))
607 {
608 settingsGetPointer()->design = 3;
609 t3_set_customview_to_primary();
610 releaseAllFramesExcept(22,t7screen.FBStartAdress);
611 releaseFrame(22,t7screen.FBStartAdress);
612 set_globalState(StD);
613 return;
614 }
615 }
616
617 if(status.page == PageSurface)
618 set_globalState(StD);
619
620 t7_refresh_divemode();
621 }
637 } 622 }
638 else // from if(stateUsed->mode == MODE_DIVE) 623 else // from if(stateUsed->mode == MODE_DIVE)
639 { 624 {
640 if(last_mode != MODE_SURFACE) 625 if(last_mode != MODE_SURFACE)
641 { 626 {