Added Docu for functions

This commit is contained in:
Applevangelist 2021-06-25 12:39:02 +02:00
parent 3b44aba341
commit 2ff128f184
2 changed files with 113 additions and 96 deletions

View File

@ -25,7 +25,7 @@
-- Date: June 2021 -- Date: June 2021
------------------------------------------------------------------------- -------------------------------------------------------------------------
--- **CSAR** class, extends #Core.Base#BASE, #Core.Fsm#FSM --- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
-- @type CSAR -- @type CSAR
-- @field #string ClassName Name of the class. -- @field #string ClassName Name of the class.
-- @field #number verbose Verbosity level. -- @field #number verbose Verbosity level.
@ -157,7 +157,7 @@
-- If missions designers want to spawn downed pilots into the field, e.g. at mission begin to give the helicopter guys works, they can do this like so: -- If missions designers want to spawn downed pilots into the field, e.g. at mission begin to give the helicopter guys works, they can do this like so:
-- --
-- -- Create downed "Pilot Wagner" in #ZONE "CSAR_Start_1" at a random point for the blue coalition -- -- Create downed "Pilot Wagner" in #ZONE "CSAR_Start_1" at a random point for the blue coalition
-- my_csar:_SpawnCsarAtZone( "CSAR_Start_1", coalition.side.BLUE, "Pilot Wagner", true ) -- my_csar:SpawnCSARAtZone( "CSAR_Start_1", coalition.side.BLUE, "Pilot Wagner", true )
-- --
-- --
-- @field #CSAR -- @field #CSAR
@ -240,7 +240,7 @@ CSAR.AircraftType["Mi-24V"] = 8
--- CSAR class version. --- CSAR class version.
-- @field #string version -- @field #string version
CSAR.version="0.1.4r3" CSAR.version="0.1.4r4"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list -- ToDo list
@ -452,7 +452,7 @@ end
--- Helper Functions --- --- Helper Functions ---
------------------------ ------------------------
--- Function to insert downed pilot tracker object. --- (Internal) Function to insert downed pilot tracker object.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Group#GROUP Group The #GROUP object -- @param Wrapper.Group#GROUP Group The #GROUP object
-- @param #string Groupname Name of the spawned group. -- @param #string Groupname Name of the spawned group.
@ -490,7 +490,7 @@ function CSAR:_CreateDownedPilotTrack(Group,Groupname,Side,OriginalUnit,Descript
self.downedpilotcounter = self.downedpilotcounter+1 self.downedpilotcounter = self.downedpilotcounter+1
end end
--- Count pilots on board. --- (Internal) Count pilots on board.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _heliName -- @param #string _heliName
-- @return #number count -- @return #number count
@ -505,7 +505,7 @@ function CSAR:_PilotsOnboard(_heliName)
return count return count
end end
--- Function to check for dupe eject events. --- (Internal) Function to check for dupe eject events.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _unitname Name of unit. -- @param #string _unitname Name of unit.
-- @return #boolean Outcome -- @return #boolean Outcome
@ -521,7 +521,7 @@ function CSAR:_DoubleEjection(_unitname)
return false return false
end end
--- Spawn a downed pilot --- (Internal) Spawn a downed pilot
-- @param #CSAR self -- @param #CSAR self
-- @param #number country Country for template. -- @param #number country Country for template.
-- @param Core.Point#COORDINATE point Coordinate to spawn at. -- @param Core.Point#COORDINATE point Coordinate to spawn at.
@ -547,7 +547,7 @@ function CSAR:_SpawnPilotInField(country,point)
return _spawnedGroup, alias -- Wrapper.Group#GROUP object return _spawnedGroup, alias -- Wrapper.Group#GROUP object
end end
--- Add options to a downed pilot --- (Internal) Add options to a downed pilot
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Group#GROUP group Group to use. -- @param Wrapper.Group#GROUP group Group to use.
function CSAR:_AddSpecialOptions(group) function CSAR:_AddSpecialOptions(group)
@ -581,7 +581,7 @@ function CSAR:_AddSpecialOptions(group)
end end
--- Function to spawn a CSAR object into the scene. --- (Internal) Function to spawn a CSAR object into the scene.
-- @param #CSAR self -- @param #CSAR self
-- @param #number _coalition Coalition -- @param #number _coalition Coalition
-- @param DCS#country.id _country Country ID -- @param DCS#country.id _country Country ID
@ -634,7 +634,7 @@ function CSAR:_AddCsar(_coalition , _country, _point, _typeName, _unitName, _pla
end end
--- Function to add a CSAR object into the scene at a zone coordinate. For mission designers wanting to add e.g. PoWs to the scene. --- (Internal) Function to add a CSAR object into the scene at a zone coordinate. For mission designers wanting to add e.g. PoWs to the scene.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _zone Name of the zone. -- @param #string _zone Name of the zone.
-- @param #number _coalition Coalition. -- @param #number _coalition Coalition.
@ -672,8 +672,24 @@ function CSAR:_SpawnCsarAtZone( _zone, _coalition, _description, _randomPoint, _
self:_AddCsar(_coalition, _country, pos, "PoW", "Unknown", nil, freq, _nomessage, _description) self:_AddCsar(_coalition, _country, pos, "PoW", "Unknown", nil, freq, _nomessage, _description)
end end
--- Function to add a CSAR object into the scene at a zone coordinate. For mission designers wanting to add e.g. PoWs to the scene.
-- @param #CSAR self
-- @param #string Zone Name of the zone.
-- @param #number Coalition Coalition.
-- @param #string Description (optional) Description.
-- @param #boolean RandomPoint (optional) Random yes or no.
-- @param #boolean Nomessage (optional) If true, don\'t send a message to SAR.
-- @usage If missions designers want to spawn downed pilots into the field, e.g. at mission begin, to give the helicopter guys works, they can do this like so:
--
-- -- Create downed "Pilot Wagner" in #ZONE "CSAR_Start_1" at a random point for the blue coalition
-- my_csar:SpawnCSARAtZone( "CSAR_Start_1", coalition.side.BLUE, "Pilot Wagner", true )
function CSAR:SpawnCSARAtZone(Zone, Coalition, Description, RandomPoint, Nomessage)
self:_SpawnCsarAtZone(Zone, Coalition, Description, RandomPoint, Nomessage)
return self
end
-- TODO: Split in functions per Event type -- TODO: Split in functions per Event type
--- Event handler. --- (Internal) Event handler.
-- @param #CSAR self -- @param #CSAR self
function CSAR:_EventHandler(EventData) function CSAR:_EventHandler(EventData)
self:T(self.lid .. " _EventHandler") self:T(self.lid .. " _EventHandler")
@ -836,7 +852,7 @@ function CSAR:_EventHandler(EventData)
end end
--- Initialize the action for a pilot. --- (Internal) Initialize the action for a pilot.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Group#GROUP _downedGroup The group to rescue. -- @param Wrapper.Group#GROUP _downedGroup The group to rescue.
-- @param #string _GroupName Name of the Group -- @param #string _GroupName Name of the Group
@ -864,7 +880,7 @@ function CSAR:_InitSARForPilot(_downedGroup, _GroupName, _freq, _nomessage)
self:__PilotDown(2,_downedGroup, _freqk, _leadername, _coordinatesText) self:__PilotDown(2,_downedGroup, _freqk, _leadername, _coordinatesText)
end end
--- Check if a name is in downed pilot table --- (Internal) Check if a name is in downed pilot table
-- @param #CSAR self -- @param #CSAR self
-- @param #string name Name to search for. -- @param #string name Name to search for.
-- @return #boolean Outcome. -- @return #boolean Outcome.
@ -883,7 +899,7 @@ function CSAR:_CheckNameInDownedPilots(name)
return found, table return found, table
end end
--- Check if a name is in downed pilot table and remove it. --- (Internal) Check if a name is in downed pilot table and remove it.
-- @param #CSAR self -- @param #CSAR self
-- @param #string name Name to search for. -- @param #string name Name to search for.
-- @param #boolean force Force removal. -- @param #boolean force Force removal.
@ -914,7 +930,7 @@ function CSAR:_RemoveNameFromDownedPilots(name,force)
return found return found
end end
--- Check state of wounded group. --- (Internal) Check state of wounded group.
-- @param #CSAR self -- @param #CSAR self
-- @param #string heliname heliname -- @param #string heliname heliname
-- @param #string woundedgroupname woundedgroupname -- @param #string woundedgroupname woundedgroupname
@ -967,7 +983,7 @@ function CSAR:_CheckWoundedGroupStatus(heliname,woundedgroupname)
end end
end end
--- Function to pop a smoke at a wounded pilot\'s positions. --- (Internal) Function to pop a smoke at a wounded pilot\'s positions.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _woundedGroupName Name of the group. -- @param #string _woundedGroupName Name of the group.
-- @param Wrapper.Group#GROUP _woundedLeader Object of the group. -- @param Wrapper.Group#GROUP _woundedLeader Object of the group.
@ -984,7 +1000,7 @@ function CSAR:_PopSmokeForGroup(_woundedGroupName, _woundedLeader)
end end
end end
--- Function to pickup the wounded pilot from the ground. --- (Internal) Function to pickup the wounded pilot from the ground.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Unit#UNIT _heliUnit Object of the group. -- @param Wrapper.Unit#UNIT _heliUnit Object of the group.
-- @param #string _pilotName Name of the pilot. -- @param #string _pilotName Name of the pilot.
@ -1035,7 +1051,7 @@ function CSAR:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupNam
return true return true
end end
--- Move group to destination. --- (Internal) Move group to destination.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Group#GROUP _leader -- @param Wrapper.Group#GROUP _leader
-- @param Core.Point#COORDINATE _destination -- @param Core.Point#COORDINATE _destination
@ -1048,7 +1064,7 @@ function CSAR:_OrderGroupToMoveToPoint(_leader, _destination)
group:RouteToVec2(coordinate,5) group:RouteToVec2(coordinate,5)
end end
--- Function to check if heli is close to group. --- (Internal) Function to check if heli is close to group.
-- @param #CSAR self -- @param #CSAR self
-- @param #number _distance -- @param #number _distance
-- @param Wrapper.Unit#UNIT _heliUnit -- @param Wrapper.Unit#UNIT _heliUnit
@ -1179,7 +1195,7 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
end end
end end
--- Check if group not KIA. --- (Internal) Check if group not KIA.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Group#GROUP _woundedGroup -- @param Wrapper.Group#GROUP _woundedGroup
-- @param #string _woundedGroupName -- @param #string _woundedGroupName
@ -1209,7 +1225,7 @@ function CSAR:_CheckGroupNotKIA(_woundedGroup, _woundedGroupName, _heliUnit, _he
return inTransit return inTransit
end end
--- Monitor in-flight returning groups. --- (Internal) Monitor in-flight returning groups.
-- @param #CSAR self -- @param #CSAR self
-- @param #string heliname Heli name -- @param #string heliname Heli name
-- @param #string groupname Group name -- @param #string groupname Group name
@ -1245,7 +1261,7 @@ function CSAR:_ScheduledSARFlight(heliname,groupname)
self:__Returning(-5,heliname,_woundedGroupName) self:__Returning(-5,heliname,_woundedGroupName)
end end
--- Mark pilot as rescued and remove from tables. --- (Internal) Mark pilot as rescued and remove from tables.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Unit#UNIT _heliUnit -- @param Wrapper.Unit#UNIT _heliUnit
function CSAR:_RescuePilots(_heliUnit) function CSAR:_RescuePilots(_heliUnit)
@ -1270,7 +1286,7 @@ function CSAR:_RescuePilots(_heliUnit)
self:__Rescued(-1,_heliUnit,_heliName, PilotsSaved) self:__Rescued(-1,_heliUnit,_heliName, PilotsSaved)
end end
--- Check and return Wrappe.Unit#UNIT based on the name if alive. --- (Internal) Check and return Wrappe.Unit#UNIT based on the name if alive.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _unitname Name of Unit -- @param #string _unitname Name of Unit
-- @return #UNIT or nil -- @return #UNIT or nil
@ -1284,7 +1300,7 @@ function CSAR:_GetSARHeli(_unitName)
end end
end end
--- Display message to single Unit. --- (Internal) Display message to single Unit.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Unit#UNIT _unit Unit #UNIT to display to. -- @param Wrapper.Unit#UNIT _unit Unit #UNIT to display to.
-- @param #string _text Text of message. -- @param #string _text Text of message.
@ -1308,7 +1324,7 @@ function CSAR:_DisplayMessageToSAR(_unit, _text, _time, _clear, _speak)
end end
end end
--- Function to get string of a group\'s position. --- (Internal) Function to get string of a group\'s position.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Controllable#CONTROLLABLE _woundedGroup Group or Unit object. -- @param Wrapper.Controllable#CONTROLLABLE _woundedGroup Group or Unit object.
-- @return #string Coordinates as Text -- @return #string Coordinates as Text
@ -1334,7 +1350,7 @@ function CSAR:_GetPositionOfWounded(_woundedGroup)
return _coordinatesText return _coordinatesText
end end
--- Display active SAR tasks to player. --- (Internal) Display active SAR tasks to player.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _unitName Unit to display to -- @param #string _unitName Unit to display to
function CSAR:_DisplayActiveSAR(_unitName) function CSAR:_DisplayActiveSAR(_unitName)
@ -1386,7 +1402,7 @@ function CSAR:_DisplayActiveSAR(_unitName)
self:_DisplayMessageToSAR(_heli, _msg, self.messageTime*2) self:_DisplayMessageToSAR(_heli, _msg, self.messageTime*2)
end end
--- Find the closest downed pilot to a heli. --- (Internal) Find the closest downed pilot to a heli.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Unit#UNIT _heli Helicopter #UNIT -- @param Wrapper.Unit#UNIT _heli Helicopter #UNIT
-- @return #table Table of results -- @return #table Table of results
@ -1420,7 +1436,7 @@ function CSAR:_GetClosestDownedPilot(_heli)
return { pilot = _closestGroup, distance = _shortestDistance, groupInfo = _closestGroupInfo } return { pilot = _closestGroup, distance = _shortestDistance, groupInfo = _closestGroupInfo }
end end
--- Fire a flare at the point of a downed pilot. --- (Internal) Fire a flare at the point of a downed pilot.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _unitName Name of the unit. -- @param #string _unitName Name of the unit.
function CSAR:_SignalFlare(_unitName) function CSAR:_SignalFlare(_unitName)
@ -1455,7 +1471,7 @@ function CSAR:_SignalFlare(_unitName)
end end
end end
--- Display info to all SAR groups. --- (Internal) Display info to all SAR groups.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _message Message to display. -- @param #string _message Message to display.
-- @param #number _side Coalition of message. -- @param #number _side Coalition of message.
@ -1472,7 +1488,7 @@ function CSAR:_DisplayToAllSAR(_message, _side, _messagetime)
end end
end end
---Request smoke at closest downed pilot. ---(Internal) Request smoke at closest downed pilot.
--@param #CSAR self --@param #CSAR self
--@param #string _unitName Name of the helicopter --@param #string _unitName Name of the helicopter
function CSAR:_Reqsmoke( _unitName ) function CSAR:_Reqsmoke( _unitName )
@ -1504,7 +1520,7 @@ function CSAR:_Reqsmoke( _unitName )
end end
end end
--- Determine distance to closest MASH. --- (Internal) Determine distance to closest MASH.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Unit#UNIT _heli Helicopter #UNIT -- @param Wrapper.Unit#UNIT _heli Helicopter #UNIT
-- @retunr -- @retunr
@ -1559,7 +1575,7 @@ function CSAR:_GetClosestMASH(_heli)
end end
end end
--- Display onboarded rescued pilots. --- (Internal) Display onboarded rescued pilots.
-- @param #CSAR self -- @param #CSAR self
-- @param #string _unitName Name of the chopper -- @param #string _unitName Name of the chopper
function CSAR:_CheckOnboard(_unitName) function CSAR:_CheckOnboard(_unitName)
@ -1581,7 +1597,7 @@ function CSAR:_CheckOnboard(_unitName)
end end
end end
--- Populate F10 menu for CSAR players. --- (Internal) Populate F10 menu for CSAR players.
-- @param #CSAR self -- @param #CSAR self
function CSAR:_AddMedevacMenuItem() function CSAR:_AddMedevacMenuItem()
self:T(self.lid .. " _AddMedevacMenuItem") self:T(self.lid .. " _AddMedevacMenuItem")
@ -1624,7 +1640,7 @@ function CSAR:_AddMedevacMenuItem()
return return
end end
--- Return distance in meters between two coordinates. --- (Internal) Return distance in meters between two coordinates.
-- @param #CSAR self -- @param #CSAR self
-- @param Core.Point#COORDINATE _point1 Coordinate one -- @param Core.Point#COORDINATE _point1 Coordinate one
-- @param Core.Point#COORDINATE _point2 Coordinate two -- @param Core.Point#COORDINATE _point2 Coordinate two
@ -1639,7 +1655,7 @@ function CSAR:_GetDistance(_point1, _point2)
end end
end end
--- Populate table with available beacon frequencies. --- (Internal) Populate table with available beacon frequencies.
-- @param #CSAR self -- @param #CSAR self
function CSAR:_GenerateVHFrequencies() function CSAR:_GenerateVHFrequencies()
self:T(self.lid .. " _GenerateVHFrequencies") self:T(self.lid .. " _GenerateVHFrequencies")
@ -1710,7 +1726,7 @@ function CSAR:_GenerateVHFrequencies()
self.FreeVHFFrequencies = FreeVHFFrequencies self.FreeVHFFrequencies = FreeVHFFrequencies
end end
--- Pop frequency from prepopulated table. --- (Internal) Pop frequency from prepopulated table.
-- @param #CSAR self -- @param #CSAR self
-- @return #number frequency -- @return #number frequency
function CSAR:_GenerateADFFrequency() function CSAR:_GenerateADFFrequency()
@ -1724,7 +1740,7 @@ function CSAR:_GenerateADFFrequency()
return _vhf return _vhf
end end
--- Function to determine clockwise direction for flares. --- (Internal) Function to determine clockwise direction for flares.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Unit#UNIT _heli The Helicopter -- @param Wrapper.Unit#UNIT _heli The Helicopter
-- @param Wrapper.Group#GROUP _group The downed Group -- @param Wrapper.Group#GROUP _group The downed Group
@ -1748,7 +1764,7 @@ function CSAR:_GetClockDirection(_heli, _group)
return clock return clock
end end
--- Function to add beacon to downed pilot. --- (Internal) Function to add beacon to downed pilot.
-- @param #CSAR self -- @param #CSAR self
-- @param Wrapper.Group#GROUP _group Group #GROUP object. -- @param Wrapper.Group#GROUP _group Group #GROUP object.
-- @param #number _freq Frequency to use -- @param #number _freq Frequency to use
@ -1774,7 +1790,7 @@ function CSAR:_AddBeaconToGroup(_group, _freq)
end end
end end
--- Helper function to (re-)add beacon to downed pilot. --- (Internal) Helper function to (re-)add beacon to downed pilot.
-- @param #CSAR self -- @param #CSAR self
-- @param #table _args Arguments -- @param #table _args Arguments
function CSAR:_RefreshRadioBeacons() function CSAR:_RefreshRadioBeacons()
@ -1790,7 +1806,7 @@ function CSAR:_RefreshRadioBeacons()
end end
end end
--- Helper function to count active downed pilots. --- (Internal) Helper function to count active downed pilots.
-- @param #CSAR self -- @param #CSAR self
-- @return #number Number of pilots in the field. -- @return #number Number of pilots in the field.
function CSAR:_CountActiveDownedPilots() function CSAR:_CountActiveDownedPilots()
@ -1805,7 +1821,7 @@ function CSAR:_CountActiveDownedPilots()
return PilotsInFieldN return PilotsInFieldN
end end
--- Helper to decide if we're over max limit. --- (Internal) Helper to decide if we're over max limit.
-- @param #CSAR self -- @param #CSAR self
-- @return #boolean True or false. -- @return #boolean True or false.
function CSAR:_ReachedPilotLimit() function CSAR:_ReachedPilotLimit()
@ -1824,7 +1840,7 @@ end
--- FSM internal Functions --- --- FSM internal Functions ---
------------------------------ ------------------------------
--- Function called after Start() event. --- (Internal) Function called after Start() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1850,7 +1866,7 @@ function CSAR:onafterStart(From, Event, To)
return self return self
end end
--- Function called before Status() event. --- (Internal) Function called before Status() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1875,7 +1891,7 @@ function CSAR:onbeforeStatus(From, Event, To)
return self return self
end end
--- Function called after Status() event. --- (Internal) Function called after Status() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1912,7 +1928,7 @@ function CSAR:onafterStatus(From, Event, To)
return self return self
end end
--- Function called after Stop() event. --- (Internal) Function called after Stop() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1930,7 +1946,7 @@ function CSAR:onafterStop(From, Event, To)
return self return self
end end
--- Function called before Approach() event. --- (Internal) Function called before Approach() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1943,7 +1959,7 @@ function CSAR:onbeforeApproach(From, Event, To, Heliname, Woundedgroupname)
return self return self
end end
--- Function called before Boarded() event. --- (Internal) Function called before Boarded() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1956,7 +1972,7 @@ function CSAR:onbeforeBoarded(From, Event, To, Heliname, Woundedgroupname)
return self return self
end end
--- Function called before Returning() event. --- (Internal) Function called before Returning() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1969,7 +1985,7 @@ function CSAR:onbeforeReturning(From, Event, To, Heliname, Woundedgroupname)
return self return self
end end
--- Function called before Rescued() event. --- (Internal) Function called before Rescued() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.
@ -1984,7 +2000,7 @@ function CSAR:onbeforeRescued(From, Event, To, HeliUnit, HeliName, PilotsSaved)
return self return self
end end
--- Function called before PilotDown() event. --- (Internal) Function called before PilotDown() event.
-- @param #CSAR self. -- @param #CSAR self.
-- @param #string From From state. -- @param #string From From state.
-- @param #string Event Event triggered. -- @param #string Event Event triggered.

View File

@ -8,7 +8,7 @@
-- --
-- ## Missions: -- ## Missions:
-- --
-- ### [CTLD - Combat Troop & Logistics Deployment](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/) -- ### [CTLD - Combat Troop & Logistics Deployment](https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/develop/OPS%20-%20CTLD)
-- --
-- === -- ===
-- --
@ -180,7 +180,7 @@ end
do do
------------------------------------------------------------------------- -------------------------------------------------------------------------
--- **CTLD** class, extends #Core.Base#BASE, #Core.Fsm#FSM --- **CTLD** class, extends Core.Base#BASE, Core.Fsm#FSM
-- @type CTLD -- @type CTLD
-- @field #string ClassName Name of the class. -- @field #string ClassName Name of the class.
-- @field #number verbose Verbosity level. -- @field #number verbose Verbosity level.
@ -489,7 +489,7 @@ CTLD.SkipFrequencies = {
--- CTLD class version. --- CTLD class version.
-- @field #string version -- @field #string version
CTLD.version="0.1.1b1" CTLD.version="0.1.1b2"
--- Instantiate a new CTLD. --- Instantiate a new CTLD.
-- @param #CTLD self -- @param #CTLD self
@ -703,7 +703,7 @@ end
-- Helper and User Functions -- Helper and User Functions
------------------------------------------------------------------- -------------------------------------------------------------------
--- Function to generate valid UHF Frequencies --- (Internal) Function to generate valid UHF Frequencies
-- @param #CTLD self -- @param #CTLD self
function CTLD:_GenerateUHFrequencies() function CTLD:_GenerateUHFrequencies()
self:T(self.lid .. " _GenerateUHFrequencies") self:T(self.lid .. " _GenerateUHFrequencies")
@ -718,7 +718,7 @@ function CTLD:_GenerateUHFrequencies()
return self return self
end end
--- Function to generate valid FM Frequencies --- (Internal) Function to generate valid FM Frequencies
-- @param #CTLD sel -- @param #CTLD sel
function CTLD:_GenerateFMFrequencies() function CTLD:_GenerateFMFrequencies()
self:T(self.lid .. " _GenerateFMrequencies") self:T(self.lid .. " _GenerateFMrequencies")
@ -742,7 +742,7 @@ function CTLD:_GenerateFMFrequencies()
return self return self
end end
--- Populate table with available VHF beacon frequencies. --- (Internal) Populate table with available VHF beacon frequencies.
-- @param #CTLD self -- @param #CTLD self
function CTLD:_GenerateVHFrequencies() function CTLD:_GenerateVHFrequencies()
self:T(self.lid .. " _GenerateVHFrequencies") self:T(self.lid .. " _GenerateVHFrequencies")
@ -806,7 +806,7 @@ function CTLD:_GenerateVHFrequencies()
return self return self
end end
--- Function to generate valid laser codes. --- (Internal) Function to generate valid laser codes.
-- @param #CTLD self -- @param #CTLD self
function CTLD:_GenerateLaserCodes() function CTLD:_GenerateLaserCodes()
self:T(self.lid .. " _GenerateLaserCodes") self:T(self.lid .. " _GenerateLaserCodes")
@ -828,7 +828,7 @@ function CTLD:_GenerateLaserCodes()
end end
end end
--- Helper function to generate laser codes. --- (Internal) Helper function to generate laser codes.
-- @param #CTLD self -- @param #CTLD self
-- @param #number _number -- @param #number _number
-- @param #number _numberToFind -- @param #number _numberToFind
@ -846,7 +846,7 @@ function CTLD:_ContainsDigit(_number, _numberToFind)
return false return false
end end
--- Event handler function --- (Internal) Event handler function
-- @param #CTLD self -- @param #CTLD self
-- @param Core.Event#EVENTDATA EventData -- @param Core.Event#EVENTDATA EventData
function CTLD:_EventHandler(EventData) function CTLD:_EventHandler(EventData)
@ -873,7 +873,7 @@ function CTLD:_EventHandler(EventData)
return self return self
end end
--- Function to load troops into a heli. --- (Internal) Function to load troops into a heli.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -930,7 +930,7 @@ function CTLD:_LoadTroops(Group, Unit, Cargotype)
return self return self
end end
--- Function to spawn crates in front of the heli. --- (Internal) Function to spawn crates in front of the heli.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -1011,7 +1011,7 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop)
return self return self
end end
--- Function to find and list nearby crates. --- (Internal) Function to find and list nearby crates.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -1045,7 +1045,7 @@ function CTLD:_ListCratesNearby( _group, _unit)
return self return self
end end
--- Return distance in meters between two coordinates. --- (Internal) Return distance in meters between two coordinates.
-- @param #CTLD self -- @param #CTLD self
-- @param Core.Point#COORDINATE _point1 Coordinate one -- @param Core.Point#COORDINATE _point1 Coordinate one
-- @param Core.Point#COORDINATE _point2 Coordinate two -- @param Core.Point#COORDINATE _point2 Coordinate two
@ -1060,7 +1060,7 @@ function CTLD:_GetDistance(_point1, _point2)
end end
end end
--- Function to find and return nearby crates. --- (Internal) Function to find and return nearby crates.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP _group Group -- @param Wrapper.Group#GROUP _group Group
-- @param Wrapper.Unit#UNIT _unit Unit -- @param Wrapper.Unit#UNIT _unit Unit
@ -1094,7 +1094,7 @@ function CTLD:_FindCratesNearby( _group, _unit, _dist)
return found, index return found, index
end end
--- Function to get and load nearby crates. --- (Internal) Function to get and load nearby crates.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -1194,7 +1194,7 @@ function CTLD:_LoadCratesNearby(Group, Unit)
return self return self
end end
--- Function to list loaded cargo. --- (Internal) Function to list loaded cargo.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -1249,7 +1249,7 @@ function CTLD:_ListCargo(Group, Unit)
return self return self
end end
--- Function to unload troops from heli. --- (Internal) Function to unload troops from heli.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -1326,7 +1326,7 @@ function CTLD:_UnloadTroops(Group, Unit)
return self return self
end end
--- Function to unload crates from heli. --- (Internal) Function to unload crates from heli.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrappe.Unit#UNIT Unit -- @param Wrappe.Unit#UNIT Unit
@ -1384,7 +1384,7 @@ function CTLD:_UnloadCrates(Group, Unit)
return self return self
end end
--- Function to build nearby crates. --- (Internal) Function to build nearby crates.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrappe.Unit#UNIT Unit -- @param Wrappe.Unit#UNIT Unit
@ -1464,7 +1464,7 @@ function CTLD:_BuildCrates(Group, Unit)
return self return self
end end
--- Function to actually SPAWN buildables in the mission. --- (Internal) Function to actually SPAWN buildables in the mission.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Group#UNIT Unit -- @param Wrapper.Group#UNIT Unit
@ -1496,7 +1496,7 @@ function CTLD:_BuildObjectFromCrates(Group,Unit,Build)
return self return self
end end
--- Function to move group to WP zone. --- (Internal) Function to move group to WP zone.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group The Group to move. -- @param Wrapper.Group#GROUP Group The Group to move.
function CTLD:_MoveGroupToZone(Group) function CTLD:_MoveGroupToZone(Group)
@ -1523,7 +1523,7 @@ function CTLD:_MoveGroupToZone(Group)
return self return self
end end
--- Housekeeping - Cleanup crates when build --- (Internal) Housekeeping - Cleanup crates when build
-- @param #CTLD self -- @param #CTLD self
-- @param #table Crates Table of #CTLD_CARGO objects near the unit. -- @param #table Crates Table of #CTLD_CARGO objects near the unit.
-- @param #CTLD.Buildable Build Table build object. -- @param #CTLD.Buildable Build Table build object.
@ -1575,7 +1575,7 @@ function CTLD:_CleanUpCrates(Crates,Build,Number)
return self return self
end end
--- Housekeeping - Function to refresh F10 menus. --- (Internal) Housekeeping - Function to refresh F10 menus.
-- @param #CTLD self -- @param #CTLD self
-- @return #CTLD self -- @return #CTLD self
function CTLD:_RefreshF10Menus() function CTLD:_RefreshF10Menus()
@ -1747,7 +1747,7 @@ function CTLD:DeactivateZone(Name,ZoneType)
return self return self
end end
--- Function to obtain a valid FM frequency. --- (Internal) Function to obtain a valid FM frequency.
-- @param #CTLD self -- @param #CTLD self
-- @param #string Name Name of zone. -- @param #string Name Name of zone.
-- @return #CTLD.ZoneBeacon Beacon Beacon table. -- @return #CTLD.ZoneBeacon Beacon Beacon table.
@ -1768,7 +1768,7 @@ function CTLD:_GetFMBeacon(Name)
return beacon return beacon
end end
--- Function to obtain a valid UHF frequency. --- (Internal) Function to obtain a valid UHF frequency.
-- @param #CTLD self -- @param #CTLD self
-- @param #string Name Name of zone. -- @param #string Name Name of zone.
-- @return #CTLD.ZoneBeacon Beacon Beacon table. -- @return #CTLD.ZoneBeacon Beacon Beacon table.
@ -1789,7 +1789,7 @@ function CTLD:_GetUHFBeacon(Name)
return beacon return beacon
end end
--- Function to obtain a valid VHF frequency. --- (Internal) Function to obtain a valid VHF frequency.
-- @param #CTLD self -- @param #CTLD self
-- @param #string Name Name of zone. -- @param #string Name Name of zone.
-- @return #CTLD.ZoneBeacon Beacon Beacon table. -- @return #CTLD.ZoneBeacon Beacon Beacon table.
@ -1845,7 +1845,7 @@ function CTLD:AddCTLDZone(Name, Type, Color, Active, HasBeacon)
return self return self
end end
--- Function to show list of radio beacons --- (Internal) Function to show list of radio beacons
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -1878,7 +1878,7 @@ function CTLD:_ListRadioBeacons(Group, Unit)
return self return self
end end
--- Add radio beacon to zone. Runs 30 secs. --- (Internal) Add radio beacon to zone. Runs 30 secs.
-- @param #CTLD self -- @param #CTLD self
-- @param #string Name Name of zone. -- @param #string Name Name of zone.
-- @param #string Sound Name of soundfile. -- @param #string Sound Name of soundfile.
@ -1898,7 +1898,7 @@ function CTLD:_AddRadioBeacon(Name, Sound, Mhz, Modulation)
return self return self
end end
--- Function to refresh radio beacons --- (Internal) Function to refresh radio beacons
-- @param #CTLD self -- @param #CTLD self
function CTLD:_RefreshRadioBeacons() function CTLD:_RefreshRadioBeacons()
self:I(self.lid .. " _RefreshRadioBeacons") self:I(self.lid .. " _RefreshRadioBeacons")
@ -1926,7 +1926,7 @@ function CTLD:_RefreshRadioBeacons()
return self return self
end end
--- function to see if a unit is in a specific zone type. --- (Internal) Function to see if a unit is in a specific zone type.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit Unit -- @param Wrapper.Unit#UNIT Unit Unit
-- @param #CTLD.CargoZoneType Zonetype Zonetype -- @param #CTLD.CargoZoneType Zonetype Zonetype
@ -1978,7 +1978,7 @@ function CTLD:IsUnitInZone(Unit,Zonetype)
return outcome, zonenameret, zoneret, maxdist return outcome, zonenameret, zoneret, maxdist
end end
--- Userfunction - Start smoke in a zone close to the Unit. --- User function - Start smoke in a zone close to the Unit.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit The Unit. -- @param Wrapper.Unit#UNIT Unit The Unit.
-- @param #boolean Flare If true, flare instead. -- @param #boolean Flare If true, flare instead.
@ -2020,6 +2020,7 @@ function CTLD:SmokeZoneNearBy(Unit, Flare)
end end
return self return self
end end
--- User - Function to add/adjust unittype capabilities. --- User - Function to add/adjust unittype capabilities.
-- @param #CTLD self -- @param #CTLD self
-- @param #string Unittype The unittype to adjust. If passed as Wrapper.Unit#UNIT, it will search for the unit in the mission. -- @param #string Unittype The unittype to adjust. If passed as Wrapper.Unit#UNIT, it will search for the unit in the mission.
@ -2050,7 +2051,7 @@ end
return self return self
end end
--- Check if a unit is hovering *in parameters*. --- (Internal) Check if a unit is hovering *in parameters*.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
-- @return #boolean Outcome -- @return #boolean Outcome
@ -2077,7 +2078,7 @@ end
return outcome return outcome
end end
--- List if a unit is hovering *in parameters*. --- (Internal) List if a unit is hovering *in parameters*.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Group#GROUP Group -- @param Wrapper.Group#GROUP Group
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
@ -2090,7 +2091,7 @@ end
return self return self
end end
--- Check if a unit is in a load zone and is hovering in parameters. --- (Internal) Check if a unit is in a load zone and is hovering in parameters.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
-- @return #boolean Outcome -- @return #boolean Outcome
@ -2100,7 +2101,7 @@ end
return outcome return outcome
end end
--- Check if a unit is above ground. --- (Internal) Check if a unit is above ground.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
-- @return #boolean Outcome -- @return #boolean Outcome
@ -2117,7 +2118,7 @@ end
end end
end end
--- Autoload if we can do crates, have capacity free and are in a load zone. --- (Internal) Autoload if we can do crates, have capacity free and are in a load zone.
-- @param #CTLD self -- @param #CTLD self
-- @param Wrapper.Unit#UNIT Unit -- @param Wrapper.Unit#UNIT Unit
-- @return #CTLD self -- @return #CTLD self
@ -2147,7 +2148,7 @@ end
return self return self
end end
--- Run through all pilots and see if we autoload. --- (Internal) Run through all pilots and see if we autoload.
-- @param #CTLD self -- @param #CTLD self
-- @return #CTLD self -- @return #CTLD self
function CTLD:CheckAutoHoverload() function CTLD:CheckAutoHoverload()
@ -2164,7 +2165,7 @@ end
-- FSM functions -- FSM functions
------------------------------------------------------------------- -------------------------------------------------------------------
--- FSM Function onafterStart. --- (Internal) FSM Function onafterStart.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2185,7 +2186,7 @@ end
return self return self
end end
--- FSM Function onbeforeStatus. --- (Internal) FSM Function onbeforeStatus.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2199,7 +2200,7 @@ end
return self return self
end end
--- FSM Function onafterStatus. --- (Internal) FSM Function onafterStatus.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2232,7 +2233,7 @@ end
return self return self
end end
--- FSM Function onafterStop. --- (Internal) FSM Function onafterStop.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2246,7 +2247,7 @@ end
return self return self
end end
--- FSM Function onbeforeTroopsPickedUp. --- (Internal) FSM Function onbeforeTroopsPickedUp.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2260,7 +2261,7 @@ end
return self return self
end end
--- FSM Function onbeforeCratesPickedUp. --- (Internal) FSM Function onbeforeCratesPickedUp.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State . -- @param #string From State .
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2274,7 +2275,7 @@ end
return self return self
end end
--- FSM Function onbeforeTroopsDeployed. --- (Internal) FSM Function onbeforeTroopsDeployed.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2288,7 +2289,7 @@ end
return self return self
end end
--- FSM Function onbeforeCratesDropped. --- (Internal) FSM Function onbeforeCratesDropped.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.
@ -2302,7 +2303,7 @@ end
return self return self
end end
--- FSM Function onbeforeCratesBuild. --- (Internal) FSM Function onbeforeCratesBuild.
-- @param #CTLD self -- @param #CTLD self
-- @param #string From State. -- @param #string From State.
-- @param #string Event Trigger. -- @param #string Event Trigger.