Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {EditorSideViewComponent} from "./view/editor-side-view/editor-side-view.
import {StammdatenDialogComponent} from "./view/dialogs/stammdaten-dialog/stammdaten-dialog.component";
import {TrainrunAndSectionDialogComponent} from "./view/dialogs/trainrun-and-section-dialog/trainrun-and-section-dialog.component";
import {ConfirmationDialogComponent} from "./view/dialogs/confirmation-dialog/confirmation-dialog.component";
import {SymmetrySelectionDialogComponent} from "./view/dialogs/symmetry-selection-dialog/symmetry-selection-dialog.component";
import {FilterMainSideViewComponent} from "./view/filter-main-side-view/filter-main-side-view.component";
import {KnotenAuslastungViewComponent} from "./view/knoten-auslastung-view/knoten-auslastung-view.component";
import {environment} from "../environments/environment";
Expand Down Expand Up @@ -126,6 +127,7 @@ import {ToggleSwitchButtonComponent} from "./view/toggle-switch-button/toggle-sw
EditorSideViewComponent,
TrainrunAndSectionDialogComponent,
ConfirmationDialogComponent,
SymmetrySelectionDialogComponent,
FilterMainSideViewComponent,
KnotenAuslastungViewComponent,
ProjectsViewComponent,
Expand Down
8 changes: 7 additions & 1 deletion src/app/data-structures/business.data.structures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,14 @@ export interface TrainrunSectionDto {
targetNodeId: number; // reference to the node by Node.id
targetPortId: number; // reference to the node by Node.id

sourceSymmetry: boolean; // binds sourceDeparture and sourceArrival times
targetSymmetry: boolean; // binds targetDeparture and targetArrival times
sourceArrival: TimeLockDto; // declares the soruce arrival time
sourceDeparture: TimeLockDto; // declares the soruce departure time
targetArrival: TimeLockDto; // declares the target arrival time
targetDeparture: TimeLockDto; // declares the target departure time
travelTime: TimeLockDto; // declares the travel arrival time
travelTime: TimeLockDto; // declares the travel time (forward direction)
backwardTravelTime: TimeLockDto; // declares the travel time in the opposite direction

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

Expand Down Expand Up @@ -290,15 +293,18 @@ export interface FilterSettingDto {
filterNoteLabels: number[]; // labels to filter out (labels only of type - LabelRef: note)
filterTrainrunLabels: number[]; // labels to filter out (labels only of type - LabelRef: trainrun)
filterDirectionArrows: boolean; // flag for trainrun direction arrows (hide/show)
filterAsymmetryArrows: boolean; // flag for trainrun section asymmetry arrows (hide/show)
filterArrivalDepartureTime: boolean; // flag for arrival and departure time filtering (hide/show)
filterTravelTime: boolean; // flag for travel time filter (hide/show)
filterBackwardTravelTime: boolean; // flag for trainrun section backward travel times (hide/show)
filterTrainrunName: boolean; // flag for trainrun time filter (hide/show)
filterConnections: boolean; // flag for connections filtering (hide/show)
filterShowNonStopTime: boolean; // flag for non-stop time filtering (hide/show)
filterTrainrunCategory: TrainrunCategory[]; // list of category to filter out
filterTrainrunFrequency: TrainrunFrequency[]; // list of frequency to filter out
filterTrainrunTimeCategory: TrainrunTimeCategory[]; // list of time categroy to filter out
filterDirection: Direction[]; // list of trainrun direction to filter out
filterSymmetry: boolean[]; // list of trainrun symmetry values (true/false) to filter out
filterAllEmptyNodes: boolean; // flag to filter all empty nodes (hide/show)
filterAllNonStopNodes: boolean; // flag to filter all only non-stop nodes (hide/show)
filterNotes: boolean; // flag to filter notes (hide/show)
Expand Down
2 changes: 2 additions & 0 deletions src/app/data-structures/technical.data.structures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export enum TrainrunSectionText {
TargetDeparture,
TrainrunSectionName,
TrainrunSectionTravelTime,
TrainrunSectionBackwardTravelTime,
TrainrunSectionNumberOfStops,
}

Expand All @@ -38,6 +39,7 @@ export interface TrainrunSectionTextPositions {
[TrainrunSectionText.TargetDeparture]: PointDto;
[TrainrunSectionText.TrainrunSectionName]: PointDto;
[TrainrunSectionText.TrainrunSectionTravelTime]: PointDto;
[TrainrunSectionText.TrainrunSectionBackwardTravelTime]: PointDto;
[TrainrunSectionText.TrainrunSectionNumberOfStops]: PointDto;
}

Expand Down
22 changes: 20 additions & 2 deletions src/app/models/filterSettings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ export class FilterSetting {
public filterNodeLabels: number[];
public filterNoteLabels: number[];
public filterTrainrunLabels: number[];
public filterDirectionArrows;
public filterDirectionArrows: boolean;
public filterAsymmetryArrows: boolean;
public filterArrivalDepartureTime;
public filterTravelTime;
public filterBackwardTravelTime: boolean;
public filterTrainrunName;
public filterConnections;
public filterShowNonStopTime;
public filterTrainrunCategory: TrainrunCategory[];
public filterTrainrunFrequency: TrainrunFrequency[];
public filterTrainrunTimeCategory: TrainrunTimeCategory[];
public filterDirection: Direction[];
public filterSymmetry: boolean[];
public filterAllEmptyNodes;
public filterAllNonStopNodes;
public filterNotes;
Expand All @@ -44,16 +47,19 @@ export class FilterSetting {
filterNodeLabels,
filterNoteLabels,
filterTrainrunLabels,
filterDirectionArrows: filterDirectionArrows,
filterDirectionArrows,
filterAsymmetryArrows,
filterArrivalDepartureTime,
filterTravelTime,
filterBackwardTravelTime,
filterTrainrunName,
filterConnections,
filterShowNonStopTime,
filterTrainrunCategory,
filterTrainrunFrequency,
filterTrainrunTimeCategory,
filterDirection: filterDirection,
filterSymmetry: filterSymmetry,
filterAllEmptyNodes,
filterAllNonStopNodes,
filterNotes,
Expand All @@ -68,15 +74,18 @@ export class FilterSetting {
filterNoteLabels: [],
filterTrainrunLabels: [],
filterDirectionArrows: true,
filterAsymmetryArrows: true,
filterArrivalDepartureTime: true,
filterTravelTime: true,
filterBackwardTravelTime: true,
filterTrainrunName: true,
filterConnections: true,
filterShowNonStopTime: true,
filterTrainrunCategory: null,
filterTrainrunFrequency: null,
filterTrainrunTimeCategory: null,
filterDirection: null,
filterSymmetry: null,
filterAllEmptyNodes: false,
filterAllNonStopNodes: false,
filterNotes: false,
Expand All @@ -92,15 +101,18 @@ export class FilterSetting {
this.filterNoteLabels = filterNoteLabels;
this.filterTrainrunLabels = filterTrainrunLabels;
this.filterDirectionArrows = filterDirectionArrows;
this.filterAsymmetryArrows = filterAsymmetryArrows;
this.filterArrivalDepartureTime = filterArrivalDepartureTime;
this.filterTravelTime = filterTravelTime;
this.filterBackwardTravelTime = filterBackwardTravelTime;
this.filterTrainrunName = filterTrainrunName;
this.filterConnections = filterConnections;
this.filterShowNonStopTime = filterShowNonStopTime;
this.filterTrainrunCategory = filterTrainrunCategory;
this.filterTrainrunFrequency = filterTrainrunFrequency;
this.filterTrainrunTimeCategory = filterTrainrunTimeCategory;
this.filterDirection = filterDirection;
this.filterSymmetry = filterSymmetry;
this.filterAllEmptyNodes = filterAllEmptyNodes;
this.filterAllNonStopNodes = filterAllNonStopNodes;
this.filterNotes = filterNotes;
Expand Down Expand Up @@ -165,15 +177,18 @@ export class FilterSetting {
this.filterNoteLabels.length === 0 &&
this.filterTrainrunLabels.length === 0 &&
this.filterDirectionArrows === true &&
this.filterAsymmetryArrows === true &&
this.filterArrivalDepartureTime === true &&
this.filterTravelTime === true &&
this.filterBackwardTravelTime === true &&
this.filterTrainrunName === true &&
this.filterConnections === true &&
this.filterShowNonStopTime === true &&
this.filterTrainrunCategory.length === trainrunCategoriesLength &&
this.filterTrainrunFrequency.length === frainrunFrequenciesLength &&
this.filterTrainrunTimeCategory.length === trainrunTimeCategoryLength &&
this.filterDirection.length === Object.values(Direction).length &&
this.filterSymmetry.length === 2 &&
this.filterAllEmptyNodes === false &&
this.filterAllNonStopNodes === false &&
this.filterNotes === false &&
Expand All @@ -192,15 +207,18 @@ export class FilterSetting {
filterNoteLabels: this.filterNoteLabels,
filterTrainrunLabels: this.filterTrainrunLabels,
filterDirectionArrows: this.filterDirectionArrows,
filterAsymmetryArrows: this.filterAsymmetryArrows,
filterArrivalDepartureTime: this.filterArrivalDepartureTime,
filterTravelTime: this.filterTravelTime,
filterBackwardTravelTime: this.filterBackwardTravelTime,
filterTrainrunName: this.filterTrainrunName,
filterConnections: this.filterConnections,
filterShowNonStopTime: this.filterShowNonStopTime,
filterTrainrunCategory: this.filterTrainrunCategory,
filterTrainrunFrequency: this.filterTrainrunFrequency,
filterTrainrunTimeCategory: this.filterTrainrunTimeCategory,
filterDirection: this.filterDirection,
filterSymmetry: this.filterSymmetry,
filterAllEmptyNodes: this.filterAllEmptyNodes,
filterAllNonStopNodes: this.filterAllNonStopNodes,
filterNotes: this.filterNotes,
Expand Down
13 changes: 13 additions & 0 deletions src/app/models/trainrunsection.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ describe("TrainrunSection Model Test", () => {
ts.setSourceDepartureLock(false);
ts.setSourceArrivalLock(false);
ts.setTravelTimeLock(false);
ts.setBackwardTravelTimeLock(false);
expect(ts.getTargetDepartureLock()).toBe(false);
expect(ts.getTargetArrivalLock()).toBe(false);
expect(ts.getSourceDepartureLock()).toBe(false);
expect(ts.getSourceArrivalLock()).toBe(false);
expect(ts.getTravelTimeLock()).toBe(false);
expect(ts.getBackwardTravelTimeLock()).toBe(false);
});

it("set...lock - 1", () => {
Expand All @@ -174,11 +176,13 @@ describe("TrainrunSection Model Test", () => {
ts.setSourceArrivalLock(false);
ts.setTravelTimeLock(false);
ts.setTargetDepartureLock(true);
ts.setBackwardTravelTimeLock(false);
expect(ts.getTargetDepartureLock()).toBe(true);
expect(ts.getTargetArrivalLock()).toBe(false);
expect(ts.getSourceDepartureLock()).toBe(false);
expect(ts.getSourceArrivalLock()).toBe(false);
expect(ts.getTravelTimeLock()).toBe(false);
expect(ts.getBackwardTravelTimeLock()).toBe(false);
});

it("set...lock - 2", () => {
Expand All @@ -189,11 +193,13 @@ describe("TrainrunSection Model Test", () => {
ts.setSourceArrivalLock(false);
ts.setTravelTimeLock(false);
ts.setTargetArrivalLock(true);
ts.setBackwardTravelTimeLock(false);
expect(ts.getTargetDepartureLock()).toBe(false);
expect(ts.getTargetArrivalLock()).toBe(true);
expect(ts.getSourceDepartureLock()).toBe(false);
expect(ts.getSourceArrivalLock()).toBe(false);
expect(ts.getTravelTimeLock()).toBe(false);
expect(ts.getBackwardTravelTimeLock()).toBe(false);
});

it("set...lock - 3", () => {
Expand All @@ -203,12 +209,14 @@ describe("TrainrunSection Model Test", () => {
ts.setSourceDepartureLock(false);
ts.setSourceArrivalLock(false);
ts.setTravelTimeLock(false);
ts.setBackwardTravelTimeLock(false);
ts.setSourceDepartureLock(true);
expect(ts.getTargetDepartureLock()).toBe(false);
expect(ts.getTargetArrivalLock()).toBe(false);
expect(ts.getSourceDepartureLock()).toBe(true);
expect(ts.getSourceArrivalLock()).toBe(false);
expect(ts.getTravelTimeLock()).toBe(false);
expect(ts.getBackwardTravelTimeLock()).toBe(false);
});

it("set...lock - 4", () => {
Expand All @@ -219,11 +227,13 @@ describe("TrainrunSection Model Test", () => {
ts.setSourceArrivalLock(false);
ts.setTravelTimeLock(false);
ts.setSourceArrivalLock(true);
ts.setBackwardTravelTimeLock(false);
expect(ts.getTargetDepartureLock()).toBe(false);
expect(ts.getTargetArrivalLock()).toBe(false);
expect(ts.getSourceDepartureLock()).toBe(false);
expect(ts.getSourceArrivalLock()).toBe(true);
expect(ts.getTravelTimeLock()).toBe(false);
expect(ts.getBackwardTravelTimeLock()).toBe(false);
});

it("set...lock - 5", () => {
Expand All @@ -233,12 +243,15 @@ describe("TrainrunSection Model Test", () => {
ts.setSourceDepartureLock(false);
ts.setSourceArrivalLock(false);
ts.setTravelTimeLock(false);
ts.setBackwardTravelTimeLock(false);
ts.setTravelTimeLock(true);
ts.setBackwardTravelTimeLock(true);
expect(ts.getTargetDepartureLock()).toBe(false);
expect(ts.getTargetArrivalLock()).toBe(false);
expect(ts.getSourceDepartureLock()).toBe(false);
expect(ts.getSourceArrivalLock()).toBe(false);
expect(ts.getTravelTimeLock()).toBe(true);
expect(ts.getBackwardTravelTimeLock()).toBe(true);
});

it("select", () => {
Expand Down
Loading