summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-17 14:43:25 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-17 14:04:47 -0800
commit779c1b6738c4378be79a46b744da2c556380ca32 (patch)
tree699733e78e58c6c14cc12e2aa4ab30a6737a99db /profile.c
parent0787347691aec0521f1e3fa749415aae70bd4cd3 (diff)
downloadsubsurface-779c1b6738c4378be79a46b744da2c556380ca32.tar.gz
Create a version of create_graph_info that doesn't depend on GC.
This version of the create plot info is the same as before, with the difference that it doesn't depends on the gc. Also fixed a crash. The Pressure Index, Information and interpolated seems wrong, I'm getting only zeroes. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index 23903d99f..a24cd1682 100644
--- a/profile.c
+++ b/profile.c
@@ -1300,6 +1300,24 @@ struct plot_info *create_plot_info(struct dive *dive, struct divecomputer *dc, s
return analyze_plot_info(pi);
}
+void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi)
+{
+ if (prefs.profile_calc_ceiling) /* reset deco information to start the calculation */
+ init_decompression(dive);
+ if (last_pi_entry) /* Create the new plot data */
+ free((void *)last_pi_entry);
+ last_pi_entry = populate_plot_entries(dive, dc, pi);
+ check_gas_change_events(dive, dc, pi); /* Populate the gas index from the gas change events */
+ setup_gas_sensor_pressure(dive, dc, pi); /* Try to populate our gas pressure knowledge */
+ populate_pressure_information(dive, dc, pi);/* .. calculate missing pressure entries */
+ calculate_sac(dive, pi); /* Calculate sac */
+ if (prefs.profile_calc_ceiling) /* Then, calculate deco information */
+ calculate_deco_information(dive, dc, pi, false);
+ calculate_gas_information(dive, pi); /* And finaly calculate gas partial pressures */
+ pi->meandepth = dive->dc.meandepth.mm;
+ analyze_plot_info(pi);
+}
+
/* make sure you pass this the FIRST dc - it just walks the list */
static int nr_dcs(struct divecomputer *main)
{