changeset 1012:23c405d5a766 GasConsumption

Update CCR summary view: In the previous version depending on the language settings the text sometimes overlap. To avoid this the alignment has been changed from tab to right border. In addition the scrubber timer is displayed in small font in case both timers are active.
author Ideenmodellierer
date Sat, 10 May 2025 21:26:02 +0200 (3 months ago)
parents 085e9c04b76b
children fa1af49319e5
files Discovery/Src/t7.c
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Wed May 07 10:58:45 2025 +0200
+++ b/Discovery/Src/t7.c	Sat May 10 21:26:02 2025 +0200
@@ -1912,7 +1912,7 @@
     heading[headingIndex++] = '\016';
     heading[headingIndex++] = TXT_CCRmode;
 
-    data[dataIndex++] = '\t';
+    data[dataIndex++] = '\002';
     char *modeText;
     if (settings->CCR_Mode == CCRMODE_Sensors) {
         if (settings->fallbackToFixedSetpoint) {
@@ -1940,7 +1940,7 @@
 
         data[dataIndex++] = '\n';
         data[dataIndex++] = '\r';
-        data[dataIndex++] = '\t';
+        data[dataIndex++] = '\002';
         dataIndex += snprintf(&data[dataIndex], 10, "\020%01.2f", setpointsToShow[i]->setpoint_cbar / 100.0);
         if (setpointsToShow[i]->depth_meter && !(settings->autoSetpoint && i + 1 == SETPOINT_INDEX_AUTO_DECO)) {
             bool setpointDelayed = settings->autoSetpoint && i + 1 == SETPOINT_INDEX_AUTO_LOW && settings->delaySetpointLow;
@@ -1960,7 +1960,7 @@
 
         data[dataIndex++] = '\n';
         data[dataIndex++] = '\r';
-        data[dataIndex++] = '\t';
+        data[dataIndex++] = '\002';
         data[dataIndex++] = '\020';
         dataIndex += write_gas(&data[dataIndex], diluentsToShow[i]->oxygen_percentage, diluentsToShow[i]->helium_percentage);
         if (diluentsToShow[i]->note.ub.deco) {
@@ -1982,8 +1982,19 @@
 
         data[dataIndex++] = '\n';
         data[dataIndex++] = '\r';
-        data[dataIndex++] = '\t';
+        data[dataIndex++] = '\002';
+        if(settings->scubberActiveId == 3)	/* switch to small font size to avoid bad alignment */
+        {
+        	data[dataIndex++] = '\016';
+        	data[dataIndex++] = '\016';
+        }
         dataIndex += printScrubberText(&data[dataIndex], 10, settings->scrubberData, settings);
+        if(settings->scubberActiveId == 3)
+        {
+        	data[dataIndex++] = ' ';
+        	data[dataIndex++] = ' ';
+        }
+
     }
 
     heading[headingIndex++] = '\017';
@@ -1998,16 +2009,19 @@
     if (!settings->FlipDisplay) {
 	    t7cY0free.WindowY0 = t7cC.WindowY0 - 10;
         t7cY0free.WindowX0 += 10;
+        t7cY0free.WindowX1 = t7cC.WindowX1 - 10;
         t7cY0free.WindowY0 += 10;
         t7cY0free.WindowY1 = 355;
         GFX_write_string(&FontT24, &t7cY0free, heading, 1);
         t7cY0free.WindowX0 -= 10;
         t7cY0free.WindowY0 -= 10;
     } else {
+    	t7cY0free.WindowX0 -= 10;
 	    t7cY0free.WindowY1 = 400;
         t7cY0free.WindowY1 -= 10;
         t7cY0free.WindowX1 -= 10;
         GFX_write_string(&FontT24, &t7cY0free, heading, 1);
+        t7cY0free.WindowX0 += 10;
         t7cY0free.WindowY1 += 10;
         t7cY0free.WindowX1 += 10;
     }