mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-12 14:06:15 +00:00
Planner: update cylinder mixes and MND and MOD when prefs are changed
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ffca5674bf
commit
bb31517951
3 changed files with 6 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
||||||
#define UNIT_FACTOR ((prefs.units.length == units::METERS) ? 1000.0 / 60.0 : feet_to_mm(1.0) / 60.0)
|
#define UNIT_FACTOR ((prefs.units.length == units::METERS) ? 1000.0 / 60.0 : feet_to_mm(1.0) / 60.0)
|
||||||
|
|
||||||
static DivePlannerPointsModel* plannerModel = DivePlannerPointsModel::instance();
|
static DivePlannerPointsModel* plannerModel = DivePlannerPointsModel::instance();
|
||||||
|
static CylindersModel* cylinderModel = CylindersModel::instance();
|
||||||
|
|
||||||
DiveHandler::DiveHandler() : QGraphicsEllipseItem()
|
DiveHandler::DiveHandler() : QGraphicsEllipseItem()
|
||||||
{
|
{
|
||||||
|
@ -354,8 +355,10 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
||||||
connect(ui.descRate, SIGNAL(valueChanged(int)), this, SLOT(setDescRate(int)));
|
connect(ui.descRate, SIGNAL(valueChanged(int)), this, SLOT(setDescRate(int)));
|
||||||
connect(ui.descRate, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged()));
|
connect(ui.descRate, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged()));
|
||||||
connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double)));
|
connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double)));
|
||||||
|
connect(ui.bottompo2, SIGNAL(valueChanged(double)), cylinderModel, SLOT(updateBestMixes()));
|
||||||
connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double)));
|
connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double)));
|
||||||
connect(ui.bestmixEND, SIGNAL(valueChanged(int)), this, SLOT(setBestmixEND(int)));
|
connect(ui.bestmixEND, SIGNAL(valueChanged(int)), this, SLOT(setBestmixEND(int)));
|
||||||
|
connect(ui.bestmixEND, SIGNAL(valueChanged(int)), cylinderModel, SLOT(updateBestMixes()));
|
||||||
connect(ui.drop_stone_mode, SIGNAL(toggled(bool)), plannerModel, SLOT(setDropStoneMode(bool)));
|
connect(ui.drop_stone_mode, SIGNAL(toggled(bool)), plannerModel, SLOT(setDropStoneMode(bool)));
|
||||||
connect(ui.bottomSAC, SIGNAL(valueChanged(double)), this, SLOT(bottomSacChanged(double)));
|
connect(ui.bottomSAC, SIGNAL(valueChanged(double)), this, SLOT(bottomSacChanged(double)));
|
||||||
connect(ui.decoStopSAC, SIGNAL(valueChanged(double)), this, SLOT(decoSacChanged(double)));
|
connect(ui.decoStopSAC, SIGNAL(valueChanged(double)), this, SLOT(decoSacChanged(double)));
|
||||||
|
|
|
@ -506,6 +506,8 @@ bool CylindersModel::updateBestMixes()
|
||||||
gasUpdated = true;
|
gasUpdated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* This slot is called when the bottom pO2 and END preferences are updated, we want to
|
||||||
|
* emit dataChanged so MOD and MND are refreshed, even if the gas mix hasn't been changed */
|
||||||
emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, COLUMNS - 1));
|
emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, COLUMNS - 1));
|
||||||
return gasUpdated;
|
return gasUpdated;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,13 +38,13 @@ public:
|
||||||
void updateDive();
|
void updateDive();
|
||||||
void copyFromDive(struct dive *d);
|
void copyFromDive(struct dive *d);
|
||||||
void updateDecoDepths(pressure_t olddecopo2);
|
void updateDecoDepths(pressure_t olddecopo2);
|
||||||
bool updateBestMixes();
|
|
||||||
cylinder_t *cylinderAt(const QModelIndex &index);
|
cylinder_t *cylinderAt(const QModelIndex &index);
|
||||||
bool changed;
|
bool changed;
|
||||||
|
|
||||||
public
|
public
|
||||||
slots:
|
slots:
|
||||||
void remove(const QModelIndex &index);
|
void remove(const QModelIndex &index);
|
||||||
|
bool updateBestMixes();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int rows;
|
int rows;
|
||||||
|
|
Loading…
Add table
Reference in a new issue