mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Improvements on reporting.
This commit is contained in:
parent
fb23ac1d55
commit
cff4f60923
@ -306,65 +306,51 @@ function TASKINFO:Report( Report, Detail, ReportGroup, Task )
|
|||||||
|
|
||||||
for Key, Data in UTILS.spairs( self.Info.Set, function( t, a, b ) return t[a].Order < t[b].Order end ) do
|
for Key, Data in UTILS.spairs( self.Info.Set, function( t, a, b ) return t[a].Order < t[b].Order end ) do
|
||||||
|
|
||||||
self:F( { Key = Key, Detail = Detail, Data = Data } )
|
|
||||||
|
|
||||||
if Data.Detail:find( Detail ) then
|
if Data.Detail:find( Detail ) then
|
||||||
local Text = ""
|
local Text = ""
|
||||||
if Key == "TaskName" then
|
if Key == "TaskName" then
|
||||||
Key = nil
|
Key = nil
|
||||||
Text = Data.Data
|
Text = Data.Data
|
||||||
end
|
elseif Key == "Coordinate" then
|
||||||
if Key == "Coordinate" then
|
|
||||||
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
||||||
Text = Coordinate:ToString( ReportGroup:GetUnit(1), nil, Task )
|
Text = Coordinate:ToString( ReportGroup:GetUnit(1), nil, Task )
|
||||||
end
|
elseif Key == "Threat" then
|
||||||
if Key == "Threat" then
|
|
||||||
local DataText = Data.Data -- #string
|
local DataText = Data.Data -- #string
|
||||||
Text = DataText
|
Text = DataText
|
||||||
end
|
elseif Key == "Counting" then
|
||||||
if Key == "Counting" then
|
|
||||||
local DataText = Data.Data -- #string
|
local DataText = Data.Data -- #string
|
||||||
Text = DataText
|
Text = DataText
|
||||||
end
|
elseif Key == "Targets" then
|
||||||
if Key == "Targets" then
|
|
||||||
local DataText = Data.Data -- #string
|
local DataText = Data.Data -- #string
|
||||||
Text = DataText
|
Text = DataText
|
||||||
end
|
elseif Key == "QFE" then
|
||||||
if Key == "QFE" then
|
|
||||||
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
||||||
Text = Coordinate:ToStringPressure( ReportGroup:GetUnit(1), nil, Task )
|
Text = Coordinate:ToStringPressure( ReportGroup:GetUnit(1), nil, Task )
|
||||||
end
|
elseif Key == "Temperature" then
|
||||||
if Key == "Temperature" then
|
|
||||||
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
||||||
Text = Coordinate:ToStringTemperature( ReportGroup:GetUnit(1), nil, Task )
|
Text = Coordinate:ToStringTemperature( ReportGroup:GetUnit(1), nil, Task )
|
||||||
end
|
elseif Key == "Wind" then
|
||||||
if Key == "Wind" then
|
|
||||||
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
local Coordinate = Data.Data -- Core.Point#COORDINATE
|
||||||
Text = Coordinate:ToStringWind( ReportGroup:GetUnit(1), nil, Task )
|
Text = Coordinate:ToStringWind( ReportGroup:GetUnit(1), nil, Task )
|
||||||
end
|
elseif Key == "Cargo" then
|
||||||
if Key == "Cargo" then
|
local DataText = Data.Data -- #string
|
||||||
|
Text = DataText
|
||||||
|
elseif Key == "Friendlies" then
|
||||||
|
local DataText = Data.Data -- #string
|
||||||
|
Text = DataText
|
||||||
|
elseif Key == "Players" then
|
||||||
|
local DataText = Data.Data -- #string
|
||||||
|
Text = DataText
|
||||||
|
else
|
||||||
local DataText = Data.Data -- #string
|
local DataText = Data.Data -- #string
|
||||||
Text = DataText
|
Text = DataText
|
||||||
end
|
end
|
||||||
if Key == "Friendlies" then
|
|
||||||
local DataText = Data.Data -- #string
|
|
||||||
Text = DataText
|
|
||||||
end
|
|
||||||
if Key == "Players" then
|
|
||||||
local DataText = Data.Data -- #string
|
|
||||||
Text = DataText
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if Line < math.floor( Data.Order / 10 ) then
|
if Line < math.floor( Data.Order / 10 ) then
|
||||||
if Line == 0 then
|
if Line == 0 then
|
||||||
if Text ~= "" then
|
Report:AddIndent( LineReport:Text( ", " ), "-" )
|
||||||
Report:AddIndent( LineReport:Text( ", " ), "-" )
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if Text ~= "" then
|
Report:AddIndent( LineReport:Text( ", " ) )
|
||||||
Report:AddIndent( LineReport:Text( ", " ) )
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
LineReport = REPORT:New()
|
LineReport = REPORT:New()
|
||||||
Line = math.floor( Data.Order / 10 )
|
Line = math.floor( Data.Order / 10 )
|
||||||
@ -373,8 +359,9 @@ function TASKINFO:Report( Report, Detail, ReportGroup, Task )
|
|||||||
if Text ~= "" then
|
if Text ~= "" then
|
||||||
LineReport:Add( ( Key and ( Key .. ":" ) or "" ) .. Text )
|
LineReport:Add( ( Key and ( Key .. ":" ) or "" ) .. Text )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Report:AddIndent( LineReport:Text( ", " ) )
|
Report:AddIndent( LineReport:Text( ", " ) )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -246,6 +246,7 @@ do -- TASK_CAPTURE_DISPATCHER
|
|||||||
-- Here we need to check if the pilot is still existing.
|
-- Here we need to check if the pilot is still existing.
|
||||||
-- Task = self:RemoveTask( TaskIndex )
|
-- Task = self:RemoveTask( TaskIndex )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Now that all obsolete tasks are removed, loop through the Zone tasks.
|
-- Now that all obsolete tasks are removed, loop through the Zone tasks.
|
||||||
@ -257,25 +258,32 @@ do -- TASK_CAPTURE_DISPATCHER
|
|||||||
CaptureZone.Task.TaskPrefix = CaptureZone.TaskPrefix -- We keep the TaskPrefix for further reference!
|
CaptureZone.Task.TaskPrefix = CaptureZone.TaskPrefix -- We keep the TaskPrefix for further reference!
|
||||||
Mission:AddTask( CaptureZone.Task )
|
Mission:AddTask( CaptureZone.Task )
|
||||||
TaskReport:Add( TaskName )
|
TaskReport:Add( TaskName )
|
||||||
|
CaptureZone.Task:UpdateTaskInfo()
|
||||||
|
|
||||||
function CaptureZone.Task.OnEnterSuccess( Task, From, Event, To )
|
function CaptureZone.Task.OnEnterSuccess( Task, From, Event, To )
|
||||||
self:Success( Task )
|
self:Success( Task )
|
||||||
|
CaptureZone.Task:UpdateTaskInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
function CaptureZone.Task.OnEnterCancelled( Task, From, Event, To )
|
function CaptureZone.Task.OnEnterCancelled( Task, From, Event, To )
|
||||||
self:Cancelled( Task )
|
self:Cancelled( Task )
|
||||||
|
CaptureZone.Task:UpdateTaskInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
function CaptureZone.Task.OnEnterFailed( Task, From, Event, To )
|
function CaptureZone.Task.OnEnterFailed( Task, From, Event, To )
|
||||||
self:Failed( Task )
|
self:Failed( Task )
|
||||||
|
CaptureZone.Task:UpdateTaskInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
function CaptureZone.Task.OnEnterAborted( Task, From, Event, To )
|
function CaptureZone.Task.OnEnterAborted( Task, From, Event, To )
|
||||||
self:Aborted( Task )
|
self:Aborted( Task )
|
||||||
|
CaptureZone.Task:UpdateTaskInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Now broadcast the onafterCargoPickedUp event to the Task Cargo Dispatcher.
|
-- Now broadcast the onafterCargoPickedUp event to the Task Cargo Dispatcher.
|
||||||
function CaptureZone.Task.OnAfterCaptured( Task, From, Event, To, TaskUnit )
|
function CaptureZone.Task.OnAfterCaptured( Task, From, Event, To, TaskUnit )
|
||||||
self:Captured( Task, Task.TaskPrefix, TaskUnit )
|
self:Captured( Task, Task.TaskPrefix, TaskUnit )
|
||||||
|
CaptureZone.Task:UpdateTaskInfo()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -219,12 +219,13 @@ do -- TASK_CAPTURE_ZONE
|
|||||||
|
|
||||||
--- Instantiates a new TASK_CAPTURE_ZONE.
|
--- Instantiates a new TASK_CAPTURE_ZONE.
|
||||||
-- @param #TASK_CAPTURE_ZONE self
|
-- @param #TASK_CAPTURE_ZONE self
|
||||||
function TASK_CAPTURE_ZONE:UpdateTaskInfo()
|
function TASK_CAPTURE_ZONE:UpdateTaskInfo( DetectedItem )
|
||||||
|
|
||||||
local ZoneCoordinate = self.ZoneGoal:GetZone():GetCoordinate()
|
local ZoneCoordinate = self.ZoneGoal:GetZone():GetCoordinate()
|
||||||
self.TaskInfo:AddCoordinate( ZoneCoordinate, 0, "SOD" )
|
self.TaskInfo:AddTaskName( 0, "MSOD", true )
|
||||||
self.TaskInfo:AddText( "Zone Name", self.ZoneGoal:GetZoneName(), 10, "MOD" )
|
self.TaskInfo:AddCoordinate( ZoneCoordinate, 1, "SOD", true )
|
||||||
self.TaskInfo:AddText( "Zone Coalition", self.ZoneGoal:GetCoalitionName(), 11, "MOD" )
|
self.TaskInfo:AddText( "Zone Name", self.ZoneGoal:GetZoneName(), 10, "MOD", true )
|
||||||
|
self.TaskInfo:AddText( "Zone Coalition", self.ZoneGoal:GetCoalitionName(), 11, "MOD", true )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user