return decimals;
}
-static void set_cylinder_spinbuttons(struct cylinder_widget *cylinder, int ml, int mbar, int start, int end)
+static void set_cylinder_type_spinbuttons(struct cylinder_widget *cylinder, int ml, int mbar)
{
double volume, pressure;
convert_volume_pressure(ml, mbar, &volume, &pressure);
gtk_spin_button_set_value(cylinder->size, volume);
gtk_spin_button_set_value(cylinder->pressure, pressure);
+}
+
+static void set_cylinder_pressure_spinbuttons(struct cylinder_widget *cylinder, int start, int end)
+{
+ double pressure;
convert_pressure(start, &pressure);
gtk_spin_button_set_value(cylinder->start, pressure);
{
GtkTreeIter iter;
GtkTreeModel *model = gtk_combo_box_get_model(combo_box);
- int ml, mbar, start, end;
+ int ml, mbar;
struct cylinder_widget *cylinder = data;
cylinder_t *cyl = current_dive->cylinder + cylinder->index;
gtk_tree_model_get(model, &iter,
CYL_SIZE, &ml,
CYL_WORKP, &mbar,
- CYL_STARTP, &start,
- CYL_ENDP, &end,
-1);
- set_cylinder_spinbuttons(cylinder, ml, mbar, start, end);
+ set_cylinder_type_spinbuttons(cylinder, ml, mbar);
}
/*
mbar = cyl->type.workingpressure.mbar;
add_cylinder(cylinder, desc, ml, mbar);
- set_cylinder_spinbuttons(cylinder,
- cyl->type.size.mliter, cyl->type.workingpressure.mbar,
+ set_cylinder_type_spinbuttons(cylinder,
+ cyl->type.size.mliter, cyl->type.workingpressure.mbar);
+ set_cylinder_pressure_spinbuttons(cylinder,
cyl->start.mbar, cyl->end.mbar);
o2 = cyl->gasmix.o2.permille / 10.0;
gtk_widget_set_sensitive(cylinder->o2, !!o2);