Skip to content

Commit

Permalink
Added tansk to test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Pokorny committed Oct 2, 2023
1 parent 158e3be commit 195d515
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion projects/planner/src/app/diff/diff.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,31 @@ import { Component } from '@angular/core';
import { Profile, WayPointsService } from '../shared/waypoints.service';
import { UnitConversion } from '../shared/UnitConversion';
import {
CalculatedProfile, Ceiling, Events, Segments, StandardGases, Time
CalculatedProfile, Ceiling, Events, Segments, StandardGases, Tank, Time
} from 'scuba-physics';


class TestData {
public readonly profileA: Profile;
public readonly tanksA: Tank[];

public readonly profileB: Profile;
public readonly tanksB: Tank[];

constructor() {
const units = new UnitConversion();
const emptyEvents = new Events();
const waypointService = new WayPointsService(units);

this.tanksA = [
new Tank(24, 200, 21),
new Tank(11, 200, 50),
new Tank(11, 150, 100),
];
this.tanksA[0].consumed = 120;
this.tanksA[1].consumed = 80;
this.tanksA[2].consumed = 60;

const ceilingsA: Ceiling[] = [];
const segmentsA = new Segments();
segmentsA.add(0, 40, StandardGases.air, Time.oneMinute * 2);
Expand All @@ -28,6 +39,14 @@ class TestData {
const calculatedA = CalculatedProfile.fromProfile(segmentsA.items, ceilingsA);
this.profileA = waypointService.calculateWayPoints(calculatedA, emptyEvents);


this.tanksB = [
new Tank(24, 200, 21),
new Tank(11, 200, 50)
];
this.tanksB[0].consumed = 90;
this.tanksB[1].consumed = 40;

const ceilingsB: Ceiling[] = [];
const segmentsB = new Segments();
segmentsB.add(0, 30, StandardGases.air, Time.oneMinute * 4);
Expand All @@ -46,6 +65,7 @@ class TestData {
styleUrls: ['./diff.component.scss']
})
export class DiffComponent {
public data = new TestData();

// run: npm start
// Navigate to the component: http://localhost:4200/diff
Expand Down

0 comments on commit 195d515

Please sign in to comment.