feat(status): statusvindue på skærmen slås til med en tast
This commit is contained in:
@@ -53,6 +53,16 @@ function ADStuckDiag.describe(vehicle)
|
||||
return table.concat(parts, " ")
|
||||
end
|
||||
|
||||
-- Kun læsning (statusvinduet): køretøjer der har holdt stille mindst minMs -> {{vehicle, ms}}, længst først.
|
||||
function ADStuckDiag.stillVehicles(minMs)
|
||||
local list = {}
|
||||
for vehicle, ms in pairs(stillMs) do
|
||||
if ms >= (minMs or ADStuckDiag.STILL_MS) then table.insert(list, {vehicle = vehicle, ms = ms}) end
|
||||
end
|
||||
table.sort(list, function(a, b) return a.ms > b.ms end)
|
||||
return list
|
||||
end
|
||||
|
||||
function ADStuckDiag.tick(dt)
|
||||
timerMs = timerMs + (dt or 0)
|
||||
if timerMs < ADStuckDiag.CHECK_INTERVAL_MS then return end
|
||||
|
||||
Reference in New Issue
Block a user