Skip to content

Commit 0784c94

Browse files
committed
wip
Signed-off-by: Louis Greiner <[email protected]>
1 parent 2cbaaef commit 0784c94

File tree

61 files changed

+11730
-4705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+11730
-4705
lines changed

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {EditorSideViewComponent} from "./view/editor-side-view/editor-side-view.
4343
import {StammdatenDialogComponent} from "./view/dialogs/stammdaten-dialog/stammdaten-dialog.component";
4444
import {TrainrunAndSectionDialogComponent} from "./view/dialogs/trainrun-and-section-dialog/trainrun-and-section-dialog.component";
4545
import {ConfirmationDialogComponent} from "./view/dialogs/confirmation-dialog/confirmation-dialog.component";
46+
import {SymmetrySelectionDialogComponent} from "./view/dialogs/symmetry-selection-dialog/symmetry-selection-dialog.component";
4647
import {FilterMainSideViewComponent} from "./view/filter-main-side-view/filter-main-side-view.component";
4748
import {KnotenAuslastungViewComponent} from "./view/knoten-auslastung-view/knoten-auslastung-view.component";
4849
import {environment} from "../environments/environment";
@@ -125,6 +126,7 @@ import {SbbToggleModule} from "@sbb-esta/angular/toggle";
125126
EditorSideViewComponent,
126127
TrainrunAndSectionDialogComponent,
127128
ConfirmationDialogComponent,
129+
SymmetrySelectionDialogComponent,
128130
FilterMainSideViewComponent,
129131
KnotenAuslastungViewComponent,
130132
ProjectsViewComponent,

src/app/data-structures/business.data.structures.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ export interface TrainrunSectionDto {
117117
targetNodeId: number; // reference to the node by Node.id
118118
targetPortId: number; // reference to the node by Node.id
119119

120+
sourceSymmetry: boolean; // binds sourceDeparture and sourceArrival times
121+
targetSymmetry: boolean; // binds targetDeparture and targetArrival times
120122
sourceArrival: TimeLockDto; // declares the soruce arrival time
121123
sourceDeparture: TimeLockDto; // declares the soruce departure time
122124
targetArrival: TimeLockDto; // declares the target arrival time
123125
targetDeparture: TimeLockDto; // declares the target departure time
124-
travelTime: TimeLockDto; // declares the travel arrival time
126+
travelTime: TimeLockDto; // declares the travel time (forward direction)
127+
backwardTravelTime: TimeLockDto; // declares the travel time in the opposite direction
125128

126129
numberOfStops: number; // number of stops - not declared in detail (no node attached)
127130

@@ -290,15 +293,18 @@ export interface FilterSettingDto {
290293
filterNoteLabels: number[]; // labels to filter out (labels only of type - LabelRef: note)
291294
filterTrainrunLabels: number[]; // labels to filter out (labels only of type - LabelRef: trainrun)
292295
filterDirectionArrows: boolean; // flag for trainrun direction arrows (hide/show)
296+
filterAsymmetryArrows: boolean; // flag for trainrun section asymmetry arrows (hide/show)
293297
filterArrivalDepartureTime: boolean; // flag for arrival and departure time filtering (hide/show)
294298
filterTravelTime: boolean; // flag for travel time filter (hide/show)
299+
filterBackwardTravelTime: boolean; // flag for trainrun section backward travel times (hide/show)
295300
filterTrainrunName: boolean; // flag for trainrun time filter (hide/show)
296301
filterConnections: boolean; // flag for connections filtering (hide/show)
297302
filterShowNonStopTime: boolean; // flag for non-stop time filtering (hide/show)
298303
filterTrainrunCategory: TrainrunCategory[]; // list of category to filter out
299304
filterTrainrunFrequency: TrainrunFrequency[]; // list of frequency to filter out
300305
filterTrainrunTimeCategory: TrainrunTimeCategory[]; // list of time categroy to filter out
301306
filterDirection: Direction[]; // list of trainrun direction to filter out
307+
filterSymmetry: boolean[]; // list of trainrun symmetry values (true/false) to filter out
302308
filterAllEmptyNodes: boolean; // flag to filter all empty nodes (hide/show)
303309
filterAllNonStopNodes: boolean; // flag to filter all only non-stop nodes (hide/show)
304310
filterNotes: boolean; // flag to filter notes (hide/show)

src/app/data-structures/technical.data.structures.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export enum TrainrunSectionText {
2323
TargetDeparture,
2424
TrainrunSectionName,
2525
TrainrunSectionTravelTime,
26+
TrainrunSectionBackwardTravelTime,
2627
TrainrunSectionNumberOfStops,
2728
}
2829

@@ -38,6 +39,7 @@ export interface TrainrunSectionTextPositions {
3839
[TrainrunSectionText.TargetDeparture]: PointDto;
3940
[TrainrunSectionText.TrainrunSectionName]: PointDto;
4041
[TrainrunSectionText.TrainrunSectionTravelTime]: PointDto;
42+
[TrainrunSectionText.TrainrunSectionBackwardTravelTime]: PointDto;
4143
[TrainrunSectionText.TrainrunSectionNumberOfStops]: PointDto;
4244
}
4345

src/app/models/filterSettings.model.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ export class FilterSetting {
1919
public filterNodeLabels: number[];
2020
public filterNoteLabels: number[];
2121
public filterTrainrunLabels: number[];
22-
public filterDirectionArrows;
22+
public filterDirectionArrows: boolean;
23+
public filterAsymmetryArrows: boolean;
2324
public filterArrivalDepartureTime;
2425
public filterTravelTime;
26+
public filterBackwardTravelTime: boolean;
2527
public filterTrainrunName;
2628
public filterConnections;
2729
public filterShowNonStopTime;
2830
public filterTrainrunCategory: TrainrunCategory[];
2931
public filterTrainrunFrequency: TrainrunFrequency[];
3032
public filterTrainrunTimeCategory: TrainrunTimeCategory[];
3133
public filterDirection: Direction[];
34+
public filterSymmetry: boolean[];
3235
public filterAllEmptyNodes;
3336
public filterAllNonStopNodes;
3437
public filterNotes;
@@ -44,16 +47,19 @@ export class FilterSetting {
4447
filterNodeLabels,
4548
filterNoteLabels,
4649
filterTrainrunLabels,
47-
filterDirectionArrows: filterDirectionArrows,
50+
filterDirectionArrows,
51+
filterAsymmetryArrows,
4852
filterArrivalDepartureTime,
4953
filterTravelTime,
54+
filterBackwardTravelTime,
5055
filterTrainrunName,
5156
filterConnections,
5257
filterShowNonStopTime,
5358
filterTrainrunCategory,
5459
filterTrainrunFrequency,
5560
filterTrainrunTimeCategory,
5661
filterDirection: filterDirection,
62+
filterSymmetry: filterSymmetry,
5763
filterAllEmptyNodes,
5864
filterAllNonStopNodes,
5965
filterNotes,
@@ -68,15 +74,18 @@ export class FilterSetting {
6874
filterNoteLabels: [],
6975
filterTrainrunLabels: [],
7076
filterDirectionArrows: true,
77+
filterAsymmetryArrows: true,
7178
filterArrivalDepartureTime: true,
7279
filterTravelTime: true,
80+
filterBackwardTravelTime: true,
7381
filterTrainrunName: true,
7482
filterConnections: true,
7583
filterShowNonStopTime: true,
7684
filterTrainrunCategory: null,
7785
filterTrainrunFrequency: null,
7886
filterTrainrunTimeCategory: null,
7987
filterDirection: null,
88+
filterSymmetry: null,
8089
filterAllEmptyNodes: false,
8190
filterAllNonStopNodes: false,
8291
filterNotes: false,
@@ -92,15 +101,18 @@ export class FilterSetting {
92101
this.filterNoteLabels = filterNoteLabels;
93102
this.filterTrainrunLabels = filterTrainrunLabels;
94103
this.filterDirectionArrows = filterDirectionArrows;
104+
this.filterAsymmetryArrows = filterAsymmetryArrows;
95105
this.filterArrivalDepartureTime = filterArrivalDepartureTime;
96106
this.filterTravelTime = filterTravelTime;
107+
this.filterBackwardTravelTime = filterBackwardTravelTime;
97108
this.filterTrainrunName = filterTrainrunName;
98109
this.filterConnections = filterConnections;
99110
this.filterShowNonStopTime = filterShowNonStopTime;
100111
this.filterTrainrunCategory = filterTrainrunCategory;
101112
this.filterTrainrunFrequency = filterTrainrunFrequency;
102113
this.filterTrainrunTimeCategory = filterTrainrunTimeCategory;
103114
this.filterDirection = filterDirection;
115+
this.filterSymmetry = filterSymmetry;
104116
this.filterAllEmptyNodes = filterAllEmptyNodes;
105117
this.filterAllNonStopNodes = filterAllNonStopNodes;
106118
this.filterNotes = filterNotes;
@@ -165,15 +177,18 @@ export class FilterSetting {
165177
this.filterNoteLabels.length === 0 &&
166178
this.filterTrainrunLabels.length === 0 &&
167179
this.filterDirectionArrows === true &&
180+
this.filterAsymmetryArrows === true &&
168181
this.filterArrivalDepartureTime === true &&
169182
this.filterTravelTime === true &&
183+
this.filterBackwardTravelTime === true &&
170184
this.filterTrainrunName === true &&
171185
this.filterConnections === true &&
172186
this.filterShowNonStopTime === true &&
173187
this.filterTrainrunCategory.length === trainrunCategoriesLength &&
174188
this.filterTrainrunFrequency.length === frainrunFrequenciesLength &&
175189
this.filterTrainrunTimeCategory.length === trainrunTimeCategoryLength &&
176190
this.filterDirection.length === Object.values(Direction).length &&
191+
this.filterSymmetry.length === 2 &&
177192
this.filterAllEmptyNodes === false &&
178193
this.filterAllNonStopNodes === false &&
179194
this.filterNotes === false &&
@@ -192,15 +207,18 @@ export class FilterSetting {
192207
filterNoteLabels: this.filterNoteLabels,
193208
filterTrainrunLabels: this.filterTrainrunLabels,
194209
filterDirectionArrows: this.filterDirectionArrows,
210+
filterAsymmetryArrows: this.filterAsymmetryArrows,
195211
filterArrivalDepartureTime: this.filterArrivalDepartureTime,
196212
filterTravelTime: this.filterTravelTime,
213+
filterBackwardTravelTime: this.filterBackwardTravelTime,
197214
filterTrainrunName: this.filterTrainrunName,
198215
filterConnections: this.filterConnections,
199216
filterShowNonStopTime: this.filterShowNonStopTime,
200217
filterTrainrunCategory: this.filterTrainrunCategory,
201218
filterTrainrunFrequency: this.filterTrainrunFrequency,
202219
filterTrainrunTimeCategory: this.filterTrainrunTimeCategory,
203220
filterDirection: this.filterDirection,
221+
filterSymmetry: this.filterSymmetry,
204222
filterAllEmptyNodes: this.filterAllEmptyNodes,
205223
filterAllNonStopNodes: this.filterAllNonStopNodes,
206224
filterNotes: this.filterNotes,

src/app/models/trainrun.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class Trainrun {
3434
frequencyId,
3535
trainrunTimeCategoryId,
3636
labelIds,
37-
direction = Direction.ROUND_TRIP, // temporary, to allow migration of old trainruns
37+
direction = Direction.ROUND_TRIP, // temporary, to allow migration of old trainruns from file
3838
}: TrainrunDto = {
3939
id: Trainrun.incrementId(),
4040
name: Trainrun.DEFAULT_TRAINRUN_NAME,

src/app/models/trainrunsection.model.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,13 @@ describe("TrainrunSection Model Test", () => {
159159
ts.setSourceDepartureLock(false);
160160
ts.setSourceArrivalLock(false);
161161
ts.setTravelTimeLock(false);
162+
ts.setBackwardTravelTimeLock(false);
162163
expect(ts.getTargetDepartureLock()).toBe(false);
163164
expect(ts.getTargetArrivalLock()).toBe(false);
164165
expect(ts.getSourceDepartureLock()).toBe(false);
165166
expect(ts.getSourceArrivalLock()).toBe(false);
166167
expect(ts.getTravelTimeLock()).toBe(false);
168+
expect(ts.getBackwardTravelTimeLock()).toBe(false);
167169
});
168170

169171
it("set...lock - 1", () => {
@@ -174,11 +176,13 @@ describe("TrainrunSection Model Test", () => {
174176
ts.setSourceArrivalLock(false);
175177
ts.setTravelTimeLock(false);
176178
ts.setTargetDepartureLock(true);
179+
ts.setBackwardTravelTimeLock(false);
177180
expect(ts.getTargetDepartureLock()).toBe(true);
178181
expect(ts.getTargetArrivalLock()).toBe(false);
179182
expect(ts.getSourceDepartureLock()).toBe(false);
180183
expect(ts.getSourceArrivalLock()).toBe(false);
181184
expect(ts.getTravelTimeLock()).toBe(false);
185+
expect(ts.getBackwardTravelTimeLock()).toBe(false);
182186
});
183187

184188
it("set...lock - 2", () => {
@@ -189,11 +193,13 @@ describe("TrainrunSection Model Test", () => {
189193
ts.setSourceArrivalLock(false);
190194
ts.setTravelTimeLock(false);
191195
ts.setTargetArrivalLock(true);
196+
ts.setBackwardTravelTimeLock(false);
192197
expect(ts.getTargetDepartureLock()).toBe(false);
193198
expect(ts.getTargetArrivalLock()).toBe(true);
194199
expect(ts.getSourceDepartureLock()).toBe(false);
195200
expect(ts.getSourceArrivalLock()).toBe(false);
196201
expect(ts.getTravelTimeLock()).toBe(false);
202+
expect(ts.getBackwardTravelTimeLock()).toBe(false);
197203
});
198204

199205
it("set...lock - 3", () => {
@@ -203,12 +209,14 @@ describe("TrainrunSection Model Test", () => {
203209
ts.setSourceDepartureLock(false);
204210
ts.setSourceArrivalLock(false);
205211
ts.setTravelTimeLock(false);
212+
ts.setBackwardTravelTimeLock(false);
206213
ts.setSourceDepartureLock(true);
207214
expect(ts.getTargetDepartureLock()).toBe(false);
208215
expect(ts.getTargetArrivalLock()).toBe(false);
209216
expect(ts.getSourceDepartureLock()).toBe(true);
210217
expect(ts.getSourceArrivalLock()).toBe(false);
211218
expect(ts.getTravelTimeLock()).toBe(false);
219+
expect(ts.getBackwardTravelTimeLock()).toBe(false);
212220
});
213221

214222
it("set...lock - 4", () => {
@@ -219,11 +227,13 @@ describe("TrainrunSection Model Test", () => {
219227
ts.setSourceArrivalLock(false);
220228
ts.setTravelTimeLock(false);
221229
ts.setSourceArrivalLock(true);
230+
ts.setBackwardTravelTimeLock(false);
222231
expect(ts.getTargetDepartureLock()).toBe(false);
223232
expect(ts.getTargetArrivalLock()).toBe(false);
224233
expect(ts.getSourceDepartureLock()).toBe(false);
225234
expect(ts.getSourceArrivalLock()).toBe(true);
226235
expect(ts.getTravelTimeLock()).toBe(false);
236+
expect(ts.getBackwardTravelTimeLock()).toBe(false);
227237
});
228238

229239
it("set...lock - 5", () => {
@@ -233,12 +243,15 @@ describe("TrainrunSection Model Test", () => {
233243
ts.setSourceDepartureLock(false);
234244
ts.setSourceArrivalLock(false);
235245
ts.setTravelTimeLock(false);
246+
ts.setBackwardTravelTimeLock(false);
236247
ts.setTravelTimeLock(true);
248+
ts.setBackwardTravelTimeLock(true);
237249
expect(ts.getTargetDepartureLock()).toBe(false);
238250
expect(ts.getTargetArrivalLock()).toBe(false);
239251
expect(ts.getSourceDepartureLock()).toBe(false);
240252
expect(ts.getSourceArrivalLock()).toBe(false);
241253
expect(ts.getTravelTimeLock()).toBe(true);
254+
expect(ts.getBackwardTravelTimeLock()).toBe(true);
242255
});
243256

244257
it("select", () => {

0 commit comments

Comments
 (0)