From 82a4ecd3e890ac8b8285bfe79604e265ddf4d421 Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Sun, 16 Aug 2026 12:22:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A1=AE=E4=BF=9D=E5=9C=A8=E7=AB=99?= =?UTF-8?q?=E5=88=97=E8=BD=A6=EF=BC=88=E5=8C=85=E6=8B=AC=E7=BB=88=E7=82=B9?= =?UTF-8?q?=E7=AB=99=E5=88=97=E8=BD=A6=EF=BC=89=E5=A7=8B=E7=BB=88=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=9C=A8=E9=A2=84=E6=B5=8B=E5=88=97=E8=A1=A8=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 当 State.currentTrain 存在时,手动将其信息插入 upcomingTrains 列表头部 - 解决终点站列车被 CRN 导航系统从 TrainStops 提前移除导致预测区无显示的问题 - 使用 normalizeUpcomingKey 去重,避免重复条目 - 版本号 v1.0.68 -> v1.0.69 --- station_broadcast.lua | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/station_broadcast.lua b/station_broadcast.lua index deffaee..c9bcb76 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -1,6 +1,6 @@ -- 1. Configuration & Constants -local APP_VERSION_TEXT = "v1.0.68" +local APP_VERSION_TEXT = "v1.0.69" local CONFIG = { CLOUD_URL = "ws://stabadmin.fse-media.group", @@ -3480,6 +3480,34 @@ function Main.loop() State.currentTrain = nil end end + + if State.currentTrain then + local ctKey = normalizeUpcomingKey(State.currentTrain.id, State.currentTrain.dest) + local alreadyInUpcoming = false + for _, ut in ipairs(State.upcomingTrains) do + local utKey = normalizeUpcomingKey(ut.trainName, ut.dest) + if utKey == ctKey then + alreadyInUpcoming = true + break + end + end + if not alreadyInUpcoming then + local nowSec = os.epoch("utc") / 1000 + local remaining = State.currentTrain.departureTime and math.max(0, State.currentTrain.departureTime - nowSec) or 0 + table.insert(State.upcomingTrains, 1, { + trainName = State.currentTrain.id, + dest = State.currentTrain.dest, + platform = State.currentTrain.platform or State.stationPlatform or "1", + eta = 0, + etaLabel = buildEtaLabel(0, nil), + delay = 0, + cancelled = false, + reason = nil, + _atStation = true, + _departingIn = remaining + }) + end + end Display.render() Display.renderTerminal()