# HG changeset patch # User Ideenmodellierer # Date 1609792538 -3600 # Node ID 16e369eae6e5c99543175fbffda3fd4eb2386258 # Parent fd0b60dee6f30437cf9c14e740680c4b1cb7af90 Added functionality to select a dive to be shown in the T3 profile view: The new T3 Profile provides the option to display the profile of a previous dive which is stored in the log. This may be done by using the (middle) button. In case the dive is selected for the replay function a '>' will be shown in the lower right corner. diff -r fd0b60dee6f3 -r 16e369eae6e5 Discovery/Inc/show_logbook.h --- a/Discovery/Inc/show_logbook.h Mon Jan 04 21:32:39 2021 +0100 +++ b/Discovery/Inc/show_logbook.h Mon Jan 04 21:35:38 2021 +0100 @@ -32,6 +32,9 @@ //void build_logbook_test(void); void show_logbook_test(_Bool firstPage, uint8_t StepBackwards); void show_logbook_exit(void); +uint8_t getActiveLogPage(void); +void updateReplayIncdicator(GFX_DrawCfgScreen *hgfx); + //void show_logbook_logbook_show_log_page4(GFX_DrawCfgScreen *hgfx); #endif /* SHOW_LOGBOOK_H */ diff -r fd0b60dee6f3 -r 16e369eae6e5 Discovery/Src/show_logbook.c --- a/Discovery/Src/show_logbook.c Mon Jan 04 21:32:39 2021 +0100 +++ b/Discovery/Src/show_logbook.c Mon Jan 04 21:35:38 2021 +0100 @@ -34,6 +34,7 @@ #include "show_logbook.h" #include "unit.h" #include "configuration.h" +#include "logbook_miniLive.h" #include #include @@ -50,6 +51,9 @@ static void print_gas_name(char* output,uint8_t lengh,uint8_t oxygen,uint8_t helium); static int16_t get_colour(int16_t color); +static uint8_t active_log_page = 1; +static uint8_t active_log_offset = 0; + /* Overview */ static void show_logbook_logbook_show_log_page1(GFX_DrawCfgScreen *hgfx, uint8_t StepBackwards); /* Temperature */ @@ -670,6 +674,19 @@ snprintf(text,40,"%i\016\016 hPa\017",logbookHeader.surfacePressure_mbar); Gfx_write_label_var(hgfx,320,600,440, &FontT42,CLUT_GasSensor1,text); + +/* show symbol in case log entry is marked for usage in profile custom view */ + snprintf(text,10,"\002>"); + if(0xFFFF != getReplayOffset()) + { + Gfx_write_label_var(hgfx,750,799,440, &FontT42,CLUT_GasSensor1,text); + } + else + { + Gfx_write_label_var(hgfx,750,799,440, &FontT42,CLUT_MenuTopBackground,text); + } + + /* Show tank info */ #ifdef ENABLE_BOTTLE_SENSOR for(loop = 0; loop < dataLength; loop++) @@ -841,19 +858,21 @@ void show_logbook_test(_Bool firstPage, uint8_t StepBackwards) { - static uint8_t page = 1; if(firstPage) { - page = 1; + active_log_page = 1; + active_log_offset = StepBackwards; } else { - page++; - if(page > 4) - page = 1; + active_log_page++; + if(active_log_page > 4) + { + active_log_page = 1; + } } - build_logbook_test(page,StepBackwards); + build_logbook_test(active_log_page,StepBackwards); // GFX_ResetLayer(TOP_LAYER); // GFX_ResetLayer(BACKGRD_LAYER); @@ -1111,3 +1130,14 @@ { return CLUT_GasSensor1 + color; } + +uint8_t getActiveLogPage() +{ + return active_log_page; +} + +void updateReplayIncdicator(GFX_DrawCfgScreen *hgfx) +{ + build_logbook_test(1,active_log_offset); + GFX_SetFramesTopBottom(tLOGscreen.FBStartAdress, tLOGbackground.FBStartAdress,480); +}