Clean up the detection code. It is complicated

This commit is contained in:
FlightControl_Master
2018-03-17 05:23:44 +01:00
parent 0f18b29144
commit 9be9277a08
7 changed files with 128 additions and 216 deletions

View File

@@ -875,7 +875,7 @@ end
function TASK:MenuMarkToGroup( TaskGroup )
self:F()
self:UpdateTaskInfo()
self:UpdateTaskInfo( self.DetectedItem )
local Report = REPORT:New():SetIndent( 0 )
@@ -1380,14 +1380,14 @@ do -- Links
--- Set detection of a task
-- @param #TASK self
-- @param Function.Detection#DETECTION_BASE Detection
-- @param #number DetectedItemIndex
-- @param DetectedItem
-- @return #TASK
function TASK:SetDetection( Detection, DetectedItemIndex )
function TASK:SetDetection( Detection, DetectedItem )
self:E({DetectedItemIndex,Detection})
self:E( { DetectedItem, Detection } )
self.Detection = Detection
self.DetectedItemIndex = DetectedItemIndex
self.DetectedItem = DetectedItem
end
end
@@ -1420,7 +1420,7 @@ end
-- @return #string
function TASK:ReportOverview( ReportGroup )
self:UpdateTaskInfo()
self:UpdateTaskInfo( self.DetectedItem )
-- List the name of the Task.
local TaskName = self:GetName()
@@ -1480,7 +1480,7 @@ end
-- @return #string
function TASK:ReportDetails( ReportGroup )
self:UpdateTaskInfo()
self:UpdateTaskInfo( self.DetectedItem )
local Report = REPORT:New():SetIndent( 3 )