summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/planner.c22
-rw-r--r--qt-models/cylindermodel.cpp4
-rw-r--r--qt-models/diveplannermodel.cpp52
-rw-r--r--qt-models/diveplannermodel.h5
4 files changed, 0 insertions, 83 deletions
diff --git a/core/planner.c b/core/planner.c
index 8ce1e29bd..8a2e1d649 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -219,24 +219,6 @@ void fill_default_cylinder(cylinder_t *cyl)
cyl->depth = gas_mod(&cyl->gasmix, pO2, &displayed_dive, 1);
}
-/* make sure that the gas we are switching to is represented in our
- * list of cylinders */
-static int verify_gas_exists(struct gasmix mix_in)
-{
- int i;
- cylinder_t *cyl;
-
- for (i = 0; i < MAX_CYLINDERS; i++) {
- cyl = displayed_dive.cylinder + i;
- if (cylinder_nodata(cyl))
- continue;
- if (gasmix_distance(&cyl->gasmix, &mix_in) < 100)
- return i;
- }
- fprintf(stderr, "this gas %s should have been on the cylinder list\nThings will fail now\n", gasname(&mix_in));
- return -1;
-}
-
/* calculate the new end pressure of the cylinder, based on its current end pressure and the
* latest segment. */
static void update_cylinder_pressure(struct dive *d, int old_depth, int new_depth, int duration, int sac, cylinder_t *cyl, bool in_deco)
@@ -370,10 +352,6 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
save_dive(stdout, &displayed_dive);
#endif
return;
-
-gas_error_exit:
- report_error(translate("gettextFromC", "Too many gas mixes"));
- return;
}
void free_dps(struct diveplan *diveplan)
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index d944d204e..f3496855d 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -210,9 +210,6 @@ void CylindersModel::passInData(const QModelIndex &index, const QVariant &value)
bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
QString vString;
- bool addDiveMode = DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING;
- if (addDiveMode)
- DivePlannerPointsModel::instance()->rememberTanks();
cylinder_t *cyl = cylinderAt(index);
switch (index.column()) {
@@ -472,7 +469,6 @@ void CylindersModel::updateDecoDepths(pressure_t olddecopo2)
decopo2.mbar = prefs.decopo2;
for (int i = 0; i < MAX_CYLINDERS; i++) {
cylinder_t *cyl = &displayed_dive.cylinder[i];
- struct gasmix *mygas = &cyl->gasmix;
/* If the gas's deco MOD matches the old pO2, it will have been automatically calculated and should be updated.
* If they don't match, we should leave the user entered depth as it is */
if (cyl->depth.mm == gas_mod(&cyl->gasmix, olddecopo2, &displayed_dive, M_OR_FT(3, 10)).mm) {
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 69706c88f..03cc90e06 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -551,43 +551,6 @@ bool divePointsLessThan(const divedatapoint &p1, const divedatapoint &p2)
return p1.time <= p2.time;
}
-bool DivePlannerPointsModel::addGas(struct gasmix mix)
-{
- sanitize_gasmix(&mix);
-
- for (int i = 0; i < MAX_CYLINDERS; i++) {
- cylinder_t *cyl = &displayed_dive.cylinder[i];
- if (cylinder_nodata(cyl)) {
- fill_default_cylinder(cyl);
- cyl->gasmix = mix;
- /* The depth to change to that gas is given by the depth where its pO₂ is 1.6 bar.
- * The user should be able to change this depth manually. */
- pressure_t modpO2;
- if (displayed_dive.dc.divemode == PSCR)
- modpO2.mbar = prefs.decopo2 + (1000 - get_o2(&mix)) * SURFACE_PRESSURE *
- prefs.o2consumption / prefs.decosac / prefs.pscr_ratio;
- else
- modpO2.mbar = prefs.decopo2;
- cyl->depth = gas_mod(&mix, modpO2, &displayed_dive, M_OR_FT(3,10));
-
-
-
-
- // FIXME -- need to get rid of stagingDIve
- // the following now uses displayed_dive !!!!
-
-
-
- CylindersModel::instance()->updateDive();
- return true;
- }
- if (!gasmix_distance(&cyl->gasmix, &mix))
- return true;
- }
- qDebug("too many gases");
- return false;
-}
-
int DivePlannerPointsModel::lastEnteredPoint()
{
for (int i = divepoints.count() - 1; i >= 0; i--)
@@ -756,21 +719,6 @@ DivePlannerPointsModel::Mode DivePlannerPointsModel::currentMode() const
return mode;
}
-QVector<QPair<int, int> > DivePlannerPointsModel::collectGases(struct dive *d)
-{
- QVector<QPair<int, int> > l;
- for (int i = 0; i < MAX_CYLINDERS; i++) {
- cylinder_t *cyl = &d->cylinder[i];
- if (!cylinder_nodata(cyl))
- l.push_back(qMakePair(get_o2(&cyl->gasmix), get_he(&cyl->gasmix)));
- }
- return l;
-}
-void DivePlannerPointsModel::rememberTanks()
-{
- oldGases = collectGases(&displayed_dive);
-}
-
bool DivePlannerPointsModel::tankInUse(int cylinderid)
{
for (int j = 0; j < rowCount(); j++) {
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h
index 2525e7695..8e76d9bba 100644
--- a/qt-models/diveplannermodel.h
+++ b/qt-models/diveplannermodel.h
@@ -40,8 +40,6 @@ public:
Mode currentMode() const;
bool setRecalc(bool recalc);
bool recalcQ();
- void tanksUpdated();
- void rememberTanks();
bool tankInUse(int cylinderid);
void setupCylinders();
bool updateMaxDepth();
@@ -53,7 +51,6 @@ public:
int size();
struct diveplan &getDiveplan();
QStringList &getGasList();
- QVector<QPair<int, int> > collectGases(dive *d);
int lastEnteredPoint();
void removeDeco();
static bool addingDeco;
@@ -105,14 +102,12 @@ signals:
private:
explicit DivePlannerPointsModel(QObject *parent = 0);
- bool addGas(struct gasmix mix);
void createPlan(bool replanCopy);
struct diveplan diveplan;
Mode mode;
bool recalc;
QVector<divedatapoint> divepoints;
QVector<sample> backupSamples; // For editing added dives.
- QVector<QPair<int, int> > oldGases;
QDateTime startTime;
int tempGFHigh;
int tempGFLow;