mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Convert plot_gas_value to gasmix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
28093ae957
commit
d740ad1317
4 changed files with 5 additions and 8 deletions
|
@ -137,7 +137,6 @@ private:
|
|||
Ui::DivePlanner ui;
|
||||
};
|
||||
|
||||
QString gasToStr(gasmix gas);
|
||||
QString dpGasToStr(const divedatapoint &p);
|
||||
|
||||
#endif // DIVEPLANNER_H
|
||||
|
|
|
@ -463,8 +463,7 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
|
|||
if (!seen_cyl[cyl]) {
|
||||
plot_pressure_value(mbar, entry->sec, Qt::AlignRight | Qt::AlignTop);
|
||||
plot_gas_value(mbar, entry->sec, Qt::AlignRight | Qt::AlignBottom,
|
||||
get_o2(&dive->cylinder[cyl].gasmix),
|
||||
get_he(&dive->cylinder[cyl].gasmix));
|
||||
dive->cylinder[cyl].gasmix);
|
||||
seen_cyl[cyl] = true;
|
||||
}
|
||||
}
|
||||
|
@ -491,11 +490,9 @@ void DiveGasPressureItem::plot_pressure_value(int mbar, int sec, QFlags<Qt::Alig
|
|||
texts.push_back(text);
|
||||
}
|
||||
|
||||
void DiveGasPressureItem::plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> flags, int o2, int he)
|
||||
void DiveGasPressureItem::plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> flags, struct gasmix gasmix)
|
||||
{
|
||||
QString gas = (is_air(o2, he)) ? tr("air") :
|
||||
(he == 0) ? QString(tr("EAN%1")).arg((o2 + 5) / 10) :
|
||||
QString("%1/%2").arg((o2 + 5) / 10).arg((he + 5) / 10);
|
||||
QString gas = gasToStr(gasmix);
|
||||
DiveTextItem *text = new DiveTextItem(this);
|
||||
text->setPos(hAxis->posAtValue(sec), vAxis->posAtValue(mbar));
|
||||
text->setText(gas);
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
private:
|
||||
void plot_pressure_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> align);
|
||||
void plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> align, int o2, int he);
|
||||
void plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> align, struct gasmix gasmix);
|
||||
QVector<QPolygonF> polygons;
|
||||
};
|
||||
|
||||
|
|
|
@ -15,4 +15,5 @@ QString weight_string(int weight_in_grams);
|
|||
bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_text, bool *parsed);
|
||||
QString printGPSCoords(int lat, int lon);
|
||||
QList<int> getDivesInTrip(dive_trip_t *trip);
|
||||
QString gasToStr(struct gasmix gas);
|
||||
#endif // QTHELPER_H
|
||||
|
|
Loading…
Add table
Reference in a new issue