props宣言の変更
This commit is contained in:
parent
26111e7ce8
commit
f5491200eb
@ -40,7 +40,12 @@ let diagramData = undefined;
|
||||
* 9031M サンライズ瀬戸琴平(延長)(臨時?)
|
||||
* 9062D 四国まんなか千年ものがたり(臨時?)
|
||||
*/
|
||||
export default function LED_vision(props) {
|
||||
export default function LED_vision({
|
||||
station,
|
||||
navigate,
|
||||
setTrainInfo,
|
||||
EachTrainInfoAsSR,
|
||||
}) {
|
||||
const HeaderConfig = {
|
||||
headers: {
|
||||
referer: "https://train.jr-shikoku.co.jp/sp.html",
|
||||
@ -91,12 +96,12 @@ export default function LED_vision(props) {
|
||||
}
|
||||
let returnData = {};
|
||||
Object.keys(trainDiagram).forEach((key) => {
|
||||
if (trainDiagram[key].match(props.station.Station_JP + ",")) {
|
||||
if (trainDiagram[key].match(station.Station_JP + ",")) {
|
||||
returnData[key] = trainDiagram[key];
|
||||
}
|
||||
});
|
||||
setStationDiagram(returnData);
|
||||
}, [trainDiagram, props.station]);
|
||||
}, [trainDiagram, station]);
|
||||
|
||||
const getCurrentTrain = () =>
|
||||
fetch(
|
||||
@ -157,7 +162,7 @@ export default function LED_vision(props) {
|
||||
useEffect(() => {
|
||||
//現在の駅に停車する列車から時刻を切り出してLEDベースにフォーマット
|
||||
if (objectIsEmpty(stationDiagram)) return () => {};
|
||||
const getTimeData = getTime(stationDiagram, props.station);
|
||||
const getTimeData = getTime(stationDiagram, station);
|
||||
setTrainTimeAndNumber(getTimeData);
|
||||
}, [stationDiagram]);
|
||||
|
||||
@ -211,9 +216,9 @@ export default function LED_vision(props) {
|
||||
props={props}
|
||||
currentTrain={currentTrain}
|
||||
customTrainDataDetector={customTrainDataDetector}
|
||||
navigate={props.navigate}
|
||||
setTrainInfo={props.setTrainInfo}
|
||||
EachTrainInfoAsSR={props.EachTrainInfoAsSR}
|
||||
navigate={navigate}
|
||||
setTrainInfo={setTrainInfo}
|
||||
EachTrainInfoAsSR={EachTrainInfoAsSR}
|
||||
/>
|
||||
))}
|
||||
<Footer
|
||||
@ -353,6 +358,7 @@ const EachData = ({
|
||||
const openTrainInfo = (d) => {
|
||||
console.log(train);
|
||||
console.log(d);
|
||||
console.log(currentTrain);
|
||||
let TrainNumber = "";
|
||||
if (train.trainNumDistance != undefined) {
|
||||
const timeInfo =
|
||||
@ -479,7 +485,7 @@ const StatusAndDelay = ({ currentTrain, d, props, trainDescriptionSwitch }) => {
|
||||
const delay = current.delay;
|
||||
switch (true) {
|
||||
case delay === "入線":
|
||||
if (current.Pos === props.station.Station_JP) {
|
||||
if (current.Pos === station.Station_JP) {
|
||||
setStatus("当駅始発");
|
||||
break;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user