X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=7caa5da9f98eb40071bbc390bef39ab93fc9eaac;hb=d906c82f31c5406b6debe0df88cb49b916cd6ced;hp=f81ae7138dae8f92a91c9eb26739ef06456bd0d0;hpb=18b8247cb357a9a716846854e451e306b752e542;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index f81ae71..7caa5da 100644 --- a/profile.c +++ b/profile.c @@ -611,32 +611,13 @@ static void plot_cylinder_pressure(struct graphics_context *gc, struct plot_info plot_pressure_helper(gc, pi, INTERPOLATED_PR); } -static int mbar_to_PSI(int mbar) -{ - pressure_t p = {mbar}; - return to_PSI(p); -} - static void plot_pressure_value(struct graphics_context *gc, int mbar, int sec, int xalign, int yalign) { int pressure; const char *unit; - switch (output_units.pressure) { - case PASCAL: - pressure = mbar * 100; - unit = "pascal"; - break; - case BAR: - pressure = (mbar + 500) / 1000; - unit = "bar"; - break; - case PSI: - pressure = mbar_to_PSI(mbar); - unit = "psi"; - break; - } + pressure = get_pressure_units(mbar, &unit); text_render_options_t tro = {10, 0.2, 1.0, 0.2, xalign, yalign}; plot_text(gc, &tro, sec, mbar, "%d %s", pressure, unit); }