Change to Version 1.0.2

Add Help functions:
ExportScript.Tools.getListIndicatorValue()
ExportScript.Tools.RoundFreqeuncy()

replace previous code with calls to the new functions.

Add new PDF Documenation

Last version for DCS World 1.5.8 and 2.5.0
This commit is contained in:
McMicha
2018-06-17 20:22:45 +02:00
parent 52d4b25f85
commit 260fa80177
37 changed files with 704 additions and 667 deletions

View File

@@ -33,4 +33,10 @@ ExportScript.Maps.Normandy = {} -- Normandy Map
ExportScript.Maps.Normandy.Lat1 = 53.85556 -- high left Latitude 53° 51' 20" N
ExportScript.Maps.Normandy.Long1 = -15.02667 -- high left Longitude 15° 01' 36" W
ExportScript.Maps.Normandy.Lat2 = 45.07167 -- low right Latitude 45° 04' 18" N
ExportScript.Maps.Normandy.Long2 = 8.437222 -- low right Longitude 08° 26' 14" E
ExportScript.Maps.Normandy.Long2 = 8.437222 -- low right Longitude 08° 26' 14" E
-- Persian Gulf Map
ExportScript.Maps.PersianGulf = {}
ExportScript.Maps.PersianGulf.Lat1 = 30.50833 -- high left Latitude 30° 20.630 N
ExportScript.Maps.PersianGulf.Long1 = 45.15167 -- high left Longitude 44° 54.906 E
ExportScript.Maps.PersianGulf.Lat2 = 22.43528 -- low right Latitude 22° 24.127 N
ExportScript.Maps.PersianGulf.Long2 = 61.67306 -- low right Longitude 61° 36.263 E

View File

@@ -1,5 +1,5 @@
-- Ikarus and D.A.C. Export Script
-- Version 1.0.1
-- Version 1.0.2
--
-- Tools
--
@@ -667,8 +667,8 @@ function ExportScript.Tools.split(stringvalue, delimiter)
return result;
end
-- the function evaluation of the handover parameters and makes accordingly to the light on or off
-- handover parameters, singel id or a table with id's
-- the function checks whether the cockpit light should be activated in ikarus on the basis of the parameters
-- functional parameters, a single ID, or a table with IDs
function ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, ExportIDs)
local TmpExportIDs = ExportIDs or 0
local TmpLight = false
@@ -698,6 +698,66 @@ function ExportScript.Tools.IkarusCockpitLights(mainPanelDevice, ExportIDs)
end
end
-- The function returns a correctly formatted string with the given radio frequency.
-- Frequency: MHz/KHz, format: e.g. "7.3" or "5.2", fill with leading zeros (default false), least value of frequency (default 0.025 (MHz))
function ExportScript.Tools.RoundFreqeuncy(Freqeuncy, Format, PrefixZeros, LeastValue)
local freqeuncy = Freqeuncy or 0.0
local format = Format or "7.3"
local prefixzeros = PrefixZeros or false
local leastvalue = LeastValue or 0.025
local tmpstring = ""
local tmp1, tmp2, tmp3, tmp4 = 0, 0, 0, 0
local from ,to = string.find(format, "%.")
tmp1 = string.sub(format, 0, to)
tmp2 = string.sub(format, to)
tmp1 = tonumber(string.sub(tmp1, string.find(tmp1, "%d+")))
tmp2 = tonumber(string.sub(tmp2, string.find(tmp2, "%d+")))
local tmp3, tmp4 = math.modf(freqeuncy)
local bla3, bla4 = math.modf(tmp4 / leastvalue)
tmpstring = (tmp3 + (bla3 * leastvalue ))
tmpstring = string.format("%."..tmp2.."f", tmpstring)
while string.len(tmpstring) < tmp1 do
tmpstring = " "..tmpstring
end
if prefixzeros then
tmpstring = string.gsub(tmpstring, " ", "0")
end
return tmpstring
end
-- The function return a table with values of given indicator
-- The value is retrievable via a named index. e.g. TmpReturn.txt_digits
function ExportScript.Tools.getListIndicatorValue(IndicatorID)
local ListIindicator = list_indication(IndicatorID)
local TmpReturn = {}
if ExportScript.Config.Debug then
ExportScript.Tools.WriteToLog('list_indication('..IndicatorID..'): '..ExportScript.Tools.dump(ListIindicator))
end
if ListIindicator == "" then
return nil
end
local ListindicatorMatch = ListIindicator:gmatch("-----------------------------------------\n([^\n]+)\n([^\n]*)\n")
while true do
local Key, Value = ListindicatorMatch()
if not Key then
break
end
TmpReturn[Key] = Value
end
return TmpReturn
end
-- Pointed to by ExportScript.ProcessIkarusDCSHighImportance, if the player aircraft is something else
function ExportScript.ProcessIkarusDCSHighImportanceNoConfig(mainPanelDevice)
end

View File

@@ -1,5 +1,5 @@
-- Ikarus and D.A.C. Export Script
-- Version 1.0.1
-- Version 1.0.2
--
-- generic Radio File
--