From 62a8015b9bd1d06163b09c65816ae3891311fc21 Mon Sep 17 00:00:00 2001 From: Jiri Pokorny Date: Sun, 18 Aug 2024 00:41:43 +0200 Subject: [PATCH] Replaced nodeco exceeded with event --- .../src/app/dive-issues/dive-issues.component.html | 14 ++++++++------ .../src/app/dive-issues/dive-issues.component.ts | 5 ++++- projects/planner/src/app/shared/diveresults.ts | 4 ---- .../planner/src/app/shared/planner.service.spec.ts | 6 ------ 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/projects/planner/src/app/dive-issues/dive-issues.component.html b/projects/planner/src/app/dive-issues/dive-issues.component.html index 4523e301..6103e52c 100644 --- a/projects/planner/src/app/dive-issues/dive-issues.component.html +++ b/projects/planner/src/app/dive-issues/dive-issues.component.html @@ -19,12 +19,6 @@ shorter than currently planned dive. Use larger tank, fill it with more gas, reduce dive duration or planned depth. -
- - No decompression time for current depth exceeded (For no decompression dive set dive time - maximum - to {{ noDeco | number:'1.0-0' }} min)! -
Exceeded 80 % of maximum single exposure oxygen toxicity units @@ -40,6 +34,14 @@
+
+ + {{ event.timeStamp | duration:event.timeStamp + }} min, {{ eventDepthFor(event) | number:'1.0-0' }} {{units.length}}: + No decompression time for current depth exceeded (For no decompression dive set dive time + maximum + to {{ noDeco | number:'1.0-0' }} min)! +
{{ event.timeStamp | duration:event.timeStamp diff --git a/projects/planner/src/app/dive-issues/dive-issues.component.ts b/projects/planner/src/app/dive-issues/dive-issues.component.ts index fab58572..86889cd6 100644 --- a/projects/planner/src/app/dive-issues/dive-issues.component.ts +++ b/projects/planner/src/app/dive-issues/dive-issues.component.ts @@ -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; } @@ -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; } diff --git a/projects/planner/src/app/shared/diveresults.ts b/projects/planner/src/app/shared/diveresults.ts index d9da2b5d..225cd429 100644 --- a/projects/planner/src/app/shared/diveresults.ts +++ b/projects/planner/src/app/shared/diveresults.ts @@ -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); diff --git a/projects/planner/src/app/shared/planner.service.spec.ts b/projects/planner/src/app/shared/planner.service.spec.ts index e444879e..73e699c9 100644 --- a/projects/planner/src/app/shared/planner.service.spec.ts +++ b/projects/planner/src/app/shared/planner.service.spec.ts @@ -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', () => {