summaryrefslogtreecommitdiffstats
path: root/profile-widget/tankitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget/tankitem.cpp')
-rw-r--r--profile-widget/tankitem.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp
index 89ddffed9..e2b528eb2 100644
--- a/profile-widget/tankitem.cpp
+++ b/profile-widget/tankitem.cpp
@@ -98,20 +98,24 @@ void TankItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &b
// walk the list and figure out which tanks go where
struct plot_data *entry = pInfoEntry;
struct plot_data *lastentry = pInfoEntry;
- int cylIdx = entry->sensor[0];
+ int cylIdx = 0; // explicit_first_cylinder(dive, dc)
int i = -1;
int startTime = 0;
struct gasmix *gas = &diveCylinderStore.cylinder[cylIdx].gasmix;
qreal width, left;
+
+ // FIXME! This used to depend on the sensor indexes that we no longer have
+ // We should use gaschange events or something
while (++i < pInfoNr) {
+ int newIdx = 0; // get_next_event(dc->events, "gaschange");
entry = &pInfoEntry[i];
lastentry = &pInfoEntry[i-1];
- if (entry->sensor[0] == cylIdx)
+ if (newIdx == cylIdx)
continue;
width = hAxis->posAtValue(lastentry->sec) - hAxis->posAtValue(startTime);
left = hAxis->posAtValue(startTime);
createBar(left, width, gas);
- cylIdx = entry->sensor[0];
+ cylIdx = newIdx;
gas = &diveCylinderStore.cylinder[cylIdx].gasmix;
startTime = lastentry->sec;
}