diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-24 14:51:21 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-25 01:19:00 +0100 |
commit | adaeb506b7a1485cab741f12450abeb76e109276 (patch) | |
tree | a1c8637c5e013f56d90859a5beff1164f2a8869b | |
parent | 288aff9dbb58b6e18cf12f4d04502d60f18e74a9 (diff) | |
download | subsurface-adaeb506b7a1485cab741f12450abeb76e109276.tar.gz |
Show both the nominal and "real" size for an imperial cylinder
This is questionable, but perhaps useful.
When showing imperial cylinder sizes, show both the nominal value (with
no compensation for compressibility of the gas) and the "actual" amount
of gas the cylinder contains.
So an AL80 will show as a size of "80 (77)cuft", because while 80 is the
nominal size, the actual amount of gas that will fit is just 77 cuft.
[Dirk Hohndel: adjusted to take translation of the unit into account]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-models/cylindermodel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index f5eb764db..1a587cee6 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -36,9 +36,10 @@ static QString get_cylinder_string(cylinder_t *cyl) // liters: if we don't have a working pressure, we cannot // convert the cylinder size to cuft. if (wp.mbar && prefs.units.volume == units::CUFT) { + double real_value = ml_to_cuft(gas_volume(cyl, wp)); value = ml_to_cuft(ml) * bar_to_atm(wp.mbar / 1000.0); decimals = (value > 20.0) ? 0 : (value > 2.0) ? 1 : 2; - unit = CylindersModel::tr("cuft"); + unit = QString("(%1)%2").arg(real_value, 0, 'f', 0).arg(CylindersModel::tr("cuft")); } else { value = ml / 1000.0; decimals = 1; |