A little pixel-pushing to make high CO2 numbers look not so much crammed.

This commit is contained in:
Marcus Scholz 2022-04-09 19:57:19 +02:00
parent 3b209ec96d
commit e9937726ec

View File

@ -450,21 +450,21 @@ display:
} }
if(livingroom_co2 >=380 && livingroom_co2 <= 20000) { if(livingroom_co2 >=380 && livingroom_co2 <= 20000) {
it.printf(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2); it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2);
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
} }
else { else {
it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
} }
if(livingroom_pm25 < 255 && livingroom_pm25 >=0) { if(livingroom_pm25 < 255 && livingroom_pm25 >=0) {
it.printf(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25); it.printf(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25);
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
else { else {
it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
@ -493,21 +493,21 @@ display:
} }
if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) { if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) {
it.printf(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2); it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2);
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
} }
else { else {
it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
} }
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) { if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
it.printf(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25); it.printf(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25);
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
else { else {
it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
/* Weather */ /* Weather */
@ -733,12 +733,12 @@ display:
} }
if(livingroom_co2 >=380 && livingroom_co2 <= 20000) { if(livingroom_co2 >=380 && livingroom_co2 <= 20000) {
it.printf(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2); it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2);
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
} }
else { else {
it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
} }
if(livingroom_pm25 < 255 && livingroom_pm25 >=0) { if(livingroom_pm25 < 255 && livingroom_pm25 >=0) {
@ -777,21 +777,21 @@ display:
} }
if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) { if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) {
it.printf(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2); it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2);
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
} }
else { else {
it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(150, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³"); it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
} }
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) { if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
it.printf(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25); it.printf(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25);
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
else { else {
it.print(200, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- "); it.print(220, 114 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
it.print(205, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³"); it.print(225, 114 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
} }
*/ */