diff --git a/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue b/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue
index 50ef6f0..ee1fda2 100644
--- a/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue
+++ b/src/components/SceneryView/SceneryInfo/SceneryInfoRoutes.vue
@@ -1,114 +1,106 @@
-
-
-
-
{{ $t('scenery.one-way-routes') }}
-
-
- -
- {{ route.name }}
- SBL
-
-
-
-
-
-
{{ $t('scenery.two-way-routes') }}
-
-
- -
- {{ route.name }} SBL
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
{{ $t('scenery.one-way-routes') }}
+
+
+ -
+ {{ route.name }}
+ {{ route.speed }}
+ SBL
+
+
+
+
+
+
{{ $t('scenery.two-way-routes') }}
+
+
+ -
+ {{ route.name }}
+ {{ route.speed }}
+ SBL
+
+
+
+
+
+
+
+
+
diff --git a/src/components/TrainsView/TrainSchedule.vue b/src/components/TrainsView/TrainSchedule.vue
index e8fe839..29b9d86 100644
--- a/src/components/TrainsView/TrainSchedule.vue
+++ b/src/components/TrainsView/TrainSchedule.vue
@@ -89,6 +89,7 @@ import dateMixin from '../../mixins/dateMixin';
import imageMixin from '../../mixins/imageMixin';
import Train from '../../scripts/interfaces/Train';
import TrainStop from '../../scripts/interfaces/TrainStop';
+import { useStore } from '../../store/store';
import StopDate from '../Global/StopDate.vue';
export default defineComponent({
@@ -106,6 +107,8 @@ export default defineComponent({
setup(props) {
return {
+ store: useStore(),
+
lastConfirmed: computed(() => {
return props.train.timetableData!.followingStops.findIndex(
(stop, i, stops) => stop.confirmed && !stops[i + 1]?.confirmed && !stops[i + 1]?.stopped
@@ -424,3 +427,4 @@ ul.stop_list > li.stop {
}
}
+
diff --git a/src/scripts/interfaces/StationRoutes.ts b/src/scripts/interfaces/StationRoutes.ts
index 434c343..b7587ac 100644
--- a/src/scripts/interfaces/StationRoutes.ts
+++ b/src/scripts/interfaces/StationRoutes.ts
@@ -1,27 +1,30 @@
-export default interface StationRoutes {
- oneWay:
- {
- name: string;
- catenary: boolean;
- SBL: boolean;
- TWB: boolean;
- isInternal: boolean;
- tracks: number;
- }[];
-
- twoWay: {
- name: string;
- catenary: boolean;
- SBL: boolean;
- TWB: boolean;
- isInternal: boolean;
- tracks: number;
- }[];
-
- /* [catenary, noCatenary] */
- oneWayCatenaryRouteNames: string[];
- oneWayNoCatenaryRouteNames: string[];
- twoWayCatenaryRouteNames: string[];
- twoWayNoCatenaryRouteNames: string[];
- sblRouteNames: string[];
-}
\ No newline at end of file
+export default interface StationRoutes {
+ oneWay: {
+ name: string;
+ catenary: boolean;
+ SBL: boolean;
+ TWB: boolean;
+ isInternal: boolean;
+ tracks: number;
+ speed: number;
+ length: number;
+ }[];
+
+ twoWay: {
+ name: string;
+ catenary: boolean;
+ SBL: boolean;
+ TWB: boolean;
+ isInternal: boolean;
+ tracks: number;
+ speed: number;
+ length: number;
+ }[];
+
+ /* [catenary, noCatenary] */
+ oneWayCatenaryRouteNames: string[];
+ oneWayNoCatenaryRouteNames: string[];
+ twoWayCatenaryRouteNames: string[];
+ twoWayNoCatenaryRouteNames: string[];
+ sblRouteNames: string[];
+}
diff --git a/src/scripts/interfaces/Train.ts b/src/scripts/interfaces/Train.ts
index b4e4dfb..8c46386 100644
--- a/src/scripts/interfaces/Train.ts
+++ b/src/scripts/interfaces/Train.ts
@@ -12,7 +12,7 @@ export default interface Train {
driverId: number;
trainNo: number;
driverName: string;
- driverLevel: number;
+ driverLevel?: number;
currentStationName: string;
currentStationHash: string;
locoURL: string;
diff --git a/src/scripts/interfaces/TrainStop.ts b/src/scripts/interfaces/TrainStop.ts
index 7062d13..3572504 100644
--- a/src/scripts/interfaces/TrainStop.ts
+++ b/src/scripts/interfaces/TrainStop.ts
@@ -1,4 +1,4 @@
-export default interface TrainStop {
+export default interface TrainStop {
stopName: string;
stopNameRAW: string;
stopType: string;
diff --git a/src/store/store.ts b/src/store/store.ts
index b72cdc8..ac12b04 100644
--- a/src/store/store.ts
+++ b/src/store/store.ts
@@ -24,6 +24,7 @@ export const useStore = defineStore('store', {
stationList: [],
trainList: [],
+ routesList: [],
sceneryData: [],
lastDispatcherStatuses: [],
@@ -115,8 +116,8 @@ export const useStore = defineStore('store', {
sceneries: timetable.sceneries,
}
: undefined,
- };
- }) as Train[];
+ } as Train;
+ });
},
getDispatcherStatus(onlineStationData: StationAPIData) {
@@ -294,65 +295,72 @@ export const useStore = defineStore('store', {
return;
}
- this.stationList = sceneryData.map((scenery) => ({
- name: scenery.name,
+ this.stationList = sceneryData.map((scenery) => {
+ return {
+ name: scenery.name,
- generalInfo: {
- ...scenery,
- authors: scenery.authors?.split(',').map((a) => a.trim()),
- routes:
- scenery.routes
- ?.split(';')
- .filter((routeString) => routeString)
- .reduce(
- (acc, routeString) => {
- const specs1 = routeString.split('_')[0];
- const isInternal = specs1.startsWith('!');
- const name = isInternal ? specs1.replace('!', '') : specs1;
+ generalInfo: {
+ ...scenery,
+ authors: scenery.authors?.split(',').map((a) => a.trim()),
+ routes:
+ scenery.routes
+ ?.split(';')
+ .filter((routeString) => routeString)
+ .reduce(
+ (acc, routeString) => {
+ const specs1 = routeString.split('_')[0];
+ const isInternal = specs1.startsWith('!');
+ const name = isInternal ? specs1.replace('!', '') : specs1;
- const specs2 = routeString.split('_')[1].split('');
- const twoWay = specs2[0] == '2';
- const catenary = specs2[1] == 'E';
- const SBL = specs2[2] == 'S';
- const TWB = specs2[3] ? true : false;
+ const specs2 = routeString.split('_')[1].split('');
+ const twoWay = specs2[0] == '2';
+ const catenary = specs2[1] == 'E';
+ const SBL = specs2[2] == 'S';
+ const TWB = specs2[3] ? true : false;
+ const speed = Number(routeString.split(':')[1]) || 0;
+ const length = Number(routeString.split(':')[2]) || 0;
- const propName = twoWay
- ? catenary
- ? 'twoWayCatenaryRouteNames'
- : 'twoWayNoCatenaryRouteNames'
- : catenary
- ? 'oneWayCatenaryRouteNames'
- : 'oneWayNoCatenaryRouteNames';
- acc[twoWay ? 'twoWay' : 'oneWay'].push({
- name,
- SBL,
- TWB,
- catenary,
- isInternal,
- tracks: twoWay ? 2 : 1,
- });
- if (!isInternal) acc[propName].push(name);
+ const propName = twoWay
+ ? catenary
+ ? 'twoWayCatenaryRouteNames'
+ : 'twoWayNoCatenaryRouteNames'
+ : catenary
+ ? 'oneWayCatenaryRouteNames'
+ : 'oneWayNoCatenaryRouteNames';
- if (SBL) acc['sblRouteNames'].push(name);
+ acc[twoWay ? 'twoWay' : 'oneWay'].push({
+ name,
+ SBL,
+ TWB,
+ catenary,
+ isInternal,
+ tracks: twoWay ? 2 : 1,
+ length,
+ speed,
+ });
+ if (!isInternal) acc[propName].push(name);
- return acc;
- },
- {
- oneWay: [],
- twoWay: [],
- sblRouteNames: [],
- oneWayCatenaryRouteNames: [],
- oneWayNoCatenaryRouteNames: [],
- twoWayCatenaryRouteNames: [],
- twoWayNoCatenaryRouteNames: [],
- } as StationRoutes
- ) || {},
- checkpoints: scenery.checkpoints
- ? scenery.checkpoints.split(';').map((sub) => ({ checkpointName: sub, scheduledTrains: [] }))
- : [],
- },
- }));
+ if (SBL) acc['sblRouteNames'].push(name);
+
+ return acc;
+ },
+ {
+ oneWay: [],
+ twoWay: [],
+ sblRouteNames: [],
+ oneWayCatenaryRouteNames: [],
+ oneWayNoCatenaryRouteNames: [],
+ twoWayCatenaryRouteNames: [],
+ twoWayNoCatenaryRouteNames: [],
+ } as StationRoutes
+ ) || {},
+ checkpoints: scenery.checkpoints
+ ? scenery.checkpoints.split(';').map((sub) => ({ checkpointName: sub, scheduledTrains: [] }))
+ : [],
+ },
+ };
+ });
},
connectToWebsocket() {
diff --git a/src/store/storeTypes.ts b/src/store/storeTypes.ts
index 632ef84..d06fef5 100644
--- a/src/store/storeTypes.ts
+++ b/src/store/storeTypes.ts
@@ -69,8 +69,9 @@ export interface StationJSONData {
SUP: boolean;
routes: string;
+
checkpoints: string | null;
authors?: string;
availability: Availability;
-}
+}
\ No newline at end of file