diff options
author | Tim Segers <tsegers@pm.me> | 2023-01-04 12:58:59 +0100 |
---|---|---|
committer | Tim Segers <tsegers@pm.me> | 2023-01-07 15:24:51 +0100 |
commit | 70d7bb650ad46a4237afd27cfd595812eb040701 (patch) | |
tree | 88fa2889132c756ced9b86a87b8ea4e5d5204d47 /src/output.c | |
parent | 5737a0996df3b9f11d541cc45c7e32ae3b9a7aac (diff) | |
download | opendeco-70d7bb650ad46a4237afd27cfd595812eb040701.tar.gz |
Add support for imperial units
Implements: https://todo.sr.ht/~tsegers/opendeco/1
Diffstat (limited to 'src/output.c')
-rw-r--r-- | src/output.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/output.c b/src/output.c index 52b45dd..5997f31 100644 --- a/src/output.c +++ b/src/output.c @@ -69,8 +69,8 @@ void print_planline(wchar_t sign, double depth, double time, double runtime, con static gas_t last_gas; - const int depth_m = round(bar_to_msw(gauge_depth(depth))); - const int ead_m = round(bar_to_msw(max(0, gauge_depth(ead(depth, gas))))); + const int depth_x = round(bar_to_xsw(gauge_depth(depth))); + const int ead_x = round(bar_to_xsw(max(0, gauge_depth(ead(depth, gas))))); wchar_t swi = L' '; @@ -86,14 +86,15 @@ void print_planline(wchar_t sign, double depth, double time, double runtime, con /* only print ead and pO2 on stops */ if (sign == LVL) { - snprintf(eadbuf, 4, "%3i", ead_m); + snprintf(eadbuf, 4, "%3i", ead_x); snprintf(pO2buf, 5, "%4.2f", ppO2(depth, gas)); } else { snprintf(eadbuf, 4, "%3s", "-"); snprintf(pO2buf, 5, "%4s", "-"); } - wprintf(L" %lc %4im %8s %-7s %lc %-9s %s %s\n", sign, depth_m, timbuf, runbuf, swi, gasbuf, pO2buf, eadbuf); + wprintf(L" %lc %4i%s %8s %-7s %lc %-9s %s %s\n", sign, depth_x, (UNITS == METRIC) ? "m" : "ft", timbuf, + runbuf, swi, gasbuf, pO2buf, eadbuf); } void print_planfoot(const decostate_t *ds) |