aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/output.c b/src/output.c
index 04352d5..6d24b65 100644
--- a/src/output.c
+++ b/src/output.c
@@ -6,6 +6,8 @@
#include "output.h"
+#define DEPTHUNIT ((UNITS == METRIC) ? "m " : "ft")
+
void format_mm_ss(char *buf, size_t buflen, double time)
{
double mm;
@@ -68,7 +70,7 @@ int scan_gas(gas_t *gas, char *str)
void print_planhead(void)
{
wprintf(L"DIVE PLAN\n\n");
- wprintf(L" %-1s %-5s %-8s %-7s %1s %-9s %-4s %-3s\n", "", "Depth", "Duration", "Runtime", "", "Gas", "pO2",
+ wprintf(L" %-1s %6s %8s %-7s %1s %-9s %4s %5s\n", "", "Depth", "Duration", "Runtime", "", "Gas", "pO2",
"EAD");
}
@@ -77,7 +79,7 @@ void print_planline(wchar_t sign, double depth, double time, double runtime, con
static char gasbuf[11];
static char runbuf[8];
static char pO2buf[5];
- static char eadbuf[4];
+ static char eadbuf[6];
static char timbuf[16];
static gas_t last_gas;
@@ -99,15 +101,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_x);
+ snprintf(eadbuf, 6, "%3i%s", ead_x, DEPTHUNIT);
snprintf(pO2buf, 5, "%4.2f", ppO2(depth, gas));
} else {
- snprintf(eadbuf, 4, "%3s", "-");
+ snprintf(eadbuf, 6, "%5s", "-");
snprintf(pO2buf, 5, "%4s", "-");
}
- 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);
+ wprintf(L" %lc %4i%2s %8s %-7s %lc %-9s %s %s\n", sign, depth_x, DEPTHUNIT, timbuf, runbuf, swi, gasbuf,
+ pO2buf, eadbuf);
}
void print_planfoot(const decostate_t *ds)
@@ -135,7 +137,10 @@ void print_planfoot(const decostate_t *ds)
wprintf(L"\nDeco model: Buhlmann %s\n", model);
wprintf(L"Conservatism: GF %i/%i, Rq = %s\n", ds->gflo, ds->gfhi, rq);
- wprintf(L"Surface pressure: %4.3fbar\n\n", SURFACE_PRESSURE);
+ wprintf(L"Surface pressure: %4.3fbar\n", SURFACE_PRESSURE);
+}
- wprintf(L"WARNING: DIVE PLAN MAY BE INACCURATE AND MAY CONTAIN\nERRORS THAT COULD LEAD TO INJURY OR DEATH.\n");
+void print_disclaimer(void)
+{
+ wprintf(L"\nWARNING: DIVE PLAN MAY BE INACCURATE AND MAY CONTAIN\nERRORS THAT COULD LEAD TO INJURY OR DEATH.\n");
}