mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
Planner: pass dive to analyze_gaslist()
Use the actual planned dive, not the displayed dive in analyze_gaslist(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
90ea46ff31
commit
ff40afc1d8
1 changed files with 4 additions and 4 deletions
|
@ -406,12 +406,12 @@ struct gaschanges {
|
||||||
int gasidx;
|
int gasidx;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gaschanges *analyze_gaslist(struct diveplan *diveplan, int *gaschangenr, int depth, int *asc_cylinder)
|
static struct gaschanges *analyze_gaslist(struct diveplan *diveplan, struct dive *dive, int *gaschangenr, int depth, int *asc_cylinder)
|
||||||
{
|
{
|
||||||
int nr = 0;
|
int nr = 0;
|
||||||
struct gaschanges *gaschanges = NULL;
|
struct gaschanges *gaschanges = NULL;
|
||||||
struct divedatapoint *dp = diveplan->dp;
|
struct divedatapoint *dp = diveplan->dp;
|
||||||
int best_depth = displayed_dive.cylinder[*asc_cylinder].depth.mm;
|
int best_depth = dive->cylinder[*asc_cylinder].depth.mm;
|
||||||
bool total_time_zero = true;
|
bool total_time_zero = true;
|
||||||
while (dp) {
|
while (dp) {
|
||||||
if (dp->time == 0 && total_time_zero) {
|
if (dp->time == 0 && total_time_zero) {
|
||||||
|
@ -446,7 +446,7 @@ static struct gaschanges *analyze_gaslist(struct diveplan *diveplan, int *gascha
|
||||||
for (nr = 0; nr < *gaschangenr; nr++) {
|
for (nr = 0; nr < *gaschangenr; nr++) {
|
||||||
int idx = gaschanges[nr].gasidx;
|
int idx = gaschanges[nr].gasidx;
|
||||||
printf("gaschange nr %d: @ %5.2lfm gasidx %d (%s)\n", nr, gaschanges[nr].depth / 1000.0,
|
printf("gaschange nr %d: @ %5.2lfm gasidx %d (%s)\n", nr, gaschanges[nr].depth / 1000.0,
|
||||||
idx, gasname(&displayed_dive.cylinder[idx].gasmix));
|
idx, gasname(dive->cylinder[idx].gasmix));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return gaschanges;
|
return gaschanges;
|
||||||
|
@ -762,7 +762,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
|
||||||
gaschanges = NULL;
|
gaschanges = NULL;
|
||||||
gaschangenr = 0;
|
gaschangenr = 0;
|
||||||
} else {
|
} else {
|
||||||
gaschanges = analyze_gaslist(diveplan, &gaschangenr, depth, &best_first_ascend_cylinder);
|
gaschanges = analyze_gaslist(diveplan, dive, &gaschangenr, depth, &best_first_ascend_cylinder);
|
||||||
}
|
}
|
||||||
/* Find the first potential decostopdepth above current depth */
|
/* Find the first potential decostopdepth above current depth */
|
||||||
for (stopidx = 0; stopidx < decostoplevelcount; stopidx++)
|
for (stopidx = 0; stopidx < decostoplevelcount; stopidx++)
|
||||||
|
|
Loading…
Add table
Reference in a new issue