diff --git a/src/components/TrainsView/TrainSchedule.vue b/src/components/TrainsView/TrainSchedule.vue index 9c9bad8..38eb517 100644 --- a/src/components/TrainsView/TrainSchedule.vue +++ b/src/components/TrainsView/TrainSchedule.vue @@ -14,8 +14,12 @@
{{ stop.arrivalLine }}
+ v-if=" + i > 0 && followingStops[i - 1].departureLine != stop.arrivalLine + " + > + {{ stop.arrivalLine }} +
@@ -25,20 +29,35 @@ p. {{stylizeTime(stop.arrivalRealTimeString, stop.arrivalDelay)}} + :class="{ + delayed: stop.arrivalDelay > 0, + preponed: stop.arrivalDelay < 0, + }" + >p. + {{ + stylizeTime(stop.arrivalRealTimeString, stop.arrivalDelay) + }}
{{ stop.stopTime }} {{ stop.stopType }} + >{{ stop.stopTime }} {{ stop.stopType }} o. {{ stylizeTime(stop.departureRealTimeString, stop.departureDelay) }} + :class="{ + delayed: stop.departureDelay > 0, + preponed: stop.departureDelay < 0, + }" + >o. + {{ + stylizeTime(stop.departureRealTimeString, stop.departureDelay) + }} @@ -185,7 +204,8 @@ li.schedule-item > .stop-info { } &.pt, - &.pm { + &.pm, + &.pt-pm { background: #252525; } } diff --git a/src/components/TrainsView/TrainTable.vue b/src/components/TrainsView/TrainTable.vue index 072cf2a..ee47a2e 100644 --- a/src/components/TrainsView/TrainTable.vue +++ b/src/components/TrainsView/TrainTable.vue @@ -171,6 +171,7 @@ import Train from "@/scripts/interfaces/Train"; import Station from "@/scripts/interfaces/Station"; import TrainSchedule from "@/components/TrainsView/TrainSchedule.vue"; +import TrainStop from '@/scripts/interfaces/TrainStop'; @Component({ components: { TrainSchedule } @@ -202,11 +203,10 @@ export default class TrainTable extends Vue { generateStopList(stops: any): string | undefined { if (!stops) return ""; - return stops.reduce((acc, stop, i) => { - - if (stop.stopType.includes("ph")) acc.push(`${stop.stopName}`); - else if (i > 0 && i < stops.length - 1 && !stop.stopName.includes("po.")) - acc.push(`${stop.stopName.includes("podg.") ? stop.stopName.split(",")[0] : stop.stopName}`); + return stops.reduce((acc, stop: TrainStop, i) => { + if (stop.stopType.includes("ph")) acc.push(`${stop.stopName}`); + else if (i > 0 && i < stops.length - 1) + acc.push(`${stop.stopName}`); return acc; }, []).join(" * "); } @@ -360,6 +360,10 @@ export default class TrainTable extends Vue { } .stats { + display: flex; + flex-direction: column; + justify-content: space-around; + &-main { display: flex; margin-bottom: 1.5em; diff --git a/src/data/stations.json b/src/data/stations.json index 1eda35a..521635f 100644 --- a/src/data/stations.json +++ b/src/data/stations.json @@ -264,7 +264,7 @@ }, "default": true, "nonPublic": false, - "stops": ["Głowno"] + "stops": ["Głowno, Domaniewice"] }, { "stationName": "LCS Ozorków", @@ -1933,5 +1933,29 @@ }, "default": false, "nonPublic": false + }, + { + "stationName": "Ciechany", + "stationURL": "https://td2.info.pl/w-trakcie-prac/ciechany/", + "stationLines": "", + "reqLevel": "3", + "supportersOnly": "NIE", + "signalType": "współczesna", + "controlType": "SCS", + "SBL": "", + "twoWayBlock": "", + "routes": { + "oneWay": { + "catenary": 1, + "noCatenary": 0 + }, + "twoWay": { + "catenary": 0, + "noCatenary": 0 + } + }, + "default": false, + "nonPublic": false, + "stops": ["Pawonki"] } ] diff --git a/src/scripts/interfaces/Station.ts b/src/scripts/interfaces/Station.ts index 25e2b79..e8a9c54 100644 --- a/src/scripts/interfaces/Station.ts +++ b/src/scripts/interfaces/Station.ts @@ -33,6 +33,7 @@ export default interface Station { driverName: string; driverId: number; currentStationName: string; + currentStationHash: string; category: string; stopInfo: TrainStop; diff --git a/src/scripts/interfaces/Train.ts b/src/scripts/interfaces/Train.ts index 725e009..0980403 100644 --- a/src/scripts/interfaces/Train.ts +++ b/src/scripts/interfaces/Train.ts @@ -11,6 +11,7 @@ export default interface Train { trainNo: number; driverName: string; currentStationName: string; + currentStationHash: string; locoURL: string; locoType: string; online: boolean; diff --git a/src/store/store.ts b/src/store/store.ts index 74d970c..a647e58 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -183,6 +183,7 @@ export default class Store extends VuexModule { driverName: train.driverName, driverId: train.driverId, currentStationName: train.currentStationName, + currentStationHash: train.currentStationHash, timetableId: trainInfo.timetableId, category: trainInfo.trainCategoryCode, route: trainInfo.route, @@ -253,6 +254,7 @@ export default class Store extends VuexModule { driverId: train.driverId, driverName: train.driverName, currentStationName: train.station.stationName, + currentStationHash: train.station.stationHash, connectedTrack: train.dataSceneryConnection, locoType, locoURL: getLocoURL(locoType), @@ -375,11 +377,11 @@ export default class Store extends VuexModule { ? timetableData.followingStops.findIndex((stop: any) => { const stationName = station.stationName.toLowerCase(); const stopName = stop.stopNameRAW.toLowerCase(); - - return ( +//stationName.includes('lcs') && + return ( stationName.includes(stopName) || (stopName.includes('podg.') && stopName.split(', podg.')[0] && stationName.includes(stopName.split(', podg.')[0])) || - (stationName.includes('lcs') && JSONStationData.some(data => data.stationName.includes(station.stationName) && data.stops && data.stops.includes(stop.stopNameRAW))) + (JSONStationData.some(data => data.stationName.includes(station.stationName) && data.stops && data.stops.includes(stop.stopNameRAW))) ); }) : -1; @@ -401,6 +403,7 @@ export default class Store extends VuexModule { driverName: timetableData.driverName, driverId: timetableData.driverId, currentStationName: timetableData.currentStationName, + currentStationHash: timetableData.currentStationHash, category: timetableData.category, stopInfo, stopLabel, diff --git a/src/styles/user_badge.scss b/src/styles/user_badge.scss index c21a3af..ece519f 100644 --- a/src/styles/user_badge.scss +++ b/src/styles/user_badge.scss @@ -1,5 +1,5 @@ $no-timetable: #aaa; -$departed: lime; +$departed: springgreen; $stopped: #ffa600; $online: gold; $terminated: red;