mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Add debug function dump_cylinders
This function can be used to dump print all cylinder data. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
4e36b2509c
commit
8a92484b0c
3 changed files with 27 additions and 0 deletions
|
@ -994,6 +994,9 @@ extern bool weightsystems_equal(weightsystem_t *ws1, weightsystem_t *ws2);
|
|||
extern void remove_cylinder(struct dive *dive, int idx);
|
||||
extern void remove_weightsystem(struct dive *dive, int idx);
|
||||
extern void reset_cylinders(struct dive *dive, bool track_gas);
|
||||
#ifdef DEBUG_CYL
|
||||
extern void dump_cylinders(struct dive *dive, bool verbose);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* String handling.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -488,6 +488,9 @@ void CylindersModel::updateDive()
|
|||
{
|
||||
clear();
|
||||
rows = 0;
|
||||
#ifdef DEBUG_CYL
|
||||
dump_cylinders(&displayed_dive, true);
|
||||
#endif
|
||||
for (int i = 0; i < MAX_CYLINDERS; i++) {
|
||||
if (show_cylinder(&displayed_dive, i))
|
||||
rows = i + 1;
|
||||
|
|
Loading…
Reference in a new issue