[PATCH] some trivial pressure related stuff
Jan Schubert
Jan.Schubert at GMX.li
Tue Jan 15 09:35:25 PST 2013
This "patch" removes the need for the "string" pressurebuf in planner.c.
It also adds a unit to the partial pressures displayed in the mouse
overlay which are always displayed in bar.
BTW: Has anyone seen a pO2 shown in PSI?
Jan
Signed-off-by: Jan Schubert <Jan.Schubert at GMX.li>
--
diff --git a/planner.c b/planner.c
index 4389aac..4732845 100644
--- a/planner.c
+++ b/planner.c
@@ -909,7 +909,6 @@ void input_plan()
{
GtkWidget *planner, *content, *vbox, *hbox, *outervbox,
*add_row, *deltat, *label, *surfpres;
char starttimebuf[64] = "+60:00";
- char pressurebuf[64] = SURFACE_PRESSURE_STRING;
if (diveplan.dp)
free_dps(diveplan.dp);
@@ -946,7 +945,7 @@ void input_plan()
g_signal_connect(deltat, "focus-out-event",
G_CALLBACK(starttime_focus_out_cb), NULL);
surfpres = add_entry_to_box(hbox, _("Surface Pressure (mbar)"));
gtk_entry_set_max_length(GTK_ENTRY(surfpres), 12);
- gtk_entry_set_text(GTK_ENTRY(surfpres), pressurebuf);
+ gtk_entry_set_text(GTK_ENTRY(surfpres), SURFACE_PRESSURE_STRING);
gtk_widget_add_events(surfpres, GDK_FOCUS_CHANGE_MASK);
g_signal_connect(surfpres, "focus-out-event",
G_CALLBACK(surfpres_focus_out_cb), NULL);
diveplan.when = time(NULL) + 3600;
diff --git a/profile.c b/profile.c
index d30f1d0..5f41492 100644
--- a/profile.c
+++ b/profile.c
@@ -2149,15 +2149,15 @@ static void plot_string(struct plot_data *entry,
char *buf, size_t bufsize,
}
if (prefs.pp_graphs.po2) {
memcpy(buf2, buf, bufsize);
- snprintf(buf, bufsize, "%s\npO" UTF8_SUBSCRIPT_2
":%.2f", buf2, entry->po2);
+ snprintf(buf, bufsize, "%s\npO" UTF8_SUBSCRIPT_2
":%.2fbar", buf2, entry->po2);
}
if (prefs.pp_graphs.pn2) {
memcpy(buf2, buf, bufsize);
- snprintf(buf, bufsize, "%s\npN" UTF8_SUBSCRIPT_2
":%.2f", buf2, entry->pn2);
+ snprintf(buf, bufsize, "%s\npN" UTF8_SUBSCRIPT_2
":%.2fbar", buf2, entry->pn2);
}
if (prefs.pp_graphs.phe) {
memcpy(buf2, buf, bufsize);
- snprintf(buf, bufsize, "%s\npHe:%.2f", buf2, entry->phe);
+ snprintf(buf, bufsize, "%s\npHe:%.2fbar", buf2, entry->phe);
}
if (prefs.mod) {
mod = (int)get_depth_units(entry->mod, NULL, &depth_unit);
More information about the subsurface
mailing list