Skip to content

Commit

Permalink
Merged also elements, where different gas instance is used
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Oct 2, 2024
1 parent 3e47d2e commit e425a03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 0 additions & 4 deletions projects/planner/src/app/shared/options.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,4 @@ export class OptionsService {
this.options.maxEND =this.units.toMeters(newValues.maxEND);
OptionDefaults.useGeneralRecommended(this.options);
}

// TODO air breaks
// add to recommended options sets? (consider also Gradient factors)
// merge gas switch level with following segment on the same gas
}
13 changes: 7 additions & 6 deletions projects/scuba-physics/src/lib/Segments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ describe('Segments', () => {

beforeEach(() => {
filledSegments = new Segments();
filledSegments.add(20, StandardGases.air, 15);
filledSegments.add(20, StandardGases.air, 15);
filledSegments.add(20, StandardGases.air, 35);
filledSegments.add(5, StandardGases.air, 35);
filledSegments.add(5, StandardGases.air, 3);
filledSegments.add(5, StandardGases.air, 3);
// use copy to enforce content comparison
filledSegments.add(20, StandardGases.air.copy(), 15);
filledSegments.addFlat(StandardGases.air.copy(), 15);
filledSegments.addFlat(StandardGases.air.copy(), 35);
filledSegments.add(5, StandardGases.air.copy(), 35);
filledSegments.addFlat(StandardGases.air.copy(), 3);
filledSegments.addFlat(StandardGases.air.copy(), 3);
});


Expand Down
2 changes: 1 addition & 1 deletion projects/scuba-physics/src/lib/Segments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class Segment {

public contentEquals(toCompare: Segment): boolean {
return this.speed === toCompare.speed &&
this._gas === toCompare._gas;
this._gas.compositionEquals(toCompare._gas);
}

/**
Expand Down

0 comments on commit e425a03

Please sign in to comment.