mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: move max_gas() from DivePlotDataModel to ProfileScene
There is only one user of this - let's remove complex interdependencies. Note: there seem to be two independent plot_infos: in the ProfileScene and in the DivePlotDataModel. To avoid behavioral change, this keeps using the DivePlotDataModel's version. In any case, this has to be unified. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1df1f3d0b5
commit
e0f44237cc
3 changed files with 13 additions and 30 deletions
|
@ -178,28 +178,3 @@ void DivePlotDataModel::setDive(const plot_info &info)
|
|||
memcpy(pInfo.pressures, info.pressures, sizeof(plot_pressure_data) * pInfo.nr_cylinders * pInfo.nr);
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
static double max_gas(const plot_info &pi, double gas_pressures::*gas)
|
||||
{
|
||||
double ret = -1;
|
||||
for (int i = 0; i < pi.nr; ++i) {
|
||||
if (pi.entry[i].pressures.*gas > ret)
|
||||
ret = pi.entry[i].pressures.*gas;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
double DivePlotDataModel::pheMax() const
|
||||
{
|
||||
return max_gas(pInfo, &gas_pressures::he);
|
||||
}
|
||||
|
||||
double DivePlotDataModel::pn2Max() const
|
||||
{
|
||||
return max_gas(pInfo, &gas_pressures::n2);
|
||||
}
|
||||
|
||||
double DivePlotDataModel::po2Max() const
|
||||
{
|
||||
return max_gas(pInfo, &gas_pressures::o2);
|
||||
}
|
||||
|
|
|
@ -63,9 +63,6 @@ public:
|
|||
void clear();
|
||||
void setDive(const plot_info &pInfo);
|
||||
const plot_info &data() const;
|
||||
double pheMax() const;
|
||||
double pn2Max() const;
|
||||
double po2Max() const;
|
||||
|
||||
private:
|
||||
struct plot_info pInfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue