Merge remote-tracking branch 'origin/master' into develop

# Conflicts:
#	Moose Development/Moose/AI/AI_A2A_Dispatcher.lua
#	Moose Development/Moose/AI/AI_A2G_Dispatcher.lua
#	Moose Development/Moose/AI/AI_CAP.lua
#	Moose Development/Moose/AI/AI_CAS.lua
#	Moose Development/Moose/AI/AI_Patrol.lua
#	Moose Development/Moose/Core/Base.lua
#	Moose Development/Moose/Core/Beacon.lua
#	Moose Development/Moose/Core/Database.lua
#	Moose Development/Moose/Core/Fsm.lua
#	Moose Development/Moose/Core/MarkerOps_Base.lua
#	Moose Development/Moose/Core/Menu.lua
#	Moose Development/Moose/Core/Message.lua
#	Moose Development/Moose/Core/Point.lua
#	Moose Development/Moose/Core/ScheduleDispatcher.lua
#	Moose Development/Moose/Core/Scheduler.lua
#	Moose Development/Moose/Core/Set.lua
#	Moose Development/Moose/Core/Spawn.lua
#	Moose Development/Moose/Core/Zone.lua
#	Moose Development/Moose/DCS.lua
#	Moose Development/Moose/Functional/Detection.lua
#	Moose Development/Moose/Functional/Mantis.lua
#	Moose Development/Moose/Functional/Range.lua
#	Moose Development/Moose/Functional/Scoring.lua
#	Moose Development/Moose/Functional/Sead.lua
#	Moose Development/Moose/Modules.lua
#	Moose Development/Moose/Ops/ATIS.lua
#	Moose Development/Moose/Ops/Airboss.lua
#	Moose Development/Moose/Sound/UserSound.lua
#	Moose Development/Moose/Utilities/Enums.lua
#	Moose Development/Moose/Utilities/FiFo.lua
#	Moose Development/Moose/Utilities/Profiler.lua
#	Moose Development/Moose/Utilities/Routines.lua
#	Moose Development/Moose/Utilities/STTS.lua
#	Moose Development/Moose/Utilities/Utils.lua
#	Moose Development/Moose/Wrapper/Airbase.lua
#	Moose Development/Moose/Wrapper/Controllable.lua
#	Moose Development/Moose/Wrapper/Group.lua
#	Moose Development/Moose/Wrapper/Marker.lua
#	Moose Development/Moose/Wrapper/Positionable.lua
#	Moose Development/Moose/Wrapper/Unit.lua
#	Moose Setup/Moose.files
This commit is contained in:
Applevangelist
2022-09-06 09:53:22 +02:00
parent bf3ee93c23
commit 8cceee49ea
59 changed files with 8939 additions and 9472 deletions

View File

@@ -15,7 +15,6 @@
-- @module Wrapper.Marker
-- @image MOOSE_Core.JPG
--- Marker class.
-- @type MARKER
-- @field #string ClassName Name of the class.
@@ -24,7 +23,7 @@
-- @field #number mid Marker ID.
-- @field Core.Point#COORDINATE coordinate Coordinate of the mark.
-- @field #string text Text displayed in the mark panel.
-- @field #string message Message dispayed when the mark is added.
-- @field #string message Message displayed when the mark is added.
-- @field #boolean readonly Marker is read-only.
-- @field #number coalition Coalition to which the marker is displayed.
-- @extends Core.Fsm#FSM
@@ -42,29 +41,29 @@
-- # Create a Marker
--
-- -- Create a MARKER object at Batumi with a trivial text.
-- local Coordinate=AIRBASE:FindByName("Batumi"):GetCoordinate()
-- mymarker=MARKER:New(Coordinate, "I am Batumi Airfield")
-- local Coordinate = AIRBASE:FindByName( "Batumi" ):GetCoordinate()
-- mymarker = MARKER:New( Coordinate, "I am Batumi Airfield" )
--
-- Now this does **not** show the marker yet. We still need to specifiy to whom it is shown. There are several options, i.e.
-- show the marker to everyone, to a speficic coaliton only, or only to a specific group.
-- Now this does **not** show the marker yet. We still need to specify to whom it is shown. There are several options, i.e.
-- show the marker to everyone, to a specific coalition only, or only to a specific group.
--
-- ## For Everyone
--
-- If the marker should be visible to everyone, you can use the :ToAll() function.
--
-- mymarker=MARKER:New(Coordinate, "I am Batumi Airfield"):ToAll()
-- mymarker = MARKER:New( Coordinate, "I am Batumi Airfield" ):ToAll()
--
-- ## For a Coaliton
-- ## For a Coalition
--
-- If the maker should be visible to a specific coalition, you can use the :ToCoalition() function.
--
-- mymarker=MARKER:New(Coordinate, "I am Batumi Airfield"):ToCoaliton(coaliton.side.BLUE)
-- mymarker = MARKER:New( Coordinate , "I am Batumi Airfield" ):ToCoalition( coalition.side.BLUE )
--
-- ### To Blue Coaliton
-- ### To Blue Coalition
--
-- ### To Red Coalition
--
-- This would show the marker only to the Blue coaliton.
-- This would show the marker only to the Blue coalition.
--
-- ## For a Group
--
@@ -76,28 +75,28 @@
--
-- The marker text and coordinate can be updated easily as shown below.
--
-- However, note that **updateing involves to remove and recreate the marker if either text or its coordinate is changed**.
-- However, note that **updating involves to remove and recreate the marker if either text or its coordinate is changed**.
-- *This is a DCS scripting engine limitation.*
--
-- ## Update Text
--
-- If you created a marker "mymarker" as shown above, you can update the dispayed test by
-- If you created a marker "mymarker" as shown above, you can update the displayed test by
--
-- mymarker:UpdateText("I am the new text at Batumi")
-- mymarker:UpdateText( "I am the new text at Batumi" )
--
-- The update can also be delayed by, e.g. 90 seconds, using
--
-- mymarker:UpdateText("I am the new text at Batumi", 90)
-- mymarker:UpdateText( "I am the new text at Batumi", 90 )
--
-- ## Update Coordinate
--
-- If you created a marker "mymarker" as shown above, you can update its coordinate on the F10 map by
--
-- mymarker:UpdateCoordinate(NewCoordinate)
-- mymarker:UpdateCoordinate( NewCoordinate )
--
-- The update can also be delayed by, e.g. 60 seconds, using
--
-- mymarker:UpdateCoordinate(NewCoordinate, 60)
-- mymarker:UpdateCoordinate( NewCoordinate , 60 )
--
-- # Retrieve Data
--
@@ -105,18 +104,18 @@
--
-- ## Text
--
-- local text=mymarker:GetText()
-- env.info("Marker Text = " .. text)
-- local text =mymarker:GetText()
-- env.info( "Marker Text = " .. text )
--
-- ## Coordinate
--
-- local Coordinate=mymarker:GetCoordinate()
-- env.info("Marker Coordinate LL DSM = " .. Coordinate:ToStringLLDMS())
-- local Coordinate = mymarker:GetCoordinate()
-- env.info( "Marker Coordinate LL DSM = " .. Coordinate:ToStringLLDMS() )
--
--
-- # FSM Events
--
-- Moose creates addditonal events, so called FSM event, when markers are added, changed, removed, and text or the coordianteis updated.
-- Moose creates additional events, so called FSM event, when markers are added, changed, removed, and text or the coordinate is updated.
--
-- These events can be captured and used for processing via OnAfter functions as shown below.
--
@@ -133,22 +132,21 @@
--
-- # Examples
--
--
-- @field #MARKER
MARKER = {
ClassName = "MARKER",
Debug = false,
lid = nil,
mid = nil,
coordinate = nil,
text = nil,
message = nil,
readonly = nil,
coalition = nil,
ClassName = "MARKER",
Debug = false,
lid = nil,
mid = nil,
coordinate = nil,
text = nil,
message = nil,
readonly = nil,
coalition = nil,
}
--- Marker ID. Running number.
_MARKERID=0
_MARKERID = 0
--- Marker class version.
-- @field #string version
@@ -172,38 +170,40 @@ MARKER.version="0.1.1"
-- @param Core.Point#COORDINATE Coordinate Coordinate where to place the marker.
-- @param #string Text Text displayed on the mark panel.
-- @return #MARKER self
function MARKER:New(Coordinate, Text)
function MARKER:New( Coordinate, Text )
-- Inherit everything from FSM class.
local self = BASE:Inherit( self, FSM:New() ) -- #MARKER
local self=BASE:Inherit(self, FSM:New()) -- #MARKER
self.coordinate=UTILS.DeepCopy(Coordinate)
self.text=Text
self.text = Text
-- Defaults
self.readonly=false
self.message=""
self.readonly = false
self.message = ""
-- New marker ID. This is not the one of the actual marker.
_MARKERID=_MARKERID+1
_MARKERID = _MARKERID + 1
self.myid=_MARKERID
self.myid = _MARKERID
-- Log ID.
self.lid=string.format("Marker #%d | ", self.myid)
self.lid = string.format( "Marker #%d | ", self.myid )
-- Start State.
self:SetStartState("Invisible")
self:SetStartState( "Invisible" )
-- Add FSM transitions.
-- From State --> Event --> To State
self:AddTransition("Invisible", "Added", "Visible") -- Marker was added.
self:AddTransition("Visible", "Removed", "Invisible") -- Marker was removed.
self:AddTransition("*", "Changed", "*") -- Marker was changed.
self:AddTransition( "Invisible", "Added", "Visible" ) -- Marker was added.
self:AddTransition( "Visible", "Removed", "Invisible" ) -- Marker was removed.
self:AddTransition( "*", "Changed", "*" ) -- Marker was changed.
self:AddTransition("*", "TextUpdate", "*") -- Text updated.
self:AddTransition("*", "CoordUpdate", "*") -- Coordinates updated.
self:AddTransition( "*", "TextUpdate", "*" ) -- Text updated.
self:AddTransition( "*", "CoordUpdate", "*" ) -- Coordinates updated.
--- Triggers the FSM event "Added".
-- @function [parent=#MARKER] Added
@@ -223,7 +223,6 @@ function MARKER:New(Coordinate, Text)
-- @param #string To To state.
-- @param Core.Event#EVENTDATA EventData Event data table.
--- Triggers the FSM event "Removed".
-- @function [parent=#MARKER] Removed
-- @param #MARKER self
@@ -242,7 +241,6 @@ function MARKER:New(Coordinate, Text)
-- @param #string To To state.
-- @param Core.Event#EVENTDATA EventData Event data table.
--- Triggers the FSM event "Changed".
-- @function [parent=#MARKER] Changed
-- @param #MARKER self
@@ -261,7 +259,6 @@ function MARKER:New(Coordinate, Text)
-- @param #string To To state.
-- @param Core.Event#EVENTDATA EventData Event data table.
--- Triggers the FSM event "TextUpdate".
-- @function [parent=#MARKER] TextUpdate
-- @param #MARKER self
@@ -280,7 +277,6 @@ function MARKER:New(Coordinate, Text)
-- @param #string To To state.
-- @param #string Text The new text.
--- Triggers the FSM event "CoordUpdate".
-- @function [parent=#MARKER] CoordUpdate
-- @param #MARKER self
@@ -299,11 +295,10 @@ function MARKER:New(Coordinate, Text)
-- @param #string To To state.
-- @param Core.Point#COORDINATE Coordinate The updated Coordinate.
-- Handle events.
self:HandleEvent(EVENTS.MarkAdded)
self:HandleEvent(EVENTS.MarkRemoved)
self:HandleEvent(EVENTS.MarkChange)
self:HandleEvent( EVENTS.MarkAdded )
self:HandleEvent( EVENTS.MarkRemoved )
self:HandleEvent( EVENTS.MarkChange )
return self
end
@@ -317,7 +312,7 @@ end
-- @return #MARKER self
function MARKER:ReadOnly()
self.readonly=true
self.readonly = true
return self
end
@@ -336,9 +331,9 @@ end
-- @param #MARKER self
-- @param #string Text Message displayed when the marker is added.
-- @return #MARKER self
function MARKER:Message(Text)
function MARKER:Message( Text )
self.message=Text or ""
self.message = Text or ""
return self
end
@@ -347,28 +342,28 @@ end
-- @param #MARKER self
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:ToAll(Delay)
function MARKER:ToAll( Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.ToAll, self)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.ToAll, self )
else
self.toall=true
self.tocoaliton=nil
self.coalition=nil
self.togroup=nil
self.groupname=nil
self.groupid=nil
self.toall = true
self.tocoalition = nil
self.coalition = nil
self.togroup = nil
self.groupname = nil
self.groupid = nil
-- First remove an existing mark.
if self.shown then
self:Remove()
end
self.mid=UTILS.GetMarkID()
self.mid = UTILS.GetMarkID()
-- Call DCS function.
trigger.action.markToAll(self.mid, self.text, self.coordinate:GetVec3(), self.readonly, self.message)
trigger.action.markToAll( self.mid, self.text, self.coordinate:GetVec3(), self.readonly, self.message )
end
@@ -377,32 +372,32 @@ end
--- Place marker visible for a specific coalition only.
-- @param #MARKER self
-- @param #number Coalition Coalition 1=Red, 2=Blue, 0=Neutral. See `coaliton.side.RED`.
-- @param #number Coalition Coalition 1=Red, 2=Blue, 0=Neutral. See `coalition.side.RED`.
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:ToCoalition(Coalition, Delay)
function MARKER:ToCoalition( Coalition, Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.ToCoalition, self, Coalition)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.ToCoalition, self, Coalition )
else
self.coalition=Coalition
self.coalition = Coalition
self.tocoaliton=true
self.toall=false
self.togroup=false
self.groupname=nil
self.groupid=nil
self.tocoalition = true
self.toall = false
self.togroup = false
self.groupname = nil
self.groupid = nil
-- First remove an existing mark.
if self.shown then
self:Remove()
end
self.mid=UTILS.GetMarkID()
self.mid = UTILS.GetMarkID()
-- Call DCS function.
trigger.action.markToCoalition(self.mid, self.text, self.coordinate:GetVec3(), self.coalition, self.readonly, self.message)
trigger.action.markToCoalition( self.mid, self.text, self.coordinate:GetVec3(), self.coalition, self.readonly, self.message )
end
@@ -413,8 +408,8 @@ end
-- @param #MARKER self
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:ToBlue(Delay)
self:ToCoalition(coalition.side.BLUE, Delay)
function MARKER:ToBlue( Delay )
self:ToCoalition( coalition.side.BLUE, Delay )
return self
end
@@ -422,8 +417,8 @@ end
-- @param #MARKER self
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:ToRed(Delay)
self:ToCoalition(coalition.side.RED, Delay)
function MARKER:ToRed( Delay )
self:ToCoalition( coalition.side.RED, Delay )
return self
end
@@ -431,51 +426,50 @@ end
-- @param #MARKER self
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:ToNeutral(Delay)
self:ToCoalition(coalition.side.NEUTRAL, Delay)
function MARKER:ToNeutral( Delay )
self:ToCoalition( coalition.side.NEUTRAL, Delay )
return self
end
--- Place marker visible for a specific group only.
-- @param #MARKER self
-- @param Wrapper.Group#GROUP Group The group to which the marker is displayed.
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:ToGroup(Group, Delay)
function MARKER:ToGroup( Group, Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.ToGroup, self, Group)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.ToGroup, self, Group )
else
-- Check if group exists.
if Group and Group:IsAlive()~=nil then
if Group and Group:IsAlive() ~= nil then
self.groupid=Group:GetID()
self.groupid = Group:GetID()
if self.groupid then
self.groupname=Group:GetName()
self.groupname = Group:GetName()
self.togroup=true
self.tocoaliton=nil
self.coalition=nil
self.toall=nil
self.togroup = true
self.tocoalition = nil
self.coalition = nil
self.toall = nil
-- First remove an existing mark.
if self.shown then
self:Remove()
end
self.mid=UTILS.GetMarkID()
self.mid = UTILS.GetMarkID()
-- Call DCS function.
trigger.action.markToGroup(self.mid, self.text, self.coordinate:GetVec3(), self.groupid, self.readonly, self.message)
trigger.action.markToGroup( self.mid, self.text, self.coordinate:GetVec3(), self.groupid, self.readonly, self.message )
end
else
--TODO: Warning!
-- TODO: Warning!
end
end
@@ -488,17 +482,17 @@ end
-- @param #string Text Updated text.
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:UpdateText(Text, Delay)
function MARKER:UpdateText( Text, Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.UpdateText, self, Text)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.UpdateText, self, Text )
else
self.text=tostring(Text)
self.text = tostring( Text )
self:Refresh()
self:TextUpdate(tostring(Text))
self:TextUpdate( tostring( Text ) )
end
@@ -510,17 +504,17 @@ end
-- @param Core.Point#COORDINATE Coordinate The new coordinate.
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:UpdateCoordinate(Coordinate, Delay)
function MARKER:UpdateCoordinate( Coordinate, Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.UpdateCoordinate, self, Coordinate)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.UpdateCoordinate, self, Coordinate )
else
self.coordinate=Coordinate
self.coordinate = Coordinate
self:Refresh()
self:CoordUpdate(Coordinate)
self:CoordUpdate( Coordinate )
end
@@ -531,28 +525,28 @@ end
-- @param #MARKER self
-- @param #number Delay (Optional) Delay in seconds, before the marker is created.
-- @return #MARKER self
function MARKER:Refresh(Delay)
function MARKER:Refresh( Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.Refresh, self)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.Refresh, self )
else
if self.toall then
self:ToAll()
elseif self.tocoaliton then
elseif self.tocoalition then
self:ToCoalition(self.coalition)
self:ToCoalition( self.coalition )
elseif self.togroup then
local group=GROUP:FindByName(self.groupname)
local group = GROUP:FindByName( self.groupname )
self:ToGroup(group)
self:ToGroup( group )
else
self:E(self.lid.."ERROR: unknown To in :Refresh()!")
self:E( self.lid .. "ERROR: unknown To in :Refresh()!" )
end
end
@@ -564,16 +558,16 @@ end
-- @param #MARKER self
-- @param #number Delay (Optional) Delay in seconds, before the marker is removed.
-- @return #MARKER self
function MARKER:Remove(Delay)
function MARKER:Remove( Delay )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MARKER.Remove, self)
if Delay and Delay > 0 then
self:ScheduleOnce( Delay, MARKER.Remove, self )
else
if self.shown then
-- Call DCS function.
trigger.action.removeMark(self.mid)
trigger.action.removeMark( self.mid )
end
@@ -600,24 +594,23 @@ end
-- @param #MARKER self
-- @param #string Text Marker text. Default is an empty string "".
-- @return #MARKER self
function MARKER:SetText(Text)
self.text=Text and tostring(Text) or ""
function MARKER:SetText( Text )
self.text = Text and tostring( Text ) or ""
return self
end
--- Check if marker is currently visible on the F10 map.
-- @param #MARKER self
-- @return #boolean True if the marker is currently visible.
function MARKER:IsVisible()
return self:Is("Visible")
return self:Is( "Visible" )
end
--- Check if marker is currently invisible on the F10 map.
-- @param #MARKER self
-- @return
function MARKER:IsInvisible()
return self:Is("Invisible")
return self:Is( "Invisible" )
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -627,19 +620,19 @@ end
--- Event function when a MARKER is added.
-- @param #MARKER self
-- @param Core.Event#EVENTDATA EventData
function MARKER:OnEventMarkAdded(EventData)
function MARKER:OnEventMarkAdded( EventData )
if EventData and EventData.MarkID then
local MarkID=EventData.MarkID
local MarkID = EventData.MarkID
self:T3(self.lid..string.format("Captured event MarkAdded for Mark ID=%s", tostring(MarkID)))
self:T3( self.lid .. string.format( "Captured event MarkAdded for Mark ID=%s", tostring( MarkID ) ) )
if MarkID==self.mid then
if MarkID == self.mid then
self.shown=true
self.shown = true
self:Added(EventData)
self:Added( EventData )
end
@@ -650,19 +643,21 @@ end
--- Event function when a MARKER is removed.
-- @param #MARKER self
-- @param Core.Event#EVENTDATA EventData
function MARKER:OnEventMarkRemoved(EventData)
function MARKER:OnEventMarkRemoved( EventData )
if EventData and EventData.MarkID then
local MarkID = EventData.MarkID
local MarkID=EventData.MarkID
self:T3(self.lid..string.format("Captured event MarkRemoved for Mark ID=%s", tostring(MarkID)))
if MarkID==self.mid then
if MarkID == self.mid then
self.shown=false
self.shown = false
self:Removed(EventData)
self:Removed( EventData )
end
@@ -673,10 +668,16 @@ end
--- Event function when a MARKER changed.
-- @param #MARKER self
-- @param Core.Event#EVENTDATA EventData
function MARKER:OnEventMarkChange(EventData)
function MARKER:OnEventMarkChange( EventData )
if EventData and EventData.MarkID then
local MarkID = EventData.MarkID
self:T3( self.lid .. string.format( "Captured event MarkChange for Mark ID=%s", tostring( MarkID ) ) )
if MarkID == self.mid then
local MarkID=EventData.MarkID
self:T3(self.lid..string.format("Captured event MarkChange for Mark ID=%s", tostring(MarkID)))
@@ -692,7 +693,7 @@ function MARKER:OnEventMarkChange(EventData)
end
end
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- FSM Event Functions
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -703,17 +704,17 @@ end
-- @param #string Event Event.
-- @param #string To To state.
-- @param Core.Event#EVENTDATA EventData Event data table.
function MARKER:onafterAdded(From, Event, To, EventData)
function MARKER:onafterAdded( From, Event, To, EventData )
-- Debug info.
local text=string.format("Captured event MarkAdded for myself:\n")
text=text..string.format("Marker ID = %s\n", tostring(EventData.MarkID))
text=text..string.format("Coalition = %s\n", tostring(EventData.MarkCoalition))
text=text..string.format("Group ID = %s\n", tostring(EventData.MarkGroupID))
text=text..string.format("Initiator = %s\n", EventData.IniUnit and EventData.IniUnit:GetName() or "Nobody")
text=text..string.format("Coordinate = %s\n", EventData.MarkCoordinate and EventData.MarkCoordinate:ToStringLLDMS() or "Nowhere")
text=text..string.format("Text: \n%s", tostring(EventData.MarkText))
self:T2(self.lid..text)
local text = string.format( "Captured event MarkAdded for myself:\n" )
text = text .. string.format( "Marker ID = %s\n", tostring( EventData.MarkID ) )
text = text .. string.format( "Coalition = %s\n", tostring( EventData.MarkCoalition ) )
text = text .. string.format( "Group ID = %s\n", tostring( EventData.MarkGroupID ) )
text = text .. string.format( "Initiator = %s\n", EventData.IniUnit and EventData.IniUnit:GetName() or "Nobody" )
text = text .. string.format( "Coordinate = %s\n", EventData.MarkCoordinate and EventData.MarkCoordinate:ToStringLLDMS() or "Nowhere" )
text = text .. string.format( "Text: \n%s", tostring( EventData.MarkText ) )
self:T2( self.lid .. text )
end
@@ -723,17 +724,17 @@ end
-- @param #string Event Event.
-- @param #string To To state.
-- @param Core.Event#EVENTDATA EventData Event data table.
function MARKER:onafterRemoved(From, Event, To, EventData)
function MARKER:onafterRemoved( From, Event, To, EventData )
-- Debug info.
local text=string.format("Captured event MarkRemoved for myself:\n")
text=text..string.format("Marker ID = %s\n", tostring(EventData.MarkID))
text=text..string.format("Coalition = %s\n", tostring(EventData.MarkCoalition))
text=text..string.format("Group ID = %s\n", tostring(EventData.MarkGroupID))
text=text..string.format("Initiator = %s\n", EventData.IniUnit and EventData.IniUnit:GetName() or "Nobody")
text=text..string.format("Coordinate = %s\n", EventData.MarkCoordinate and EventData.MarkCoordinate:ToStringLLDMS() or "Nowhere")
text=text..string.format("Text: \n%s", tostring(EventData.MarkText))
self:T2(self.lid..text)
local text = string.format( "Captured event MarkRemoved for myself:\n" )
text = text .. string.format( "Marker ID = %s\n", tostring( EventData.MarkID ) )
text = text .. string.format( "Coalition = %s\n", tostring( EventData.MarkCoalition ) )
text = text .. string.format( "Group ID = %s\n", tostring( EventData.MarkGroupID ) )
text = text .. string.format( "Initiator = %s\n", EventData.IniUnit and EventData.IniUnit:GetName() or "Nobody" )
text = text .. string.format( "Coordinate = %s\n", EventData.MarkCoordinate and EventData.MarkCoordinate:ToStringLLDMS() or "Nowhere" )
text = text .. string.format( "Text: \n%s", tostring( EventData.MarkText ) )
self:T2( self.lid .. text )
end
@@ -743,17 +744,17 @@ end
-- @param #string Event Event.
-- @param #string To To state.
-- @param Core.Event#EVENTDATA EventData Event data table.
function MARKER:onafterChanged(From, Event, To, EventData)
function MARKER:onafterChanged( From, Event, To, EventData )
-- Debug info.
local text=string.format("Captured event MarkChange for myself:\n")
text=text..string.format("Marker ID = %s\n", tostring(EventData.MarkID))
text=text..string.format("Coalition = %s\n", tostring(EventData.MarkCoalition))
text=text..string.format("Group ID = %s\n", tostring(EventData.MarkGroupID))
text=text..string.format("Initiator = %s\n", EventData.IniUnit and EventData.IniUnit:GetName() or "Nobody")
text=text..string.format("Coordinate = %s\n", EventData.MarkCoordinate and EventData.MarkCoordinate:ToStringLLDMS() or "Nowhere")
text=text..string.format("Text: \n%s", tostring(EventData.MarkText))
self:T2(self.lid..text)
local text = string.format( "Captured event MarkChange for myself:\n" )
text = text .. string.format( "Marker ID = %s\n", tostring( EventData.MarkID ) )
text = text .. string.format( "Coalition = %s\n", tostring( EventData.MarkCoalition ) )
text = text .. string.format( "Group ID = %s\n", tostring( EventData.MarkGroupID ) )
text = text .. string.format( "Initiator = %s\n", EventData.IniUnit and EventData.IniUnit:GetName() or "Nobody" )
text = text .. string.format( "Coordinate = %s\n", EventData.MarkCoordinate and EventData.MarkCoordinate:ToStringLLDMS() or "Nowhere" )
text = text .. string.format( "Text: \n%s", tostring( EventData.MarkText ) )
self:T2( self.lid .. text )
end
@@ -763,9 +764,9 @@ end
-- @param #string Event Event.
-- @param #string To To state.
-- @param #string Text The updated text, displayed in the mark panel.
function MARKER:onafterTextUpdate(From, Event, To, Text)
function MARKER:onafterTextUpdate( From, Event, To, Text )
self:T(self.lid..string.format("New Marker Text:\n%s", Text))
self:T( self.lid .. string.format( "New Marker Text:\n%s", Text ) )
end
@@ -775,12 +776,8 @@ end
-- @param #string Event Event.
-- @param #string To To state.
-- @param Core.Point#COORDINATE Coordinate The updated coordinates.
function MARKER:onafterCoordUpdate(From, Event, To, Coordinate)
function MARKER:onafterCoordUpdate( From, Event, To, Coordinate )
self:T(self.lid..string.format("New Marker Coordinate in LL DMS: %s", Coordinate:ToStringLLDMS()))
self:T( self.lid .. string.format( "New Marker Coordinate in LL DMS: %s", Coordinate:ToStringLLDMS() ) )
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------