mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Code and documentation fixes (#1659)
* Update .lua-format Adjust for observed coding standards. * Update ATIS.lua Correct measurement units and spelling (also changed in Utils.lua). * Update Utils.lua Format the file, fix typos, adjust minor text. Rename "celcius" to "celsius". Rename "farenheit" to "fahrenheit". * Update Warehouse.lua Adjust measurement unit text. * Update STTS.lua Adjust formatting, minor typos, and fix error in documentation (missing blank rows) introduced in previous update. * Update Range.lua Adjust minor typos and code formatting. Adjust for celsius/fahrenheit typo correction. * Update PseudoATC.lua Adjust for celsius/fahrenheit typo correction in utils.lua. * Update Point.lua Code formatting, fix minor typos, adjust for celsius/fahrenheit corrrection in utils.lua. * Update Range.lua Minor documentation fix.
This commit is contained in:
parent
a57b9a9081
commit
a4ca4bdc99
@ -21,9 +21,9 @@ chop_down_table: true
|
||||
chop_down_kv_table: true
|
||||
column_table_limit: 500
|
||||
table_sep: ','
|
||||
extra_sep_at_table_end: false
|
||||
extra_sep_at_table_end: true
|
||||
break_after_operator: true
|
||||
single_quote_to_double_quote: true
|
||||
single_quote_to_double_quote: false
|
||||
double_quote_to_single_quote: false
|
||||
spaces_before_call: 1
|
||||
spaces_inside_functiondef_parens: true
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -742,7 +742,7 @@ function PSEUDOATC:ReportWeather(GID, UID, position, location)
|
||||
local T=position:GetTemperature()
|
||||
|
||||
-- Correct unit system.
|
||||
local _T=string.format('%d°F', UTILS.CelciusToFarenheit(T))
|
||||
local _T=string.format('%d°F', UTILS.CelsiusToFahrenheit(T))
|
||||
if settings:IsMetric() then
|
||||
_T=string.format('%d°C', T)
|
||||
end
|
||||
|
||||
@ -260,7 +260,7 @@
|
||||
-- -- Add bombing targets. A good hit is if the bomb falls less then 50 m from the target.
|
||||
-- GoldwaterRange:AddBombingTargets(bombtargets, 50)
|
||||
--
|
||||
-- -- Start range.
|
||||
-- -- Start Range.
|
||||
-- GoldwaterRange:Start()
|
||||
--
|
||||
-- The [476th - Air Weapons Range Objects mod](http://www.476vfightergroup.com/downloads.php?do=file&id=287) is (implicitly) used in this example.
|
||||
@ -329,7 +329,7 @@ RANGE = {
|
||||
instructor = nil,
|
||||
rangecontrolfreq = nil,
|
||||
rangecontrol = nil,
|
||||
soundpath = "Range Soundfiles/"
|
||||
soundpath = "Range Soundfiles/",
|
||||
}
|
||||
|
||||
--- Default range parameters.
|
||||
@ -345,7 +345,7 @@ RANGE.Defaults = {
|
||||
boxlength = 3000, -- meters
|
||||
boxwidth = 300, -- meters
|
||||
goodpass = 20, -- targethits per pass
|
||||
foulline = 610 -- meters
|
||||
foulline = 610, -- meters
|
||||
}
|
||||
|
||||
--- Target type, i.e. unit, static, or coordinate.
|
||||
@ -500,7 +500,7 @@ RANGE.Sound = {
|
||||
IRDecimal = { filename = "IR-Decimal.ogg", duration = 0.54 },
|
||||
IRMegaHertz = { filename = "IR-MegaHertz.ogg", duration = 0.87 },
|
||||
IREnterRange = { filename = "IR-EnterRange.ogg", duration = 4.83 },
|
||||
IRExitRange = { filename = "IR-ExitRange.ogg", duration = 3.10 }
|
||||
IRExitRange = { filename = "IR-ExitRange.ogg", duration = 3.10 },
|
||||
}
|
||||
|
||||
--- Global list of all defined range names.
|
||||
@ -1089,7 +1089,7 @@ end
|
||||
|
||||
--- Set sound files folder within miz file.
|
||||
-- @param #RANGE self
|
||||
-- @param #string path Path for sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end!
|
||||
-- @param #string path Path for sound files. Default "Range Soundfiles/". Mind the slash "/" at the end!
|
||||
-- @return #RANGE self
|
||||
function RANGE:SetSoundfilesPath( path )
|
||||
self.soundpath = tostring( path or "Range Soundfiles/" )
|
||||
@ -1384,12 +1384,14 @@ end
|
||||
--
|
||||
-- -- Setup a Range
|
||||
-- RangeOne = RANGE:New( "Range One" )
|
||||
-- -- Find the STATIC target object as setup in the ME
|
||||
-- RangeOneBombTarget = STATIC:FindByName( "RangeOneBombTarget" ):
|
||||
-- -- Add the coordinate of the STATIC target object as a bomb target (thus keeping the bomb function active, even if the STATIC target is destroyed)
|
||||
-- -- Find the STATIC target object as setup in the ME.
|
||||
-- RangeOneBombTarget = STATIC:FindByName( "RangeOneBombTarget" )
|
||||
-- -- Add the coordinate of the STATIC target object as a bomb target (thus keeping the bomb function active, even if the STATIC target is destroyed).
|
||||
-- RangeOne:AddBombingTargetCoordinate( RangeOneBombTarget:GetCoordinate(), "RangeOneBombTarget", 50)
|
||||
-- -- Or, add the coordinate of the STATIC target object as a bomb target using default values (name will be "Bomb Target", goodhitrange will be 25 m)
|
||||
-- -- Or, add the coordinate of the STATIC target object as a bomb target using default values (name will be "Bomb Target", goodhitrange will be 25 m).
|
||||
-- RangeOne:AddBombingTargetCoordinate( RangeOneBombTarget:GetCoordinate() )
|
||||
-- -- Start Range.
|
||||
-- RangeOne:Start()
|
||||
--
|
||||
function RANGE:AddBombingTargetCoordinate( coord, name, goodhitrange )
|
||||
|
||||
@ -1436,6 +1438,17 @@ end
|
||||
-- @param #string namepit Name of the strafe pit target object.
|
||||
-- @param #string namefoulline Name of the foul line distance marker object.
|
||||
-- @return #number Foul line distance in meters.
|
||||
-- @usage
|
||||
--
|
||||
-- -- Setup a Range
|
||||
-- RangeOne = RANGE:New( "Range One" )
|
||||
-- -- Get distance between strafe target objext and foul line distance marker object.
|
||||
-- RangeOneFoulDistance = RangeOne:GetFoullineDistance( "RangeOneStrafeTarget" , "RangeOneFoulLineObject" )
|
||||
-- -- Add a strafe pit using the measured foul line distance. Where nil is used, strafe pit default values will be used - adjust as required.
|
||||
-- RangeOne:AddStrafePit( "RangeOneStrafeTarget", nil, nil, nil, nil, nil, RangeOneFoulDistance )
|
||||
-- -- Start Range.
|
||||
-- RangeOne:Start()
|
||||
--
|
||||
function RANGE:GetFoullineDistance( namepit, namefoulline )
|
||||
self:F( { namepit = namepit, namefoulline = namefoulline } )
|
||||
|
||||
@ -2107,7 +2120,7 @@ function RANGE:onafterSave( From, Event, To )
|
||||
_savefile( filename, scores )
|
||||
end
|
||||
|
||||
--- Function called before save event. Checks that io and lfs are desanitized.
|
||||
--- Function called before load event. Checks that io and lfs are desanitized.
|
||||
-- @param #RANGE self
|
||||
-- @param #string From From state.
|
||||
-- @param #string Event Event.
|
||||
@ -2654,7 +2667,7 @@ function RANGE:_DisplayRangeWeather( _unitname )
|
||||
local tW = string.format( "%.1f m/s", Ws )
|
||||
local tP = string.format( "%.1f mmHg", P * hPa2mmHg )
|
||||
if settings:IsImperial() then
|
||||
-- tT=string.format("%d°F", UTILS.CelciusToFarenheit(T))
|
||||
-- tT=string.format("%d°F", UTILS.CelsiusToFahrenheit(T))
|
||||
tW = string.format( "%.1f knots", UTILS.MpsToKnots( Ws ) )
|
||||
tP = string.format( "%.2f inHg", P * hPa2inHg )
|
||||
end
|
||||
|
||||
@ -1601,7 +1601,7 @@ WAREHOUSE = {
|
||||
-- @field #number range Range of the unit in meters.
|
||||
-- @field #number speedmax Maximum speed in km/h the group can do.
|
||||
-- @field #number size Maximum size in length and with of the asset in meters.
|
||||
-- @field #number weight The weight of the whole asset group in kilo gramms.
|
||||
-- @field #number weight The weight of the whole asset group in kilograms.
|
||||
-- @field DCS#Object.Desc DCSdesc All DCS descriptors.
|
||||
-- @field #WAREHOUSE.Attribute attribute Generalized attribute of the group.
|
||||
-- @field #table cargobay Array of cargo bays of all units in an asset group.
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
-- @field #string activerunway The active runway specified by the user.
|
||||
-- @field #number subduration Duration how long subtitles are displayed in seconds.
|
||||
-- @field #boolean metric If true, use metric units. If false, use imperial (default).
|
||||
-- @field #boolean PmmHg If true, give pressure in millimeters of Mercury. Default is inHg for imperial and hecto Pascal (=mili Bars) for metric units.
|
||||
-- @field #boolean PmmHg If true, give pressure in millimeters of Mercury. Default is inHg for imperial and hectopascal (hPa, which is the same as millibar - mbar) for metric units.
|
||||
-- @field #boolean qnhonly If true, suppresses reporting QFE. Default is to report both QNH and QFE.
|
||||
-- @field #boolean TDegF If true, give temperature in degrees Fahrenheit. Default is in degrees Celsius independent of chosen unit system.
|
||||
-- @field #number zuludiff Time difference local vs. zulu in hours.
|
||||
@ -239,7 +239,7 @@
|
||||
--
|
||||
-- atisBatumi:SetMetricUnits()
|
||||
--
|
||||
-- With this, wind speed is given in meters per second, pressure in hecto Pascal (mbar), visibility in kilometers etc.
|
||||
-- With this, wind speed is given in meters per second, pressure in hectopascal (hPa, which is the same as millibar - mbar), visibility in kilometers etc.
|
||||
--
|
||||
-- # Sound Files
|
||||
--
|
||||
@ -1459,8 +1459,8 @@ function ATIS:onafterBroadcast(From, Event, To)
|
||||
|
||||
-- Convert to °F.
|
||||
if self.TDegF then
|
||||
temperature=UTILS.CelciusToFarenheit(temperature)
|
||||
dewpoint=UTILS.CelciusToFarenheit(dewpoint)
|
||||
temperature=UTILS.CelsiusToFahrenheit(temperature)
|
||||
dewpoint=UTILS.CelsiusToFahrenheit(dewpoint)
|
||||
end
|
||||
|
||||
local TEMPERATURE=string.format("%d", math.abs(temperature))
|
||||
@ -2280,7 +2280,7 @@ function ATIS:onafterReport(From, Event, To, Text)
|
||||
local text=string.gsub(text, "°F", "degrees Fahrenheit")
|
||||
local text=string.gsub(text, "inHg", "inches of Mercury")
|
||||
local text=string.gsub(text, "mmHg", "millimeters of Mercury")
|
||||
local text=string.gsub(text, "hPa", "hecto Pascals")
|
||||
local text=string.gsub(text, "hPa", "hectopascals")
|
||||
local text=string.gsub(text, "m/s", "meters per second")
|
||||
|
||||
-- Replace ";" by "."
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
--
|
||||
-- @module Utils.STTS
|
||||
-- @image MOOSE.JPG
|
||||
|
||||
--- [DCS Enum world](https://wiki.hoggitworld.com/view/DCS_enum_world)
|
||||
-- @type STTS
|
||||
-- @field #string DIRECTORY Path of the SRS directory.
|
||||
|
||||
--- Simple Text-To-Speech
|
||||
--
|
||||
-- Version 0.4 - Compatible with SRS version 1.9.6.0+
|
||||
@ -40,7 +42,7 @@
|
||||
-- * OPTIONAL - Speed -10 to +10
|
||||
-- * OPTIONAL - Gender male, female or neuter
|
||||
-- * OPTIONAL - Culture - en-US, en-GB etc
|
||||
-- * OPTIONAL - Voice - a specfic voice by name. Run DCS-SR-ExternalAudio.exe with --help to get the ones you can use on the command line
|
||||
-- * OPTIONAL - Voice - a specific voice by name. Run DCS-SR-ExternalAudio.exe with --help to get the ones you can use on the command line
|
||||
-- * OPTIONAL - Google TTS - Switch to Google Text To Speech - Requires STTS.GOOGLE_CREDENTIALS path and Google project setup correctly
|
||||
--
|
||||
--
|
||||
@ -89,7 +91,7 @@ STTS.SRS_PORT = 5002
|
||||
--- Google credentials file
|
||||
STTS.GOOGLE_CREDENTIALS = "C:\\Users\\Ciaran\\Downloads\\googletts.json"
|
||||
|
||||
--- DONT CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING
|
||||
--- DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING
|
||||
STTS.EXECUTABLE = "DCS-SR-ExternalAudio.exe"
|
||||
|
||||
--- Function for UUID.
|
||||
@ -117,11 +119,11 @@ function STTS.round( x, n )
|
||||
end
|
||||
|
||||
--- Function returns estimated speech time in seconds.
|
||||
-- Assumptions for time calc: 100 Words per min, avarage of 5 letters for english word so
|
||||
-- Assumptions for time calc: 100 Words per min, average of 5 letters for english word so
|
||||
--
|
||||
-- * 5 chars * 100wpm = 500 characters per min = 8.3 chars per second
|
||||
--
|
||||
-- So lengh of msg / 8.3 = number of seconds needed to read it. rounded down to 8 chars per sec map function:
|
||||
-- So length of msg / 8.3 = number of seconds needed to read it. rounded down to 8 chars per sec map function:
|
||||
--
|
||||
-- * (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
|
||||
--
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user