mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: change get_plot_pressure to take index instead of pointer
The goal here is to make it possible to detach the pressure related data from the plot_info structure. Thus, the pressure related data can be allocated independently depending on the number of cylinders per dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fbd74c26d6
commit
4724c88533
5 changed files with 80 additions and 71 deletions
|
@ -665,11 +665,12 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
|
|||
QPolygonF boundingPoly;
|
||||
polygons.clear();
|
||||
|
||||
const struct plot_info *pInfo = &dataModel->data();
|
||||
for (int i = 0, count = dataModel->rowCount(); i < count; i++) {
|
||||
struct plot_data *entry = dataModel->data().entry + i;
|
||||
const struct plot_data *entry = pInfo->entry + i;
|
||||
|
||||
for (int cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
|
||||
int mbar = get_plot_pressure(entry, cyl);
|
||||
int mbar = get_plot_pressure(pInfo, i, cyl);
|
||||
int time = entry->sec;
|
||||
|
||||
if (!mbar)
|
||||
|
@ -726,10 +727,10 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex &topLeft, const QMo
|
|||
double axisLog = log10(log10(axisRange));
|
||||
|
||||
for (int i = 0, count = dataModel->rowCount(); i < count; i++) {
|
||||
struct plot_data *entry = dataModel->data().entry + i;
|
||||
const struct plot_data *entry = pInfo->entry + i;
|
||||
|
||||
for (int cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
|
||||
int mbar = get_plot_pressure(entry, cyl);
|
||||
int mbar = get_plot_pressure(pInfo, i, cyl);
|
||||
|
||||
if (!mbar)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue