Do per cylinder statistics

This shows how much gas form each cylinder was used. I would like to add
SAC to that list too but it became a mess trying to calculate average
depth per cylinder.

Design based on idea in #284

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2013-11-20 00:29:32 +01:00 committed by Dirk Hohndel
parent 732f7a69b0
commit eb027f2a4b
3 changed files with 18 additions and 10 deletions

View file

@ -350,7 +350,12 @@ void MainTab::updateDiveInfo(int dive)
ui.otuText->setText(QString("%1").arg(d->otu));
ui.waterTemperatureText->setText(get_temperature_string(d->watertemp, TRUE));
ui.airTemperatureText->setText(get_temperature_string(d->airtemp, TRUE));
ui.gasUsedText->setText(get_volume_string(get_gas_used(d), TRUE));
volume_t gases[MAX_CYLINDERS] = { 0 };
get_gas_used(d, gases);
QString volumes = get_volume_string(gases[0], TRUE);
for(int i=1; i < MAX_CYLINDERS && gases[i].mliter != 0; i++)
volumes.append("\n" + get_volume_string(gases[i], TRUE));
ui.gasUsedText->setText(volumes);
ui.oxygenHeliumText->setText(get_gaslist(d));
ui.dateText->setText(get_short_dive_date_string(d->when));
ui.diveTimeText->setText(QString::number((int)((d->duration.seconds + 30) / 60)));