fix(flows): run starter selv om én valgt bygning mangler markør; advarsel nævner bygningen (v1.14.2.0)

This commit is contained in:
2026-09-24 01:39:12 +02:00
parent 8ec0853fae
commit 1dd2e8971d
3 changed files with 31 additions and 5 deletions
+8
View File
@@ -664,6 +664,14 @@ ADRunsController.updateRun(flowOut.id, {sourceBuildingIds = {"shed"}, sourceWayP
local cfValidation = ADRunsController.validateVehicle(adEnv, ADRuns.getRun(ADRunsController.store, flowOut.id), cfVehicle)
check("CF4 noMarker", cfValidation.reason, "noMarker")
check("CF4 hvilken bygning", cfValidation.missingBuilding, "Palleskur")
-- CF4b: ÉN bygning uden markør blandt flere med markør -> start alligevel, advar om den ene
ADRunsController.updateRun(flowOut.id, {sourceBuildingIds = {"barn1", "shed"}, sourceWayPointIds = {}})
logLines = {}
local cfValidation2 = ADRunsController.validateVehicle(adEnv, ADRuns.getRun(ADRunsController.store, flowOut.id), cfVehicle)
check("CF4b ikke afvist pga. markør", cfValidation2.reason ~= "noMarker", true)
local warned = false
for _, line in ipairs(logLines) do if line:find("Palleskur", 1, true) and line:find("springes over", 1, true) then warned = true end end
check("CF4b advarsel nævner bygningen", warned, true)
-- CF5: flow-række til tavlen
ADRunsController.updateRun(flowOut.id, {sourceBuildingIds = {"barn1"}, products = {{fillType = "SUGAR", policy = "sell"}, {fillType = "FORAGE", policy = "store"}}, collectRound = true})
ADRunsController.assignVehicle(flowOut.id, cfVehicle)