chore: log-oprydning — fallback-markør én gang pr. stald, DEBUG én gang pr. mål/læs, 'collect' = afhentningsnavn — 1.62.297

This commit is contained in:
2026-10-17 08:16:41 +02:00
parent 4607dc5f2e
commit ab58647226
4 changed files with 16 additions and 5 deletions
+5
View File
@@ -404,6 +404,7 @@ end
ADUnloadWait.DEBUG_INTERVAL_MS = 15000
local debugTimers = setmetatable({}, {__mode = "k"})
local debugStuck = setmetatable({}, {__mode = "k"}) -- vehicle -> {level, since}: læsset uændret siden
local debugLogged = setmetatable({}, {__mode = "k"}) -- vehicle -> {destination, rest}: sidst loggede DEBUG-linje
ADUnloadWait.STUCK_WITH_ROOM_MS = 30000
local function debugAtTarget(adEnv, task, dt)
@@ -463,6 +464,10 @@ local function debugAtTarget(adEnv, task, dt)
local fillTypeName = g_fillTypeManager ~= nil and g_fillTypeManager:getFillTypeNameByIndex(fillType) or tostring(fillType)
local distance = adEnv.AutoDrive.getDistanceToUnloadPosition ~= nil and adEnv.AutoDrive.getDistanceToUnloadPosition(vehicle) or -1
local secondMarker = vehicle.ad.stateModule.getSecondMarker ~= nil and vehicle.ad.stateModule:getSecondMarker() or nil
-- én gang pr. mål og læs (17/10: linjen kom hvert 15. s hele vejen til et fuldt mål)
local logged = debugLogged[vehicle]
if logged ~= nil and logged.destination == task.destinationID and math.abs(logged.rest - rest) < 1 then return end
debugLogged[vehicle] = {destination = task.destinationID, rest = rest}
Logging.info(ADUnloadWait.LOG_PREFIX .. "DEBUG '%s': targetReached=%s taskDest=%s adMål=%s; %.0f l %s på vognen; målet fri=%s/kap=%s; AD isUnloading=%s isLoading=%s afstandTilAflæsning=%.1f; venter=%s; %s", tostring(ADRuns.vehicleLabel(vehicle)), tostring(targetReached), tostring(task.destinationID), tostring(secondMarker ~= nil and secondMarker.id or nil), rest, tostring(fillTypeName), tostring(free), tostring(capacity), tostring(trailerModule ~= nil and trailerModule.isUnloading), tostring(trailerModule ~= nil and trailerModule.isLoading), tonumber(distance) or -1, tostring(waits[vehicle] ~= nil), table.concat(states, " | "))
end