aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-09 07:18:22 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-09-09 07:18:22 -0300
commit545c76992a6a9fb3de59c26e782b95d30d5cd513 (patch)
tree283fc8a555e6ddf045d4dd4fcd2cc4557b41aaf8 /qt-ui/diveplanner.cpp
parent64864fea9c5248b61d7f6f01e3d4dab3e100945a (diff)
downloadsubsurface-545c76992a6a9fb3de59c26e782b95d30d5cd513.tar.gz
Plug most of the dive planner - non - model stuff.
Plug most of the dive planner controls that weren't plugged yet - StartTime, ATMPressure, BottomSAC, DecoStopSAC, LowGF and highGF are being used by the calculations now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index ed3091ec1..10ee31e5d 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -426,13 +426,10 @@ void DivePlannerGraphics::createDecoStops()
// Get the user-input and calculate the dive info
// Not sure if this is the place to create the diveplan...
// We just start with a surface node at time = 0
- struct diveplan diveplan;
+ struct diveplan diveplan = plannerModel->getDiveplan();
struct divedatapoint *dp = create_dp(0, 0, 209, 0, 0);
dp->entered = TRUE;
diveplan.dp = dp;
- diveplan.gflow = 30;
- diveplan.gfhigh = 70;
- diveplan.surface_pressure = 1013;
int rowCount = plannerModel->rowCount();
int lastIndex = -1;
@@ -841,6 +838,15 @@ DivePlannerWidget::DivePlannerWidget(QWidget* parent, Qt::WindowFlags f): QWidge
connect(ui->lowGF, SIGNAL(textChanged(QString)), this, SLOT(gflowChanged(QString)));
connect(ui->highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString)));
connect(ui->lastStop, SIGNAL(toggled(bool)), this, SLOT(lastStopChanged(bool)));
+
+ /* set defaults. */
+ ui->startTime->setTime( QTime(1, 0) );
+ ui->ATMPressure->setText( "1013" );
+ ui->bottomSAC->setText("20");
+ ui->decoStopSAC->setText("17");
+ ui->lowGF->setText("30");
+ ui->highGF->setText("75");
+
}
void DivePlannerWidget::startTimeChanged(const QTime& time)
@@ -1058,3 +1064,8 @@ void DivePlannerPointsModel::remove(const QModelIndex& index)
divepoints.remove(index.row());
endRemoveRows();
}
+
+struct diveplan DivePlannerPointsModel::getDiveplan()
+{
+ return diveplan;
+}