117117-- mycsar.topmenuname = "CSAR" -- set the menu entry name
118118-- mycsar.ADFRadioPwr = 1000 -- ADF Beacons sending with 1KW as default
119119-- mycsar.PilotWeight = 80 -- Loaded pilots weigh 80kgs each
120+ -- mycsar.AllowIRStrobe = false -- Allow a menu item to request an IR strobe to find a downed pilot at night (requires NVGs to see it).
121+ -- mycsar.IRStrobeRuntime = 300 -- If an IR Strobe is activated, it runs for 300 seconds (5 mins).
120122--
121123-- ## 2.1 Create own SET_GROUP to manage CTLD Pilot groups
122124--
@@ -267,6 +269,8 @@ CSAR = {
267269 PilotWeight = 80 ,
268270 CreateRadioBeacons = true ,
269271 UserSetGroup = nil ,
272+ AllowIRStrobe = false ,
273+ IRStrobeRuntime = 300 ,
270274}
271275
272276--- Downed pilots info.
@@ -309,7 +313,7 @@ CSAR.AircraftType["CH-47Fbl1"] = 31
309313
310314--- CSAR class version.
311315-- @field #string version
312- CSAR .version = " 1.0.28 "
316+ CSAR .version = " 1.0.29 "
313317
314318---- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
315319-- ToDo list
@@ -753,7 +757,6 @@ function CSAR:_SpawnPilotInField(country,point,frequency,wetfeet)
753757 :NewWithAlias (template ,alias )
754758 :InitCoalition (coalition )
755759 :InitCountry (country )
756- -- :InitAIOnOff(pilotcacontrol)
757760 :InitDelayOff ()
758761 :SpawnFromCoordinate (point )
759762
@@ -1818,9 +1821,6 @@ function CSAR:_DisplayMessageToSAR(_unit, _text, _time, _clear, _speak, _overrid
18181821 end
18191822 _text = string.gsub (_text ," km" ," kilometer" )
18201823 _text = string.gsub (_text ," nm" ," nautical miles" )
1821- -- self.msrs:SetVoice(self.SRSVoice)
1822- -- self.SRSQueue:NewTransmission(_text,nil,self.msrs,nil,1)
1823- -- self:I("Voice = "..self.SRSVoice)
18241824 self .SRSQueue :NewTransmission (_text ,duration ,self .msrs ,tstart ,2 ,subgroups ,subtitle ,subduration ,self .SRSchannel ,self .SRSModulation ,gender ,culture ,self .SRSVoice ,volume ,label ,coord )
18251825 end
18261826 return self
@@ -1966,7 +1966,7 @@ function CSAR:_SignalFlare(_unitName)
19661966 else
19671967 _distance = string.format (" %.1fkm" ,_closest .distance / 1000 )
19681968 end
1969- local _msg = string.format (" %s - Popping signal flare at your %s o\' clock. Distance %s" , self :_GetCustomCallSign (_unitName ), _clockDir , _distance )
1969+ local _msg = string.format (" %s - Firing signal flare at your %s o\' clock. Distance %s" , self :_GetCustomCallSign (_unitName ), _clockDir , _distance )
19701970 self :_DisplayMessageToSAR (_heli , _msg , self .messageTime , false , true , true )
19711971
19721972 local _coord = _closest .pilot :GetCoordinate ()
@@ -2000,7 +2000,7 @@ function CSAR:_DisplayToAllSAR(_message, _side, _messagetime,ToSRS,ToScreen)
20002000 if self .msrs :GetProvider () == MSRS .Provider .WINDOWS then
20012001 voice = self .CSARVoiceMS or MSRS .Voices .Microsoft .Hedda
20022002 end
2003- self :F (" Voice = " .. voice )
2003+ -- self:F("Voice = "..voice)
20042004 self .SRSQueue :NewTransmission (_message ,duration ,self .msrs ,tstart ,2 ,subgroups ,subtitle ,subduration ,self .SRSchannel ,self .SRSModulation ,gender ,culture ,voice ,volume ,label ,self .coordinate )
20052005 end
20062006 if ToScreen == true or ToScreen == nil then
@@ -2014,6 +2014,41 @@ function CSAR:_DisplayToAllSAR(_message, _side, _messagetime,ToSRS,ToScreen)
20142014 return self
20152015end
20162016
2017+ --- (Internal) Request IR Strobe at closest downed pilot.
2018+ -- @param #CSAR self
2019+ -- @param #string _unitName Name of the helicopter
2020+ function CSAR :_ReqIRStrobe ( _unitName )
2021+ self :T (self .lid .. " _ReqIRStrobe" )
2022+ local _heli = self :_GetSARHeli (_unitName )
2023+ if _heli == nil then
2024+ return
2025+ end
2026+ local smokedist = 8000
2027+ if smokedist < self .approachdist_far then smokedist = self .approachdist_far end
2028+ local _closest = self :_GetClosestDownedPilot (_heli )
2029+ if _closest ~= nil and _closest .pilot ~= nil and _closest .distance > 0 and _closest .distance < smokedist then
2030+ local _clockDir = self :_GetClockDirection (_heli , _closest .pilot )
2031+ local _distance = string.format (" %.1fkm" ,_closest .distance / 1000 )
2032+ if _SETTINGS :IsImperial () then
2033+ _distance = string.format (" %.1fnm" ,UTILS .MetersToNM (_closest .distance ))
2034+ else
2035+ _distance = string.format (" %.1fkm" ,_closest .distance / 1000 )
2036+ end
2037+ local _msg = string.format (" %s - IR Strobe active at your %s o\' clock. Distance %s" , self :_GetCustomCallSign (_unitName ), _clockDir , _distance )
2038+ self :_DisplayMessageToSAR (_heli , _msg , self .messageTime , false , true , true )
2039+ _closest .pilot :NewIRMarker (true ,self .IRStrobeRuntime or 300 )
2040+ else
2041+ local _distance = string.format (" %.1fkm" ,smokedist / 1000 )
2042+ if _SETTINGS :IsImperial () then
2043+ _distance = string.format (" %.1fnm" ,UTILS .MetersToNM (smokedist ))
2044+ else
2045+ _distance = string.format (" %.1fkm" ,smokedist / 1000 )
2046+ end
2047+ self :_DisplayMessageToSAR (_heli , string.format (" No Pilots within %s" ,_distance ), self .messageTime , false , false , true )
2048+ end
2049+ return self
2050+ end
2051+
20172052--- (Internal) Request smoke at closest downed pilot.
20182053-- @param #CSAR self
20192054-- @param #string _unitName Name of the helicopter
@@ -2165,7 +2200,12 @@ function CSAR:_AddMedevacMenuItem()
21652200 local _rootMenu1 = MENU_GROUP_COMMAND :New (_group ," List Active CSAR" ,_rootPath , self ._DisplayActiveSAR ,self ,_unitName )
21662201 local _rootMenu2 = MENU_GROUP_COMMAND :New (_group ," Check Onboard" ,_rootPath , self ._CheckOnboard ,self ,_unitName )
21672202 local _rootMenu3 = MENU_GROUP_COMMAND :New (_group ," Request Signal Flare" ,_rootPath , self ._SignalFlare ,self ,_unitName )
2168- local _rootMenu4 = MENU_GROUP_COMMAND :New (_group ," Request Smoke" ,_rootPath , self ._Reqsmoke ,self ,_unitName ):Refresh ()
2203+ local _rootMenu4 = MENU_GROUP_COMMAND :New (_group ," Request Smoke" ,_rootPath , self ._Reqsmoke ,self ,_unitName )
2204+ if self .AllowIRStrobe then
2205+ local _rootMenu5 = MENU_GROUP_COMMAND :New (_group ," Request IR Strobe" ,_rootPath , self ._ReqIRStrobe ,self ,_unitName ):Refresh ()
2206+ else
2207+ _rootMenu4 :Refresh ()
2208+ end
21692209 end
21702210 end
21712211 end
0 commit comments