summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-01 20:13:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-01 20:13:14 -0700
commitb26ca781b87371e77b851298093b0a7136be64fa (patch)
tree287bc1a886661a5bf6f2eb49c778d40347edb36a /profile.c
parenta487f6c9314f0fe5e4173b670d9653067285da21 (diff)
downloadsubsurface-b26ca781b87371e77b851298093b0a7136be64fa.tar.gz
Use unit functions to get column headers, add unit function for pressure
Finally getting more consistent overall in how we convert between the different units and how we decide which units to display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/profile.c b/profile.c
index f81ae7138..7caa5da9f 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);
}