mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Fixes for A2G tasking, reduce trace, and put in key trace lines to follow the tasking.
This commit is contained in:
parent
76ea635b63
commit
a2fa2c4fa2
@ -426,11 +426,11 @@ do -- Group Assignment
|
|||||||
local TaskGroupName = TaskGroup:GetName()
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
if self.AssignedGroups[TaskGroupName] then
|
if self.AssignedGroups[TaskGroupName] then
|
||||||
self:T( { "Task is assigned to:", TaskGroup:GetName() } )
|
--self:T( { "Task is assigned to:", TaskGroup:GetName() } )
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( { "Task is not assigned to:", TaskGroup:GetName() } )
|
--self:T( { "Task is not assigned to:", TaskGroup:GetName() } )
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -751,7 +751,7 @@ function TASK:SetPlannedMenuForGroup( TaskGroup, MenuTime )
|
|||||||
local ReportTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Report Task Status" ), TaskTypeMenu, self.MenuTaskStatus, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" )
|
local ReportTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Report Task Status" ), TaskTypeMenu, self.MenuTaskStatus, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" )
|
||||||
|
|
||||||
if not Mission:IsGroupAssigned( TaskGroup ) then
|
if not Mission:IsGroupAssigned( TaskGroup ) then
|
||||||
self:F( { "Replacing Join Task menu" } )
|
--self:F( { "Replacing Join Task menu" } )
|
||||||
local JoinTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Join Task" ), TaskTypeMenu, self.MenuAssignToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" )
|
local JoinTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Join Task" ), TaskTypeMenu, self.MenuAssignToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" )
|
||||||
local MarkTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Mark Task on Map" ), TaskTypeMenu, self.MenuMarkToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" )
|
local MarkTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Mark Task on Map" ), TaskTypeMenu, self.MenuMarkToGroup, self, TaskGroup ):SetTime( MenuTime ):SetTag( "Tasking" )
|
||||||
end
|
end
|
||||||
@ -1239,7 +1239,6 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
||||||
|
|
||||||
|
|
||||||
--- This test is required, because the state transition will be fired also when the state does not change in case of an event.
|
--- This test is required, because the state transition will be fired also when the state does not change in case of an event.
|
||||||
if From ~= "Assigned" then
|
if From ~= "Assigned" then
|
||||||
self:E( { From, Event, To, PlayerUnit:GetName(), PlayerName } )
|
self:E( { From, Event, To, PlayerUnit:GetName(), PlayerName } )
|
||||||
@ -1261,6 +1260,10 @@ function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
|||||||
self:__Goal( -10, PlayerUnit, PlayerName ) -- Polymorphic
|
self:__Goal( -10, PlayerUnit, PlayerName ) -- Polymorphic
|
||||||
|
|
||||||
self:SetMenu()
|
self:SetMenu()
|
||||||
|
|
||||||
|
self:E( { "--> Task Assigned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
|
self:E( { "--> Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1272,7 +1275,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterSuccess( From, Event, To )
|
function TASK:onenterSuccess( From, Event, To )
|
||||||
|
|
||||||
self:E( "Task Success" )
|
self:E( { "<-> Task Replanned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
|
self:E( { "<-> Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is successful! Good job!" )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is successful! Good job!" )
|
||||||
self:UnAssignFromGroups()
|
self:UnAssignFromGroups()
|
||||||
@ -1289,7 +1293,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterAborted( From, Event, To )
|
function TASK:onenterAborted( From, Event, To )
|
||||||
|
|
||||||
self:E( "Task Aborted" )
|
self:E( { "<-- Task Aborted", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
|
self:E( { "<-- Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
if From ~= "Aborted" then
|
if From ~= "Aborted" then
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
||||||
@ -1306,7 +1311,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterCancelled( From, Event, To )
|
function TASK:onenterCancelled( From, Event, To )
|
||||||
|
|
||||||
self:E( "Task Cancelled" )
|
self:E( { "<-- Task Cancelled", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
|
self:E( { "<-- Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
if From ~= "Cancelled" then
|
if From ~= "Cancelled" then
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been cancelled! The tactical situation has changed." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been cancelled! The tactical situation has changed." )
|
||||||
@ -1323,7 +1329,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onafterReplan( From, Event, To )
|
function TASK:onafterReplan( From, Event, To )
|
||||||
|
|
||||||
self:E( "Task Replanned" )
|
self:E( { "Task Replanned", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
|
self:E( { "Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Replanning Task " .. self:GetName() .. "." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Replanning Task " .. self:GetName() .. "." )
|
||||||
|
|
||||||
@ -1338,7 +1345,8 @@ end
|
|||||||
-- @param #string To
|
-- @param #string To
|
||||||
function TASK:onenterFailed( From, Event, To )
|
function TASK:onenterFailed( From, Event, To )
|
||||||
|
|
||||||
self:E( "Task Failed" )
|
self:E( { "Task Failed", TaskName = self:GetName(), Mission = self:GetMission():GetName() } )
|
||||||
|
self:E( { "Task Player Names", PlayerNames = self:GetPlayerNames() } )
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has failed!" )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has failed!" )
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,6 @@ end
|
|||||||
-- @return Dcs.DCSWrapper.Object#Object.ID ObjectID
|
-- @return Dcs.DCSWrapper.Object#Object.ID ObjectID
|
||||||
-- @return #nil The DCS Object is not existing or alive.
|
-- @return #nil The DCS Object is not existing or alive.
|
||||||
function OBJECT:GetID()
|
function OBJECT:GetID()
|
||||||
self:F2( self.ObjectName )
|
|
||||||
|
|
||||||
local DCSObject = self:GetDCSObject()
|
local DCSObject = self:GetDCSObject()
|
||||||
|
|
||||||
@ -67,6 +66,8 @@ function OBJECT:GetID()
|
|||||||
return ObjectID
|
return ObjectID
|
||||||
end
|
end
|
||||||
|
|
||||||
|
BASE:E( { "Cannot GetID", Name = self.ObjectName, Class = self:GetClassName() } )
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -74,7 +75,6 @@ end
|
|||||||
-- @param #OBJECT self
|
-- @param #OBJECT self
|
||||||
-- @return #nil The DCS Unit is not existing or alive.
|
-- @return #nil The DCS Unit is not existing or alive.
|
||||||
function OBJECT:Destroy()
|
function OBJECT:Destroy()
|
||||||
self:F2( self.ObjectName )
|
|
||||||
|
|
||||||
local DCSObject = self:GetDCSObject()
|
local DCSObject = self:GetDCSObject()
|
||||||
|
|
||||||
@ -83,6 +83,8 @@ function OBJECT:Destroy()
|
|||||||
DCSObject:destroy()
|
DCSObject:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
BASE:E( { "Cannot Destroy", Name = self.ObjectName, Class = self:GetClassName() } )
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -600,9 +600,16 @@ function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name )
|
|||||||
local DCSObject = self:GetDCSObject()
|
local DCSObject = self:GetDCSObject()
|
||||||
if DCSObject then
|
if DCSObject then
|
||||||
if DCSObject:isExist() then
|
if DCSObject:isExist() then
|
||||||
self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup )
|
if MessageGroup:IsAlive() then
|
||||||
|
self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup )
|
||||||
|
else
|
||||||
|
BASE:E( { "Message not sent to Group; Group is not alive...", Message = Message, MessageGroup = MessageGroup } )
|
||||||
|
end
|
||||||
|
else
|
||||||
|
BASE:E( { "Message not sent to Group; Positionable is not alive ...", Message = Message, Positionable = self, MessageGroup = MessageGroup } )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|||||||
@ -761,7 +761,6 @@ function UNIT:IsInZone( Zone )
|
|||||||
if self:IsAlive() then
|
if self:IsAlive() then
|
||||||
local IsInZone = Zone:IsVec3InZone( self:GetVec3() )
|
local IsInZone = Zone:IsVec3InZone( self:GetVec3() )
|
||||||
|
|
||||||
self:E( { Unit = self.UnitName, IsInZone = IsInZone } )
|
|
||||||
return IsInZone
|
return IsInZone
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user