fix(kæde): palle-varer får egen status og linjen med frie marker passer i fanen

This commit is contained in:
2026-09-30 14:27:48 +02:00
parent 83394aabfd
commit 817fc388a2
5 changed files with 34 additions and 11 deletions
+5 -4
View File
@@ -118,9 +118,10 @@ local function collectPool(adEnv)
return implements or {}, tractors or {}
end
local function createStopped(run, reason, ...)
-- kind = "noVehicle"|"pallet": vises som status på kanten i fanen Kæder
local function createStopped(run, kind, reason, ...)
run.stopped = true
ADChain.noVehicle[run.id] = true
ADChain.noVehicle[run.id] = kind
log("flow '%s' oprettet stoppet: " .. reason, tostring(run.name), ...)
end
@@ -134,14 +135,14 @@ local function createFlow(adEnv, data, edge, pool, used)
local run = ADRuns.getRun(ADRunsController.store, runId)
local fillIndex = data.fillIndex[edge.fillType]
if fillIndex ~= nil and ADSources.isPalletFillType(fillIndex) then
createStopped(run, "palle-vare: vælg vogn med Universal Autoload (%s)", tostring(title))
createStopped(run, "pallet", "palle-vare: vælg vogn med Universal Autoload (%s)", tostring(title))
return
end
if pool.implements == nil then pool.implements, pool.tractors = collectPool(adEnv) end
if pool.blocked == nil then pool.blocked = ADPool.blocked(ADFieldJobs.now or 0) end
local pair = ADChainRun.choosePair(pool.implements, pool.tractors, fillIndex, used, pool.blocked)
if pair == nil then
createStopped(run, "ingen ledig traktor/vogn til %s", tostring(title))
createStopped(run, "noVehicle", "ingen ledig traktor/vogn til %s", tostring(title))
return
end
used[pair.tractor.id], used[pair.implement.id] = true, true