mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
64864fea9c
commit
545c76992a
2 changed files with 16 additions and 4 deletions
|
@ -426,13 +426,10 @@ void DivePlannerGraphics::createDecoStops()
|
||||||
// Get the user-input and calculate the dive info
|
// Get the user-input and calculate the dive info
|
||||||
// Not sure if this is the place to create the diveplan...
|
// Not sure if this is the place to create the diveplan...
|
||||||
// We just start with a surface node at time = 0
|
// 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);
|
struct divedatapoint *dp = create_dp(0, 0, 209, 0, 0);
|
||||||
dp->entered = TRUE;
|
dp->entered = TRUE;
|
||||||
diveplan.dp = dp;
|
diveplan.dp = dp;
|
||||||
diveplan.gflow = 30;
|
|
||||||
diveplan.gfhigh = 70;
|
|
||||||
diveplan.surface_pressure = 1013;
|
|
||||||
|
|
||||||
int rowCount = plannerModel->rowCount();
|
int rowCount = plannerModel->rowCount();
|
||||||
int lastIndex = -1;
|
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->lowGF, SIGNAL(textChanged(QString)), this, SLOT(gflowChanged(QString)));
|
||||||
connect(ui->highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString)));
|
connect(ui->highGF, SIGNAL(textChanged(QString)), this, SLOT(gfhighChanged(QString)));
|
||||||
connect(ui->lastStop, SIGNAL(toggled(bool)), this, SLOT(lastStopChanged(bool)));
|
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)
|
void DivePlannerWidget::startTimeChanged(const QTime& time)
|
||||||
|
@ -1058,3 +1064,8 @@ void DivePlannerPointsModel::remove(const QModelIndex& index)
|
||||||
divepoints.remove(index.row());
|
divepoints.remove(index.row());
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct diveplan DivePlannerPointsModel::getDiveplan()
|
||||||
|
{
|
||||||
|
return diveplan;
|
||||||
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
int addStop(int meters, int minutes,const QString& gas, int ccpoint );
|
int addStop(int meters, int minutes,const QString& gas, int ccpoint );
|
||||||
void editStop(int row, divedatapoint newData );
|
void editStop(int row, divedatapoint newData );
|
||||||
divedatapoint at(int row);
|
divedatapoint at(int row);
|
||||||
|
struct diveplan getDiveplan();
|
||||||
public slots:
|
public slots:
|
||||||
void setGFHigh(short gfhigh);
|
void setGFHigh(short gfhigh);
|
||||||
void setGFLow(short ghflow);
|
void setGFLow(short ghflow);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue