mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
OPS
less output again
This commit is contained in:
parent
624b1f5647
commit
270dfab6a2
@ -789,7 +789,7 @@ function ARMYGROUP:onbeforeEngageTarget(From, Event, To, Target)
|
|||||||
local ammo=self:GetAmmoTot()
|
local ammo=self:GetAmmoTot()
|
||||||
|
|
||||||
if ammo.Total==0 then
|
if ammo.Total==0 then
|
||||||
env.info("FF cannot engage because no ammo!")
|
self:E(self.lid.."WARNING: Cannot engage TARGET because no ammo left!")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -810,10 +810,12 @@ function ARMYGROUP:onafterEngageTarget(From, Event, To, Target)
|
|||||||
self.engage.Target=TARGET:New(Target)
|
self.engage.Target=TARGET:New(Target)
|
||||||
end
|
end
|
||||||
|
|
||||||
env.info("FF Engage Target "..self.engage.Target:GetName())
|
-- Target coordinate.
|
||||||
|
|
||||||
self.engage.Coordinate=UTILS.DeepCopy(self.engage.Target:GetCoordinate())
|
self.engage.Coordinate=UTILS.DeepCopy(self.engage.Target:GetCoordinate())
|
||||||
|
|
||||||
|
-- TODO: Backup current ROE and alarm state and reset after disengage.
|
||||||
|
|
||||||
|
-- Switch ROE and alarm state.
|
||||||
self:SwitchAlarmstate(ENUMS.AlarmState.Auto)
|
self:SwitchAlarmstate(ENUMS.AlarmState.Auto)
|
||||||
self:SwitchROE(ENUMS.ROE.WeaponFree)
|
self:SwitchROE(ENUMS.ROE.WeaponFree)
|
||||||
|
|
||||||
@ -834,7 +836,7 @@ function ARMYGROUP:_UpdateEngageTarget()
|
|||||||
|
|
||||||
if self.engage.Target and self.engage.Target:IsAlive() then
|
if self.engage.Target and self.engage.Target:IsAlive() then
|
||||||
|
|
||||||
env.info("FF Update Engage Target "..self.engage.Target:GetName())
|
--env.info("FF Update Engage Target "..self.engage.Target:GetName())
|
||||||
|
|
||||||
local vec3=self.engage.Target:GetCoordinate():GetVec3()
|
local vec3=self.engage.Target:GetCoordinate():GetVec3()
|
||||||
|
|
||||||
@ -842,7 +844,7 @@ function ARMYGROUP:_UpdateEngageTarget()
|
|||||||
|
|
||||||
if dist>100 then
|
if dist>100 then
|
||||||
|
|
||||||
env.info("FF Update Engage Target Moved "..self.engage.Target:GetName())
|
--env.info("FF Update Engage Target Moved "..self.engage.Target:GetName())
|
||||||
|
|
||||||
self.engage.Coordinate:UpdateFromVec3(vec3)
|
self.engage.Coordinate:UpdateFromVec3(vec3)
|
||||||
|
|
||||||
@ -872,6 +874,7 @@ end
|
|||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
function ARMYGROUP:onafterDisengage(From, Event, To)
|
function ARMYGROUP:onafterDisengage(From, Event, To)
|
||||||
|
-- TODO: Reset ROE and alarm state.
|
||||||
self:_CheckGroupDone(1)
|
self:_CheckGroupDone(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1189,7 +1189,7 @@ function FLIGHTGROUP:OnEventCrash(EventData)
|
|||||||
local element=self:GetElementByName(unitname)
|
local element=self:GetElementByName(unitname)
|
||||||
|
|
||||||
if element and element.status~=OPSGROUP.ElementStatus.DEAD then
|
if element and element.status~=OPSGROUP.ElementStatus.DEAD then
|
||||||
self:I(self.lid..string.format("EVENT: Element %s crashed ==> destroyed", element.name))
|
self:T(self.lid..string.format("EVENT: Element %s crashed ==> destroyed", element.name))
|
||||||
self:ElementDestroyed(element)
|
self:ElementDestroyed(element)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1204,7 +1204,7 @@ function FLIGHTGROUP:OnEventUnitLost(EventData)
|
|||||||
|
|
||||||
-- Check that this is the right group.
|
-- Check that this is the right group.
|
||||||
if EventData and EventData.IniGroup and EventData.IniUnit and EventData.IniGroupName and EventData.IniGroupName==self.groupname then
|
if EventData and EventData.IniGroup and EventData.IniUnit and EventData.IniGroupName and EventData.IniGroupName==self.groupname then
|
||||||
self:I(self.lid..string.format("EVENT: Unit %s lost at t=%.3f", EventData.IniUnitName, timer.getTime()))
|
self:T2(self.lid..string.format("EVENT: Unit %s lost at t=%.3f", EventData.IniUnitName, timer.getTime()))
|
||||||
|
|
||||||
local unit=EventData.IniUnit
|
local unit=EventData.IniUnit
|
||||||
local group=EventData.IniGroup
|
local group=EventData.IniGroup
|
||||||
@ -1214,7 +1214,7 @@ function FLIGHTGROUP:OnEventUnitLost(EventData)
|
|||||||
local element=self:GetElementByName(unitname)
|
local element=self:GetElementByName(unitname)
|
||||||
|
|
||||||
if element and element.status~=OPSGROUP.ElementStatus.DEAD then
|
if element and element.status~=OPSGROUP.ElementStatus.DEAD then
|
||||||
self:I(self.lid..string.format("EVENT: Element %s unit lost ==> destroyed t=%.3f", element.name, timer.getTime()))
|
self:T(self.lid..string.format("EVENT: Element %s unit lost ==> destroyed t=%.3f", element.name, timer.getTime()))
|
||||||
self:ElementDestroyed(element)
|
self:ElementDestroyed(element)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1229,7 +1229,7 @@ function FLIGHTGROUP:OnEventKill(EventData)
|
|||||||
|
|
||||||
-- Check that this is the right group.
|
-- Check that this is the right group.
|
||||||
if EventData and EventData.IniGroup and EventData.IniUnit and EventData.IniGroupName and EventData.IniGroupName==self.groupname then
|
if EventData and EventData.IniGroup and EventData.IniUnit and EventData.IniGroupName and EventData.IniGroupName==self.groupname then
|
||||||
self:I(self.lid..string.format("EVENT: Unit %s killed unit %s!", tostring(EventData.IniUnitName), tostring(EventData.TgtUnitName)))
|
self:T2(self.lid..string.format("EVENT: Unit %s killed unit %s!", tostring(EventData.IniUnitName), tostring(EventData.TgtUnitName)))
|
||||||
|
|
||||||
local unit=EventData.IniUnit
|
local unit=EventData.IniUnit
|
||||||
local group=EventData.IniGroup
|
local group=EventData.IniGroup
|
||||||
|
|||||||
@ -3345,7 +3345,7 @@ end
|
|||||||
function OPSGROUP:onafterLaserPause(From, Event, To)
|
function OPSGROUP:onafterLaserPause(From, Event, To)
|
||||||
|
|
||||||
-- Debug message.
|
-- Debug message.
|
||||||
self:I(self.lid.."Switching LASER off temporarily")
|
self:T(self.lid.."Switching LASER off temporarily")
|
||||||
|
|
||||||
-- "Destroy" the laser beam.
|
-- "Destroy" the laser beam.
|
||||||
self.spot.Laser:destroy()
|
self.spot.Laser:destroy()
|
||||||
@ -3380,7 +3380,7 @@ end
|
|||||||
function OPSGROUP:onafterLaserResume(From, Event, To)
|
function OPSGROUP:onafterLaserResume(From, Event, To)
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:I(self.lid.."Resuming LASER")
|
self:T(self.lid.."Resuming LASER")
|
||||||
|
|
||||||
-- Unset paused.
|
-- Unset paused.
|
||||||
self.spot.Paused=false
|
self.spot.Paused=false
|
||||||
@ -3399,7 +3399,7 @@ function OPSGROUP:onafterLaserResume(From, Event, To)
|
|||||||
if target then
|
if target then
|
||||||
|
|
||||||
-- Debug message.
|
-- Debug message.
|
||||||
self:I(self.lid.."Switching LASER on again at target ".. target:GetName())
|
self:T(self.lid.."Switching LASER on again")
|
||||||
|
|
||||||
self:LaserOn(target)
|
self:LaserOn(target)
|
||||||
end
|
end
|
||||||
@ -3601,13 +3601,13 @@ function OPSGROUP:_UpdateLaser()
|
|||||||
local unit=self.spot.TargetGroup:GetHighestThreat()
|
local unit=self.spot.TargetGroup:GetHighestThreat()
|
||||||
|
|
||||||
if unit then
|
if unit then
|
||||||
self:I(self.lid..string.format("Switching to target unit %s in the group", unit:GetName()))
|
self:T(self.lid..string.format("Switching to target unit %s in the group", unit:GetName()))
|
||||||
self.spot.TargetUnit=unit
|
self.spot.TargetUnit=unit
|
||||||
-- We update the laser position in the next update cycle and then check the LOS.
|
-- We update the laser position in the next update cycle and then check the LOS.
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
-- Switch laser off.
|
-- Switch laser off.
|
||||||
self:I(self.lid.."Target is not alive any more ==> switching LASER off")
|
self:T(self.lid.."Target is not alive any more ==> switching LASER off")
|
||||||
self:LaserOff()
|
self:LaserOff()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -3615,7 +3615,7 @@ function OPSGROUP:_UpdateLaser()
|
|||||||
else
|
else
|
||||||
|
|
||||||
-- Switch laser off.
|
-- Switch laser off.
|
||||||
self:I(self.lid.."Target is not alive any more ==> switching LASER off")
|
self:T(self.lid.."Target is not alive any more ==> switching LASER off")
|
||||||
self:LaserOff()
|
self:LaserOff()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user