comparison Discovery/Src/t7.c @ 915:ff318ae65dd0 Evo_2_23

SlowExitTimer: Some modifications in the visualization e.g. to get the graph running in flipped mode
author Ideenmodellierer
date Sat, 19 Oct 2024 20:10:56 +0200
parents a2523e19f59a
children c4c9850a2039
comparison
equal deleted inserted replaced
914:5ce7708a9095 915:ff318ae65dd0
2812 Gfx_colorsscheme_mod(TextL2, 0); 2812 Gfx_colorsscheme_mod(TextL2, 0);
2813 GFX_write_string(&FontT105,&t7l2,TextL2,1); 2813 GFX_write_string(&FontT105,&t7l2,TextL2,1);
2814 2814
2815 /* ascent rate graph */ 2815 /* ascent rate graph */
2816 2816
2817 if((pSettings->slowExitTime != 0) && (pDecoinfo->output_time_to_surface_seconds == 0) && (stateUsed->lifeData.depth_meter < pSettings->last_stop_depth_meter)) 2817 if((pSettings->slowExitTime != 0) && (nextstopDepthMeter == 0) && (stateUsed->lifeData.depth_meter < pSettings->last_stop_depth_meter))
2818 { 2818 {
2819 color = t7_drawSlowExitGraph(); 2819 color = t7_drawSlowExitGraph();
2820 } 2820 }
2821 else if(stateUsed->lifeData.ascent_rate_meter_per_min > 1) /* a value < 1 would cause a bar in negative direction brush rectangle of 12 and step width of 6 */ 2821 else if(stateUsed->lifeData.ascent_rate_meter_per_min > 1) /* a value < 1 would cause a bar in negative direction brush rectangle of 12 and step width of 6 */
2822 { 2822 {
4769 } 4769 }
4770 4770
4771 GFX_draw_thick_line(12,&t7screen, start, stop, color); 4771 GFX_draw_thick_line(12,&t7screen, start, stop, color);
4772 } 4772 }
4773 4773
4774 #define ASCENT_GRAPH_YPIXEL 120 4774 #define ASCENT_GRAPH_YPIXEL 110
4775
4775 4776
4776 uint8_t t7_drawSlowExitGraph() /* this function is only called if diver is below last last stop depth */ 4777 uint8_t t7_drawSlowExitGraph() /* this function is only called if diver is below last last stop depth */
4777 { 4778 {
4778 static SSlowExitState slowExitState = SE_END; 4779 static SSlowExitState slowExitState = SE_END;
4779 static uint16_t countDownSec = 0; 4780 static uint16_t countDownSec = 0;
4867 for(index = 0; index < pSettings->last_stop_depth_meter; index++) /* draw meter indicators */ 4868 for(index = 0; index < pSettings->last_stop_depth_meter; index++) /* draw meter indicators */
4868 { 4869 {
4869 start.y += drawingMeterStep; 4870 start.y += drawingMeterStep;
4870 stop.y = start.y; 4871 stop.y = start.y;
4871 start.x = CUSTOMBOX_LINE_LEFT - 1; 4872 start.x = CUSTOMBOX_LINE_LEFT - 1;
4872 stop.x = start.x - 40; 4873 stop.x = start.x - 38;
4873 GFX_draw_line(&t7screen, start, stop, 0); 4874 GFX_draw_line(&t7screen, start, stop, 0);
4874 } 4875 }
4875 4876
4876 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 20; 4877 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 20;
4877 stop.x = start.x; 4878 stop.x = start.x;
4878 if(!pSettings->FlipDisplay) 4879 if(!pSettings->FlipDisplay)
4879 { 4880 {
4880 start.y = t7l1.WindowY0 + ASCENT_GRAPH_YPIXEL; 4881 start.y = t7l1.WindowY0 + ASCENT_GRAPH_YPIXEL + 5;
4881 } 4882 }
4882 else 4883 else
4883 { 4884 {
4884 start.y = t7l3.WindowY0 - 25; 4885 start.y = t7l3.WindowY0 - 25 + ASCENT_GRAPH_YPIXEL + 5;
4885 } 4886 }
4886 stop.y = start.y - countDownSec * (ASCENT_GRAPH_YPIXEL / (float)(pSettings->slowExitTime * 60.0)); 4887 stop.y = start.y - countDownSec * (ASCENT_GRAPH_YPIXEL / (float)(pSettings->slowExitTime * 60.0));
4887 if(stop.y >= 470) 4888 if(stop.y >= 470)
4888 stop.y = 470; 4889 stop.y = 470;
4889 4890
4891 if(!pSettings->FlipDisplay)
4892 {
4893 stop.y += 5;
4894 }
4890 GFX_draw_thick_line(15,&t7screen, start, stop, 3); 4895 GFX_draw_thick_line(15,&t7screen, start, stop, 3);
4891 /* mark diver depth */ 4896 /* mark diver depth */
4892 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 25; 4897 start.x = CUSTOMBOX_LINE_LEFT - CUSTOMBOX_OUTSIDE_OFFSET - 30;
4893 stop.x = start.x + 15; 4898 stop.x = start.x + 24;
4894 4899
4895 start.y = start.y - (stateUsed->lifeData.depth_meter *120 / pSettings->last_stop_depth_meter); 4900 start.y = start.y - (stateUsed->lifeData.depth_meter * (ASCENT_GRAPH_YPIXEL) / pSettings->last_stop_depth_meter);
4896 stop.y = start.y; 4901 stop.y = start.y;
4897 GFX_draw_thick_line(10,&t7screen, start, stop, 9); 4902 GFX_draw_thick_line(10,&t7screen, start, stop, 9);
4898 } 4903 }
4899 } 4904 }
4900 } 4905 }