diff --git a/AIDriver.lua b/AIDriver.lua index 714719c95..9c7730d95 100644 --- a/AIDriver.lua +++ b/AIDriver.lua @@ -867,14 +867,19 @@ function AIDriver:tipIntoBGASiloTipTrigger(dt) local totalTipDuration = ((tipper.cp.totalFillLevel / dischargeNode.emptySpeed )/ 1000) + 2 --adding 2 sec for the time between setting tipstate and start of real unloading local meterPrSeconds = totalLength / totalTipDuration; self.unloadSpeed = meterPrSeconds*3.6 + self:debug("%s in mode %s: entering BGASilo: \nemptySpeed: %sl/sek; fillLevel: %0.1fl\nSilo length: %sm/Total unload time: %ss *3.6 = unload speed: %.2fkmh", tostring(tipper.getName and tipper:getName() or 'no name'), tostring(self.vehicle.cp.mode), tostring(dischargeNode.emptySpeed*1000),tipper.cp.totalFillLevel,tostring(totalLength) ,tostring(totalTipDuration),self.unloadSpeed) --print(string.format("totalTipDuration: %s; totalLength: %s",tostring(totalTipDuration),tostring(totalLength))) end local tipState = tipper:getTipState() if tipState == Trailer.TIPSTATE_CLOSED or tipState == Trailer.TIPSTATE_CLOSING then + self:debug("start tipping") tipper:setDischargeState(Dischargeable.DISCHARGE_STATE_GROUND) end else + if self.unloadSpeed then + self:debug("reset self.unloadSpeed") + end self.unloadSpeed = nil end self.speed = self.unloadSpeed or self.speed diff --git a/drive.lua b/drive.lua index d55ac839e..e56ff4485 100644 --- a/drive.lua +++ b/drive.lua @@ -816,6 +816,10 @@ function courseplay:drive(self, dt) if self.cp.currentTipTrigger ~= nil then if self.cp.currentTipTrigger.bunkerSilo ~= nil then refSpeed = Utils.getNoNil(self.cp.speeds.reverse, self.cp.speeds.crawl); + if courseplay.debugChannels[14] and g_updateLoopIndex % 100 == 0 then + courseplay:debug(string.format("%s: refSpeed: %.2f ", nameNum(self),refSpeed), 14); + end + --speedDebugLine = ("drive("..tostring(debug.getinfo(1).currentline-1).."): refSpeed = "..tostring(refSpeed)) else refSpeed = self.cp.speeds.turn; diff --git a/modDesc.xml b/modDesc.xml index 48692f310..2415628f4 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -1,6 +1,6 @@ - 6.01.00127 + 6.01.00128 <br>CoursePlay SIX</br> diff --git a/toolManager.lua b/toolManager.lua index 68c13cc24..2fee29e89 100644 --- a/toolManager.lua +++ b/toolManager.lua @@ -1124,7 +1124,9 @@ function courseplay:unload_tippers(vehicle, allowedToDrive,dt) local refSpeed = meterPrSeconds * 3.6; -- * 0.90; vehicle.cp.backupUnloadSpeed = vehicle.cp.speeds.reverse; courseplay:changeReverseSpeed(vehicle, nil, refSpeed, true); - courseplay:debug(string.format("%s: BGA totalLength=%.2f, totalTipDuration%.2f, refSpeed=%.2f", nameNum(tipper), totalLength, totalTipDuration, refSpeed), 2); + --courseplay:debug(string.format("%s: BGA totalLength=%.2f, totalTipDuration%.2f, refSpeed=%.2f", nameNum(tipper), totalLength, totalTipDuration, refSpeed), 2); + courseplay:debug(string.format("%s in mode %s: entering BGASilo: \nemptySpeed: %sl/sek; fillLevel: %0.1fl\nSilo length: %sm/Total unload time: %ss *3.6 = unload speed: %.2fkmh", tostring(tipper.getName and tipper:getName() or 'no name'), tostring(vehicle.cp.mode), tostring(dischargeNode.emptySpeed*1000),tipper.cp.totalFillLevel,tostring(totalLength) ,tostring(totalTipDuration),refSpeed),14) + --print(string.format("totalTipDuration: %s; totalLength: %s",tostring(totalTipDuration),tostring(totalLength))) --print(string.format("%s: BGA totalLength=%.2f, totalTipDuration%.2f, refSpeed=%.2f", nameNum(vehicle), totalLength, totalTipDuration, refSpeed)); end; end;