debug: show raw create target line and eta fields
This commit is contained in:
+26
-2
@@ -2,7 +2,7 @@
|
|||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
-- 1. Configuration & Constants
|
-- 1. Configuration & Constants
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
local APP_VERSION_TEXT = "v1.0.32"
|
local APP_VERSION_TEXT = "v1.0.33"
|
||||||
|
|
||||||
local CONFIG = {
|
local CONFIG = {
|
||||||
CLOUD_URL = "ws://stabadmin.fse-media.group",
|
CLOUD_URL = "ws://stabadmin.fse-media.group",
|
||||||
@@ -2176,7 +2176,23 @@ function Display.render()
|
|||||||
if #rawLine > w then rawLine = rawLine:sub(1, w) end
|
if #rawLine > w then rawLine = rawLine:sub(1, w) end
|
||||||
mon.write(rawLine)
|
mon.write(rawLine)
|
||||||
end
|
end
|
||||||
logsStartY = upcomingStartY + 5
|
if upcomingStartY + 5 <= h then
|
||||||
|
mon.setCursorPos(1, upcomingStartY + 5)
|
||||||
|
local partsLine = string.format(
|
||||||
|
"VAL:%s UNIT:%s",
|
||||||
|
tostring(dbg.textEtaValue or "-"),
|
||||||
|
tostring(dbg.textEtaUnit or "-")
|
||||||
|
)
|
||||||
|
if #partsLine > w then partsLine = partsLine:sub(1, w) end
|
||||||
|
mon.write(partsLine)
|
||||||
|
end
|
||||||
|
if upcomingStartY + 6 <= h then
|
||||||
|
mon.setCursorPos(1, upcomingStartY + 6)
|
||||||
|
local lineRaw = "RAW:" .. tostring(dbg.rawLine or "-")
|
||||||
|
if #lineRaw > w then lineRaw = lineRaw:sub(1, w) end
|
||||||
|
mon.write(lineRaw)
|
||||||
|
end
|
||||||
|
logsStartY = upcomingStartY + 7
|
||||||
end
|
end
|
||||||
if hasUpcoming then
|
if hasUpcoming then
|
||||||
mon.setTextColor(COLORS.INFO)
|
mon.setTextColor(COLORS.INFO)
|
||||||
@@ -2412,8 +2428,11 @@ function Main.loop()
|
|||||||
ok = false,
|
ok = false,
|
||||||
trainStopsCount = 0,
|
trainStopsCount = 0,
|
||||||
tickRate = State.tickRate or 20,
|
tickRate = State.tickRate or 20,
|
||||||
|
rawLine = nil,
|
||||||
textKey = nil,
|
textKey = nil,
|
||||||
textEtaRaw = nil,
|
textEtaRaw = nil,
|
||||||
|
textEtaValue = nil,
|
||||||
|
textEtaUnit = nil,
|
||||||
nbtKey = nil,
|
nbtKey = nil,
|
||||||
textEta = nil,
|
textEta = nil,
|
||||||
nbtEta = nil,
|
nbtEta = nil,
|
||||||
@@ -2427,6 +2446,9 @@ function Main.loop()
|
|||||||
if okLines and type(lines) == "table" then
|
if okLines and type(lines) == "table" then
|
||||||
for _, lineText in pairs(lines) do
|
for _, lineText in pairs(lines) do
|
||||||
if lineText and lineText ~= "" and lineText:match("[%w%?%[]") then
|
if lineText and lineText ~= "" and lineText:match("[%w%?%[]") then
|
||||||
|
if not dbg.rawLine then
|
||||||
|
dbg.rawLine = lineText
|
||||||
|
end
|
||||||
local cleanLine = string.gsub(lineText, "%s*%(?%+%s*%d+.-%)?", "")
|
local cleanLine = string.gsub(lineText, "%s*%(?%+%s*%d+.-%)?", "")
|
||||||
local etaValue, etaUnit, tName, dest
|
local etaValue, etaUnit, tName, dest
|
||||||
etaValue, etaUnit, tName, dest = string.match(cleanLine, "^(%S+)%s+(.-)%s+(%[.-%][^%s]*)%s+(.*)$")
|
etaValue, etaUnit, tName, dest = string.match(cleanLine, "^(%S+)%s+(.-)%s+(%[.-%][^%s]*)%s+(.*)$")
|
||||||
@@ -2445,6 +2467,8 @@ function Main.loop()
|
|||||||
if not dbg.textKey then
|
if not dbg.textKey then
|
||||||
dbg.textKey = textKey
|
dbg.textKey = textKey
|
||||||
dbg.textEtaRaw = etaStr
|
dbg.textEtaRaw = etaStr
|
||||||
|
dbg.textEtaValue = etaValue
|
||||||
|
dbg.textEtaUnit = etaUnit
|
||||||
dbg.textEta = etaSeconds
|
dbg.textEta = etaSeconds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user