mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
HTML: Show nice values when pressure is not available
Show nice values instead of the undefined when the pressure is not available. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a110b2858d
commit
3a28507dc1
1 changed files with 14 additions and 4 deletions
18
save-html.c
18
save-html.c
|
@ -41,13 +41,23 @@ static void put_cylinder_HTML(struct membuffer *b, struct dive *dive)
|
|||
write_attribute(b, "Size", "--");
|
||||
}
|
||||
put_pressure(b, cylinder->type.workingpressure, "\"WPressure\":\"", " bar\",");
|
||||
put_pressure(b, cylinder->start, "\"SPressure\":\"", " bar\",");
|
||||
put_pressure(b, cylinder->end, "\"EPressure\":\"", " bar\",");
|
||||
|
||||
if (cylinder->start.mbar) {
|
||||
put_milli(b, "\"EPressure\":\"", cylinder->start.mbar, " bar\",");
|
||||
} else {
|
||||
write_attribute(b, "EPressure", "--");
|
||||
}
|
||||
|
||||
if (cylinder->end.mbar) {
|
||||
put_milli(b, "\"SPressure\":\"", cylinder->end.mbar, " bar\",");
|
||||
} else {
|
||||
write_attribute(b, "SPressure", "--");
|
||||
}
|
||||
|
||||
if (cylinder->gasmix.o2.permille) {
|
||||
put_format(b, "\"O₂\":\"%u.%u%%\",", FRACTION(cylinder->gasmix.o2.permille, 10));
|
||||
put_format(b, "\"O2\":\"%u.%u%%\",", FRACTION(cylinder->gasmix.o2.permille, 10));
|
||||
} else {
|
||||
write_attribute(b, "O₂", "--");
|
||||
write_attribute(b, "O2", "--");
|
||||
}
|
||||
put_string(b, "},");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue