chore: added displaying real route lines

This commit is contained in:
2025-01-27 22:42:47 +01:00
parent 818144c894
commit c862164f69
2 changed files with 14 additions and 4 deletions
+9 -1
View File
@@ -1,7 +1,15 @@
<template> <template>
<tbody> <tbody>
<tr v-for="(row, i) in computedTimetable"> <tr v-for="(row, i) in computedTimetable">
<td class="text-center align-top border border-white print:border-black">{{ row.realLine }}</td> <td
class="text-center align-top border-l border-t-white print:border-l-black"
:class="{
'border-t print:border-t-black': i != 0 && computedTimetable[i - 1].realLine != row.realLine,
'border-b': i == computedTimetable.length - 1,
}"
>
{{ i == 0 || computedTimetable[i - 1].realLine != row.realLine ? row.realLine : '&nbsp;' }}
</td>
<td class="border border-white print:border-black relative"> <td class="border border-white print:border-black relative">
<div class="absolute top-0 left-0 w-full h-full p-0.5"> <div class="absolute top-0 left-0 w-full h-full p-0.5">
+5 -3
View File
@@ -76,7 +76,7 @@ const computedTimetable = computed(() => {
let departureSpeed = currentPath.departureLineData?.routeSpeed ?? 0, let departureSpeed = currentPath.departureLineData?.routeSpeed ?? 0,
departureTracks = currentPath.departureLineData?.routeTracks ?? 2; departureTracks = currentPath.departureLineData?.routeTracks ?? 2;
let realLineNo = 0; let realLineNo = currentPath.departureLineData?.realLineNo ?? 0;
// console.debug('=========== ' + this.selectedTrain.trainNo + ' ==========='); // console.debug('=========== ' + this.selectedTrain.trainNo + ' ===========');
@@ -87,6 +87,7 @@ const computedTimetable = computed(() => {
if (currentPath.arrivalLineData) { if (currentPath.arrivalLineData) {
arrivalSpeed = currentPath.arrivalLineData.routeSpeed; arrivalSpeed = currentPath.arrivalLineData.routeSpeed;
arrivalTracks = currentPath.arrivalLineData.routeTracks; arrivalTracks = currentPath.arrivalLineData.routeTracks;
realLineNo = currentPath.arrivalLineData.realLineNo ?? 0;
} }
departureSpeed = arrivalSpeed; departureSpeed = arrivalSpeed;
@@ -104,6 +105,7 @@ const computedTimetable = computed(() => {
if (internalRouteInfo) { if (internalRouteInfo) {
correctedDepartureSpeed = internalRouteInfo.routeSpeed; correctedDepartureSpeed = internalRouteInfo.routeSpeed;
departureSpeed = internalRouteInfo.routeSpeed; departureSpeed = internalRouteInfo.routeSpeed;
realLineNo = internalRouteInfo.realLineNo ?? realLineNo;
correctedDepartureTracks = internalRouteInfo.routeTracks; correctedDepartureTracks = internalRouteInfo.routeTracks;
departureTracks = internalRouteInfo.routeTracks; departureTracks = internalRouteInfo.routeTracks;
@@ -118,7 +120,7 @@ const computedTimetable = computed(() => {
stopTime: stop.stopTime ? (stop.departureTimestamp - stop.arrivalTimestamp) / 60000 : 0, stopTime: stop.stopTime ? (stop.departureTimestamp - stop.arrivalTimestamp) / 60000 : 0,
stopType: stop.stopType, stopType: stop.stopType,
sceneryName: currentPath.sceneryName, sceneryName: currentPath.sceneryName,
realLine: realLineNo == 0 ? ' - ' : realLineNo.toString(), realLine: realLineNo == 0 ? '' : realLineNo.toString(),
driveTime: lastDepartureTimestamp ? stop.arrivalTimestamp - lastDepartureTimestamp : 0, driveTime: lastDepartureTimestamp ? stop.arrivalTimestamp - lastDepartureTimestamp : 0,
additionalAbbrevs: [], additionalAbbrevs: [],
controlAbbrevs: [], controlAbbrevs: [],
@@ -155,7 +157,7 @@ const computedTimetable = computed(() => {
if (currentPath.departureLineData) { if (currentPath.departureLineData) {
stopRows[i].departureTracks = currentPath.departureLineData.routeTracks; stopRows[i].departureTracks = currentPath.departureLineData.routeTracks;
stopRows[i].departureSpeed = currentPath.departureLineData.routeSpeed; stopRows[i].departureSpeed = currentPath.departureLineData.routeSpeed;
stopRows[i].realLine = currentPath.departureLineData.realLineNo?.toString() ?? ' - '; stopRows[i].realLine = currentPath.departureLineData.realLineNo?.toString() ?? '';
if (stopRows[i].isMain || stopRows[i].pointName.endsWith(', podg')) { if (stopRows[i].isMain || stopRows[i].pointName.endsWith(', podg')) {
stopRows[i].departureSpeed = currentPath.departureLineData.routeSpeed; stopRows[i].departureSpeed = currentPath.departureLineData.routeSpeed;