summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-06 16:15:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-09 19:19:04 +0100
commit7c6a904bbff56d9d3ad782b569231e0a0bb16847 (patch)
tree385558c3b918ff2482f8f132cdb95df9cbd1c104 /core
parent4c9532dc516f877e7fc94616dd027508b5f2a12f (diff)
downloadsubsurface-7c6a904bbff56d9d3ad782b569231e0a0bb16847.tar.gz
Profile: use pressure data functions in save_profiles_buffer
The save_profiles_buffer() function was accessing the pressure data directly. Instead, use the already existing funcions to make transition to dynamically allocated pressure data more seamless. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/save-profiledata.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/save-profiledata.c b/core/save-profiledata.c
index 7802f7cd3..4f7440708 100644
--- a/core/save-profiledata.c
+++ b/core/save-profiledata.c
@@ -31,16 +31,15 @@ static void put_video_time(struct membuffer *b, int secs)
put_format(b, "%d:%02d:%02d.000,", hours, mins, secs);
}
-static void put_pd(struct membuffer *b, struct plot_data *entry)
+static void put_pd(struct membuffer *b, const struct plot_info *pi, int idx)
{
- if (!entry)
- return;
+ const struct plot_data *entry = pi->entry + idx;
put_int(b, entry->in_deco);
put_int(b, entry->sec);
for (int c = 0; c < MAX_CYLINDERS; c++) {
- put_int(b, entry->pressure[c][0]);
- put_int(b, entry->pressure[c][1]);
+ put_int(b, get_plot_sensor_pressure(pi, idx, c));
+ put_int(b, get_plot_interpolated_pressure(pi, idx, c));
}
put_int(b, entry->temperature);
put_int(b, entry->depth);
@@ -208,7 +207,7 @@ static void save_profiles_buffer(struct membuffer *b, bool select_only)
put_format(b, "\n");
for (int i = 0; i < pi.nr; i++) {
- put_pd(b, &pi.entry[i]);
+ put_pd(b, &pi, i);
put_format(b, "\n");
}
put_format(b, "\n");