From 0f50b73f9e885ba558b53a201f536e31a832dd22 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 14 Nov 2013 18:45:32 -0200 Subject: Fix planner / add dive handling of DiveHandler Points Dirk, is this really necessary or it's just something that you forgot to remove? this is adding a bit of pain to fix some issues on the planner, so I'm commenting this out untill you have a bit of time to look at it. It looks like this was added to handle the gas in the pos-1, but you reverted if so, this completely reverts it, and things works as expected again. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 1c8448394..09214a625 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -422,7 +422,7 @@ void DivePlannerGraphics::mouseDoubleClickEvent(QMouseEvent* event) void DivePlannerPointsModel::createSimpleDive() { - plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0); +// plannerModel->addStop(0, 0, O2_IN_AIR, 0, 0); plannerModel->addStop(M_OR_FT(15,45), 1 * 60, O2_IN_AIR, 0, 0); plannerModel->addStop(M_OR_FT(15,45), 40 * 60, O2_IN_AIR, 0, 0); plannerModel->addStop(M_OR_FT(5,15), 42 * 60, O2_IN_AIR, 0, 0); @@ -517,7 +517,7 @@ void DivePlannerGraphics::drawProfile() // Re-position the user generated dive handlers int last = 0; - for (int i = 1; i < plannerModel->rowCount(); i++) { + for (int i = 0; i < plannerModel->rowCount(); i++) { divedatapoint dp = plannerModel->at(i); if (dp.time == 0) // those are the magic entries for tanks continue; @@ -1161,6 +1161,11 @@ int DivePlannerPointsModel::addStop(int milimeters, int minutes, int o2, int he, if (o2 != -1) if (!addGas(o2, he)) qDebug("addGas failed"); // FIXME add error propagation + /* + * Dirk, is this really necessary or it's just something that you forgot + * to remove? this is adding a bit of pain to fix some issues on the planner, + * so I'm commenting this out untill you have a bit of time to look at it. + * if(row == 0) { if (o2 == -1) { o2 = O2_IN_AIR; @@ -1176,7 +1181,7 @@ int DivePlannerPointsModel::addStop(int milimeters, int minutes, int o2, int he, divepoints.append( point ); endInsertRows(); row++; - } + } */ // check if there's already a new stop before this one: for (int i = 0; i < row; i++) { -- cgit v1.2.3-70-g09d2