Skip to content

Commit

Permalink
wip: front: create node transitions in NGE
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Jul 16, 2024
1 parent d6012a7 commit 857bbb8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,18 @@ const importTimetable = async (
return port;
};

let transitionId = 0;
const createTransition = (port1Id: number, port2Id: number) => {
const transition = {
id: transitionId,
port1Id,
port2Id,
isNonStopTransit: false,
};
transitionId += 1;
return transition;
};

let trainrunSectionId = 0;
const trainrunSections: TrainrunSection[] = trainSchedules
.map((trainSchedule) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type Node = {
positionX: number;
positionY: number;
ports: Port[];
transitions: unknown[];
transitions: Transition[];
connections: unknown[];
resourceId: number;
/** Number of tracks where train can stop */
Expand All @@ -34,6 +34,13 @@ export type Port = {
trainrunSectionId: number;
};

export type Transition = {
id: number;
port1Id: number;
port2Id: number;
isNonStopTransit: boolean;
};

export enum PortAlignment {
Top,
Bottom,
Expand Down

0 comments on commit 857bbb8

Please sign in to comment.