summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/profile.c b/profile.c
index 6f2e64664..123f25479 100644
--- a/profile.c
+++ b/profile.c
@@ -391,19 +391,23 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st
unsigned int he = event->value >> 16;
unsigned int o2 = event->value & 0xffff;
if (he) {
- snprintf(buffer, sizeof(buffer), "%s: (%u/%u)",
+ snprintf(buffer, sizeof(buffer), "%s:%u/%u",
_(event->name), o2, he);
} else {
if (o2 == 21)
- snprintf(buffer, sizeof(buffer), "%s: %s",
+ snprintf(buffer, sizeof(buffer), "%s:%s",
_(event->name), _("air"));
else
- snprintf(buffer, sizeof(buffer), "%s: %u%% %s",
+ snprintf(buffer, sizeof(buffer), "%s:%u%% %s",
_(event->name), o2, "O" UTF8_SUBSCRIPT_2);
}
+ } else if (event->name && !strcmp(event->name, "SP change")) {
+ snprintf(buffer, sizeof(buffer), "%s:%0.1f", _(event->name), (double) event->value / 1000);
} else {
- snprintf(buffer, sizeof(buffer), "%s: %d", _(event->name), event->value);
+ snprintf(buffer, sizeof(buffer), "%s:%d", _(event->name), event->value);
}
+ } else if (event->name && !strcmp(event->name, "SP change")) {
+ snprintf(buffer, sizeof(buffer), "Bailing out to OC");
} else {
snprintf(buffer, sizeof(buffer), "%s%s", _(event->name),
event->flags == SAMPLE_FLAGS_BEGIN ? " begin" :
@@ -1133,8 +1137,9 @@ static void plot_deco_text(struct graphics_context *gc, struct plot_info *pi)
{
if (prefs.profile_calc_ceiling) {
float x = gc->leftx + (gc->rightx - gc->leftx) / 2;
- float y = gc->topy;
+ float y = gc->topy = 1.0;
text_render_options_t tro = {10, PRESSURE_TEXT, CENTER, -0.2};
+ gc->bottomy = 0.0;
plot_text(gc, &tro, x, y, "GF %.0f/%.0f", prefs.gflow * 100, prefs.gfhigh * 100);
}
}
@@ -1873,7 +1878,7 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
for (j = t0+1; j <= t1; j++) {
int depth = interpolate(entry[-1].depth, entry[0].depth, j - t0, t1 - t0);
double min_pressure = add_segment(depth_to_mbar(depth, dive) / 1000.0,
- &dive->cylinder[cylinderindex].gasmix, 1, entry->po2, dive);
+ &dive->cylinder[cylinderindex].gasmix, 1, entry->po2 * 1000, dive);
tissue_tolerance = min_pressure;
}
if (t0 == t1)