From b9ac89574ebd095f1c4760d223ccfb4dd9fba479 Mon Sep 17 00:00:00 2001 From: Willem Ferguson Date: Wed, 24 Jan 2018 21:50:35 +0200 Subject: Planner: print icd information at 0.1 resolution The gas fractions (in %) are now printed at a resolution of 0.1% and not at 0.01% as previously. The string in the info box that provides icd data is reformatted so that the info-box is as narrow as possible. Signed-off-by: Willem Ferguson --- core/plannernotes.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/plannernotes.c b/core/plannernotes.c index 078604774..a678131e2 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -47,18 +47,17 @@ int add_icd_entry(char *icdbuffer, unsigned int maxsize, struct icd_data *icdval "%s➙", (time_seconds + 30) / 60, translate("gettextFromC", "min"), gasname(gas_from)); len += snprintf(icdbuffer + len, maxsize - len, - "%s%+5.2f%%" - "%+5.2f%%" - "%+5.2f%%" + "%s%+5.1f%%" + "%+5.1f%%" + "%+5.1f%%" "%+5.2f%s" "%+5.2f%s" "%+5.2f%s", gasname(gas_to), icdvalues->dHe / 10.0, - ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", icdvalues->dN2 / 10.0 , 0.2 * (-icdvalues->dHe / 10), - ambientpressure_mbar * icdvalues->dHe / 1e6, translate("gettextFromC", "bar"), ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", - ambientpressure_mbar * icdvalues->dN2 / 1e6, translate("gettextFromC", "bar"), - ambientpressure_mbar * -icdvalues->dHe / 5e6, translate("gettextFromC", "bar")); - + ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", icdvalues->dN2 / 10.0 , 0.2 * (-icdvalues->dHe / 10.0), + ambientpressure_mbar * icdvalues->dHe / 1e6f, translate("gettextFromC", "bar"), ((5 * icdvalues->dN2) > -icdvalues->dHe) ? "red" : "#383838", + ambientpressure_mbar * icdvalues->dN2 / 1e6f, translate("gettextFromC", "bar"), + ambientpressure_mbar * -icdvalues->dHe / 5e6f, translate("gettextFromC", "bar")); return len; } -- cgit v1.2.3-70-g09d2