Mercurial > public > ostc4
diff 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 |
line wrap: on
line diff
--- a/Discovery/Src/t3.c Wed Jan 06 22:02:49 2021 +0100 +++ b/Discovery/Src/t3.c Sun Jan 03 14:43:16 2021 +0100 @@ -38,6 +38,11 @@ #include "unit.h" #include "motion.h" +#include "logbook_miniLive.h" + + +#define CV_PROFILE_WIDTH (700U) + //* Imported function prototypes ---------------------------------------------*/ extern uint8_t write_gas(char *text, uint8_t oxygen, uint8_t helium); @@ -75,6 +80,7 @@ CVIEW_T3_DepthData, CVIEW_noneOrDebug, CVIEW_T3_DecoTTS, + CVIEW_T3_Profile, CVIEW_T3_END }; @@ -165,6 +171,59 @@ t3c2.WindowTab = 600; } +void t3_select_customview(uint8_t selectedCustomview) +{ + if(selectedCustomview < CVIEW_T3_END) + { + t3_selection_customview = selectedCustomview; + } +} + +void t3_miniLiveLogProfile(void) +{ + SWindowGimpStyle wintemp; + uint16_t datalength = 0; + uint16_t* pReplayData; + uint16_t max_depth = 0; + + point_t start, stop; + + SSettings* pSettings; + pSettings = settingsGetPointer(); + + wintemp.left = t3c1.WindowX0; + wintemp.right = t3c1.WindowX0 + CV_PROFILE_WIDTH; + wintemp.top = 480 - BigFontSeperationTopBottom + 5; + wintemp.bottom = t3c1.WindowY1 = 479 - 5; + + start.x = CV_PROFILE_WIDTH + 2; + start.y = wintemp.top; + stop.x = start.x; + stop.y = wintemp.bottom; + + GFX_draw_line(&t3screen, start, stop, CLUT_Font020); + + if(getReplayOffset() != 0xFFFF) + { + getReplayInfo(&pReplayData, &datalength, &max_depth); + } + + if(max_depth < (uint16_t)(stateUsed->lifeData.max_depth_meter * 100)) + { + max_depth = (uint16_t)(stateUsed->lifeData.max_depth_meter * 100); + } + if(datalength != 0) + { + GFX_graph_print(&t3screen, &wintemp, 0,1,0, max_depth, pReplayData, datalength, CLUT_Font031, NULL); + } + else + { + datalength = 750; + } + + GFX_graph_print(&t3screen, &wintemp, 0,1,0, max_depth, getMiniLiveReplayPointerToData(), datalength, CLUT_Font030, NULL); +} + void t3_refresh(void) { @@ -955,6 +1014,11 @@ t3_basics_compass(tXscreen, center, heading, stateUsed->diveSettings.compassHeading); break; + case CVIEW_T3_Profile: + snprintf(text,100,"\032\f\001%c%c",TXT_2BYTE,TXT2BYTE_Profile); + GFX_write_string(&FontT42,tXc1,text,0); + t3_miniLiveLogProfile(); + break; case CVIEW_T3_DecoTTS: case CVIEW_T3_Decostop: default: