# HG changeset patch # User ideenmodellierer # Date 1585084109 -3600 # Node ID 5a633dece17ab9afd2e4b380461dc4a8252cd5f2 # Parent 1c0b911c367f4b13718d8a68e69a45c2af34a438 Reactivated samples for bottle pressure information: I previous versions (and also in the upcommings) the bottle pressure informations are not added to the log information. However for alfatesting of a potential pressure measurement the function may now be reactivated by a compile switch diff -r 1c0b911c367f -r 5a633dece17a Discovery/Src/show_logbook.c --- a/Discovery/Src/show_logbook.c Tue Mar 24 21:59:38 2020 +0100 +++ b/Discovery/Src/show_logbook.c Tue Mar 24 22:08:29 2020 +0100 @@ -33,6 +33,7 @@ #include "gfx_fonts.h" #include "show_logbook.h" #include "unit.h" +#include "configuration.h" #include #include @@ -425,9 +426,16 @@ uint16_t depthdata[1000] = { 0 }; uint8_t gasdata[1000] = { 0 }; int16_t tempdata[1000] = { 0 }; + uint16_t tankdata[1000] = { 0 }; + +#ifdef ENABLE_BOTTLE_SENSOR + uint16_t bottlePressureStart = 0; + uint16_t bottlePressureEnd = 0; + uint16_t loop = 0; +#endif uint16_t dataLength = 0; - dataLength = logbook_readSampleData(StepBackwards, 1000, depthdata,gasdata, tempdata, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + dataLength = logbook_readSampleData(StepBackwards, 1000, depthdata,gasdata, tempdata, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tankdata); //Print Date uint8_t year = logbookHeader.dateYear; @@ -620,7 +628,25 @@ snprintf(text,40,"%i\016\016 hPa\017",logbookHeader.surfacePressure_mbar); Gfx_write_label_var(hgfx,320,600,440, &FontT42,CLUT_GasSensor1,text); - +/* Show tank info */ +#ifdef ENABLE_BOTTLE_SENSOR + for(loop = 0; loop < dataLength; loop++) + { + if((bottlePressureStart == 0) && (tankdata[loop] != 0)) /* find first pressure value */ + { + bottlePressureStart = tankdata[loop]; + } + if((tankdata[loop] != 0)) /* store last pressure value */ + { + bottlePressureEnd = tankdata[loop]; + } + } + if(bottlePressureStart != 0) + { + snprintf(text,40,"%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd); + Gfx_write_label_var(hgfx,600,800,440, &FontT42,CLUT_GasSensor1,text); + } +#endif //--- print coordinate system & depth graph with gaschanges --- wintemp.left = 330; wintemp.top = 160; @@ -651,7 +677,7 @@ uint16_t decoDepthdata[1000]; uint16_t *pDecoDepthData = 0; - dataLength = logbook_readSampleData(StepBackwards, 1000, depthdata,gasdata, tempdata, NULL, NULL, NULL, NULL, NULL, NULL, NULL, decoDepthdata); + dataLength = logbook_readSampleData(StepBackwards, 1000, depthdata,gasdata, tempdata, NULL, NULL, NULL, NULL, NULL, NULL, NULL, decoDepthdata, NULL); for(int i = 0; i