伊予若宮信号所の処理を詳細化

This commit is contained in:
harukin-expo-dev-env
2025-09-24 09:45:08 +00:00
parent c0a29fab0d
commit 7ab402d35f
3 changed files with 201 additions and 120 deletions

View File

@@ -249,7 +249,35 @@ export const EachTrainInfoCore = ({
useEffect(() => {
const position = getPosition(currentTrainData);
if (position) setCurrentPosition(position);
if (position) {
if (position.length > 1) {
if (position[0] == "-Iyo") {
position[0] =
stopStationIDList[
stopStationIDList.findIndex((d) => d.includes("U14")) - 1
][0];
}
else if (position[0] == "+Iyo") {
position[0] =
stopStationIDList[
stopStationIDList.findIndex((d) => d.includes("U14")) + 1
][0];
}
if (position[1] == "+Iyo") {
position[1] =
stopStationIDList[
stopStationIDList.findIndex((d) => d.includes("U14")) + 1
][0];
}else if (position[1] == "-Iyo") {
position[1] =
stopStationIDList[
stopStationIDList.findIndex((d) => d.includes("U14")) - 1
][0];
}
}
setCurrentPosition(position);
}
}, [currentTrainData]);
useEffect(() => {