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>
This commit is contained in:
Tomaz Canabrava 2013-09-09 07:18:22 -03:00
parent 64864fea9c
commit 545c76992a
2 changed files with 16 additions and 4 deletions

View file

@ -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;
}

View file

@ -39,6 +39,7 @@ public:
int addStop(int meters, int minutes,const QString& gas, int ccpoint );
void editStop(int row, divedatapoint newData );
divedatapoint at(int row);
struct diveplan getDiveplan();
public slots:
void setGFHigh(short gfhigh);
void setGFLow(short ghflow);