diff --git a/components/発車時刻表/EachData.tsx b/components/発車時刻表/EachData.tsx index 4de1db2..c83f0b2 100644 --- a/components/発車時刻表/EachData.tsx +++ b/components/発車時刻表/EachData.tsx @@ -211,7 +211,7 @@ export const EachData: FC = (props) => { type={train.type} isThrew={d.isThrough} /> - + @@ -220,7 +220,7 @@ export const EachData: FC = (props) => { info={ d.isThrough ? "通過列車にご注意ください" - : d.lastStation == "当駅止" + : d.lastStation == station.Station_JP ? "この列車は当駅止です。間もなく到着します。" : "列車の出発時刻です。" } diff --git a/components/発車時刻表/LED_inside_Component/LastStation.tsx b/components/発車時刻表/LED_inside_Component/LastStation.tsx index 913b5e8..82a3fd8 100644 --- a/components/発車時刻表/LED_inside_Component/LastStation.tsx +++ b/components/発車時刻表/LED_inside_Component/LastStation.tsx @@ -4,19 +4,21 @@ import { Text, View } from "react-native"; type Props = { lastStation: string; ToData: string; + Station_JP: string; }; -export const LastStation: FC = ({ lastStation, ToData }) => { - const isEdit = ToData === "" ? false : ToData !== lastStation; +export const LastStation: FC = ({ lastStation, ToData, Station_JP }) => { + const isEdit = !ToData ? false : ToData !== lastStation; + const string = isEdit ? ToData : lastStation; return ( 4 ? parseInt("12%") : parseInt("16%"), - color: isEdit? "#ffd16fff":"white", + fontSize: lastStation?.length > 4 ? parseInt("12%") : parseInt("16%"), + color: isEdit ? "#ffd16fff" : "white", fontWeight: "bold", }} > - {isEdit ? ToData : lastStation} + {string === Station_JP ? "当駅止" : string} ); diff --git a/components/発車時刻表/LED_vidion.js b/components/発車時刻表/LED_vidion.js index 3a58fa6..93407f6 100644 --- a/components/発車時刻表/LED_vidion.js +++ b/components/発車時刻表/LED_vidion.js @@ -101,7 +101,7 @@ export default function LED_vision(props) { const data = trainTimeAndNumber .filter((d) => currentTrain.map((m) => m.num).includes(d.train)) //現在の列車に絞る[ToDo] .filter(timeFiltering) - .filter((d) => !!finalSwitch || d.lastStation != "当駅止"); + .filter((d) => !!finalSwitch || d.lastStation != station[0].Station_JP) //最終列車表示設定 setSelectedTrain(data); }, [trainTimeAndNumber, currentTrain, finalSwitch]); @@ -110,9 +110,6 @@ export default function LED_vision(props) { .map((trainNum) => { let trainData = {}; stationDiagram[trainNum].split("#").forEach((data) => { - if(trainNum == 74){ - console.log(data); - } if (data.match("着")) { trainData.lastStation = data.split(",着,")[0]; } @@ -129,10 +126,8 @@ export default function LED_vision(props) { trainData.isThrough = true; } else if (data.match(",着,")) { trainData.time = data.split(",着,")[1]; - trainData.lastStation = "当駅止"; }else if (data.match(",着編,")) { trainData.time = data.split(",着編,")[1]; - trainData.lastStation = "当駅止"; } } }); @@ -182,7 +177,7 @@ export default function LED_vision(props) { const nextPos = Pos.isBetween ? Pos.Pos.to : Pos.Pos.Pos; const PrePos = Pos.isBetween ? Pos.Pos.from : ""; if (station[0].Station_JP == nextPos) { - if(d.lastStation != "当駅止") return true; + if(d.lastStation != station[0].Station_JP) return true; } else if (station[0].Station_JP == PrePos) { return false; }