summaryrefslogtreecommitdiffstats
path: root/qt-ui/profilegraphics.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-10-14 23:48:43 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-17 14:54:11 -0700
commit437246d3ed280e2275fddc125f2f14005cc11dab (patch)
tree221b4afa6334acc31af1a1cafd7e170687c0d3ef /qt-ui/profilegraphics.cpp
parent0bdf11b09406672853473132929fed1de1bcd492 (diff)
downloadsubsurface-437246d3ed280e2275fddc125f2f14005cc11dab.tar.gz
Move sac-calculation to profile.c
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r--qt-ui/profilegraphics.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index e5b5cd50a..cba803de2 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -694,11 +694,9 @@ void ProfileGraphicsView::plot_single_temp_text(int sec, int mkelvin)
void ProfileGraphicsView::plot_cylinder_pressure()
{
int i;
- int last = -1, last_index = -1;
+ int last_index = -1;
int lift_pen = FALSE;
int first_plot = TRUE;
- int sac = 0;
- struct plot_data *last_entry = NULL;
if (!get_cylinder_pressure_range(&gc))
return;
@@ -711,29 +709,13 @@ void ProfileGraphicsView::plot_cylinder_pressure()
mbar = GET_PRESSURE(entry);
if (entry->cylinderindex != last_index) {
lift_pen = TRUE;
- last_entry = NULL;
}
if (!mbar) {
lift_pen = TRUE;
continue;
}
- if (!last_entry) {
- last = i;
- last_entry = entry;
- sac = get_local_sac(entry, gc.pi.entry + i + 1, dive);
- } else {
- int j;
- sac = 0;
- for (j = last; j < i; j++)
- sac += get_local_sac(gc.pi.entry + j, gc.pi.entry + j + 1, dive);
- sac /= (i - last);
- if (entry->sec - last_entry->sec >= SAC_WINDOW) {
- last++;
- last_entry = gc.pi.entry + last;
- }
- }
- QColor c = get_sac_color(sac, dive->sac);
+ QColor c = get_sac_color(entry->sac, dive->sac);
if (lift_pen) {
if (!first_plot && entry->cylinderindex == last_index) {