Skip to content

Commit

Permalink
Replaced nodeco exceeded with event
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Aug 17, 2024
1 parent 52a147e commit 62a8015
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
14 changes: 8 additions & 6 deletions projects/planner/src/app/dive-issues/dive-issues.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
shorter than currently planned dive. Use larger tank, fill it with more gas, reduce dive
duration or planned depth.</span>
</div>
<div *ngIf="dive.diveInfoCalculated && dive.noDecoExceeded" class="alert alert-info">
<fa-icon [icon]="info" class="me-2"></fa-icon>
<span>No decompression time for current depth exceeded (For no decompression dive set dive time
maximum
to {{ noDeco | number:'1.0-0' }} min)!</span>
</div>
<div *ngIf="dive.diveInfoCalculated && dive.otuExceeded" class="alert alert-warning">
<fa-icon [icon]="warning" class="me-2"></fa-icon>
<span>Exceeded 80 % of maximum single exposure oxygen toxicity units
Expand All @@ -40,6 +34,14 @@
</div>

<ng-container *ngFor="let event of events">
<div *ngIf="isNoDeco(event)" class="alert alert-info">
<fa-icon [icon]="info" class="me-2"></fa-icon>
<strong>{{ event.timeStamp | duration:event.timeStamp
}} min, {{ eventDepthFor(event) | number:'1.0-0' }} {{units.length}}: </strong>
<span>No decompression time for current depth exceeded (For no decompression dive set dive time
maximum
to {{ noDeco | number:'1.0-0' }} min)!</span>
</div>
<div *ngIf="isLowPpO2(event)" class="alert alert-warning">
<fa-icon [icon]="warning" class="me-2"></fa-icon>
<strong>{{ event.timeStamp | duration:event.timeStamp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class DiveIssuesComponent {
return this.schedules.selectedDepths.planDuration + 1;
}

// TODO replace noDeco from dive results by event
public get noDeco(): number {
return this.dive.noDecoTime;
}
Expand All @@ -42,6 +41,10 @@ export class DiveIssuesComponent {
return this.schedules.selectedResult;
}

public isNoDeco(event: Event): boolean {
return event.type === EventType.noDecoEnd;
}

public isLowPpO2(event: Event): boolean {
return event.type === EventType.lowPpO2;
}
Expand Down
4 changes: 0 additions & 4 deletions projects/planner/src/app/shared/diveresults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export class DiveResults {
return this._diveInfoCalculated && this.noDecoTime < DiveResults.maxAcceptableNdl;
}

public get noDecoExceeded(): boolean {
return this.planDuration > this.noDecoTime;
}

/** the only errors preventing draw chart */
public get hasErrors(): boolean {
return this.calculated && (this.failed || this.notEnoughTime);
Expand Down
6 changes: 0 additions & 6 deletions projects/planner/src/app/shared/planner.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ describe('PlannerService', () => {
planner.calculate(1);
expect(dive.notEnoughGas).toBeTruthy();
});

it('30m for 20 minutes no decompression time exceeded', () => {
depthsService.planDuration = 20;
planner.calculate(1);
expect(dive.noDecoExceeded).toBeTruthy();
});
});

describe('Manage tanks', () => {
Expand Down

0 comments on commit 62a8015

Please sign in to comment.