mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
commit
982bd89924
@ -2361,7 +2361,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Set flashing player messages on or off
|
--- Set flashing player messages on or off
|
||||||
-- @param #AI_A2G_DISPATCHER self
|
-- @param #AI_A2A_DISPATCHER self
|
||||||
-- @param #boolean onoff Set messages on (true) or off (false)
|
-- @param #boolean onoff Set messages on (true) or off (false)
|
||||||
function AI_A2A_DISPATCHER:SetSendMessages( onoff )
|
function AI_A2A_DISPATCHER:SetSendMessages( onoff )
|
||||||
self.SetSendPlayerMessages = onoff
|
self.SetSendPlayerMessages = onoff
|
||||||
|
|||||||
@ -194,7 +194,12 @@ do -- COORDINATE
|
|||||||
-- ## 9) Coordinate text generation
|
-- ## 9) Coordinate text generation
|
||||||
--
|
--
|
||||||
-- * @{#COORDINATE.ToStringBR}(): Generates a Bearing & Range text in the format of DDD for DI where DDD is degrees and DI is distance.
|
-- * @{#COORDINATE.ToStringBR}(): Generates a Bearing & Range text in the format of DDD for DI where DDD is degrees and DI is distance.
|
||||||
-- * @{#COORDINATE.ToStringLL}(): Generates a Latutude & Longutude text.
|
-- * @{#COORDINATE.ToStringBRA}(): Generates a Bearing, Range & Altitude text.
|
||||||
|
-- * @{#COORDINATE.ToStringBRAANATO}(): Generates a Generates a Bearing, Range, Aspect & Altitude text in NATOPS.
|
||||||
|
-- * @{#COORDINATE.ToStringLL}(): Generates a Latutide & Longitude text.
|
||||||
|
-- * @{#COORDINATE.ToStringLLDMS}(): Generates a Lat, Lon, Degree, Minute, Second text.
|
||||||
|
-- * @{#COORDINATE.ToStringLLDDM}(): Generates a Lat, Lon, Degree, decimal Minute text.
|
||||||
|
-- * @{#COORDINATE.ToStringMGRS}(): Generates a MGRS grid coordinate text.
|
||||||
--
|
--
|
||||||
-- ## 10) Drawings on F10 map
|
-- ## 10) Drawings on F10 map
|
||||||
--
|
--
|
||||||
@ -1112,25 +1117,28 @@ do -- COORDINATE
|
|||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param #number Distance The distance in meters.
|
-- @param #number Distance The distance in meters.
|
||||||
-- @param Core.Settings#SETTINGS Settings
|
-- @param Core.Settings#SETTINGS Settings
|
||||||
|
-- @param #string Language (optional) "EN" or "RU"
|
||||||
|
-- @param #number Precision (optional) round to this many decimal places
|
||||||
-- @return #string The distance text expressed in the units of measurement.
|
-- @return #string The distance text expressed in the units of measurement.
|
||||||
function COORDINATE:GetDistanceText( Distance, Settings, Language )
|
function COORDINATE:GetDistanceText( Distance, Settings, Language, Precision )
|
||||||
|
|
||||||
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
||||||
local Language = Language or "EN"
|
local Language = Language or "EN"
|
||||||
|
local Precision = Precision or 0
|
||||||
|
|
||||||
local DistanceText
|
local DistanceText
|
||||||
|
|
||||||
if Settings:IsMetric() then
|
if Settings:IsMetric() then
|
||||||
if Language == "EN" then
|
if Language == "EN" then
|
||||||
DistanceText = " for " .. UTILS.Round( Distance / 1000, 2 ) .. " km"
|
DistanceText = " for " .. UTILS.Round( Distance / 1000, Precision ) .. " km"
|
||||||
elseif Language == "RU" then
|
elseif Language == "RU" then
|
||||||
DistanceText = " за " .. UTILS.Round( Distance / 1000, 2 ) .. " километров"
|
DistanceText = " за " .. UTILS.Round( Distance / 1000, Precision ) .. " километров"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Language == "EN" then
|
if Language == "EN" then
|
||||||
DistanceText = " for " .. UTILS.Round( UTILS.MetersToNM( Distance ), 2 ) .. " miles"
|
DistanceText = " for " .. UTILS.Round( UTILS.MetersToNM( Distance ), Precision ) .. " miles"
|
||||||
elseif Language == "RU" then
|
elseif Language == "RU" then
|
||||||
DistanceText = " за " .. UTILS.Round( UTILS.MetersToNM( Distance ), 2 ) .. " миль"
|
DistanceText = " за " .. UTILS.Round( UTILS.MetersToNM( Distance ), Precision ) .. " миль"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1208,7 +1216,7 @@ do -- COORDINATE
|
|||||||
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
||||||
|
|
||||||
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, Language )
|
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, Language )
|
||||||
local DistanceText = self:GetDistanceText( Distance, Settings, Language )
|
local DistanceText = self:GetDistanceText( Distance, Settings, Language, 0 )
|
||||||
|
|
||||||
local BRText = BearingText .. DistanceText
|
local BRText = BearingText .. DistanceText
|
||||||
|
|
||||||
@ -1226,7 +1234,7 @@ do -- COORDINATE
|
|||||||
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
||||||
|
|
||||||
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, Language )
|
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, Language )
|
||||||
local DistanceText = self:GetDistanceText( Distance, Settings, Language )
|
local DistanceText = self:GetDistanceText( Distance, Settings, Language, 0 )
|
||||||
local AltitudeText = self:GetAltitudeText( Settings, Language )
|
local AltitudeText = self:GetAltitudeText( Settings, Language )
|
||||||
|
|
||||||
local BRAText = BearingText .. DistanceText .. AltitudeText -- When the POINT is a VEC2, there will be no altitude shown.
|
local BRAText = BearingText .. DistanceText .. AltitudeText -- When the POINT is a VEC2, there will be no altitude shown.
|
||||||
@ -2757,6 +2765,43 @@ do -- COORDINATE
|
|||||||
return "BRA, " .. self:GetBRAText( AngleRadians, Distance, Settings, Language )
|
return "BRA, " .. self:GetBRAText( AngleRadians, Distance, Settings, Language )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Create a BRAA NATO call string to this COORDINATE from the FromCOORDINATE.
|
||||||
|
-- @param #COORDINATE self
|
||||||
|
-- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from.
|
||||||
|
-- @param #boolean Spades Add "Spades" at the end if true (no IFF/VID ID yet known)
|
||||||
|
-- @return #string The BRAA text.
|
||||||
|
function COORDINATE:ToStringBRAANATO(FromCoordinate,Spades)
|
||||||
|
|
||||||
|
-- Thanks to @Pikey
|
||||||
|
local BRAANATO = "Merged."
|
||||||
|
|
||||||
|
local currentCoord = FromCoordinate
|
||||||
|
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||||
|
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||||
|
|
||||||
|
local bearing = UTILS.Round( UTILS.ToDegree( AngleRadians ),0 )
|
||||||
|
|
||||||
|
local rangeMetres = self:Get2DDistance(currentCoord)
|
||||||
|
local rangeNM = UTILS.Round( UTILS.MetersToNM(rangeMetres), 0)
|
||||||
|
|
||||||
|
local aspect = self:ToStringAspect(currentCoord)
|
||||||
|
|
||||||
|
local alt = UTILS.Round(UTILS.MetersToFeet(self.y)/1000,0)--*1000
|
||||||
|
|
||||||
|
local track = Utils.BearingToCardinal(bearing)
|
||||||
|
|
||||||
|
if rangeNM > 3 then
|
||||||
|
BRAANATO = string.format("BRAA, %s, %d miles, Angels %d, %s, Track %s",bearing, rangeNM, alt, aspect, track)
|
||||||
|
if Spades then
|
||||||
|
BRAANATO = BRAANATO..", Spades."
|
||||||
|
else
|
||||||
|
BRAANATO = BRAANATO.."."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return BRAANATO
|
||||||
|
end
|
||||||
|
|
||||||
--- Return a BULLS string out of the BULLS of the coalition to the COORDINATE.
|
--- Return a BULLS string out of the BULLS of the coalition to the COORDINATE.
|
||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param DCS#coalition.side Coalition The coalition.
|
-- @param DCS#coalition.side Coalition The coalition.
|
||||||
|
|||||||
@ -1029,7 +1029,7 @@ do -- SET_GROUP
|
|||||||
|
|
||||||
--- Gets the Set.
|
--- Gets the Set.
|
||||||
-- @param #SET_GROUP self
|
-- @param #SET_GROUP self
|
||||||
-- @return #SET_GROUP self
|
-- @return #table Table of objects
|
||||||
function SET_GROUP:GetAliveSet()
|
function SET_GROUP:GetAliveSet()
|
||||||
self:F2()
|
self:F2()
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
--- **Core** - TEXTANDSOUND (MOOSE gettext) system
|
--- **Core** - TEXTANDSOUND (MOOSE gettext) system
|
||||||
--
|
--
|
||||||
|
-- ===
|
||||||
|
--
|
||||||
-- ## Main Features:
|
-- ## Main Features:
|
||||||
--
|
--
|
||||||
-- * A GetText for Moose
|
-- * A GetText for Moose
|
||||||
@ -18,7 +20,8 @@
|
|||||||
-- ## Date: April 2022
|
-- ## Date: April 2022
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
-- @module Core.TEXTANDSOUND
|
--
|
||||||
|
-- @module Core.TextAndSound
|
||||||
-- @image MOOSE.JPG
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
--- Text and Sound class.
|
--- Text and Sound class.
|
||||||
|
|||||||
@ -810,7 +810,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
--- Scan the zone for the presence of units of the given ObjectCategories.
|
--- Scan the zone for the presence of units of the given ObjectCategories.
|
||||||
-- Note that after a zone has been scanned, the zone can be evaluated by:
|
-- Note that **only after** a zone has been scanned, the zone can be evaluated by:
|
||||||
--
|
--
|
||||||
-- * @{ZONE_RADIUS.IsAllInZoneOfCoalition}(): Scan the presence of units in the zone of a coalition.
|
-- * @{ZONE_RADIUS.IsAllInZoneOfCoalition}(): Scan the presence of units in the zone of a coalition.
|
||||||
-- * @{ZONE_RADIUS.IsAllInZoneOfOtherCoalition}(): Scan the presence of units in the zone of an other coalition.
|
-- * @{ZONE_RADIUS.IsAllInZoneOfOtherCoalition}(): Scan the presence of units in the zone of an other coalition.
|
||||||
@ -819,10 +819,10 @@ end
|
|||||||
-- * @{ZONE_RADIUS.IsNoneInZone}(): Scan if the zone is empty.
|
-- * @{ZONE_RADIUS.IsNoneInZone}(): Scan if the zone is empty.
|
||||||
-- @{#ZONE_RADIUS.
|
-- @{#ZONE_RADIUS.
|
||||||
-- @param #ZONE_RADIUS self
|
-- @param #ZONE_RADIUS self
|
||||||
-- @param ObjectCategories An array of categories of the objects to find in the zone.
|
-- @param ObjectCategories An array of categories of the objects to find in the zone. E.g. `{Object.Category.UNIT}`
|
||||||
-- @param UnitCategories An array of unit categories of the objects to find in the zone.
|
-- @param UnitCategories An array of unit categories of the objects to find in the zone. E.g. `{Unit.Category.GROUND_UNIT,Unit.Category.SHIP}`
|
||||||
-- @usage
|
-- @usage
|
||||||
-- self.Zone:Scan()
|
-- self.Zone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT})
|
||||||
-- local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
-- local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||||
function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
|
function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories )
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ __Moose.Include( 'Scripts/Moose/Utilities/Utils.lua' )
|
|||||||
__Moose.Include( 'Scripts/Moose/Utilities/Profiler.lua' )
|
__Moose.Include( 'Scripts/Moose/Utilities/Profiler.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Utilities/Templates.lua' )
|
__Moose.Include( 'Scripts/Moose/Utilities/Templates.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Utilities/STTS.lua' )
|
__Moose.Include( 'Scripts/Moose/Utilities/STTS.lua' )
|
||||||
|
__Moose.Include( 'Scripts/Moose/Utilities/FiFo.lua' )
|
||||||
|
|
||||||
__Moose.Include( 'Scripts/Moose/Core/Base.lua' )
|
__Moose.Include( 'Scripts/Moose/Core/Base.lua' )
|
||||||
__Moose.Include( 'Scripts/Moose/Core/Beacon.lua' )
|
__Moose.Include( 'Scripts/Moose/Core/Beacon.lua' )
|
||||||
|
|||||||
@ -1239,6 +1239,26 @@ function AIRWING:GetTankerForFlight(flightgroup)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Add the ability to call back an Ops.Awacs#AWACS object with an FSM call "FlightOnMission(FlightGroup, Mission)".
|
||||||
|
-- @param #AIRWING self
|
||||||
|
-- @param Ops.Awacs#AWACS ConnectecdAwacs
|
||||||
|
-- @return #AIRWING self
|
||||||
|
function AIRWING:SetUsingOpsAwacs(ConnectecdAwacs)
|
||||||
|
self:I(self.lid .. "Added AWACS Object: "..ConnectecdAwacs:GetName() or "unknown")
|
||||||
|
self.UseConnectedOpsAwacs = true
|
||||||
|
self.ConnectedOpsAwacs = ConnectecdAwacs
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Remove the ability to call back an Ops.Awacs#AWACS object with an FSM call "FlightOnMission(FlightGroup, Mission)".
|
||||||
|
-- @param #AIRWING self
|
||||||
|
-- @return #AIRWING self
|
||||||
|
function AIRWING:RemoveUsingOpsAwacs()
|
||||||
|
self:I(self.lid .. "Reomve AWACS Object: "..self.ConnectedOpsAwacs:GetName() or "unknown")
|
||||||
|
self.UseConnectedOpsAwacs = false
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- FSM Events
|
-- FSM Events
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -1248,11 +1268,14 @@ end
|
|||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
-- @param #string To To state.
|
-- @param #string To To state.
|
||||||
-- @param Ops.FlightGroup#FLIGHTGROUP ArmyGroup Ops army group on mission.
|
-- @param Ops.FlightGroup#FLIGHTGROUP FlightGroup Ops flight group on mission.
|
||||||
-- @param Ops.Auftrag#AUFTRAG Mission The requested mission.
|
-- @param Ops.Auftrag#AUFTRAG Mission The requested mission.
|
||||||
function AIRWING:onafterFlightOnMission(From, Event, To, FlightGroup, Mission)
|
function AIRWING:onafterFlightOnMission(From, Event, To, FlightGroup, Mission)
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:T(self.lid..string.format("Group %s on %s mission %s", FlightGroup:GetName(), Mission:GetType(), Mission:GetName()))
|
self:T(self.lid..string.format("Group %s on %s mission %s", FlightGroup:GetName(), Mission:GetType(), Mission:GetName()))
|
||||||
|
if self.UseConnectedOpsAwacs and self.ConnectedOpsAwacs then
|
||||||
|
self.ConnectedOpsAwacs:__FlightOnMission(2,FlightGroup,Mission)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -2031,14 +2031,15 @@ function AUFTRAG:NewNOTHING()
|
|||||||
|
|
||||||
--mission:_TargetFromObject(Coordinate)
|
--mission:_TargetFromObject(Coordinate)
|
||||||
|
|
||||||
mission.optionROE=ENUMS.ROE.ReturnFire
|
mission.optionROE=ENUMS.ROE.WeaponHold
|
||||||
mission.optionAlarm=ENUMS.AlarmState.Auto
|
mission.optionAlarm=ENUMS.AlarmState.Green
|
||||||
|
|
||||||
mission.missionFraction=1.0
|
mission.missionFraction=1.0
|
||||||
|
|
||||||
mission.categories={AUFTRAG.Category.ALL}
|
mission.categories={AUFTRAG.Category.ALL}
|
||||||
|
|
||||||
mission.DCStask=mission:GetDCSMissionTask()
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
mission.DCStask.params.adinfinitum=true
|
||||||
|
|
||||||
return mission
|
return mission
|
||||||
end
|
end
|
||||||
@ -5404,6 +5405,23 @@ function AUFTRAG:GetDCSMissionTask(TaskControllable)
|
|||||||
|
|
||||||
table.insert(DCStasks, DCStask)
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
|
elseif self.type==AUFTRAG.Type.NOTHING then
|
||||||
|
|
||||||
|
---------------------
|
||||||
|
-- NOTHING Mission --
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
local DCStask={}
|
||||||
|
|
||||||
|
DCStask.id=AUFTRAG.SpecialTask.NOTHING
|
||||||
|
|
||||||
|
-- We create a "fake" DCS task and pass the parameters to the OPSGROUP.
|
||||||
|
local param={}
|
||||||
|
|
||||||
|
DCStask.params=param
|
||||||
|
|
||||||
|
table.insert(DCStasks, DCStask)
|
||||||
|
|
||||||
elseif self.type==AUFTRAG.Type.HOVER then
|
elseif self.type==AUFTRAG.Type.HOVER then
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
|
|||||||
2808
Moose Development/Moose/Ops/Awacs.lua
Normal file
2808
Moose Development/Moose/Ops/Awacs.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -1956,7 +1956,7 @@ function OPSGROUP:RadioTransmission(Text, Delay, SayCallsign)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:I(self.lid..string.format("Radio transmission on %.3f MHz %s: %s", freq, UTILS.GetModulationName(modu), Text))
|
self:T(self.lid..string.format("Radio transmission on %.3f MHz %s: %s", freq, UTILS.GetModulationName(modu), Text))
|
||||||
|
|
||||||
self.msrs:PlayText(Text)
|
self.msrs:PlayText(Text)
|
||||||
end
|
end
|
||||||
|
|||||||
745
Moose Development/Moose/Utilities/FiFo.lua
Normal file
745
Moose Development/Moose/Utilities/FiFo.lua
Normal file
@ -0,0 +1,745 @@
|
|||||||
|
--- **UTILS** - ClassicFiFo Stack.
|
||||||
|
--
|
||||||
|
-- ===
|
||||||
|
--
|
||||||
|
-- ## Main Features:
|
||||||
|
--
|
||||||
|
-- * Build a simple multi-purpose FiFo (First-In, First-Out) stack for generic data.
|
||||||
|
-- * [Wikipedia](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)
|
||||||
|
--
|
||||||
|
-- ===
|
||||||
|
--
|
||||||
|
-- ### Author: **applevangelist**
|
||||||
|
-- @module Utils.FiFo
|
||||||
|
-- @image MOOSE.JPG
|
||||||
|
|
||||||
|
-- Date: April 2022
|
||||||
|
|
||||||
|
do
|
||||||
|
--- FIFO class.
|
||||||
|
-- @type FIFO
|
||||||
|
-- @field #string ClassName Name of the class.
|
||||||
|
-- @field #string lid Class id string for output to DCS log file.
|
||||||
|
-- @field #string version Version of FiFo
|
||||||
|
-- @field #number counter
|
||||||
|
-- @field #number pointer
|
||||||
|
-- @field #table stackbypointer
|
||||||
|
-- @field #table stackbyid
|
||||||
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @type FIFO.IDEntry
|
||||||
|
-- @field #number pointer
|
||||||
|
-- @field #table data
|
||||||
|
-- @field #table uniqueID
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @field #FIFO
|
||||||
|
FIFO = {
|
||||||
|
ClassName = "FIFO",
|
||||||
|
lid = "",
|
||||||
|
version = "0.0.3",
|
||||||
|
counter = 0,
|
||||||
|
pointer = 0,
|
||||||
|
stackbypointer = {},
|
||||||
|
stackbyid = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
--- Instantiate a new FIFO Stack
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #FIFO self
|
||||||
|
function FIFO:New()
|
||||||
|
-- Inherit everything from BASE class.
|
||||||
|
local self=BASE:Inherit(self, BASE:New())
|
||||||
|
self.pointer = 0
|
||||||
|
self.counter = 0
|
||||||
|
self.stackbypointer = {}
|
||||||
|
self.stackbyid = {}
|
||||||
|
self.uniquecounter = 0
|
||||||
|
-- Set some string id for output to DCS.log file.
|
||||||
|
self.lid=string.format("%s (%s) | ", "FiFo", self.version)
|
||||||
|
self:T(self.lid .."Created.")
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Empty FIFO Stack
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #FIFO self
|
||||||
|
function FIFO:Clear()
|
||||||
|
self:T(self.lid.."Clear")
|
||||||
|
self.pointer = 0
|
||||||
|
self.counter = 0
|
||||||
|
self.stackbypointer = nil
|
||||||
|
self.stackbyid = nil
|
||||||
|
self.stackbypointer = {}
|
||||||
|
self.stackbyid = {}
|
||||||
|
self.uniquecounter = 0
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Push Object to Stack
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @param #table Object
|
||||||
|
-- @param #string UniqueID (optional) - will default to current pointer + 1. Note - if you intend to use `FIFO:GetIDStackSorted()` keep the UniqueID numerical!
|
||||||
|
-- @return #FIFO self
|
||||||
|
function FIFO:Push(Object,UniqueID)
|
||||||
|
self:T(self.lid.."Push")
|
||||||
|
self:T({Object,UniqueID})
|
||||||
|
self.pointer = self.pointer + 1
|
||||||
|
self.counter = self.counter + 1
|
||||||
|
local uniID = UniqueID
|
||||||
|
if not UniqueID then
|
||||||
|
self.uniquecounter = self.uniquecounter + 1
|
||||||
|
uniID = self.uniquecounter
|
||||||
|
end
|
||||||
|
self.stackbyid[uniID] = { pointer = self.pointer, data = Object, uniqueID = uniID }
|
||||||
|
self.stackbypointer[self.pointer] = { pointer = self.pointer, data = Object, uniqueID = uniID }
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Pull Object from Stack
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #table Object or nil if stack is empty
|
||||||
|
function FIFO:Pull()
|
||||||
|
self:T(self.lid.."Pull")
|
||||||
|
if self.counter == 0 then return nil end
|
||||||
|
--local object = self.stackbypointer[self.pointer].data
|
||||||
|
--self.stackbypointer[self.pointer] = nil
|
||||||
|
local object = self.stackbypointer[1].data
|
||||||
|
self.stackbypointer[1] = nil
|
||||||
|
self.counter = self.counter - 1
|
||||||
|
--self.pointer = self.pointer - 1
|
||||||
|
self:Flatten()
|
||||||
|
return object
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Pull Object from Stack by Pointer
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @param #number Pointer
|
||||||
|
-- @return #table Object or nil if stack is empty
|
||||||
|
function FIFO:PullByPointer(Pointer)
|
||||||
|
self:T(self.lid.."PullByPointer " .. tostring(Pointer))
|
||||||
|
if self.counter == 0 then return nil end
|
||||||
|
local object = self.stackbypointer[Pointer] -- #FIFO.IDEntry
|
||||||
|
self.stackbypointer[Pointer] = nil
|
||||||
|
if object then self.stackbyid[object.uniqueID] = nil end
|
||||||
|
self.counter = self.counter - 1
|
||||||
|
self:Flatten()
|
||||||
|
if object then
|
||||||
|
return object.data
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- FIFO Read, not Pull, Object from Stack by Pointer
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @param #number Pointer
|
||||||
|
-- @return #table Object or nil if stack is empty or pointer does not exist
|
||||||
|
function FIFO:ReadByPointer(Pointer)
|
||||||
|
self:T(self.lid.."ReadByPointer " .. tostring(Pointer))
|
||||||
|
if self.counter == 0 or not Pointer or not self.stackbypointer[Pointer] then return nil end
|
||||||
|
local object = self.stackbypointer[Pointer] -- #FIFO.IDEntry
|
||||||
|
return object.data
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Read, not Pull, Object from Stack by UniqueID
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @param #number UniqueID
|
||||||
|
-- @return #table Object data or nil if stack is empty or ID does not exist
|
||||||
|
function FIFO:ReadByID(UniqueID)
|
||||||
|
self:T(self.lid.."ReadByID " .. tostring(UniqueID))
|
||||||
|
if self.counter == 0 or not UniqueID or not self.stackbyid[UniqueID] then return nil end
|
||||||
|
local object = self.stackbyid[UniqueID] -- #FIFO.IDEntry
|
||||||
|
return object.data
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Pull Object from Stack by UniqueID
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @param #tableUniqueID
|
||||||
|
-- @return #table Object or nil if stack is empty
|
||||||
|
function FIFO:PullByID(UniqueID)
|
||||||
|
self:T(self.lid.."PullByID " .. tostring(UniqueID))
|
||||||
|
if self.counter == 0 then return nil end
|
||||||
|
local object = self.stackbyid[UniqueID] -- #FIFO.IDEntry
|
||||||
|
--self.stackbyid[UniqueID] = nil
|
||||||
|
return self:PullByPointer(object.pointer)
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Housekeeping
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #FIFO self
|
||||||
|
function FIFO:Flatten()
|
||||||
|
self:T(self.lid.."Flatten")
|
||||||
|
-- rebuild stacks
|
||||||
|
local pointerstack = {}
|
||||||
|
local idstack = {}
|
||||||
|
local counter = 0
|
||||||
|
for _ID,_entry in pairs(self.stackbypointer) do
|
||||||
|
counter = counter + 1
|
||||||
|
pointerstack[counter] = { pointer = counter, data = _entry.data, uniqueID = _entry.uniqueID}
|
||||||
|
end
|
||||||
|
for _ID,_entry in pairs(pointerstack) do
|
||||||
|
idstack[_entry.uniqueID] = { pointer = _entry.pointer , data = _entry.data, uniqueID = _entry.uniqueID}
|
||||||
|
end
|
||||||
|
self.stackbypointer = nil
|
||||||
|
self.stackbypointer = pointerstack
|
||||||
|
self.stackbyid = nil
|
||||||
|
self.stackbyid = idstack
|
||||||
|
self.counter = counter
|
||||||
|
self.pointer = counter
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Check Stack is empty
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #boolean empty
|
||||||
|
function FIFO:IsEmpty()
|
||||||
|
self:T(self.lid.."IsEmpty")
|
||||||
|
return self.counter == 0 and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get stack size
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #number size
|
||||||
|
function FIFO:GetSize()
|
||||||
|
self:T(self.lid.."GetSize")
|
||||||
|
return self.counter
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get stack size
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #number size
|
||||||
|
function FIFO:Count()
|
||||||
|
self:T(self.lid.."Count")
|
||||||
|
return self.counter
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Check Stack is NOT empty
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #boolean notempty
|
||||||
|
function FIFO:IsNotEmpty()
|
||||||
|
self:T(self.lid.."IsNotEmpty")
|
||||||
|
return not self:IsEmpty()
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get the data stack by pointer
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #table Table of #FIFO.IDEntry entries
|
||||||
|
function FIFO:GetPointerStack()
|
||||||
|
self:T(self.lid.."GetPointerStack")
|
||||||
|
return self.stackbypointer
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Check if a certain UniqeID exists
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #boolean exists
|
||||||
|
function FIFO:HasUniqueID(UniqueID)
|
||||||
|
self:T(self.lid.."HasUniqueID")
|
||||||
|
return self.stackbyid[UniqueID] and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get the data stack by UniqueID
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #table Table of #FIFO.IDEntry entries
|
||||||
|
function FIFO:GetIDStack()
|
||||||
|
self:T(self.lid.."GetIDStack")
|
||||||
|
return self.stackbyid
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get table of UniqueIDs sorted smallest to largest
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #table Table with index [1] to [n] of UniqueID entries
|
||||||
|
function FIFO:GetIDStackSorted()
|
||||||
|
self:T(self.lid.."GetIDStackSorted")
|
||||||
|
|
||||||
|
local stack = self:GetIDStack()
|
||||||
|
local idstack = {}
|
||||||
|
for _id,_entry in pairs(stack) do
|
||||||
|
idstack[#idstack+1] = _id
|
||||||
|
|
||||||
|
self:T({"pre",_id})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function sortID(a, b)
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
|
||||||
|
table.sort(idstack)
|
||||||
|
|
||||||
|
return idstack
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get table of data entries
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #table Raw table indexed [1] to [n] of object entries - might be empty!
|
||||||
|
function FIFO:GetDataTable()
|
||||||
|
self:T(self.lid.."GetDataTable")
|
||||||
|
local datatable = {}
|
||||||
|
for _,_entry in pairs(self.stackbypointer) do
|
||||||
|
datatable[#datatable+1] = _entry.data
|
||||||
|
end
|
||||||
|
return datatable
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Get sorted table of data entries by UniqueIDs (must be numerical UniqueIDs only!)
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #table Table indexed [1] to [n] of sorted object entries - might be empty!
|
||||||
|
function FIFO:GetSortedDataTable()
|
||||||
|
self:T(self.lid.."GetSortedDataTable")
|
||||||
|
local datatable = {}
|
||||||
|
local idtablesorted = self:GetIDStackSorted()
|
||||||
|
for _,_entry in pairs(idtablesorted) do
|
||||||
|
datatable[#datatable+1] = self:ReadByID(_entry)
|
||||||
|
end
|
||||||
|
return datatable
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Iterate the FIFO and call an iterator function for the given FIFO data, providing the object for each element of the stack and optional parameters.
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @param #function IteratorFunction The function that will be called.
|
||||||
|
-- @param #table Arg (Optional) Further Arguments of the IteratorFunction.
|
||||||
|
-- @param #function Function (Optional) A function returning a #boolean true/false. Only if true, the IteratorFunction is called.
|
||||||
|
-- @param #table FunctionArguments (Optional) Function arguments.
|
||||||
|
-- @return #FIFO self
|
||||||
|
function FIFO:ForEach( IteratorFunction, Arg, Function, FunctionArguments )
|
||||||
|
self:T(self.lid.."ForEach")
|
||||||
|
|
||||||
|
local Set = self:GetPointerStack() or {}
|
||||||
|
Arg = Arg or {}
|
||||||
|
|
||||||
|
local function CoRoutine()
|
||||||
|
local Count = 0
|
||||||
|
for ObjectID, ObjectData in pairs( Set ) do
|
||||||
|
local Object = ObjectData.data
|
||||||
|
self:T( {Object} )
|
||||||
|
if Function then
|
||||||
|
if Function( unpack( FunctionArguments or {} ), Object ) == true then
|
||||||
|
IteratorFunction( Object, unpack( Arg ) )
|
||||||
|
end
|
||||||
|
else
|
||||||
|
IteratorFunction( Object, unpack( Arg ) )
|
||||||
|
end
|
||||||
|
Count = Count + 1
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local co = CoRoutine
|
||||||
|
|
||||||
|
local function Schedule()
|
||||||
|
|
||||||
|
local status, res = co()
|
||||||
|
self:T( { status, res } )
|
||||||
|
|
||||||
|
if status == false then
|
||||||
|
error( res )
|
||||||
|
end
|
||||||
|
if res == false then
|
||||||
|
return true -- resume next time the loop
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
Schedule()
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- FIFO Print stacks to dcs.log
|
||||||
|
-- @param #FIFO self
|
||||||
|
-- @return #FIFO self
|
||||||
|
function FIFO:Flush()
|
||||||
|
self:T(self.lid.."FiFo Flush")
|
||||||
|
self:I("FIFO Flushing Stack by Pointer")
|
||||||
|
for _id,_data in pairs (self.stackbypointer) do
|
||||||
|
local data = _data -- #FIFO.IDEntry
|
||||||
|
self:I(string.format("Pointer: %s | Entry: Number = %s Data = %s UniqueID = %s",tostring(_id),tostring(data.pointer),tostring(data.data),tostring(data.uniqueID)))
|
||||||
|
end
|
||||||
|
self:I("FIFO Flushing Stack by ID")
|
||||||
|
for _id,_data in pairs (self.stackbyid) do
|
||||||
|
local data = _data -- #FIFO.IDEntry
|
||||||
|
self:I(string.format("ID: %s | Entry: Number = %s Data = %s UniqueID = %s",tostring(_id),tostring(data.pointer),tostring(data.data),tostring(data.uniqueID)))
|
||||||
|
end
|
||||||
|
self:I("Counter = " .. self.counter)
|
||||||
|
self:I("Pointer = ".. self.pointer)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
-- End FIFO
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
-- LIFO
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
do
|
||||||
|
--- **UTILS** - LiFo Stack.
|
||||||
|
--
|
||||||
|
-- **Main Features:**
|
||||||
|
--
|
||||||
|
-- * Build a simple multi-purpose LiFo (Last-In, First-Out) stack for generic data.
|
||||||
|
--
|
||||||
|
-- ===
|
||||||
|
--
|
||||||
|
-- ### Author: **applevangelist**
|
||||||
|
|
||||||
|
--- LIFO class.
|
||||||
|
-- @type LIFO
|
||||||
|
-- @field #string ClassName Name of the class.
|
||||||
|
-- @field #string lid Class id string for output to DCS log file.
|
||||||
|
-- @field #string version Version of LiFo
|
||||||
|
-- @field #number counter
|
||||||
|
-- @field #number pointer
|
||||||
|
-- @field #table stackbypointer
|
||||||
|
-- @field #table stackbyid
|
||||||
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @type LIFO.IDEntry
|
||||||
|
-- @field #number pointer
|
||||||
|
-- @field #table data
|
||||||
|
-- @field #table uniqueID
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @field #LIFO
|
||||||
|
LIFO = {
|
||||||
|
ClassName = "LIFO",
|
||||||
|
lid = "",
|
||||||
|
version = "0.0.2",
|
||||||
|
counter = 0,
|
||||||
|
pointer = 0,
|
||||||
|
stackbypointer = {},
|
||||||
|
stackbyid = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
--- Instantiate a new LIFO Stack
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #LIFO self
|
||||||
|
function LIFO:New()
|
||||||
|
-- Inherit everything from BASE class.
|
||||||
|
local self=BASE:Inherit(self, BASE:New())
|
||||||
|
self.pointer = 0
|
||||||
|
self.counter = 0
|
||||||
|
self.uniquecounter = 0
|
||||||
|
self.stackbypointer = {}
|
||||||
|
self.stackbyid = {}
|
||||||
|
-- Set some string id for output to DCS.log file.
|
||||||
|
self.lid=string.format("%s (%s) | ", "LiFo", self.version)
|
||||||
|
self:T(self.lid .."Created.")
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Empty LIFO Stack
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #LIFO self
|
||||||
|
function LIFO:Clear()
|
||||||
|
self:T(self.lid.."Clear")
|
||||||
|
self.pointer = 0
|
||||||
|
self.counter = 0
|
||||||
|
self.stackbypointer = nil
|
||||||
|
self.stackbyid = nil
|
||||||
|
self.stackbypointer = {}
|
||||||
|
self.stackbyid = {}
|
||||||
|
self.uniquecounter = 0
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Push Object to Stack
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @param #table Object
|
||||||
|
-- @param #string UniqueID (optional) - will default to current pointer + 1
|
||||||
|
-- @return #LIFO self
|
||||||
|
function LIFO:Push(Object,UniqueID)
|
||||||
|
self:T(self.lid.."Push")
|
||||||
|
self:T({Object,UniqueID})
|
||||||
|
self.pointer = self.pointer + 1
|
||||||
|
self.counter = self.counter + 1
|
||||||
|
local uniID = UniqueID
|
||||||
|
if not UniqueID then
|
||||||
|
self.uniquecounter = self.uniquecounter + 1
|
||||||
|
uniID = self.uniquecounter
|
||||||
|
end
|
||||||
|
self.stackbyid[uniID] = { pointer = self.pointer, data = Object, uniqueID = uniID }
|
||||||
|
self.stackbypointer[self.pointer] = { pointer = self.pointer, data = Object, uniqueID = uniID }
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Pull Object from Stack
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #table Object or nil if stack is empty
|
||||||
|
function LIFO:Pull()
|
||||||
|
self:T(self.lid.."Pull")
|
||||||
|
if self.counter == 0 then return nil end
|
||||||
|
local object = self.stackbypointer[self.pointer].data
|
||||||
|
self.stackbypointer[self.pointer] = nil
|
||||||
|
--local object = self.stackbypointer[1].data
|
||||||
|
--self.stackbypointer[1] = nil
|
||||||
|
self.counter = self.counter - 1
|
||||||
|
self.pointer = self.pointer - 1
|
||||||
|
self:Flatten()
|
||||||
|
return object
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Pull Object from Stack by Pointer
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @param #number Pointer
|
||||||
|
-- @return #table Object or nil if stack is empty
|
||||||
|
function LIFO:PullByPointer(Pointer)
|
||||||
|
self:T(self.lid.."PullByPointer " .. tostring(Pointer))
|
||||||
|
if self.counter == 0 then return nil end
|
||||||
|
local object = self.stackbypointer[Pointer] -- #FIFO.IDEntry
|
||||||
|
self.stackbypointer[Pointer] = nil
|
||||||
|
if object then self.stackbyid[object.uniqueID] = nil end
|
||||||
|
self.counter = self.counter - 1
|
||||||
|
self:Flatten()
|
||||||
|
if object then
|
||||||
|
return object.data
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Read, not Pull, Object from Stack by Pointer
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @param #number Pointer
|
||||||
|
-- @return #table Object or nil if stack is empty or pointer does not exist
|
||||||
|
function LIFO:ReadByPointer(Pointer)
|
||||||
|
self:T(self.lid.."ReadByPointer " .. tostring(Pointer))
|
||||||
|
if self.counter == 0 or not Pointer or not self.stackbypointer[Pointer] then return nil end
|
||||||
|
local object = self.stackbypointer[Pointer] -- #LIFO.IDEntry
|
||||||
|
return object.data
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Read, not Pull, Object from Stack by UniqueID
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @param #number UniqueID
|
||||||
|
-- @return #table Object or nil if stack is empty or ID does not exist
|
||||||
|
function LIFO:ReadByID(UniqueID)
|
||||||
|
self:T(self.lid.."ReadByID " .. tostring(UniqueID))
|
||||||
|
if self.counter == 0 or not UniqueID or not self.stackbyid[UniqueID] then return nil end
|
||||||
|
local object = self.stackbyid[UniqueID] -- #LIFO.IDEntry
|
||||||
|
return object.data
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Pull Object from Stack by UniqueID
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @param #tableUniqueID
|
||||||
|
-- @return #table Object or nil if stack is empty
|
||||||
|
function LIFO:PullByID(UniqueID)
|
||||||
|
self:T(self.lid.."PullByID " .. tostring(UniqueID))
|
||||||
|
if self.counter == 0 then return nil end
|
||||||
|
local object = self.stackbyid[UniqueID] -- #LIFO.IDEntry
|
||||||
|
--self.stackbyid[UniqueID] = nil
|
||||||
|
return self:PullByPointer(object.pointer)
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Housekeeping
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #LIFO self
|
||||||
|
function LIFO:Flatten()
|
||||||
|
self:T(self.lid.."Flatten")
|
||||||
|
-- rebuild stacks
|
||||||
|
local pointerstack = {}
|
||||||
|
local idstack = {}
|
||||||
|
local counter = 0
|
||||||
|
for _ID,_entry in pairs(self.stackbypointer) do
|
||||||
|
counter = counter + 1
|
||||||
|
pointerstack[counter] = { pointer = counter, data = _entry.data, uniqueID = _entry.uniqueID}
|
||||||
|
end
|
||||||
|
for _ID,_entry in pairs(pointerstack) do
|
||||||
|
idstack[_entry.uniqueID] = { pointer = _entry.pointer , data = _entry.data, uniqueID = _entry.uniqueID}
|
||||||
|
end
|
||||||
|
self.stackbypointer = nil
|
||||||
|
self.stackbypointer = pointerstack
|
||||||
|
self.stackbyid = nil
|
||||||
|
self.stackbyid = idstack
|
||||||
|
self.counter = counter
|
||||||
|
self.pointer = counter
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Check Stack is empty
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #boolean empty
|
||||||
|
function LIFO:IsEmpty()
|
||||||
|
self:T(self.lid.."IsEmpty")
|
||||||
|
return self.counter == 0 and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get stack size
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #number size
|
||||||
|
function LIFO:GetSize()
|
||||||
|
self:T(self.lid.."GetSize")
|
||||||
|
return self.counter
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get stack size
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #number size
|
||||||
|
function LIFO:Count()
|
||||||
|
self:T(self.lid.."Count")
|
||||||
|
return self.counter
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Check Stack is NOT empty
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #boolean notempty
|
||||||
|
function LIFO:IsNotEmpty()
|
||||||
|
self:T(self.lid.."IsNotEmpty")
|
||||||
|
return not self:IsEmpty()
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get the data stack by pointer
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #table Table of #LIFO.IDEntry entries
|
||||||
|
function LIFO:GetPointerStack()
|
||||||
|
self:T(self.lid.."GetPointerStack")
|
||||||
|
return self.stackbypointer
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get the data stack by UniqueID
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #table Table of #LIFO.IDEntry entries
|
||||||
|
function LIFO:GetIDStack()
|
||||||
|
self:T(self.lid.."GetIDStack")
|
||||||
|
return self.stackbyid
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get table of UniqueIDs sorted smallest to largest
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #table Table of #LIFO.IDEntry entries
|
||||||
|
function LIFO:GetIDStackSorted()
|
||||||
|
self:T(self.lid.."GetIDStackSorted")
|
||||||
|
|
||||||
|
local stack = self:GetIDStack()
|
||||||
|
local idstack = {}
|
||||||
|
for _id,_entry in pairs(stack) do
|
||||||
|
idstack[#idstack+1] = _id
|
||||||
|
|
||||||
|
self:T({"pre",_id})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function sortID(a, b)
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
|
||||||
|
table.sort(idstack)
|
||||||
|
|
||||||
|
return idstack
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Check if a certain UniqeID exists
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #boolean exists
|
||||||
|
function LIFO:HasUniqueID(UniqueID)
|
||||||
|
self:T(self.lid.."HasUniqueID")
|
||||||
|
return self.stackbyid[UniqueID] and true or false
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Print stacks to dcs.log
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #LIFO self
|
||||||
|
function LIFO:Flush()
|
||||||
|
self:T(self.lid.."FiFo Flush")
|
||||||
|
self:I("LIFO Flushing Stack by Pointer")
|
||||||
|
for _id,_data in pairs (self.stackbypointer) do
|
||||||
|
local data = _data -- #LIFO.IDEntry
|
||||||
|
self:I(string.format("Pointer: %s | Entry: Number = %s Data = %s UniqueID = %s",tostring(_id),tostring(data.pointer),tostring(data.data),tostring(data.uniqueID)))
|
||||||
|
end
|
||||||
|
self:I("LIFO Flushing Stack by ID")
|
||||||
|
for _id,_data in pairs (self.stackbyid) do
|
||||||
|
local data = _data -- #LIFO.IDEntry
|
||||||
|
self:I(string.format("ID: %s | Entry: Number = %s Data = %s UniqueID = %s",tostring(_id),tostring(data.pointer),tostring(data.data),tostring(data.uniqueID)))
|
||||||
|
end
|
||||||
|
self:I("Counter = " .. self.counter)
|
||||||
|
self:I("Pointer = ".. self.pointer)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get table of data entries
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #table Raw table indexed [1] to [n] of object entries - might be empty!
|
||||||
|
function LIFO:GetDataTable()
|
||||||
|
self:T(self.lid.."GetDataTable")
|
||||||
|
local datatable = {}
|
||||||
|
for _,_entry in pairs(self.stackbypointer) do
|
||||||
|
datatable[#datatable+1] = _entry.data
|
||||||
|
end
|
||||||
|
return datatable
|
||||||
|
end
|
||||||
|
|
||||||
|
--- LIFO Get sorted table of data entries by UniqueIDs (must be numerical UniqueIDs only!)
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @return #table Table indexed [1] to [n] of sorted object entries - might be empty!
|
||||||
|
function LIFO:GetSortedDataTable()
|
||||||
|
self:T(self.lid.."GetSortedDataTable")
|
||||||
|
local datatable = {}
|
||||||
|
local idtablesorted = self:GetIDStackSorted()
|
||||||
|
for _,_entry in pairs(idtablesorted) do
|
||||||
|
datatable[#datatable+1] = self:ReadByID(_entry)
|
||||||
|
end
|
||||||
|
return datatable
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Iterate the LIFO and call an iterator function for the given LIFO data, providing the object for each element of the stack and optional parameters.
|
||||||
|
-- @param #LIFO self
|
||||||
|
-- @param #function IteratorFunction The function that will be called.
|
||||||
|
-- @param #table Arg (Optional) Further Arguments of the IteratorFunction.
|
||||||
|
-- @param #function Function (Optional) A function returning a #boolean true/false. Only if true, the IteratorFunction is called.
|
||||||
|
-- @param #table FunctionArguments (Optional) Function arguments.
|
||||||
|
-- @return #LIFO self
|
||||||
|
function LIFO:ForEach( IteratorFunction, Arg, Function, FunctionArguments )
|
||||||
|
self:T(self.lid.."ForEach")
|
||||||
|
|
||||||
|
local Set = self:GetPointerStack() or {}
|
||||||
|
Arg = Arg or {}
|
||||||
|
|
||||||
|
local function CoRoutine()
|
||||||
|
local Count = 0
|
||||||
|
for ObjectID, ObjectData in pairs( Set ) do
|
||||||
|
local Object = ObjectData.data
|
||||||
|
self:T( {Object} )
|
||||||
|
if Function then
|
||||||
|
if Function( unpack( FunctionArguments or {} ), Object ) == true then
|
||||||
|
IteratorFunction( Object, unpack( Arg ) )
|
||||||
|
end
|
||||||
|
else
|
||||||
|
IteratorFunction( Object, unpack( Arg ) )
|
||||||
|
end
|
||||||
|
Count = Count + 1
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local co = CoRoutine
|
||||||
|
|
||||||
|
local function Schedule()
|
||||||
|
|
||||||
|
local status, res = co()
|
||||||
|
self:T( { status, res } )
|
||||||
|
|
||||||
|
if status == false then
|
||||||
|
error( res )
|
||||||
|
end
|
||||||
|
if res == false then
|
||||||
|
return true -- resume next time the loop
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
Schedule()
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
-- End LIFO
|
||||||
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
end
|
||||||
@ -125,6 +125,9 @@ end
|
|||||||
--
|
--
|
||||||
-- * (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
|
-- * (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
|
||||||
--
|
--
|
||||||
|
-- @param #number length can also be passed as #string
|
||||||
|
-- @param #number speed Defaults to 1.0
|
||||||
|
-- @param #boolean isGoogle We're using Google TTS
|
||||||
function STTS.getSpeechTime(length,speed,isGoogle)
|
function STTS.getSpeechTime(length,speed,isGoogle)
|
||||||
|
|
||||||
local maxRateRatio = 3
|
local maxRateRatio = 3
|
||||||
|
|||||||
@ -1476,6 +1476,48 @@ function UTILS.GetCallsignName(Callsign)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.B1B) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.B52) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.F15E) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.F16) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.F18) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.FARP) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for name, value in pairs(CALLSIGN.TransportAircraft) do
|
||||||
|
if value==Callsign then
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return "Ghostrider"
|
return "Ghostrider"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2356,214 +2398,45 @@ function UTILS.LoadStationaryListOfStatics(Path,Filename,Reduce)
|
|||||||
return datatable
|
return datatable
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
--- Heading Degrees (0-360) to Cardinal
|
||||||
-- FIFO
|
-- @param #number Heading The heading
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- @return #string Cardinal, e.g. "NORTH"
|
||||||
|
function UTILS.BearingToCardinal(Heading)
|
||||||
do
|
if Heading >= 0 and Heading <= 22 then return "North"
|
||||||
--- **UTILS** - FiFo Stack.
|
elseif Heading >= 23 and Heading <= 66 then return "North-East"
|
||||||
--
|
elseif Heading >= 67 and Heading <= 101 then return "East"
|
||||||
-- **Main Features:**
|
elseif Heading >= 102 and Heading <= 146 then return "South-East"
|
||||||
--
|
elseif Heading >= 147 and Heading <= 201 then return "South"
|
||||||
-- * Build a simple multi-purpose FiFo (First-In, First-Out) stack for generic data.
|
elseif Heading >= 202 and Heading <= 246 then return "South-West"
|
||||||
--
|
elseif Heading >= 247 and Heading <= 291 then return "West"
|
||||||
-- ===
|
elseif Heading >= 292 and Heading <= 338 then return "North-West"
|
||||||
--
|
elseif Heading >= 339 then return "North"
|
||||||
-- ### Author: **applevangelist**
|
|
||||||
-- @module Utils.FiFo
|
|
||||||
-- @image MOOSE.JPG
|
|
||||||
|
|
||||||
|
|
||||||
--- FIFO class.
|
|
||||||
-- @type FIFO
|
|
||||||
-- @field #string ClassName Name of the class.
|
|
||||||
-- @field #boolean debug
|
|
||||||
-- @field #string lid Class id string for output to DCS log file.
|
|
||||||
-- @field #string version Version of FiFo
|
|
||||||
-- @field #number counter
|
|
||||||
-- @field #number pointer
|
|
||||||
-- @field #number nextin
|
|
||||||
-- @field #number nextout
|
|
||||||
-- @field #table stackbypointer
|
|
||||||
-- @field #table stackbyid
|
|
||||||
-- @extends Core.Base#BASE
|
|
||||||
--
|
|
||||||
|
|
||||||
---
|
|
||||||
-- @type FIFO.IDEntry
|
|
||||||
-- @field #number pointer
|
|
||||||
-- @field #table data
|
|
||||||
-- @field #table uniqueID
|
|
||||||
|
|
||||||
---
|
|
||||||
-- @field #FIFO
|
|
||||||
FIFO = {
|
|
||||||
ClassName = "FIFO",
|
|
||||||
debug = true,
|
|
||||||
lid = "",
|
|
||||||
version = "0.0.1",
|
|
||||||
counter = 0,
|
|
||||||
pointer = 0,
|
|
||||||
nextin = 0,
|
|
||||||
nextout = 0,
|
|
||||||
stackbypointer = {},
|
|
||||||
stackbyid = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
--- Instantiate a new FIFO Stack
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #FIFO self
|
|
||||||
function FIFO:New()
|
|
||||||
-- Inherit everything from BASE class.
|
|
||||||
local self=BASE:Inherit(self, BASE:New()) -- #INTEL
|
|
||||||
self.pointer = 0
|
|
||||||
self.counter = 0
|
|
||||||
self.stackbypointer = {}
|
|
||||||
self.stackbyid = {}
|
|
||||||
-- Set some string id for output to DCS.log file.
|
|
||||||
self.lid=string.format("%s (%s) | ", "FiFo", self.version)
|
|
||||||
self:I(self.lid .."Created.")
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Push Object to Stack
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @param #table Object
|
|
||||||
-- @param #string UniqueID (optional) - will default to current pointer + 1
|
|
||||||
-- @return #FIFO self
|
|
||||||
function FIFO:Push(Object,UniqueID)
|
|
||||||
self:T(self.lid.."Push")
|
|
||||||
self:T({Object,UniqueID})
|
|
||||||
self.pointer = self.pointer + 1
|
|
||||||
self.counter = self.counter + 1
|
|
||||||
self.stackbypointer[self.pointer] = { pointer = self.pointer, data = Object, uniqueID = UniqueID }
|
|
||||||
if UniqueID then
|
|
||||||
self.stackbyid[UniqueID] = { pointer = self.pointer, data = Object, uniqueID = UniqueID }
|
|
||||||
else
|
|
||||||
self.stackbyid[self.pointer] = { pointer = self.pointer, data = Object, uniqueID = UniqueID }
|
|
||||||
end
|
end
|
||||||
return self
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- FIFO Pull Object from Stack
|
--- Create a BRAA NATO call string BRAA between two GROUP objects
|
||||||
-- @param #FIFO self
|
-- @param Wrapper.Group#GROUP FromGrp GROUP object
|
||||||
-- @return #table Object or nil if stack is empty
|
-- @param Wrapper.Group#GROUP ToGrp GROUP object
|
||||||
function FIFO:Pull()
|
-- @return #string Formatted BRAA NATO call
|
||||||
self:T(self.lid.."Pull")
|
function UTILS.ToStringBRAANATO(FromGrp,ToGrp)
|
||||||
if self.counter == 0 then return nil end
|
local BRAANATO = "Merged."
|
||||||
local object = self.stackbypointer[self.pointer].data
|
local GroupNumber = FromGrp:GetSize()
|
||||||
self.stackbypointer[self.pointer] = nil
|
local GroupWords = "Singleton"
|
||||||
self.counter = self.counter - 1
|
if GroupNumber == 2 then GroupWords = "Two-Ship"
|
||||||
self.pointer = self.pointer - 1
|
elseif GroupNumber >= 3 then GroupWords = "Heavy"
|
||||||
self:Flatten()
|
|
||||||
return object
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Pull Object from Stack by Pointer
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @param #number Pointer
|
|
||||||
-- @return #table Object or nil if stack is empty
|
|
||||||
function FIFO:PullByPointer(Pointer)
|
|
||||||
self:T(self.lid.."PullByPointer " .. tostring(Pointer))
|
|
||||||
if self.counter == 0 then return nil end
|
|
||||||
local object = self.stackbypointer[Pointer] -- #FIFO.IDEntry
|
|
||||||
self.stackbypointer[Pointer] = nil
|
|
||||||
self.stackbyid[object.uniqueID] = nil
|
|
||||||
self.counter = self.counter - 1
|
|
||||||
self:Flatten()
|
|
||||||
return object.data
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Pull Object from Stack by UniqueID
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @param #tableUniqueID
|
|
||||||
-- @return #table Object or nil if stack is empty
|
|
||||||
function FIFO:PullByID(UniqueID)
|
|
||||||
self:T(self.lid.."PullByID " .. tostring(UniqueID))
|
|
||||||
if self.counter == 0 then return nil end
|
|
||||||
local object = self.stackbyid[UniqueID] -- #FIFO.IDEntry
|
|
||||||
--self.stackbyid[UniqueID] = nil
|
|
||||||
return self:PullByPointer(object.pointer)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Housekeeping
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #FIFO self
|
|
||||||
function FIFO:Flatten()
|
|
||||||
self:T(self.lid.."Flatten")
|
|
||||||
-- rebuild stacks
|
|
||||||
local pointerstack = {}
|
|
||||||
local idstack = {}
|
|
||||||
local counter = 0
|
|
||||||
for _ID,_entry in pairs(self.stackbypointer) do
|
|
||||||
counter = counter + 1
|
|
||||||
pointerstack[counter] = { pointer = counter, data = _entry.data, uniqueID = _entry.uniqueID}
|
|
||||||
end
|
end
|
||||||
for _ID,_entry in pairs(pointerstack) do
|
local grpLeadUnit = ToGrp:GetUnit(1)
|
||||||
idstack[_entry.uniqueID] = { pointer = _entry.pointer , data = _entry.data, uniqueID = _entry.uniqueID}
|
local tgtCoord = grpLeadUnit:GetCoordinate()
|
||||||
|
local currentCoord = FromGrp:GetCoordinate()
|
||||||
|
local hdg = UTILS.Round(ToGrp:GetHeading()/100,1)*100
|
||||||
|
local bearing = UTILS.Round(currentCoord:HeadingTo(tgtCoord),0)
|
||||||
|
local rangeMetres = tgtCoord:Get2DDistance(currentCoord)
|
||||||
|
local rangeNM = UTILS.Round( UTILS.MetersToNM(rangeMetres), 0)
|
||||||
|
local aspect = tgtCoord:ToStringAspect(currentCoord)
|
||||||
|
local alt = UTILS.Round(UTILS.MetersToFeet(grpLeadUnit:GetAltitude())/1000,0)--*1000
|
||||||
|
local track = UTILS.BearingToCardinal(hdg)
|
||||||
|
if rangeNM > 3 then
|
||||||
|
BRAANATO = string.format("%s, BRAA, %s, %d miles, Angels %d, %s, Track %s, Spades.",GroupWords,bearing, rangeNM, alt, aspect, track)
|
||||||
end
|
end
|
||||||
self.stackbypointer = nil
|
return BRAANATO
|
||||||
self.stackbypointer = pointerstack
|
|
||||||
self.stackbyid = nil
|
|
||||||
self.stackbyid = idstack
|
|
||||||
self.counter = counter
|
|
||||||
self.pointer = counter
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Check Stack is empty
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #boolean empty
|
|
||||||
function FIFO:IsEmpty()
|
|
||||||
self:T(self.lid.."IsEmpty")
|
|
||||||
return self.counter == 0 and true or false
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Check Stack is NOT empty
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #boolean notempty
|
|
||||||
function FIFO:IsNotEmpty()
|
|
||||||
self:T(self.lid.."IsNotEmpty")
|
|
||||||
return not self:IsEmpty()
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Get the data stack by pointer
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #table Table of #FIFO.IDEntry entries
|
|
||||||
function FIFO:GetPointerStack()
|
|
||||||
self:T(self.lid.."GetPointerStack")
|
|
||||||
return self.stackbypointer
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Get the data stack by UniqueID
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #table Table of #FIFO.IDEntry entries
|
|
||||||
function FIFO:GetIDStack()
|
|
||||||
self:T(self.lid.."GetIDStack")
|
|
||||||
return self.stackbyid
|
|
||||||
end
|
|
||||||
|
|
||||||
--- FIFO Print stacks to dcs.log
|
|
||||||
-- @param #FIFO self
|
|
||||||
-- @return #FIFO self
|
|
||||||
function FIFO:Flush()
|
|
||||||
self:T(self.lid.."FiFo Flush")
|
|
||||||
self:I("FIFO Flushing Stack by Pointer")
|
|
||||||
for _id,_data in pairs (self.stackbypointer) do
|
|
||||||
local data = _data -- #FIFO.IDEntry
|
|
||||||
self:I(string.format("Pointer: %s | Entry: Number = %s Data = %s UniID = %s",tostring(_id),tostring(data.pointer),tostring(data.data),tostring(data.uniqueID)))
|
|
||||||
end
|
|
||||||
self:I("FIFO Flushing Stack by ID")
|
|
||||||
for _id,_data in pairs (self.stackbyid) do
|
|
||||||
local data = _data -- #FIFO.IDEntry
|
|
||||||
self:I(string.format("ID: %s | Entry: Number = %s Data = %s UniID = %s",tostring(_id),tostring(data.pointer),tostring(data.data),tostring(data.uniqueID)))
|
|
||||||
end
|
|
||||||
self:I("Counter = " .. self.counter)
|
|
||||||
self:I("Pointer = ".. self.pointer)
|
|
||||||
return self
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
-- End FIFO
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
end
|
end
|
||||||
@ -588,7 +588,7 @@ end
|
|||||||
|
|
||||||
--- Set text that is displayed in the marker panel. Note this does not show the marker.
|
--- Set text that is displayed in the marker panel. Note this does not show the marker.
|
||||||
-- @param #MARKER self
|
-- @param #MARKER self
|
||||||
-- @param #string Text Marker text. Default is an empty sting "".
|
-- @param #string Text Marker text. Default is an empty string "".
|
||||||
-- @return #MARKER self
|
-- @return #MARKER self
|
||||||
function MARKER:SetText(Text)
|
function MARKER:SetText(Text)
|
||||||
self.text=Text and tostring(Text) or ""
|
self.text=Text and tostring(Text) or ""
|
||||||
|
|||||||
@ -5,6 +5,7 @@ Utilities/Enums.lua
|
|||||||
Utilities/Profiler.lua
|
Utilities/Profiler.lua
|
||||||
Utilities/Templates.lua
|
Utilities/Templates.lua
|
||||||
Utilities/STTS.lua
|
Utilities/STTS.lua
|
||||||
|
Utilities/FiFo.lua
|
||||||
|
|
||||||
Core/Base.lua
|
Core/Base.lua
|
||||||
Core/Beacon.lua
|
Core/Beacon.lua
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user