diff --git a/src/app/data-structures/business.data.structures.ts b/src/app/data-structures/business.data.structures.ts index 665a51f38..074b02e19 100644 --- a/src/app/data-structures/business.data.structures.ts +++ b/src/app/data-structures/business.data.structures.ts @@ -123,8 +123,6 @@ export interface TrainrunSectionDto { targetDeparture: TimeLockDto; // declares the target departure time travelTime: TimeLockDto; // declares the travel arrival time - numberOfStops: number; // number of stops - not declared in detail (no node attached) - trainrunId: number; // reference to the trainrun (main object) resourceId: number; // reference to the algined (resource - not yet implemented) @@ -173,6 +171,7 @@ export interface NodeDto { fullName: string; // full name of the trainrun eg. BN => Bern Wankdorf positionX: number; // coordinate X positionY: number; // coordinate Y + isCollapsed: boolean; // flag to collapse the node ports: PortDto[]; // all ports aligned to the node transitions: TransitionDto[]; // all tranisitons aligned to the node diff --git a/src/app/models/node.model.ts b/src/app/models/node.model.ts index d2fda5735..5ddae54a2 100644 --- a/src/app/models/node.model.ts +++ b/src/app/models/node.model.ts @@ -38,6 +38,7 @@ export class Node { private warnings: WarningDto[]; private isSelected: boolean; private labelIds: number[]; + private isCollapsed: boolean; constructor( { @@ -56,6 +57,7 @@ export class Node { symmetryAxis, warnings, labelIds, + isCollapsed, }: NodeDto = { id: Node.incrementId(), betriebspunktName: $localize`:@@app.models.node.shortNameDefault:NEW`, @@ -72,6 +74,7 @@ export class Node { symmetryAxis: null, warnings: null, labelIds: [], + isCollapsed: false, }, ) { this.id = id; @@ -93,6 +96,7 @@ export class Node { this.warnings = warnings; this.isSelected = false; this.labelIds = labelIds; + this.isCollapsed = isCollapsed; if (Node.currentId < this.id) { Node.currentId = this.id; @@ -318,6 +322,14 @@ export class Node { return currentMaxIndex; } + getIsCollapsed(): boolean { + return this.isCollapsed; + } + + setIsCollapsed(isCollapsed: boolean) { + this.isCollapsed = isCollapsed; + } + computeTransitionRouting(transition: Transition) { const port1 = this.getPort(transition.getPortId1()); const port2 = this.getPort(transition.getPortId2()); @@ -820,6 +832,7 @@ export class Node { symmetryAxis: this.symmetryAxis, warnings: this.warnings, labelIds: this.labelIds, + isCollapsed: this.isCollapsed, }; } diff --git a/src/app/models/trainrunsection.model.ts b/src/app/models/trainrunsection.model.ts index 0410b232f..7d604edd7 100644 --- a/src/app/models/trainrunsection.model.ts +++ b/src/app/models/trainrunsection.model.ts @@ -28,7 +28,6 @@ export class TrainrunSection { private targetArrival: TimeLockDto; private targetDeparture: TimeLockDto; private travelTime: TimeLockDto; - private numberOfStops: number; private trainrunId: number; private resourceId: number; @@ -54,7 +53,6 @@ export class TrainrunSection { targetDeparture, targetArrival, travelTime, - numberOfStops, trainrunId, resourceId, specificTrainrunSectionFrequencyId, @@ -104,7 +102,6 @@ export class TrainrunSection { trainrunId: 0, resourceId: 0, specificTrainrunSectionFrequencyId: null, - numberOfStops: 0, path: { path: [], textPositions: { @@ -136,7 +133,6 @@ export class TrainrunSection { this.path = path; this.warnings = warnings; this.isSelected = false; - this.numberOfStops = numberOfStops; this.convertPathToVec2D(); @@ -381,10 +377,6 @@ export class TrainrunSection { return TrainrunSection.getDisplayColorRef(this.targetArrival); } - getNumberOfStops(): number { - return this.numberOfStops; - } - setTravelTime(time: number) { this.travelTime.time = time; TrainrunSectionValidator.validateTravelTime(this); @@ -450,10 +442,6 @@ export class TrainrunSection { this.targetArrival.lock = lock; } - setNumberOfStops(numberOfStops: number) { - this.numberOfStops = numberOfStops; - } - hasTravelTimeWarning(): boolean { return this.travelTime.warning !== null; } @@ -658,8 +646,6 @@ export class TrainrunSection { targetDeparture: this.targetDeparture, targetArrival: this.targetArrival, - numberOfStops: this.numberOfStops, - trainrunId: this.trainrunId, resourceId: this.resourceId,