mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
@@ -512,7 +512,7 @@ function OPSGROUP:New(group)
|
||||
-- Check if group exists.
|
||||
if self.group then
|
||||
if not self:IsExist() then
|
||||
self:E(self.lid.."ERROR: GROUP does not exist! Returning nil")
|
||||
self:T(self.lid.."ERROR: GROUP does not exist! Returning nil")
|
||||
return nil
|
||||
end
|
||||
end
|
||||
@@ -1382,7 +1382,7 @@ function OPSGROUP:GetCoordinate(NewObject)
|
||||
return self.coordinate
|
||||
end
|
||||
else
|
||||
self:E(self.lid.."WARNING: Cannot get coordinate!")
|
||||
self:T(self.lid.."WARNING: Cannot get coordinate!")
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -1413,11 +1413,11 @@ function OPSGROUP:GetVelocity(UnitName)
|
||||
return vel
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: Unit does not exist. Cannot get velocity!")
|
||||
self:T(self.lid.."WARNING: Unit does not exist. Cannot get velocity!")
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: Group does not exist. Cannot get velocity!")
|
||||
self:T(self.lid.."WARNING: Group does not exist. Cannot get velocity!")
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -1454,7 +1454,7 @@ function OPSGROUP:GetHeading(UnitName)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: Group does not exist. Cannot get heading!")
|
||||
self:T(self.lid.."WARNING: Group does not exist. Cannot get heading!")
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -1486,7 +1486,7 @@ function OPSGROUP:GetOrientation(UnitName)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: Group does not exist. Cannot get orientation!")
|
||||
self:T(self.lid.."WARNING: Group does not exist. Cannot get orientation!")
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -1724,9 +1724,9 @@ function OPSGROUP:Activate(delay)
|
||||
self.isLateActivated=false
|
||||
|
||||
elseif self:IsAlive()==true then
|
||||
self:E(self.lid.."WARNING: Activating group that is already activated")
|
||||
self:T(self.lid.."WARNING: Activating group that is already activated")
|
||||
else
|
||||
self:E(self.lid.."ERROR: Activating group that is does not exist!")
|
||||
self:T(self.lid.."ERROR: Activating group that is does not exist!")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2790,13 +2790,13 @@ function OPSGROUP:RemoveWaypoint(wpindex)
|
||||
|
||||
-- Always keep at least one waypoint.
|
||||
if N==1 then
|
||||
self:E(self.lid..string.format("ERROR: Cannot remove waypoint with index=%d! It is the only waypoint and a group needs at least ONE waypoint", wpindex))
|
||||
self:T(self.lid..string.format("ERROR: Cannot remove waypoint with index=%d! It is the only waypoint and a group needs at least ONE waypoint", wpindex))
|
||||
return self
|
||||
end
|
||||
|
||||
-- Check that wpindex is not larger than the number of waypoints in the table.
|
||||
if wpindex>N then
|
||||
self:E(self.lid..string.format("ERROR: Cannot remove waypoint with index=%d as there are only N=%d waypoints!", wpindex, N))
|
||||
self:T(self.lid..string.format("ERROR: Cannot remove waypoint with index=%d as there are only N=%d waypoints!", wpindex, N))
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -3101,7 +3101,7 @@ end
|
||||
function OPSGROUP:ClearTasks()
|
||||
local hastask=self:HasTaskController()
|
||||
if self:IsAlive() and self.controller and self:HasTaskController() then
|
||||
self:I(self.lid..string.format("CLEARING Tasks"))
|
||||
self:T(self.lid..string.format("CLEARING Tasks"))
|
||||
self.controller:resetTask()
|
||||
end
|
||||
return self
|
||||
@@ -3639,7 +3639,7 @@ function OPSGROUP:onafterTaskExecute(From, Event, To, Task)
|
||||
---
|
||||
|
||||
-- Just stay put and wait until something happens.
|
||||
|
||||
|
||||
elseif Task.dcstask.id==AUFTRAG.SpecialTask.ALERT5 then
|
||||
|
||||
---
|
||||
@@ -3723,7 +3723,7 @@ function OPSGROUP:onafterTaskExecute(From, Event, To, Task)
|
||||
elseif Task.type==OPSGROUP.TaskType.WAYPOINT then
|
||||
-- Waypoint tasks are executed elsewhere!
|
||||
else
|
||||
self:E(self.lid.."ERROR: Unknown task type: ")
|
||||
self:T(self.lid.."ERROR: Unknown task type: ")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -3803,7 +3803,7 @@ function OPSGROUP:onafterTaskCancel(From, Event, To, Task)
|
||||
else
|
||||
|
||||
local text=string.format("WARNING: No (current) task to cancel!")
|
||||
self:E(self.lid..text)
|
||||
self:T(self.lid..text)
|
||||
|
||||
end
|
||||
|
||||
@@ -3925,9 +3925,9 @@ function OPSGROUP:AddMission(Mission)
|
||||
table.insert(self.missionqueue, Mission)
|
||||
|
||||
-- ad infinitum?
|
||||
|
||||
|
||||
self.adinfinitum = Mission.DCStask.params.adinfinitum and Mission.DCStask.params.adinfinitum or false
|
||||
|
||||
|
||||
-- Info text.
|
||||
local text=string.format("Added %s mission %s starting at %s, stopping at %s",
|
||||
tostring(Mission.type), tostring(Mission.name), UTILS.SecondsToClock(Mission.Tstart, true), Mission.Tstop and UTILS.SecondsToClock(Mission.Tstop, true) or "INF")
|
||||
@@ -3953,7 +3953,7 @@ function OPSGROUP:RemoveMission(Mission)
|
||||
if Task then
|
||||
self:RemoveTask(Task)
|
||||
end
|
||||
|
||||
|
||||
-- Take care of a paused mission.
|
||||
if self.missionpaused and self.missionpaused.auftragsnummer==Mission.auftragsnummer then
|
||||
self.missionpaused=nil
|
||||
@@ -4222,14 +4222,14 @@ function OPSGROUP:onafterMissionStart(From, Event, To, Mission)
|
||||
|
||||
-- Route group to mission zone.
|
||||
if self.speedMax>3.6 then
|
||||
|
||||
|
||||
self:RouteToMission(Mission, 3)
|
||||
|
||||
|
||||
else
|
||||
---
|
||||
-- IMMOBILE Group
|
||||
---
|
||||
|
||||
|
||||
env.info("FF Immobile GROUP")
|
||||
|
||||
-- Add waypoint task. UpdateRoute is called inside.
|
||||
@@ -4240,7 +4240,7 @@ function OPSGROUP:onafterMissionStart(From, Event, To, Mission)
|
||||
-- Set waypoint task.
|
||||
Mission:SetGroupWaypointTask(self, Task)
|
||||
|
||||
-- Execute task. This calls mission execute.
|
||||
-- Execute task. This calls mission execute.
|
||||
self:__TaskExecute(3, Task)
|
||||
end
|
||||
|
||||
@@ -4320,7 +4320,7 @@ function OPSGROUP:onafterUnpauseMission(From, Event, To)
|
||||
|
||||
self.missionpaused=nil
|
||||
else
|
||||
self:E(self.lid.."ERROR: No mission to unpause!")
|
||||
self:T(self.lid.."ERROR: No mission to unpause!")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -4543,7 +4543,7 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
end
|
||||
|
||||
-- Get ingress waypoint.
|
||||
if mission.type==AUFTRAG.Type.PATROLZONE or mission.type==AUFTRAG.Type.BARRAGE or mission.type==AUFTRAG.Type.AMMOSUPPLY
|
||||
if mission.type==AUFTRAG.Type.PATROLZONE or mission.type==AUFTRAG.Type.BARRAGE or mission.type==AUFTRAG.Type.AMMOSUPPLY
|
||||
or mission.type.FUELSUPPLY then
|
||||
local zone=mission.engageTarget:GetObject() --Core.Zone#ZONE
|
||||
waypointcoord=zone:GetRandomCoordinate(nil , nil, surfacetypes)
|
||||
@@ -4552,7 +4552,7 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
else
|
||||
waypointcoord=mission:GetMissionWaypointCoord(self.group, randomradius, surfacetypes)
|
||||
end
|
||||
|
||||
|
||||
local armorwaypointcoord = nil
|
||||
if mission.type==AUFTRAG.Type.ARMORATTACK then
|
||||
local target=mission.engageTarget:GetObject() -- Wrapper.Positionable#POSITIONABLE
|
||||
@@ -4562,7 +4562,7 @@ function OPSGROUP:RouteToMission(mission, delay)
|
||||
-- Ingress - add formation to this one
|
||||
armorwaypointcoord = zone:GetRandomCoordinate(1000, 500, surfacetypes) -- Core.Point#COORDINATE
|
||||
end
|
||||
|
||||
|
||||
-- Add enroute tasks.
|
||||
for _,task in pairs(mission.enrouteTasks) do
|
||||
self:AddTaskEnroute(task)
|
||||
@@ -5301,7 +5301,7 @@ function OPSGROUP:onbeforeLaserOn(From, Event, To, Target)
|
||||
|
||||
else
|
||||
-- No target specified.
|
||||
self:E(self.lid.."ERROR: No target provided for LASER!")
|
||||
self:T(self.lid.."ERROR: No target provided for LASER!")
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -5328,7 +5328,7 @@ function OPSGROUP:onbeforeLaserOn(From, Event, To, Target)
|
||||
-- Check LOS.
|
||||
local los=self:HasLoS(self.spot.Coordinate, self.spot.element, self.spot.offset)
|
||||
|
||||
--self:I({los=los, coord=self.spot.Coordinate, offset=self.spot.offset})
|
||||
--self:T({los=los, coord=self.spot.Coordinate, offset=self.spot.offset})
|
||||
|
||||
if los then
|
||||
self:LaserGotLOS()
|
||||
@@ -5342,7 +5342,7 @@ function OPSGROUP:onbeforeLaserOn(From, Event, To, Target)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: No element alive for lasing")
|
||||
self:T(self.lid.."ERROR: No element alive for lasing")
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -5609,7 +5609,7 @@ function OPSGROUP:SetLaserTarget(Target)
|
||||
end
|
||||
|
||||
else
|
||||
self:E("WARNING: LASER target is not alive!")
|
||||
self:T("WARNING: LASER target is not alive!")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -5620,7 +5620,7 @@ function OPSGROUP:SetLaserTarget(Target)
|
||||
self.spot.offsetTarget={x=0, y=0, z=0}
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: LASER target should be a POSITIONABLE (GROUP, UNIT or STATIC) or a COORDINATE object!")
|
||||
self:T(self.lid.."ERROR: LASER target should be a POSITIONABLE (GROUP, UNIT or STATIC) or a COORDINATE object!")
|
||||
return
|
||||
end
|
||||
|
||||
@@ -5713,7 +5713,7 @@ function OPSGROUP:_UpdateLaser()
|
||||
if los then
|
||||
-- Got LOS
|
||||
if self.spot.lostLOS then
|
||||
--self:I({los=self.spot.LOS, coord=self.spot.Coordinate, offset=self.spot.offset})
|
||||
--self:T({los=self.spot.LOS, coord=self.spot.Coordinate, offset=self.spot.offset})
|
||||
self:LaserGotLOS()
|
||||
end
|
||||
|
||||
@@ -5878,7 +5878,7 @@ end
|
||||
function OPSGROUP:onafterRespawn(From, Event, To, Template)
|
||||
|
||||
-- Debug info.
|
||||
self:I(self.lid.."Respawning group!")
|
||||
self:T(self.lid.."Respawning group!")
|
||||
|
||||
-- Copy template.
|
||||
local template=UTILS.DeepCopy(Template or self.template)
|
||||
@@ -6148,7 +6148,7 @@ function OPSGROUP:onbeforeStop(From, Event, To)
|
||||
|
||||
-- We check if
|
||||
if self:IsAlive() then
|
||||
self:E(self.lid..string.format("WARNING: Group is still alive! Will not stop the FSM. Use :Despawn() instead"))
|
||||
self:T(self.lid..string.format("WARNING: Group is still alive! Will not stop the FSM. Use :Despawn() instead"))
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -6205,7 +6205,7 @@ function OPSGROUP:onafterStop(From, Event, To)
|
||||
local life, life0=self:GetLifePoints()
|
||||
local state=self:GetState()
|
||||
local text=string.format("WARNING: Group is still alive! Current state=%s. Life points=%d/%d. Use OPSGROUP:Destroy() or OPSGROUP:Despawn() for a clean stop", state, life, life0)
|
||||
self:E(self.lid..text)
|
||||
self:T(self.lid..text)
|
||||
end
|
||||
|
||||
-- Remove flight from data base.
|
||||
@@ -6249,7 +6249,7 @@ function OPSGROUP:_CheckCargoTransport()
|
||||
if text=="" then
|
||||
text=" empty"
|
||||
end
|
||||
self:I(self.lid.."Cargo bay:"..text)
|
||||
self:T(self.lid.."Cargo bay:"..text)
|
||||
end
|
||||
|
||||
-- Cargo queue debug info.
|
||||
@@ -6274,7 +6274,7 @@ function OPSGROUP:_CheckCargoTransport()
|
||||
end
|
||||
end
|
||||
if text~="" then
|
||||
self:I(self.lid.."Cargo queue:"..text)
|
||||
self:T(self.lid.."Cargo queue:"..text)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6589,7 +6589,7 @@ function OPSGROUP:_DelCargobay(CargoGroup)
|
||||
return true
|
||||
end
|
||||
|
||||
self:E(self.lid.."ERROR: Group is not in cargo bay. Cannot remove it!")
|
||||
self:T(self.lid.."ERROR: Group is not in cargo bay. Cannot remove it!")
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -6928,7 +6928,7 @@ function OPSGROUP:GetWeightCargo(UnitName, IncludeReserved)
|
||||
|
||||
-- Quick check.
|
||||
if IncludeReserved==false and gewicht~=weight then
|
||||
self:E(self.lid..string.format("ERROR: FF weight!=gewicht: weight=%.1f, gewicht=%.1f", weight, gewicht))
|
||||
self:T(self.lid..string.format("ERROR: FF weight!=gewicht: weight=%.1f, gewicht=%.1f", weight, gewicht))
|
||||
end
|
||||
|
||||
return gewicht
|
||||
@@ -7262,7 +7262,7 @@ function OPSGROUP:onafterPickup(From, Event, To)
|
||||
local waypoint=FLIGHTGROUP.AddWaypoint(self, Coordinate, nil, uid, UTILS.MetersToFeet(self.altitudeCruise), false) ; waypoint.detour=1
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Transportcarrier aircraft cannot land in Pickup zone! Specify a ZONE_AIRBASE as pickup zone")
|
||||
self:T(self.lid.."ERROR: Transportcarrier aircraft cannot land in Pickup zone! Specify a ZONE_AIRBASE as pickup zone")
|
||||
end
|
||||
|
||||
-- Cancel landedAt task. This should trigger Cruise once airborne.
|
||||
@@ -7271,7 +7271,7 @@ function OPSGROUP:onafterPickup(From, Event, To)
|
||||
if Task then
|
||||
self:TaskCancel(Task)
|
||||
else
|
||||
self:E(self.lid.."ERROR: No current task but landed at?!")
|
||||
self:T(self.lid.."ERROR: No current task but landed at?!")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7502,7 +7502,7 @@ function OPSGROUP:onafterLoad(From, Event, To, CargoGroup, Carrier)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Cargo has no carrier on Load event!")
|
||||
self:T(self.lid.."ERROR: Cargo has no carrier on Load event!")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7656,7 +7656,7 @@ function OPSGROUP:onafterTransport(From, Event, To)
|
||||
local waypoint=FLIGHTGROUP.AddWaypoint(self, Coordinate, nil, self:GetWaypointCurrent().uid, UTILS.MetersToFeet(self.altitudeCruise), false) ; waypoint.detour=1
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Aircraft (cargo carrier) cannot land in Deploy zone! Specify a ZONE_AIRBASE as deploy zone")
|
||||
self:T(self.lid.."ERROR: Aircraft (cargo carrier) cannot land in Deploy zone! Specify a ZONE_AIRBASE as deploy zone")
|
||||
end
|
||||
|
||||
-- Cancel landedAt task. This should trigger Cruise once airborne.
|
||||
@@ -7665,7 +7665,7 @@ function OPSGROUP:onafterTransport(From, Event, To)
|
||||
if Task then
|
||||
self:TaskCancel(Task)
|
||||
else
|
||||
self:E(self.lid.."ERROR: No current task but landed at?!")
|
||||
self:T(self.lid.."ERROR: No current task but landed at?!")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7793,7 +7793,7 @@ function OPSGROUP:onafterUnloading(From, Event, To)
|
||||
---
|
||||
|
||||
-- Issue warning.
|
||||
self:E(self.lid.."ERROR: Deploy/disembark zone is a ZONE_AIRBASE of a ship! Where to put the cargo? Dumping into the sea, sorry!")
|
||||
self:T(self.lid.."ERROR: Deploy/disembark zone is a ZONE_AIRBASE of a ship! Where to put the cargo? Dumping into the sea, sorry!")
|
||||
|
||||
-- Unload but keep "in utero" (no coordinate provided).
|
||||
self:Unload(cargo.opsgroup)
|
||||
@@ -7992,7 +7992,7 @@ end
|
||||
-- @param #string To To state.
|
||||
-- @param #OPSGROUP OpsGroupCargo Cargo OPSGROUP that was unloaded from a carrier.
|
||||
function OPSGROUP:onafterUnloaded(From, Event, To, OpsGroupCargo)
|
||||
self:I(self.lid..string.format("Unloaded OPSGROUP %s", OpsGroupCargo:GetName()))
|
||||
self:T(self.lid..string.format("Unloaded OPSGROUP %s", OpsGroupCargo:GetName()))
|
||||
end
|
||||
|
||||
|
||||
@@ -8023,13 +8023,13 @@ function OPSGROUP:onafterUnloadingDone(From, Event, To)
|
||||
if self.cargoTZC then
|
||||
|
||||
-- Pickup the next batch.
|
||||
self:I(self.lid.."Unloaded: Still cargo left ==> Pickup")
|
||||
self:T(self.lid.."Unloaded: Still cargo left ==> Pickup")
|
||||
self:Pickup()
|
||||
|
||||
else
|
||||
|
||||
-- Debug info.
|
||||
self:I(self.lid..string.format("WARNING: Not all cargo was delivered but could not get a transport zone combo ==> setting carrier state to NOT CARRIER"))
|
||||
self:T(self.lid..string.format("WARNING: Not all cargo was delivered but could not get a transport zone combo ==> setting carrier state to NOT CARRIER"))
|
||||
|
||||
-- This is not a carrier anymore.
|
||||
self:_NewCarrierStatus(OPSGROUP.CarrierStatus.NOTCARRIER)
|
||||
@@ -8039,7 +8039,7 @@ function OPSGROUP:onafterUnloadingDone(From, Event, To)
|
||||
else
|
||||
|
||||
-- Everything delivered.
|
||||
self:I(self.lid.."Unloaded: ALL cargo unloaded ==> Delivered (current)")
|
||||
self:T(self.lid.."Unloaded: ALL cargo unloaded ==> Delivered (current)")
|
||||
self:Delivered(self.cargoTransport)
|
||||
|
||||
end
|
||||
@@ -8239,14 +8239,14 @@ end
|
||||
function OPSGROUP:onbeforeBoard(From, Event, To, CarrierGroup, Carrier)
|
||||
|
||||
if self:IsDead() then
|
||||
self:I(self.lid.."Group DEAD ==> Deny Board transition!")
|
||||
self:T(self.lid.."Group DEAD ==> Deny Board transition!")
|
||||
return false
|
||||
elseif CarrierGroup:IsDead() then
|
||||
self:I(self.lid.."Carrier Group DEAD ==> Deny Board transition!")
|
||||
self:T(self.lid.."Carrier Group DEAD ==> Deny Board transition!")
|
||||
self:_NewCargoStatus(OPSGROUP.CargoStatus.NOTCARGO)
|
||||
return false
|
||||
elseif Carrier.status==OPSGROUP.ElementStatus.DEAD then
|
||||
self:I(self.lid.."Carrier Element DEAD ==> Deny Board transition!")
|
||||
self:T(self.lid.."Carrier Element DEAD ==> Deny Board transition!")
|
||||
self:_NewCargoStatus(OPSGROUP.CargoStatus.NOTCARGO)
|
||||
return false
|
||||
end
|
||||
@@ -8592,7 +8592,7 @@ function OPSGROUP:_CheckGroupDone(delay)
|
||||
self:T(self.lid..string.format("Adinfinitum=TRUE ==> Goto WP index=%d at speed=%d knots", i, speed))
|
||||
|
||||
else
|
||||
self:E(self.lid..string.format("WARNING: No waypoints left! Commanding a Full Stop"))
|
||||
self:T(self.lid..string.format("WARNING: No waypoints left! Commanding a Full Stop"))
|
||||
self:__FullStop(-1)
|
||||
end
|
||||
|
||||
@@ -8632,7 +8632,7 @@ function OPSGROUP:_CheckGroupDone(delay)
|
||||
self:T(self.lid..string.format("NOT Passed final WP, #WP>0 ==> Update Route"))
|
||||
self:Cruise()
|
||||
else
|
||||
self:E(self.lid..string.format("WARNING: No waypoints left! Commanding a Full Stop"))
|
||||
self:T(self.lid..string.format("WARNING: No waypoints left! Commanding a Full Stop"))
|
||||
self:__FullStop(-1)
|
||||
end
|
||||
|
||||
@@ -8686,7 +8686,7 @@ function OPSGROUP:_CheckStuck()
|
||||
if holdtime>=5*60 and holdtime<10*60 then
|
||||
|
||||
-- Debug warning.
|
||||
self:E(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime))
|
||||
self:T(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime))
|
||||
|
||||
-- Give cruise command again.
|
||||
if self:IsReturning() then
|
||||
@@ -8698,14 +8698,14 @@ function OPSGROUP:_CheckStuck()
|
||||
elseif holdtime>=10*60 and holdtime<30*60 then
|
||||
|
||||
-- Debug warning.
|
||||
self:E(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime))
|
||||
self:T(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime))
|
||||
|
||||
--TODO: Stuck event!
|
||||
|
||||
-- Look for a current mission and cancel it as we do not seem to be able to perform it.
|
||||
local mission=self:GetMissionCurrent()
|
||||
if mission then
|
||||
self:E(self.lid..string.format("WARNING: Cancelling mission %s [%s] due to being stuck", mission:GetName(), mission:GetType()))
|
||||
self:T(self.lid..string.format("WARNING: Cancelling mission %s [%s] due to being stuck", mission:GetName(), mission:GetType()))
|
||||
self:MissionCancel(mission)
|
||||
else
|
||||
-- Give cruise command again.
|
||||
@@ -8719,7 +8719,7 @@ function OPSGROUP:_CheckStuck()
|
||||
elseif holdtime>=30*60 then
|
||||
|
||||
-- Debug warning.
|
||||
self:E(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime))
|
||||
self:T(self.lid..string.format("WARNING: Group came to an unexpected standstill. Speed=%.1f<%.1f m/s expected for %d sec", speed, ExpectedSpeed, holdtime))
|
||||
|
||||
end
|
||||
|
||||
@@ -9137,7 +9137,7 @@ function OPSGROUP:_InitWaypoints(WpIndexMin, WpIndexMax)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: No waypoints initialized. Number of waypoints is 0!")
|
||||
self:T(self.lid.."WARNING: No waypoints initialized. Number of waypoints is 0!")
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -9172,7 +9172,7 @@ function OPSGROUP:Route(waypoints, delay)
|
||||
self:SetTask(DCSTask)
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Group is not alive! Cannot route group.")
|
||||
self:T(self.lid.."ERROR: Group is not alive! Cannot route group.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9289,7 +9289,7 @@ function OPSGROUP._PassingWaypoint(opsgroup, uid)
|
||||
|
||||
if (opsgroup:IsNavygroup() or opsgroup:IsArmygroup()) and opsgroup.currentwp==#opsgroup.waypoints then
|
||||
--TODO: not sure if this works with FLIGHTGROUPS
|
||||
|
||||
|
||||
-- Removing this for now.
|
||||
opsgroup:Cruise()
|
||||
end
|
||||
@@ -9502,7 +9502,7 @@ function OPSGROUP:SwitchROE(roe)
|
||||
if self:IsInUtero() then
|
||||
self:T2(self.lid..string.format("Setting current ROE=%d when GROUP is SPAWNED", self.option.ROE))
|
||||
else
|
||||
|
||||
|
||||
self.group:OptionROE(self.option.ROE)
|
||||
|
||||
self:T(self.lid..string.format("Setting current ROE=%d (%s)", self.option.ROE, self:_GetROEName(self.option.ROE)))
|
||||
@@ -9510,7 +9510,7 @@ function OPSGROUP:SwitchROE(roe)
|
||||
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: Cannot switch ROE! Group is not alive")
|
||||
self:T(self.lid.."WARNING: Cannot switch ROE! Group is not alive")
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -9575,7 +9575,7 @@ function OPSGROUP:SwitchROT(rot)
|
||||
|
||||
|
||||
else
|
||||
self:E(self.lid.."WARNING: Cannot switch ROT! Group is not alive")
|
||||
self:T(self.lid.."WARNING: Cannot switch ROT! Group is not alive")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -9628,7 +9628,7 @@ function OPSGROUP:SwitchAlarmstate(alarmstate)
|
||||
elseif self.option.Alarm==2 then
|
||||
self.group:OptionAlarmStateRed()
|
||||
else
|
||||
self:E("ERROR: Unknown Alarm State! Setting to AUTO")
|
||||
self:T("ERROR: Unknown Alarm State! Setting to AUTO")
|
||||
self.group:OptionAlarmStateAuto()
|
||||
self.option.Alarm=0
|
||||
end
|
||||
@@ -9639,7 +9639,7 @@ function OPSGROUP:SwitchAlarmstate(alarmstate)
|
||||
|
||||
end
|
||||
else
|
||||
self:E(self.lid.."WARNING: Cannot switch Alarm State! Group is not alive.")
|
||||
self:T(self.lid.."WARNING: Cannot switch Alarm State! Group is not alive.")
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -9888,11 +9888,11 @@ function OPSGROUP:SwitchTACAN(Channel, Morse, UnitName, Band)
|
||||
self:T(self.lid..string.format("Switching TACAN to Channel %d%s Morse %s on unit %s", self.tacan.Channel, self.tacan.Band, tostring(self.tacan.Morse), self.tacan.BeaconName))
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Cound not set TACAN! Unit is not alive")
|
||||
self:T(self.lid.."ERROR: Cound not set TACAN! Unit is not alive")
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Cound not set TACAN! Group is not alive and not in utero any more")
|
||||
self:T(self.lid.."ERROR: Cound not set TACAN! Group is not alive and not in utero any more")
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -10030,7 +10030,7 @@ function OPSGROUP:SwitchICLS(Channel, Morse, UnitName)
|
||||
self:T(self.lid..string.format("Switching ICLS to Channel %d Morse %s on unit %s", self.icls.Channel, tostring(self.icls.Morse), self.icls.BeaconName))
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Cound not set ICLS! Unit is not alive.")
|
||||
self:T(self.lid.."ERROR: Cound not set ICLS! Unit is not alive.")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -10119,7 +10119,7 @@ function OPSGROUP:SwitchRadio(Frequency, Modulation)
|
||||
self:T(self.lid..string.format("Switching radio to frequency %.3f MHz %s", self.radio.Freq, UTILS.GetModulationName(self.radio.Modu)))
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Cound not set Radio! Group is not alive or not in utero any more")
|
||||
self:T(self.lid.."ERROR: Cound not set Radio! Group is not alive or not in utero any more")
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -10142,7 +10142,7 @@ function OPSGROUP:TurnOffRadio()
|
||||
|
||||
self:T(self.lid..string.format("Switching radio OFF"))
|
||||
else
|
||||
self:E(self.lid.."ERROR: Radio can only be turned off for aircraft!")
|
||||
self:T(self.lid.."ERROR: Radio can only be turned off for aircraft!")
|
||||
end
|
||||
|
||||
end
|
||||
@@ -10182,7 +10182,7 @@ function OPSGROUP:SwitchFormation(Formation)
|
||||
-- Polymorphic and overwritten in ARMYGROUP.
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Formation can only be set for aircraft or ground units!")
|
||||
self:T(self.lid.."ERROR: Formation can only be set for aircraft or ground units!")
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -10255,7 +10255,7 @@ function OPSGROUP:SwitchCallsign(CallsignName, CallsignNumber)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid.."ERROR: Group is not alive and not in utero! Cannot switch callsign")
|
||||
self:T(self.lid.."ERROR: Group is not alive and not in utero! Cannot switch callsign")
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -11101,11 +11101,11 @@ function OPSGROUP:_CoordinateFromObject(Object)
|
||||
local coord=Object:GetCoordinate()
|
||||
return coord
|
||||
else
|
||||
self:E(self.lid.."ERROR: Coordinate is neither a COORDINATE nor any POSITIONABLE or ZONE!")
|
||||
self:T(self.lid.."ERROR: Coordinate is neither a COORDINATE nor any POSITIONABLE or ZONE!")
|
||||
end
|
||||
end
|
||||
else
|
||||
self:E(self.lid.."ERROR: Object passed is nil!")
|
||||
self:T(self.lid.."ERROR: Object passed is nil!")
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -11213,8 +11213,8 @@ function OPSGROUP:_AddElementByName(unitname)
|
||||
element.category=unit:GetUnitCategory()
|
||||
element.categoryname=unit:GetCategoryName()
|
||||
element.typename=unit:GetTypeName()
|
||||
|
||||
|
||||
|
||||
|
||||
--self:I({desc=element.descriptors})
|
||||
|
||||
-- Ammo.
|
||||
@@ -11327,7 +11327,7 @@ function OPSGROUP:_GetTemplate(Copy)
|
||||
end
|
||||
|
||||
else
|
||||
self:E(self.lid..string.format("ERROR: No template was set yet!"))
|
||||
self:T(self.lid..string.format("ERROR: No template was set yet!"))
|
||||
end
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user