Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/app/data-structures/business.data.structures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/app/models/node.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class Node {
private warnings: WarningDto[];
private isSelected: boolean;
private labelIds: number[];
private isCollapsed: boolean;

constructor(
{
Expand All @@ -56,6 +57,7 @@ export class Node {
symmetryAxis,
warnings,
labelIds,
isCollapsed,
}: NodeDto = {
id: Node.incrementId(),
betriebspunktName: $localize`:@@app.models.node.shortNameDefault:NEW`,
Expand All @@ -72,6 +74,7 @@ export class Node {
symmetryAxis: null,
warnings: null,
labelIds: [],
isCollapsed: false,
},
) {
this.id = id;
Expand All @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -820,6 +832,7 @@ export class Node {
symmetryAxis: this.symmetryAxis,
warnings: this.warnings,
labelIds: this.labelIds,
isCollapsed: this.isCollapsed,
};
}

Expand Down
14 changes: 0 additions & 14 deletions src/app/models/trainrunsection.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -54,7 +53,6 @@ export class TrainrunSection {
targetDeparture,
targetArrival,
travelTime,
numberOfStops,
trainrunId,
resourceId,
specificTrainrunSectionFrequencyId,
Expand Down Expand Up @@ -104,7 +102,6 @@ export class TrainrunSection {
trainrunId: 0,
resourceId: 0,
specificTrainrunSectionFrequencyId: null,
numberOfStops: 0,
path: {
path: [],
textPositions: {
Expand Down Expand Up @@ -136,7 +133,6 @@ export class TrainrunSection {
this.path = path;
this.warnings = warnings;
this.isSelected = false;
this.numberOfStops = numberOfStops;

this.convertPathToVec2D();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -450,10 +442,6 @@ export class TrainrunSection {
this.targetArrival.lock = lock;
}

setNumberOfStops(numberOfStops: number) {
this.numberOfStops = numberOfStops;
}

hasTravelTimeWarning(): boolean {
return this.travelTime.warning !== null;
}
Expand Down Expand Up @@ -658,8 +646,6 @@ export class TrainrunSection {
targetDeparture: this.targetDeparture,
targetArrival: this.targetArrival,

numberOfStops: this.numberOfStops,

trainrunId: this.trainrunId,
resourceId: this.resourceId,

Expand Down