Merge commit '036a7ee914eac55099ca5cfed6930bd31d345348' into patch/6.x
This commit is contained in:
@@ -151,10 +151,20 @@ export default function AllTrainDiagramView() {
|
|||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
data={keyList?.filter((d) => {
|
data={keyList?.filter((d) => {
|
||||||
if (useStationName) {
|
if (useStationName) {
|
||||||
const ls = input.split(",").map((stationName) => {
|
const EachStopInfo = allTrainDiagram[d].split("#");
|
||||||
return allTrainDiagram[d].includes(stationName);
|
const ls = input.split(",").map((inputStationValue) => {
|
||||||
|
const isHit = EachStopInfo.find((dx) => {
|
||||||
|
if (!dx) return undefined;
|
||||||
|
const returnData = dx.split(",")[0] == inputStationValue;
|
||||||
|
if (returnData) {
|
||||||
|
const isThrew = dx.split(",")[1].includes("通");
|
||||||
|
if (isThrew) return undefined;
|
||||||
|
}
|
||||||
|
return returnData;
|
||||||
|
});
|
||||||
|
return isHit;
|
||||||
});
|
});
|
||||||
return !ls.includes(false);
|
return !ls.includes(undefined);
|
||||||
}
|
}
|
||||||
if (useRegex) {
|
if (useRegex) {
|
||||||
try {
|
try {
|
||||||
|
@@ -211,7 +211,7 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
type={train.type}
|
type={train.type}
|
||||||
isThrew={d.isThrough}
|
isThrew={d.isThrough}
|
||||||
/>
|
/>
|
||||||
<LastStation lastStation={d.lastStation} ToData={train.ToData} />
|
<LastStation lastStation={d.lastStation} ToData={train.ToData} Station_JP={station.Station_JP} />
|
||||||
<DependTime time={d.time} />
|
<DependTime time={d.time} />
|
||||||
<StatusAndDelay trainDelayStatus={trainDelayStatus} />
|
<StatusAndDelay trainDelayStatus={trainDelayStatus} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -220,7 +220,7 @@ export const EachData: FC<Props> = (props) => {
|
|||||||
info={
|
info={
|
||||||
d.isThrough
|
d.isThrough
|
||||||
? "通過列車にご注意ください"
|
? "通過列車にご注意ください"
|
||||||
: d.lastStation == "当駅止"
|
: d.lastStation == station.Station_JP
|
||||||
? "この列車は当駅止です。間もなく到着します。"
|
? "この列車は当駅止です。間もなく到着します。"
|
||||||
: "列車の出発時刻です。"
|
: "列車の出発時刻です。"
|
||||||
}
|
}
|
||||||
|
@@ -4,19 +4,21 @@ import { Text, View } from "react-native";
|
|||||||
type Props = {
|
type Props = {
|
||||||
lastStation: string;
|
lastStation: string;
|
||||||
ToData: string;
|
ToData: string;
|
||||||
|
Station_JP: string;
|
||||||
};
|
};
|
||||||
export const LastStation: FC<Props> = ({ lastStation, ToData }) => {
|
export const LastStation: FC<Props> = ({ lastStation, ToData, Station_JP }) => {
|
||||||
const isEdit = ToData === "" ? false : ToData !== lastStation;
|
const isEdit = !ToData ? false : ToData !== lastStation;
|
||||||
|
const string = isEdit ? ToData : lastStation;
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 4, flexDirection: "row" }}>
|
<View style={{ flex: 4, flexDirection: "row" }}>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
fontSize: lastStation.length > 4 ? parseInt("12%") : parseInt("16%"),
|
fontSize: lastStation?.length > 4 ? parseInt("12%") : parseInt("16%"),
|
||||||
color: isEdit? "#ffd16fff":"white",
|
color: isEdit ? "#ffd16fff" : "white",
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isEdit ? ToData : lastStation}
|
{string === Station_JP ? "当駅止" : string}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
@@ -101,7 +101,7 @@ export default function LED_vision(props) {
|
|||||||
const data = trainTimeAndNumber
|
const data = trainTimeAndNumber
|
||||||
.filter((d) => currentTrain.map((m) => m.num).includes(d.train)) //現在の列車に絞る[ToDo]
|
.filter((d) => currentTrain.map((m) => m.num).includes(d.train)) //現在の列車に絞る[ToDo]
|
||||||
.filter(timeFiltering)
|
.filter(timeFiltering)
|
||||||
.filter((d) => !!finalSwitch || d.lastStation != "当駅止");
|
.filter((d) => !!finalSwitch || d.lastStation != station[0].Station_JP) //最終列車表示設定
|
||||||
setSelectedTrain(data);
|
setSelectedTrain(data);
|
||||||
}, [trainTimeAndNumber, currentTrain, finalSwitch]);
|
}, [trainTimeAndNumber, currentTrain, finalSwitch]);
|
||||||
|
|
||||||
@@ -110,9 +110,6 @@ export default function LED_vision(props) {
|
|||||||
.map((trainNum) => {
|
.map((trainNum) => {
|
||||||
let trainData = {};
|
let trainData = {};
|
||||||
stationDiagram[trainNum].split("#").forEach((data) => {
|
stationDiagram[trainNum].split("#").forEach((data) => {
|
||||||
if(trainNum == 74){
|
|
||||||
console.log(data);
|
|
||||||
}
|
|
||||||
if (data.match("着")) {
|
if (data.match("着")) {
|
||||||
trainData.lastStation = data.split(",着,")[0];
|
trainData.lastStation = data.split(",着,")[0];
|
||||||
}
|
}
|
||||||
@@ -129,10 +126,8 @@ export default function LED_vision(props) {
|
|||||||
trainData.isThrough = true;
|
trainData.isThrough = true;
|
||||||
} else if (data.match(",着,")) {
|
} else if (data.match(",着,")) {
|
||||||
trainData.time = data.split(",着,")[1];
|
trainData.time = data.split(",着,")[1];
|
||||||
trainData.lastStation = "当駅止";
|
|
||||||
}else if (data.match(",着編,")) {
|
}else if (data.match(",着編,")) {
|
||||||
trainData.time = data.split(",着編,")[1];
|
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 nextPos = Pos.isBetween ? Pos.Pos.to : Pos.Pos.Pos;
|
||||||
const PrePos = Pos.isBetween ? Pos.Pos.from : "";
|
const PrePos = Pos.isBetween ? Pos.Pos.from : "";
|
||||||
if (station[0].Station_JP == nextPos) {
|
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) {
|
} else if (station[0].Station_JP == PrePos) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user