From 545c76992a6a9fb3de59c26e782b95d30d5cd513 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 9 Sep 2013 07:18:22 -0300 Subject: 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 --- qt-ui/diveplanner.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'qt-ui/diveplanner.cpp') 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; +} -- cgit v1.2.3-70-g09d2