feat: diagnose i loggen når ingen autoload findes på traktorens enheder (v1.12.7.0)
This commit is contained in:
@@ -474,6 +474,10 @@ check("Cout1 første kilde-markør", ADRunsController.getSourceMarkers(adEnv, 1)
|
||||
|
||||
-- Cout2: validering
|
||||
local outRun = ADRuns.getRun(ADRunsController.store, out.id)
|
||||
-- diagnose: hvad moden ser på enhederne, når ingen autoload findes (logges én gang pr. traktor,
|
||||
-- første gang varerne slås op — dvs. allerede ved noProducts-tjekket nedenfor)
|
||||
logLines = {}
|
||||
bulkTractor.trailers[1] = {spec_universalAutoload = {isAutoloadAvailable = false, autoloadDisabled = true}, getName = function() return "Vogn" end}
|
||||
check("Cout2 ingen kilder -> noSource", ADRunsController.validateVehicle(adEnv, outRun, bulkTractor).reason, "noSource")
|
||||
ADRunsController.store = ADRuns.toggleSource(ADRunsController.store, out.id, 1)
|
||||
ADRunsController.store = ADRuns.toggleSource(ADRunsController.store, out.id, 3)
|
||||
@@ -482,6 +486,14 @@ check("Cout2 ingen vare valgt -> noProducts", ADRunsController.validateVehicle(a
|
||||
ADRunsController.store = ADRuns.setProductPolicy(ADRunsController.store, out.id, "STRAW_BASKET", "sell")
|
||||
outRun = ADRuns.getRun(ADRunsController.store, out.id)
|
||||
check("Cout2 kun paller uden UAL -> needsAutoload", ADRunsController.validateVehicle(adEnv, outRun, bulkTractor).reason, "needsAutoload")
|
||||
local diag = nil
|
||||
for _, line in ipairs(logLines) do if line:find("ingen autoload", 1, true) then diag = line end end
|
||||
check("Cout2 diagnose logges", diag ~= nil, true)
|
||||
check("Cout2 diagnose viser UAL-flag", diag ~= nil and diag:find("isAutoloadAvailable=false", 1, true) ~= nil, true)
|
||||
logLines = {}
|
||||
ADRunsController.validateVehicle(adEnv, outRun, bulkTractor)
|
||||
check("Cout2 diagnose kun én gang", #logLines, 0)
|
||||
bulkTractor.trailers[1] = nil
|
||||
check("Cout2 UAL-vogn ok", ADRunsController.validateVehicle(adEnv, outRun, ualTractor).ok, true)
|
||||
ADRunsController.store = ADRuns.setProductPolicy(ADRunsController.store, out.id, "FORAGE", "store")
|
||||
outRun = ADRuns.getRun(ADRunsController.store, out.id)
|
||||
|
||||
Reference in New Issue
Block a user