mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
New profile: enable switching between dive computers
This was mostly in place, just needed to be hooked up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
73d6057424
commit
d1c4bcf570
4 changed files with 14 additions and 3 deletions
|
@ -486,6 +486,7 @@ void MainWindow::on_actionPreviousDC_triggered()
|
||||||
{
|
{
|
||||||
dc_number--;
|
dc_number--;
|
||||||
ui.InfoWidget->updateDiveInfo(selected_dive);
|
ui.InfoWidget->updateDiveInfo(selected_dive);
|
||||||
|
ui.graphicsView->plotDives(QList<struct dive*>() << (current_dive));
|
||||||
redrawProfile();
|
redrawProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,6 +494,7 @@ void MainWindow::on_actionNextDC_triggered()
|
||||||
{
|
{
|
||||||
dc_number++;
|
dc_number++;
|
||||||
ui.InfoWidget->updateDiveInfo(selected_dive);
|
ui.InfoWidget->updateDiveInfo(selected_dive);
|
||||||
|
ui.graphicsView->plotDives(QList<struct dive*>() << (current_dive));
|
||||||
redrawProfile();
|
redrawProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,7 @@ void DivePlotDataModel::setDive(dive* d, const plot_info& info)
|
||||||
clear();
|
clear();
|
||||||
Q_ASSERT(d != NULL);
|
Q_ASSERT(d != NULL);
|
||||||
diveId = d->id;
|
diveId = d->id;
|
||||||
|
dcNr = dc_number;
|
||||||
pInfo = info;
|
pInfo = info;
|
||||||
beginInsertRows(QModelIndex(), 0, pInfo.nr-1);
|
beginInsertRows(QModelIndex(), 0, pInfo.nr-1);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
@ -119,6 +120,11 @@ int DivePlotDataModel::id() const
|
||||||
return diveId;
|
return diveId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DivePlotDataModel::dcShown() const
|
||||||
|
{
|
||||||
|
return dcNr;
|
||||||
|
}
|
||||||
|
|
||||||
#define MAX_PPGAS_FUNC( GAS, GASFUNC ) \
|
#define MAX_PPGAS_FUNC( GAS, GASFUNC ) \
|
||||||
double DivePlotDataModel::GASFUNC() \
|
double DivePlotDataModel::GASFUNC() \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
@ -24,6 +24,7 @@ public:
|
||||||
void setDive(struct dive *d, const plot_info& pInfo);
|
void setDive(struct dive *d, const plot_info& pInfo);
|
||||||
const plot_info& data() const;
|
const plot_info& data() const;
|
||||||
int id() const;
|
int id() const;
|
||||||
|
int dcShown() const;
|
||||||
double pheMax();
|
double pheMax();
|
||||||
double pn2Max();
|
double pn2Max();
|
||||||
double po2Max();
|
double po2Max();
|
||||||
|
@ -32,6 +33,7 @@ public:
|
||||||
private:
|
private:
|
||||||
plot_info pInfo;
|
plot_info pInfo;
|
||||||
int diveId;
|
int diveId;
|
||||||
|
int dcNr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -271,12 +271,13 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
if (!d)
|
if (!d)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// No need to do this again if we are already showing that dive,
|
// No need to do this again if we are already showing the same dive
|
||||||
// so we check the unique id of the dive against the one we are
|
// computer of the same dive, so we check the unique id of the dive
|
||||||
|
// and the selected dive computer number against the ones we are
|
||||||
// showing (can't compare the dive pointers as those might change).
|
// showing (can't compare the dive pointers as those might change).
|
||||||
// I'm unclear what the semantics are supposed to be if we actually
|
// I'm unclear what the semantics are supposed to be if we actually
|
||||||
// use more than one 'dives' as argument - so ignoring that right now :-)
|
// use more than one 'dives' as argument - so ignoring that right now :-)
|
||||||
if (d->id == dataModel->id())
|
if (d->id == dataModel->id() && dc_number == dataModel->dcShown())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setProfileState();
|
setProfileState();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue