mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 05:28:12 +00:00
chore: added support for left & right track vmax
This commit is contained in:
@@ -80,7 +80,8 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'border-t-0':
|
'border-t-0':
|
||||||
row.lastRowRef == null ||
|
row.lastRowRef == null ||
|
||||||
(row.lastRowRef.departureSpeed == row.arrivalSpeed &&
|
(row.lastRowRef.departureSpeedL == row.arrivalSpeedL &&
|
||||||
|
row.lastRowRef.departureSpeedP == row.arrivalSpeedP &&
|
||||||
row.lastRowRef.departureTracks == row.arrivalTracks &&
|
row.lastRowRef.departureTracks == row.arrivalTracks &&
|
||||||
row.lastRowRef.realLine == row.realLine),
|
row.lastRowRef.realLine == row.realLine),
|
||||||
'border-b-0': i != computedTimetableRows.length - 1
|
'border-b-0': i != computedTimetableRows.length - 1
|
||||||
@@ -93,7 +94,8 @@
|
|||||||
<tr
|
<tr
|
||||||
:class="`align-top ${
|
:class="`align-top ${
|
||||||
row.lastRowRef == null ||
|
row.lastRowRef == null ||
|
||||||
(row.lastRowRef.departureSpeed == row.arrivalSpeed &&
|
(row.lastRowRef.departureSpeedL == row.arrivalSpeedL &&
|
||||||
|
row.lastRowRef.departureSpeedP == row.arrivalSpeedP &&
|
||||||
row.lastRowRef.departureTracks == row.arrivalTracks &&
|
row.lastRowRef.departureTracks == row.arrivalTracks &&
|
||||||
row.lastRowRef.realLine == row.realLine)
|
row.lastRowRef.realLine == row.realLine)
|
||||||
? 'text-transparent'
|
? 'text-transparent'
|
||||||
@@ -108,10 +110,12 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'border-black dark:border-white border-t align-top':
|
'border-black dark:border-white border-t align-top':
|
||||||
row.arrivalTracks != row.departureTracks ||
|
row.arrivalTracks != row.departureTracks ||
|
||||||
row.departureSpeed != row.arrivalSpeed,
|
row.departureSpeedL != row.arrivalSpeedL ||
|
||||||
|
row.departureSpeedP != row.arrivalSpeedP,
|
||||||
hidden:
|
hidden:
|
||||||
row.arrivalTracks == row.departureTracks &&
|
row.arrivalTracks == row.departureTracks &&
|
||||||
row.departureSpeed == row.arrivalSpeed
|
row.departureSpeedL == row.arrivalSpeedL &&
|
||||||
|
row.departureSpeedP == row.arrivalSpeedP
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<td>{{ row.departureKm == '0.000' ? '' : row.departureKm }}</td>
|
<td>{{ row.departureKm == '0.000' ? '' : row.departureKm }}</td>
|
||||||
@@ -126,7 +130,9 @@
|
|||||||
class="text-center align-top p-0 border-l-black dark:border-l-white relative"
|
class="text-center align-top p-0 border-l-black dark:border-l-white relative"
|
||||||
:class="{
|
:class="{
|
||||||
'border-t border-t-black dark:border-t-white':
|
'border-t border-t-black dark:border-t-white':
|
||||||
row.lastRowRef != null && row.lastRowRef.departureSpeed != row.arrivalSpeed,
|
row.lastRowRef != null &&
|
||||||
|
row.lastRowRef.departureSpeedL != row.arrivalSpeedL &&
|
||||||
|
row.lastRowRef.departureSpeedP != row.arrivalSpeedP,
|
||||||
'border-b border-b-black dark:border-b-white': i == computedTimetableRows.length - 1
|
'border-b border-b-black dark:border-b-white': i == computedTimetableRows.length - 1
|
||||||
}"
|
}"
|
||||||
colspan="2"
|
colspan="2"
|
||||||
@@ -138,9 +144,9 @@
|
|||||||
<td :colspan="row.arrivalTracks == 2 ? '1' : '2'" class="font-bold" width="35">
|
<td :colspan="row.arrivalTracks == 2 ? '1' : '2'" class="font-bold" width="35">
|
||||||
{{
|
{{
|
||||||
row.lastRowRef == null ||
|
row.lastRowRef == null ||
|
||||||
row.lastRowRef.departureSpeed != row.arrivalSpeed ||
|
row.lastRowRef.departureSpeedP != row.arrivalSpeedP ||
|
||||||
row.lastRowRef.departureTracks != row.arrivalTracks
|
row.lastRowRef.departureTracks != row.arrivalTracks
|
||||||
? row.arrivalSpeed
|
? row.arrivalSpeedP
|
||||||
: ' '
|
: ' '
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@@ -152,9 +158,9 @@
|
|||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
row.lastRowRef == null ||
|
row.lastRowRef == null ||
|
||||||
row.lastRowRef.departureSpeed != row.arrivalSpeed ||
|
row.lastRowRef.departureSpeedL != row.arrivalSpeedL ||
|
||||||
row.lastRowRef.departureTracks != row.arrivalTracks
|
row.lastRowRef.departureTracks != row.arrivalTracks
|
||||||
? row.arrivalSpeed
|
? row.arrivalSpeedL
|
||||||
: ' '
|
: ' '
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@@ -164,7 +170,8 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'border-t border-t-black dark:border-t-white align-top':
|
'border-t border-t-black dark:border-t-white align-top':
|
||||||
row.arrivalTracks != row.departureTracks ||
|
row.arrivalTracks != row.departureTracks ||
|
||||||
row.departureSpeed != row.arrivalSpeed
|
row.departureSpeedL != row.arrivalSpeedL ||
|
||||||
|
row.departureSpeedP != row.arrivalSpeedP
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
@@ -173,9 +180,9 @@
|
|||||||
width="35"
|
width="35"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
row.departureSpeed != row.arrivalSpeed ||
|
row.departureSpeedP != row.arrivalSpeedP ||
|
||||||
row.departureTracks != row.arrivalTracks
|
row.departureTracks != row.arrivalTracks
|
||||||
? row.departureSpeed
|
? row.departureSpeedP
|
||||||
: ' '
|
: ' '
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@@ -186,9 +193,9 @@
|
|||||||
width="35"
|
width="35"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
row.departureSpeed != row.arrivalSpeed ||
|
row.departureSpeedL != row.arrivalSpeedL ||
|
||||||
row.departureTracks != row.arrivalTracks
|
row.departureTracks != row.arrivalTracks
|
||||||
? row.departureSpeed
|
? row.departureSpeedL
|
||||||
: ' '
|
: ' '
|
||||||
}}
|
}}
|
||||||
</td>
|
</td>
|
||||||
@@ -373,20 +380,33 @@ const computedTimetableRows = computed(() => {
|
|||||||
|
|
||||||
let lastDepartureTimestamp = 0;
|
let lastDepartureTimestamp = 0;
|
||||||
|
|
||||||
|
let arrivalSpeedL = 0,
|
||||||
|
arrivalSpeedP = 0;
|
||||||
|
|
||||||
|
let departureSpeedL = 0,
|
||||||
|
departureSpeedP = 0;
|
||||||
|
|
||||||
let arrivalKm = 0,
|
let arrivalKm = 0,
|
||||||
arrivalSpeed = 0,
|
|
||||||
arrivalTracks = 0,
|
arrivalTracks = 0,
|
||||||
departureSpeed = 0,
|
|
||||||
departureTracks = 2,
|
departureTracks = 2,
|
||||||
realLineNo = 0,
|
realLineNo = 0,
|
||||||
abbrevs = [] as string[];
|
abbrevs = [] as string[];
|
||||||
|
|
||||||
if (currentPath.departureLineData) {
|
if (currentPath.departureLineData) {
|
||||||
departureSpeed = Math.min(currentPath.departureLineData.routeSpeed, stockVmax);
|
departureSpeedL = Math.min(currentPath.departureLineData.routeSpeed, stockVmax);
|
||||||
|
departureSpeedP = currentPath.departureLineData.routeSpeedExit
|
||||||
|
? Math.min(currentPath.departureLineData.routeSpeedExit, stockVmax)
|
||||||
|
: departureSpeedL;
|
||||||
|
|
||||||
|
// departureSpeed = Math.min(currentPath.departureLineData.routeSpeed, stockVmax);
|
||||||
departureTracks = currentPath.departureLineData.routeTracks;
|
departureTracks = currentPath.departureLineData.routeTracks;
|
||||||
|
|
||||||
arrivalSpeed = Math.min(currentPath.departureLineData.routeSpeed, stockVmax);
|
// arrivalSpeed = departureSpeed;
|
||||||
arrivalTracks = currentPath.departureLineData.routeTracks;
|
|
||||||
|
arrivalSpeedL = departureSpeedL;
|
||||||
|
arrivalSpeedP = departureSpeedP;
|
||||||
|
|
||||||
|
arrivalTracks = departureTracks;
|
||||||
|
|
||||||
realLineNo = currentPath.departureLineData?.realLineNo ?? 0;
|
realLineNo = currentPath.departureLineData?.realLineNo ?? 0;
|
||||||
abbrevs = getAbbrevs(currentPath.departureLineData);
|
abbrevs = getAbbrevs(currentPath.departureLineData);
|
||||||
@@ -403,13 +423,19 @@ const computedTimetableRows = computed(() => {
|
|||||||
(Number(stopRows[stopRows.length - 1].departureKm ?? '0') + stop.stopDistance) / 2;
|
(Number(stopRows[stopRows.length - 1].departureKm ?? '0') + stop.stopDistance) / 2;
|
||||||
|
|
||||||
if (currentPath.arrivalLineData) {
|
if (currentPath.arrivalLineData) {
|
||||||
arrivalSpeed = Math.min(currentPath.arrivalLineData.routeSpeed, stockVmax);
|
arrivalSpeedP = Math.min(currentPath.arrivalLineData.routeSpeed, stockVmax);
|
||||||
|
arrivalSpeedL = currentPath.arrivalLineData.routeSpeedExit
|
||||||
|
? Math.min(currentPath.arrivalLineData.routeSpeedExit, stockVmax)
|
||||||
|
: arrivalSpeedP;
|
||||||
|
|
||||||
arrivalTracks = currentPath.arrivalLineData.routeTracks;
|
arrivalTracks = currentPath.arrivalLineData.routeTracks;
|
||||||
realLineNo = currentPath.arrivalLineData.realLineNo ?? 0;
|
realLineNo = currentPath.arrivalLineData.realLineNo ?? 0;
|
||||||
abbrevs = getAbbrevs(currentPath.arrivalLineData);
|
abbrevs = getAbbrevs(currentPath.arrivalLineData);
|
||||||
}
|
}
|
||||||
|
|
||||||
departureSpeed = arrivalSpeed;
|
departureSpeedL = arrivalSpeedL;
|
||||||
|
departureSpeedP = arrivalSpeedP;
|
||||||
|
|
||||||
departureTracks = arrivalTracks;
|
departureTracks = arrivalTracks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +443,8 @@ const computedTimetableRows = computed(() => {
|
|||||||
stop.mainStop ||
|
stop.mainStop ||
|
||||||
(/^podg|po|pe$/.test(stop.stopNameRAW) && !/^sbl/i.test(stop.stopNameRAW))
|
(/^podg|po|pe$/.test(stop.stopNameRAW) && !/^sbl/i.test(stop.stopNameRAW))
|
||||||
) {
|
) {
|
||||||
let correctedDepartureSpeed = 0,
|
let correctedDepartureSpeedL = 0,
|
||||||
|
correctedDepartureSpeedP = 0,
|
||||||
correctedDepartureTracks = 0;
|
correctedDepartureTracks = 0;
|
||||||
|
|
||||||
const internalRouteInfo = stop.departureLine
|
const internalRouteInfo = stop.departureLine
|
||||||
@@ -427,8 +454,14 @@ const computedTimetableRows = computed(() => {
|
|||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
if (internalRouteInfo) {
|
if (internalRouteInfo) {
|
||||||
correctedDepartureSpeed = Math.min(internalRouteInfo.routeSpeed, stockVmax);
|
correctedDepartureSpeedL = Math.min(internalRouteInfo.routeSpeed, stockVmax);
|
||||||
departureSpeed = Math.min(internalRouteInfo.routeSpeed, stockVmax);
|
correctedDepartureSpeedP = internalRouteInfo.routeSpeedExit
|
||||||
|
? Math.min(internalRouteInfo.routeSpeedExit, stockVmax)
|
||||||
|
: correctedDepartureSpeedL;
|
||||||
|
|
||||||
|
departureSpeedL = correctedDepartureSpeedL;
|
||||||
|
departureSpeedP = correctedDepartureSpeedP;
|
||||||
|
|
||||||
realLineNo = internalRouteInfo.realLineNo ?? realLineNo;
|
realLineNo = internalRouteInfo.realLineNo ?? realLineNo;
|
||||||
abbrevs = getAbbrevs(internalRouteInfo);
|
abbrevs = getAbbrevs(internalRouteInfo);
|
||||||
|
|
||||||
@@ -436,7 +469,8 @@ const computedTimetableRows = computed(() => {
|
|||||||
departureTracks = internalRouteInfo.routeTracks;
|
departureTracks = internalRouteInfo.routeTracks;
|
||||||
|
|
||||||
if (stopRows.length == 0) {
|
if (stopRows.length == 0) {
|
||||||
arrivalSpeed = departureSpeed;
|
arrivalSpeedL = departureSpeedL;
|
||||||
|
arrivalSpeedP = departureSpeedP;
|
||||||
arrivalTracks = departureTracks;
|
arrivalTracks = departureTracks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,10 +496,14 @@ const computedTimetableRows = computed(() => {
|
|||||||
arrivalKm: arrivalKm.toFixed(3),
|
arrivalKm: arrivalKm.toFixed(3),
|
||||||
departureKm: stop.stopDistance.toFixed(3),
|
departureKm: stop.stopDistance.toFixed(3),
|
||||||
|
|
||||||
arrivalSpeed: arrivalSpeed,
|
arrivalSpeedL,
|
||||||
|
arrivalSpeedP,
|
||||||
|
|
||||||
arrivalTracks: arrivalTracks,
|
arrivalTracks: arrivalTracks,
|
||||||
|
|
||||||
departureSpeed: departureSpeed,
|
departureSpeedL,
|
||||||
|
departureSpeedP,
|
||||||
|
|
||||||
departureTracks: departureTracks,
|
departureTracks: departureTracks,
|
||||||
|
|
||||||
headUnits: timetableData.headUnits,
|
headUnits: timetableData.headUnits,
|
||||||
@@ -479,7 +517,10 @@ const computedTimetableRows = computed(() => {
|
|||||||
// console.debug(stop.stopNameRAW, stop.departureLine);
|
// console.debug(stop.stopNameRAW, stop.departureLine);
|
||||||
|
|
||||||
arrivalKm = stop.stopDistance;
|
arrivalKm = stop.stopDistance;
|
||||||
arrivalSpeed = correctedDepartureSpeed || arrivalSpeed;
|
|
||||||
|
arrivalSpeedL = correctedDepartureSpeedL || arrivalSpeedL;
|
||||||
|
arrivalSpeedP = correctedDepartureSpeedP || arrivalSpeedP;
|
||||||
|
|
||||||
arrivalTracks = correctedDepartureTracks || arrivalTracks;
|
arrivalTracks = correctedDepartureTracks || arrivalTracks;
|
||||||
|
|
||||||
if (stop.departureTimestamp) lastDepartureTimestamp = stop.departureTimestamp;
|
if (stop.departureTimestamp) lastDepartureTimestamp = stop.departureTimestamp;
|
||||||
@@ -508,17 +549,28 @@ const computedTimetableRows = computed(() => {
|
|||||||
|
|
||||||
for (let i = stopRows.length - 1; i >= 0; i--) {
|
for (let i = stopRows.length - 1; i >= 0; i--) {
|
||||||
stopRows[i].departureTracks = currentPath.departureLineData.routeTracks;
|
stopRows[i].departureTracks = currentPath.departureLineData.routeTracks;
|
||||||
stopRows[i].departureSpeed = Math.min(
|
|
||||||
|
stopRows[i].departureSpeedL = Math.min(
|
||||||
currentPath.departureLineData.routeSpeed,
|
currentPath.departureLineData.routeSpeed,
|
||||||
stockVmax
|
stockVmax
|
||||||
);
|
);
|
||||||
|
|
||||||
|
stopRows[i].departureSpeedP = currentPath.departureLineData.routeSpeedExit
|
||||||
|
? Math.min(currentPath.departureLineData.routeSpeedExit, stockVmax)
|
||||||
|
: stopRows[i].departureSpeedL;
|
||||||
|
|
||||||
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 = Math.min(
|
stopRows[i].departureSpeedL = Math.min(
|
||||||
currentPath.departureLineData.routeSpeed,
|
currentPath.departureLineData.routeSpeed,
|
||||||
stockVmax
|
stockVmax
|
||||||
);
|
);
|
||||||
|
|
||||||
|
stopRows[i].departureSpeedP = currentPath.departureLineData.routeSpeedExit
|
||||||
|
? Math.min(currentPath.departureLineData.routeSpeedExit, stockVmax)
|
||||||
|
: stopRows[i].departureSpeedL;
|
||||||
|
|
||||||
stopRows[i].departureTracks = currentPath.departureLineData.routeTracks;
|
stopRows[i].departureTracks = currentPath.departureLineData.routeTracks;
|
||||||
|
|
||||||
// console.log(
|
// console.log(
|
||||||
@@ -539,7 +591,10 @@ const computedTimetableRows = computed(() => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
stopRows[i].arrivalSpeed = Math.min(currentPath.departureLineData.routeSpeed, stockVmax);
|
stopRows[i].arrivalSpeedP = Math.min(currentPath.departureLineData.routeSpeed, stockVmax);
|
||||||
|
stopRows[i].arrivalSpeedL = currentPath.departureLineData.routeSpeedExit
|
||||||
|
? Math.min(currentPath.departureLineData.routeSpeedExit, stockVmax)
|
||||||
|
: stopRows[i].arrivalSpeedP;
|
||||||
stopRows[i].arrivalTracks = currentPath.departureLineData.routeTracks;
|
stopRows[i].arrivalTracks = currentPath.departureLineData.routeTracks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ export interface SceneryRoute {
|
|||||||
isInternal: boolean;
|
isInternal: boolean;
|
||||||
isRouteSBL: boolean;
|
isRouteSBL: boolean;
|
||||||
routeSpeed: number;
|
routeSpeed: number;
|
||||||
|
routeSpeedExit?: number;
|
||||||
routeLength: number;
|
routeLength: number;
|
||||||
routeTracks: number;
|
routeTracks: number;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
@@ -138,10 +139,12 @@ export interface StopRow {
|
|||||||
abbrevs: string[];
|
abbrevs: string[];
|
||||||
sceneryName: string;
|
sceneryName: string;
|
||||||
arrivalKm: string;
|
arrivalKm: string;
|
||||||
arrivalSpeed: number;
|
arrivalSpeedL: number;
|
||||||
|
arrivalSpeedP: number;
|
||||||
arrivalTracks: number;
|
arrivalTracks: number;
|
||||||
departureKm: string;
|
departureKm: string;
|
||||||
departureSpeed: number;
|
departureSpeedL: number;
|
||||||
|
departureSpeedP: number;
|
||||||
departureTracks: number;
|
departureTracks: number;
|
||||||
headUnits: string[];
|
headUnits: string[];
|
||||||
stockVmax: number;
|
stockVmax: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user