Changeset a8e8d56 in subsurface


Ignore:
Timestamp:
Jan 16, 2017, 3:22:33 AM (10 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
7f7c008
Parents:
7725842
git-author:
Linus Torvalds <torvalds@…> (01/15/17 16:07:35)
git-committer:
Dirk Hohndel <dirk@…> (01/16/17 03:22:33)
Message:

Tweak cylinder equipment tooltips

While playing around with the current subsurface, I realized that while we
give the gas volume and Z factor for the beginning/end pressures in the
newly added tooltips, there is no way to actually see that same
information for the working pressure.

So if you have filled in cylinder type information, but don't have any
actual gas usage information, there will be no cylinder tooltips at all.
But you might still want to know what the actual volume for a particular
cylinder is, and what the Z value for that working pressure is.

So this tweaks the tool-tips a bit.

When mousing over the pressure fields (ie "working pressure", "start" and
"end"), it now always gives the cylinder gas volume and Z factor for that
pressure, so for example on an AL72 that has a working pressure of 3000
psi and that contains air the tooltip will say:

69 cuft, Z=1.040

when you mouse over the working pressure field (that's obviously with
imperial units, in metric you'll see liters of gas).

When mousing over the type/size field, it gives the used gas amounts, ie
something like this:

37 cuft (82 cuft -> 45 cuft)

but if the cylinder doesn't have starting/ending pressures (and thus no
used gas information), this patch will make subsurface show the working
pressure data instead, so that you at least get something.

This all seems more useful than what my first version gave.

NOTE! This makes commit adaeb506b7a1 ("Show both the nominal and "real"
size for an imperial cylinder") kind of pointless. You now see the real
size in the tooltip when you mouse over the size, and now it actually
works both for imperial and metric people, so the tooltip is in many ways
the better model.

Signed-off-by: Linus Torvalds <torvalds@…>
Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/cylindermodel.cpp

    r638e7fb ra8e8d56  
    6464}
    6565
     66static QVariant gas_wp_tooltip(cylinder_t *cyl);
     67
    6668static QVariant gas_usage_tooltip(cylinder_t *cyl)
    6769{
     
    7678
    7779        if (!used)
    78                 return QVariant();
     80                return gas_wp_tooltip(cyl);
    7981
    8082        return gas_volume_string(used, "(") +
     
    9395        Z = gas_compressibility_factor(&cyl->gasmix, p.mbar / 1000.0);
    9496        return gas_volume_string(vol, "(Z=") + QString("%1)").arg(Z, 0, 'f', 3);
     97}
     98
     99static QVariant gas_wp_tooltip(cylinder_t *cyl)
     100{
     101        return gas_volume_tooltip(cyl, cyl->type.workingpressure);
    95102}
    96103
     
    229236                        ret = tr("Clicking here will remove this cylinder.");
    230237                        break;
     238                case TYPE:
    231239                case SIZE:
     240                        return gas_usage_tooltip(cyl);
    232241                case WORKINGPRESS:
    233                         return gas_usage_tooltip(cyl);
     242                        return gas_wp_tooltip(cyl);
    234243                case START:
    235244                        return gas_start_tooltip(cyl);
Note: See TracChangeset for help on using the changeset viewer.