fix: Wait udløses også når AD stadig regner vognen som aflæssende ved fuldt trug; AD's aflæsning stoppes før omdirigering (v1.10.1.0)
This commit is contained in:
@@ -84,7 +84,14 @@ local function hasRouteBothWays(adEnv, vehicle, waitWayPointId, homeWayPointId)
|
||||
and pathReaches(graph:pathFromTo(waitWayPointId, homeWayPointId), homeWayPointId)
|
||||
end
|
||||
|
||||
-- Står AD midt i en (blokeret) aflæsning, stoppes den pænt først — ellers kører traktoren
|
||||
-- væk med tippet vogn.
|
||||
local function redirect(task, destinationID)
|
||||
local trailerModule = task.vehicle.ad.trailerModule
|
||||
if trailerModule ~= nil and trailerModule.isActiveAtTrigger ~= nil and trailerModule:isActiveAtTrigger() then
|
||||
if trailerModule.stopUnloading ~= nil then trailerModule:stopUnloading() end
|
||||
if trailerModule.stopLoading ~= nil then trailerModule:stopLoading() end
|
||||
end
|
||||
task.destinationID = destinationID
|
||||
task.state = ADUnloadWait.STATE_DRIVING
|
||||
task.vehicle.ad.drivePathModule:setPathTo(destinationID)
|
||||
@@ -104,7 +111,10 @@ end
|
||||
-- Står køretøjet ved målet med rest-læs, som målet ikke kan tage? Så find et Wait-punkt.
|
||||
local function startWaiting(adEnv, task)
|
||||
local vehicle = task.vehicle
|
||||
if not vehicle.ad.drivePathModule:isTargetReached() or vehicle.ad.trailerModule:isActiveAtTrigger() then
|
||||
-- Kun "fremme ved målet". At AD stadig regner vognen som aflæssende (isActiveAtTrigger)
|
||||
-- tæller IKKE med: ved et fuldt fodertrug bliver isUnloading stående for evigt, selv om
|
||||
-- intet løber — og så blokerede traktoren stalden i stedet for at køre til Wait.
|
||||
if not vehicle.ad.drivePathModule:isTargetReached() then
|
||||
return
|
||||
end
|
||||
-- Efter et bytte er opgavens mål en silo, ikke AD's rigtige aflæsningsmål (anden markør);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<modDesc descVersion="107">
|
||||
<author>masterdraco</author>
|
||||
<version>1.10.0.0</version>
|
||||
<version>1.10.1.0</version>
|
||||
<title>
|
||||
<en>AD Smart Pickup</en>
|
||||
</title>
|
||||
|
||||
@@ -720,6 +720,17 @@ check("W11 én reservation", #claims, 1)
|
||||
check("W11 markør", claims[1].marker.id, 40)
|
||||
check("W11 køretøj", claims[1].vehicle, vc1)
|
||||
|
||||
|
||||
-- W12: AD regner vognen som "aflæssende" ved et fuldt trug (isUnloading bliver hængende) —
|
||||
-- omdirigeres alligevel, og AD's aflæsning stoppes først
|
||||
buildWaitWorld()
|
||||
local vs, ts = makeUnloadingVehicle("Fastrac Tippet", 541, 5000, 35000)
|
||||
local stopped = false
|
||||
vs.ad.trailerModule = {isActiveAtTrigger = function() return true end, stopUnloading = function() stopped = true end, stopLoading = function() end}
|
||||
UnloadTask.update(ts, 16)
|
||||
check("W12 omdirigeret trods isActiveAtTrigger", ts.destinationID, 40)
|
||||
check("W12 AD's aflæsning stoppet før kørsel", stopped, true)
|
||||
|
||||
-- ==== I: run-integration — ingredienser fra run i stedet for multi-valg; Wait-pulje pr. run ====
|
||||
-- I1: traktor i et run med ÉN valgt vare i AD får alligevel behovsstyring (run'ets liste)
|
||||
local runDriver = buildCowWorld()
|
||||
|
||||
Reference in New Issue
Block a user