mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Fixed issue in TASK_A2A_DISPATCHER with taskupdates.
This commit is contained in:
parent
52d783a0b7
commit
cbb800de02
@ -100,7 +100,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName )
|
|||||||
function( self, EventData )
|
function( self, EventData )
|
||||||
if EventData.IniObjectCategory == 1 then
|
if EventData.IniObjectCategory == 1 then
|
||||||
local EventGroup = GROUP:Find( EventData.IniDCSGroup )
|
local EventGroup = GROUP:Find( EventData.IniDCSGroup )
|
||||||
self:E( { CommandCenter = self:GetName(), EventGroup = EventGroup, HasGroup = self:HasGroup( EventGroup ), EventData = EventData } )
|
self:E( { CommandCenter = self:GetName(), EventGroup = EventGroup:GetName(), HasGroup = self:HasGroup( EventGroup ), EventData = EventData } )
|
||||||
if EventGroup and self:HasGroup( EventGroup ) then
|
if EventGroup and self:HasGroup( EventGroup ) then
|
||||||
local CommandCenterMenu = MENU_GROUP:New( EventGroup, "Command Center (" .. self:GetName() .. ")" )
|
local CommandCenterMenu = MENU_GROUP:New( EventGroup, "Command Center (" .. self:GetName() .. ")" )
|
||||||
local MenuReporting = MENU_GROUP:New( EventGroup, "Missions Reports", CommandCenterMenu )
|
local MenuReporting = MENU_GROUP:New( EventGroup, "Missions Reports", CommandCenterMenu )
|
||||||
|
|||||||
@ -739,57 +739,57 @@ function MISSION:ReportBriefing()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Create a status report of the Mission.
|
----- Create a status report of the Mission.
|
||||||
-- This reports provides a one liner of the mission status. It indicates how many players and how many Tasks.
|
---- This reports provides a one liner of the mission status. It indicates how many players and how many Tasks.
|
||||||
--
|
----
|
||||||
-- Mission "<MissionName>" - Status "<MissionStatus>"
|
---- Mission "<MissionName>" - Status "<MissionStatus>"
|
||||||
-- - Task Types: <TaskType>, <TaskType>
|
---- - Task Types: <TaskType>, <TaskType>
|
||||||
-- - <xx> Planned Tasks (xp)
|
---- - <xx> Planned Tasks (xp)
|
||||||
-- - <xx> Assigned Tasks(xp)
|
---- - <xx> Assigned Tasks(xp)
|
||||||
-- - <xx> Success Tasks (xp)
|
---- - <xx> Success Tasks (xp)
|
||||||
-- - <xx> Hold Tasks (xp)
|
---- - <xx> Hold Tasks (xp)
|
||||||
-- - <xx> Cancelled Tasks (xp)
|
---- - <xx> Cancelled Tasks (xp)
|
||||||
-- - <xx> Aborted Tasks (xp)
|
---- - <xx> Aborted Tasks (xp)
|
||||||
-- - <xx> Failed Tasks (xp)
|
---- - <xx> Failed Tasks (xp)
|
||||||
--
|
----
|
||||||
-- @param #MISSION self
|
---- @param #MISSION self
|
||||||
-- @return #string
|
---- @return #string
|
||||||
function MISSION:ReportSummary()
|
--function MISSION:ReportSummary()
|
||||||
|
--
|
||||||
local Report = REPORT:New()
|
-- local Report = REPORT:New()
|
||||||
|
--
|
||||||
-- List the name of the mission.
|
-- -- List the name of the mission.
|
||||||
local Name = self:GetText()
|
-- local Name = self:GetText()
|
||||||
|
--
|
||||||
-- Determine the status of the mission.
|
-- -- Determine the status of the mission.
|
||||||
local Status = "<" .. self:GetState() .. ">"
|
-- local Status = "<" .. self:GetState() .. ">"
|
||||||
|
--
|
||||||
Report:Add( string.format( '%s - Status "%s"', Name, Status ) )
|
-- Report:Add( string.format( '%s - Status "%s"', Name, Status ) )
|
||||||
|
--
|
||||||
local TaskTypes = self:GetTaskTypes()
|
-- local TaskTypes = self:GetTaskTypes()
|
||||||
|
--
|
||||||
Report:Add( string.format( " - Task Types: %s", table.concat(TaskTypes, ", " ) ) )
|
-- Report:Add( string.format( " - Task Types: %s", table.concat(TaskTypes, ", " ) ) )
|
||||||
|
--
|
||||||
local TaskStatusList = { "Planned", "Assigned", "Success", "Hold", "Cancelled", "Aborted", "Failed" }
|
-- local TaskStatusList = { "Planned", "Assigned", "Success", "Hold", "Cancelled", "Aborted", "Failed" }
|
||||||
|
--
|
||||||
for TaskStatusID, TaskStatus in pairs( TaskStatusList ) do
|
-- for TaskStatusID, TaskStatus in pairs( TaskStatusList ) do
|
||||||
local TaskCount = 0
|
-- local TaskCount = 0
|
||||||
local TaskPlayerCount = 0
|
-- local TaskPlayerCount = 0
|
||||||
-- Determine how many tasks are remaining.
|
-- -- Determine how many tasks are remaining.
|
||||||
for TaskID, Task in pairs( self:GetTasks() ) do
|
-- for TaskID, Task in pairs( self:GetTasks() ) do
|
||||||
local Task = Task -- Tasking.Task#TASK
|
-- local Task = Task -- Tasking.Task#TASK
|
||||||
if Task:Is( TaskStatus ) then
|
-- if Task:Is( TaskStatus ) then
|
||||||
TaskCount = TaskCount + 1
|
-- TaskCount = TaskCount + 1
|
||||||
TaskPlayerCount = TaskPlayerCount + Task:GetPlayerCount()
|
-- TaskPlayerCount = TaskPlayerCount + Task:GetPlayerCount()
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
if TaskCount > 0 then
|
-- if TaskCount > 0 then
|
||||||
Report:Add( string.format( " - %02d %s Tasks (%dp)", TaskCount, TaskStatus, TaskPlayerCount ) )
|
-- Report:Add( string.format( " - %02d %s Tasks (%dp)", TaskCount, TaskStatus, TaskPlayerCount ) )
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
return Report:Text()
|
-- return Report:Text()
|
||||||
end
|
--end
|
||||||
|
|
||||||
|
|
||||||
--- Create an active player report of the Mission.
|
--- Create an active player report of the Mission.
|
||||||
|
|||||||
@ -1401,6 +1401,8 @@ do -- Reporting
|
|||||||
-- @return #string
|
-- @return #string
|
||||||
function TASK:ReportSummary( ReportGroup )
|
function TASK:ReportSummary( ReportGroup )
|
||||||
|
|
||||||
|
self:UpdateTaskInfo( self.DetectedItem )
|
||||||
|
|
||||||
local Report = REPORT:New()
|
local Report = REPORT:New()
|
||||||
|
|
||||||
-- List the name of the Task.
|
-- List the name of the Task.
|
||||||
|
|||||||
@ -539,16 +539,19 @@ do -- TASK_A2A_DISPATCHER
|
|||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2A_ENGAGE:New( Mission, self.SetGroup, string.format( "ENGAGE.%03d", DetectedID ), TargetSetUnit )
|
Task = TASK_A2A_ENGAGE:New( Mission, self.SetGroup, string.format( "ENGAGE.%03d", DetectedID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, DetectedItem )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
else
|
else
|
||||||
local TargetSetUnit = self:EvaluateINTERCEPT( DetectedItem ) -- Returns a SetUnit if there are targets to be INTERCEPTed...
|
local TargetSetUnit = self:EvaluateINTERCEPT( DetectedItem ) -- Returns a SetUnit if there are targets to be INTERCEPTed...
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2A_INTERCEPT:New( Mission, self.SetGroup, string.format( "INTERCEPT.%03d", DetectedID ), TargetSetUnit )
|
Task = TASK_A2A_INTERCEPT:New( Mission, self.SetGroup, string.format( "INTERCEPT.%03d", DetectedID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, DetectedItem )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
else
|
else
|
||||||
local TargetSetUnit = self:EvaluateSWEEP( DetectedItem ) -- Returns a SetUnit
|
local TargetSetUnit = self:EvaluateSWEEP( DetectedItem ) -- Returns a SetUnit
|
||||||
if TargetSetUnit then
|
if TargetSetUnit then
|
||||||
Task = TASK_A2A_SWEEP:New( Mission, self.SetGroup, string.format( "SWEEP.%03d", DetectedID ), TargetSetUnit )
|
Task = TASK_A2A_SWEEP:New( Mission, self.SetGroup, string.format( "SWEEP.%03d", DetectedID ), TargetSetUnit )
|
||||||
Task:SetDetection( Detection, DetectedItem )
|
Task:SetDetection( Detection, DetectedItem )
|
||||||
|
Task:UpdateTaskInfo( DetectedItem )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user