diff options
Diffstat (limited to 'core/equipment.c')
-rw-r--r-- | core/equipment.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/equipment.c b/core/equipment.c index 3eccfd6b5..8a3b172ef 100644 --- a/core/equipment.c +++ b/core/equipment.c @@ -242,3 +242,24 @@ void reset_cylinders(struct dive *dive, bool track_gas) cyl->deco_gas_used.mliter = 0; } } + +#ifdef DEBUG_CYL +void dump_cylinders(struct dive *dive, bool verbose) +{ + printf("Cylinder list:\n"); + for (int i = 0; i < MAX_CYLINDERS; i++) { + cylinder_t *cyl = &dive->cylinder[i]; + + printf("%02d: Type %s, %3.1fl, %3.0fbar\n", i, cyl->type.description, cyl->type.size.mliter / 1000.0, cyl->type.workingpressure.mbar / 1000.0); + printf(" Gasmix O2 %2.0f%% He %2.0f%%\n", cyl->gasmix.o2.permille / 10.0, cyl->gasmix.he.permille / 10.0); + printf(" Pressure Start %3.0fbar End %3.0fbar Sample start %3.0fbar Sample end %3.0fbar\n", cyl->start.mbar / 1000.0, cyl->end.mbar / 1000.0, cyl->sample_start.mbar / 1000.0, cyl->sample_end.mbar / 1000.0); + if (verbose) { + printf(" Depth %3.0fm\n", cyl->depth.mm / 1000.0); + printf(" Added %s\n", (cyl->manually_added ? "manually" : "")); + printf(" Gas used Bottom %5.0fl Deco %5.0fl\n", cyl->gas_used.mliter / 1000.0, cyl->deco_gas_used.mliter / 1000.0); + printf(" Use %d\n", cyl->cylinder_use); + printf(" Bestmix %s %s\n", (cyl->bestmix_o2 ? "O2" : " "), (cyl->bestmix_he ? "He" : " ")); + } + } +} +#endif |