Mercurial > public > ostc4
comparison Discovery/Src/t7.c @ 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 |
| parents | 75f958ca5d0e |
| children | 8c0134a287da |
comparison
equal
deleted
inserted
replaced
| 1011:085e9c04b76b | 1012:23c405d5a766 |
|---|---|
| 1910 heading[headingIndex++] = '\032'; | 1910 heading[headingIndex++] = '\032'; |
| 1911 heading[headingIndex++] = '\016'; | 1911 heading[headingIndex++] = '\016'; |
| 1912 heading[headingIndex++] = '\016'; | 1912 heading[headingIndex++] = '\016'; |
| 1913 heading[headingIndex++] = TXT_CCRmode; | 1913 heading[headingIndex++] = TXT_CCRmode; |
| 1914 | 1914 |
| 1915 data[dataIndex++] = '\t'; | 1915 data[dataIndex++] = '\002'; |
| 1916 char *modeText; | 1916 char *modeText; |
| 1917 if (settings->CCR_Mode == CCRMODE_Sensors) { | 1917 if (settings->CCR_Mode == CCRMODE_Sensors) { |
| 1918 if (settings->fallbackToFixedSetpoint) { | 1918 if (settings->fallbackToFixedSetpoint) { |
| 1919 modeText = (char *)&"Sens/FB"; | 1919 modeText = (char *)&"Sens/FB"; |
| 1920 } else { | 1920 } else { |
| 1938 heading[headingIndex++] = TXT2BYTE_Setpoint; | 1938 heading[headingIndex++] = TXT2BYTE_Setpoint; |
| 1939 } | 1939 } |
| 1940 | 1940 |
| 1941 data[dataIndex++] = '\n'; | 1941 data[dataIndex++] = '\n'; |
| 1942 data[dataIndex++] = '\r'; | 1942 data[dataIndex++] = '\r'; |
| 1943 data[dataIndex++] = '\t'; | 1943 data[dataIndex++] = '\002'; |
| 1944 dataIndex += snprintf(&data[dataIndex], 10, "\020%01.2f", setpointsToShow[i]->setpoint_cbar / 100.0); | 1944 dataIndex += snprintf(&data[dataIndex], 10, "\020%01.2f", setpointsToShow[i]->setpoint_cbar / 100.0); |
| 1945 if (setpointsToShow[i]->depth_meter && !(settings->autoSetpoint && i + 1 == SETPOINT_INDEX_AUTO_DECO)) { | 1945 if (setpointsToShow[i]->depth_meter && !(settings->autoSetpoint && i + 1 == SETPOINT_INDEX_AUTO_DECO)) { |
| 1946 bool setpointDelayed = settings->autoSetpoint && i + 1 == SETPOINT_INDEX_AUTO_LOW && settings->delaySetpointLow; | 1946 bool setpointDelayed = settings->autoSetpoint && i + 1 == SETPOINT_INDEX_AUTO_LOW && settings->delaySetpointLow; |
| 1947 dataIndex += snprintf(&data[dataIndex], 10, "\016\016 %um%s\017", setpointsToShow[i]->depth_meter, setpointDelayed ? "(d)" : ""); | 1947 dataIndex += snprintf(&data[dataIndex], 10, "\016\016 %um%s\017", setpointsToShow[i]->depth_meter, setpointDelayed ? "(d)" : ""); |
| 1948 } | 1948 } |
| 1958 heading[headingIndex++] = TXT_Diluent_Gas_Edit; | 1958 heading[headingIndex++] = TXT_Diluent_Gas_Edit; |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 data[dataIndex++] = '\n'; | 1961 data[dataIndex++] = '\n'; |
| 1962 data[dataIndex++] = '\r'; | 1962 data[dataIndex++] = '\r'; |
| 1963 data[dataIndex++] = '\t'; | 1963 data[dataIndex++] = '\002'; |
| 1964 data[dataIndex++] = '\020'; | 1964 data[dataIndex++] = '\020'; |
| 1965 dataIndex += write_gas(&data[dataIndex], diluentsToShow[i]->oxygen_percentage, diluentsToShow[i]->helium_percentage); | 1965 dataIndex += write_gas(&data[dataIndex], diluentsToShow[i]->oxygen_percentage, diluentsToShow[i]->helium_percentage); |
| 1966 if (diluentsToShow[i]->note.ub.deco) { | 1966 if (diluentsToShow[i]->note.ub.deco) { |
| 1967 char *space = " "; | 1967 char *space = " "; |
| 1968 if (diluentsToShow[i]->depth_meter > 99) { | 1968 if (diluentsToShow[i]->depth_meter > 99) { |
| 1980 heading[headingIndex++] = TXT_2BYTE; | 1980 heading[headingIndex++] = TXT_2BYTE; |
| 1981 heading[headingIndex++] = TXT2BYTE_Scrubber; | 1981 heading[headingIndex++] = TXT2BYTE_Scrubber; |
| 1982 | 1982 |
| 1983 data[dataIndex++] = '\n'; | 1983 data[dataIndex++] = '\n'; |
| 1984 data[dataIndex++] = '\r'; | 1984 data[dataIndex++] = '\r'; |
| 1985 data[dataIndex++] = '\t'; | 1985 data[dataIndex++] = '\002'; |
| 1986 if(settings->scubberActiveId == 3) /* switch to small font size to avoid bad alignment */ | |
| 1987 { | |
| 1988 data[dataIndex++] = '\016'; | |
| 1989 data[dataIndex++] = '\016'; | |
| 1990 } | |
| 1986 dataIndex += printScrubberText(&data[dataIndex], 10, settings->scrubberData, settings); | 1991 dataIndex += printScrubberText(&data[dataIndex], 10, settings->scrubberData, settings); |
| 1992 if(settings->scubberActiveId == 3) | |
| 1993 { | |
| 1994 data[dataIndex++] = ' '; | |
| 1995 data[dataIndex++] = ' '; | |
| 1996 } | |
| 1997 | |
| 1987 } | 1998 } |
| 1988 | 1999 |
| 1989 heading[headingIndex++] = '\017'; | 2000 heading[headingIndex++] = '\017'; |
| 1990 heading[headingIndex++] = 0; | 2001 heading[headingIndex++] = 0; |
| 1991 | 2002 |
| 1996 t7cY0free.WindowTab = 375; | 2007 t7cY0free.WindowTab = 375; |
| 1997 | 2008 |
| 1998 if (!settings->FlipDisplay) { | 2009 if (!settings->FlipDisplay) { |
| 1999 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; | 2010 t7cY0free.WindowY0 = t7cC.WindowY0 - 10; |
| 2000 t7cY0free.WindowX0 += 10; | 2011 t7cY0free.WindowX0 += 10; |
| 2012 t7cY0free.WindowX1 = t7cC.WindowX1 - 10; | |
| 2001 t7cY0free.WindowY0 += 10; | 2013 t7cY0free.WindowY0 += 10; |
| 2002 t7cY0free.WindowY1 = 355; | 2014 t7cY0free.WindowY1 = 355; |
| 2003 GFX_write_string(&FontT24, &t7cY0free, heading, 1); | 2015 GFX_write_string(&FontT24, &t7cY0free, heading, 1); |
| 2004 t7cY0free.WindowX0 -= 10; | 2016 t7cY0free.WindowX0 -= 10; |
| 2005 t7cY0free.WindowY0 -= 10; | 2017 t7cY0free.WindowY0 -= 10; |
| 2006 } else { | 2018 } else { |
| 2019 t7cY0free.WindowX0 -= 10; | |
| 2007 t7cY0free.WindowY1 = 400; | 2020 t7cY0free.WindowY1 = 400; |
| 2008 t7cY0free.WindowY1 -= 10; | 2021 t7cY0free.WindowY1 -= 10; |
| 2009 t7cY0free.WindowX1 -= 10; | 2022 t7cY0free.WindowX1 -= 10; |
| 2010 GFX_write_string(&FontT24, &t7cY0free, heading, 1); | 2023 GFX_write_string(&FontT24, &t7cY0free, heading, 1); |
| 2024 t7cY0free.WindowX0 += 10; | |
| 2011 t7cY0free.WindowY1 += 10; | 2025 t7cY0free.WindowY1 += 10; |
| 2012 t7cY0free.WindowX1 += 10; | 2026 t7cY0free.WindowX1 += 10; |
| 2013 } | 2027 } |
| 2014 | 2028 |
| 2015 Gfx_colorsscheme_mod(data, 0); | 2029 Gfx_colorsscheme_mod(data, 0); |
