Use correct name for oxygen

When O2 is 100% we should use oxygen instead of EAN100.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Joakim Bygdell 2015-01-05 20:09:30 +01:00 committed by Dirk Hohndel
parent 344e517956
commit 88d806f218

View file

@ -79,8 +79,10 @@ void get_gas_string(const struct gasmix *gasmix, char *text, int len)
{ {
if (gasmix_is_air(gasmix)) if (gasmix_is_air(gasmix))
snprintf(text, len, "%s", translate("gettextFromC", "air")); snprintf(text, len, "%s", translate("gettextFromC", "air"));
else if (get_he(gasmix) == 0) else if (get_he(gasmix) == 0 && get_o2(gasmix) < 1000)
snprintf(text, len, translate("gettextFromC", "EAN%d"), (get_o2(gasmix) + 5) / 10); snprintf(text, len, translate("gettextFromC", "EAN%d"), (get_o2(gasmix) + 5) / 10);
else if (get_he(gasmix) == 0 && get_o2(gasmix) == 1000)
snprintf(text, len, "%s", translate("gettextFromC", "oxygen"));
else else
snprintf(text, len, "(%d/%d)", (get_o2(gasmix) + 5) / 10, (get_he(gasmix) + 5) / 10); snprintf(text, len, "(%d/%d)", (get_o2(gasmix) + 5) / 10, (get_he(gasmix) + 5) / 10);
} }