mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Dodano wsparcie dla szlaków wewnętrznych
This commit is contained in:
@@ -4,14 +4,16 @@ export default interface StationRoutes {
|
|||||||
name: string;
|
name: string;
|
||||||
catenary: boolean;
|
catenary: boolean;
|
||||||
SBL: boolean;
|
SBL: boolean;
|
||||||
TWB: boolean
|
TWB: boolean;
|
||||||
|
isInternal: boolean;
|
||||||
}[];
|
}[];
|
||||||
|
|
||||||
twoWay: {
|
twoWay: {
|
||||||
name: string;
|
name: string;
|
||||||
catenary: boolean;
|
catenary: boolean;
|
||||||
SBL: boolean;
|
SBL: boolean;
|
||||||
TWB: boolean
|
TWB: boolean;
|
||||||
|
isInternal: boolean;
|
||||||
}[];
|
}[];
|
||||||
|
|
||||||
/* [catenary, noCatenary] */
|
/* [catenary, noCatenary] */
|
||||||
|
|||||||
+10
-8
@@ -346,13 +346,15 @@ export const store = createStore<State>({
|
|||||||
generalInfo: {
|
generalInfo: {
|
||||||
...stationData,
|
...stationData,
|
||||||
routes: stationData.routes?.split(";").filter(routeString => routeString).reduce((acc, routeString) => {
|
routes: stationData.routes?.split(";").filter(routeString => routeString).reduce((acc, routeString) => {
|
||||||
const name = routeString.split("_")[0];
|
const specs1 = routeString.split("_")[0];
|
||||||
const specs = routeString.split("_")[1].split("");
|
const isInternal = specs1.startsWith('!');
|
||||||
|
const name = isInternal ? specs1.replace("!", "") : specs1;
|
||||||
|
|
||||||
const twoWay = specs[0] == "2";
|
const specs2 = routeString.split("_")[1].split("");
|
||||||
const catenary = specs[1] == "E";
|
const twoWay = specs2[0] == "2";
|
||||||
const SBL = specs[2] == "S";
|
const catenary = specs2[1] == "E";
|
||||||
const TWB = specs[3] ? true : false;
|
const SBL = specs2[2] == "S";
|
||||||
|
const TWB = specs2[3] ? true : false;
|
||||||
|
|
||||||
const propName = twoWay
|
const propName = twoWay
|
||||||
? catenary
|
? catenary
|
||||||
@@ -362,8 +364,8 @@ export const store = createStore<State>({
|
|||||||
? 'oneWayCatenaryRouteNames'
|
? 'oneWayCatenaryRouteNames'
|
||||||
: 'oneWayNoCatenaryRouteNames';
|
: 'oneWayNoCatenaryRouteNames';
|
||||||
|
|
||||||
acc[twoWay ? 'twoWay' : 'oneWay'].push({ name, SBL, TWB, catenary });
|
acc[twoWay ? 'twoWay' : 'oneWay'].push({ name, SBL, TWB, catenary, isInternal });
|
||||||
acc[propName].push(name);
|
if(!isInternal) acc[propName].push(name);
|
||||||
|
|
||||||
if (SBL) acc['sblRouteNames'].push(name);
|
if (SBL) acc['sblRouteNames'].push(name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user