Fix cylinder printout information

Dirk Hohndel dirk at hohndel.org
Sun Jan 6 14:37:00 PST 2013


Salvador Cuñat <salvador.cunat at gmail.com> writes:
> Yes, it was the latter. In metric a working pressure is senseless and may have interest only when describing the tank.
>
>> 
>> BTW: I notice that we are printing OTUs and CNS... wouldn't it be even
>> more interesting to print the SAC rate above those two? 
>> 
>
> Here is attached a patch whith the SAC (lowering the OTU to the third line, as there is still room for it), and some little corrections relative to scaling, font size and repetitive operations.
>
> I've been thinking on using get_volume_units(cyl->type.size.mliter, &decimal, &unit)  where there isn't a cyl->type.description (usually every imported dive),  as we are getting now a blank space.
>
> Regards
> +/* Print the SAC */
> +static void print_SAC (struct dive *dive, cairo_t *cr, int maxwidth, int maxheight, PangoFontDescription *font)
> +{
...
> +	cairo_move_to (cr, (2 * maxwidth) / (3 * (double) PANGO_SCALE), 0);
> +	snprintf(buffer, sizeof(buffer), "%d", dive->sac/1000);

That's once again not the way I would suggest that you do this... SAC
rate is basically a volume (well, a volume per minute), so you should
use get_volume_units for it...

Sadly, the world is not a metric place. Even though there's again a
petition up to have the US finally switch. Which (if it were to happen)
might mean that in about two generations (let's say 60-80 years) we can
start thinking about dropping ft/psi/ft^3/F etc...


/D


More information about the subsurface mailing list