feat: departure广播新增下一站播报 + 客户端预解析station code
This commit is contained in:
+17
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
-- 1. Configuration & Constants
|
||||
local APP_VERSION_TEXT = "v1.0.70"
|
||||
local APP_VERSION_TEXT = "v1.0.71"
|
||||
|
||||
local CONFIG = {
|
||||
CLOUD_URL = "ws://stabadmin.fse-media.group",
|
||||
@@ -3529,6 +3529,13 @@ function Main.loop()
|
||||
local nextStation = Utils.getNextStation(schedule, State.stationName)
|
||||
local now = os.epoch("utc") / 1000
|
||||
local stationTime = Utils.getStopTime(schedule, State.stationName) or 60
|
||||
local lineCode = Utils.getStationCode(State.stationCode or State.stationName)
|
||||
if lineCode then
|
||||
local dash = lineCode:find("-")
|
||||
if dash then lineCode = lineCode:sub(1, dash - 1) end
|
||||
end
|
||||
local destCode = Utils.getStationCode(dest)
|
||||
local nextCode = Utils.getStationCode(nextStation)
|
||||
|
||||
State.currentTrain = {
|
||||
id = id,
|
||||
@@ -3536,6 +3543,9 @@ function Main.loop()
|
||||
schedule = schedule,
|
||||
dest = dest,
|
||||
nextStation = nextStation,
|
||||
lineCode = lineCode,
|
||||
destCode = destCode,
|
||||
nextCode = nextCode,
|
||||
arrivalTime = now,
|
||||
departureTime = now + stationTime,
|
||||
platform = Utils.getPlatformNumber(State.stationName, "1"),
|
||||
@@ -3549,7 +3559,10 @@ function Main.loop()
|
||||
stationPlatform = State.stationPlatform,
|
||||
trainId = id,
|
||||
destination = dest,
|
||||
destCode = destCode,
|
||||
nextStation = nextStation,
|
||||
nextCode = nextCode,
|
||||
lineCode = lineCode,
|
||||
departureTime = State.currentTrain.departureTime,
|
||||
departureBeep = State.departureBeep
|
||||
})
|
||||
@@ -3566,7 +3579,10 @@ function Main.loop()
|
||||
stationPlatform = State.stationPlatform,
|
||||
trainId = State.currentTrain.id,
|
||||
destination = State.currentTrain.dest,
|
||||
destCode = State.currentTrain.destCode,
|
||||
nextStation = State.currentTrain.nextStation,
|
||||
nextCode = State.currentTrain.nextCode,
|
||||
lineCode = State.currentTrain.lineCode,
|
||||
departureBeep = State.departureBeep
|
||||
})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user