From 230d9d82bfe1ba3cc6f57c2ab1a689d98eb53b0f Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:04:35 +0100 Subject: [PATCH 1/2] Update Detection.lua (#2063) # RadarBlur - make burn-through limit configureable --- Moose Development/Moose/Functional/Detection.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index 1acd82ad2..a71e194ed 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -721,7 +721,7 @@ do -- DETECTION_BASE end end - -- Calculate radar blue probability + -- Calculate radar blur probability if self.RadarBlur then MESSAGE:New("Radar Blur",10):ToLogIf(self.debug):ToAllIf(self.verbose) @@ -729,9 +729,9 @@ do -- DETECTION_BASE local thresheight = self.RadarBlurThresHeight or 90 -- 10% chance to find a low flying group local thresblur = self.RadarBlurThresBlur or 85 -- 25% chance to escape the radar overall local dist = math.floor(Distance) - if dist <= 20 then - thresheight = (((dist*dist)/400)*thresheight) - thresblur = (((dist*dist)/400)*thresblur) + if dist <= self.RadarBlurClosing then + thresheight = (((dist*dist)/self.RadarBlurClosingSquare)*thresheight) + thresblur = (((dist*dist)/self.RadarBlurClosingSquare)*thresblur) end local fheight = math.floor(math.random(1,10000)/100) local fblur = math.floor(math.random(1,10000)/100) @@ -1051,12 +1051,15 @@ do -- DETECTION_BASE -- @param #number minheight Minimum flight height to be detected, in meters AGL (above ground) -- @param #number thresheight Threshold to escape the radar if flying below minheight, defaults to 90 (90% escape chance) -- @param #number thresblur Threshold to be detected by the radar overall, defaults to 85 (85% chance to be found) + -- @param #number closing Closing-in in km - the limit of km from which on it becomes increasingly difficult to escape radar detection if flying towards the radar position. Should be about 1/3 of the radar detection radius in kilometers, defaults to 20. -- @return #DETECTION_BASE self - function DETECTION_BASE:SetRadarBlur(minheight,thresheight,thresblur) + function DETECTION_BASE:SetRadarBlur(minheight,thresheight,thresblur,closing) self.RadarBlur = true self.RadarBlurMinHeight = minheight or 250 -- meters self.RadarBlurThresHeight = thresheight or 90 -- 10% chance to find a low flying group self.RadarBlurThresBlur = thresblur or 85 -- 25% chance to escape the radar overall + self.RadarBlurClosing = closing or 20 -- 20km + self.RadarBlurClosingSquare = self.RadarBlurClosing * self.RadarBlurClosing return self end From f837e9dec7522605ce60b31bbccfcb092c839b8b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 12 Dec 2023 10:53:37 +0100 Subject: [PATCH 2/2] #COORDINATE * Added functions to create a COORDINATE from MGRS --- Moose Development/Moose/Core/Point.lua | 52 ++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 3911a52f3..9cf13ba3e 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -25,7 +25,7 @@ do -- COORDINATE - --- @type COORDINATE + -- @type COORDINATE -- @field #string ClassName Name of the class -- @field #number x Component of the 3D vector. -- @field #number y Component of the 3D vector. @@ -2551,7 +2551,7 @@ do -- COORDINATE Offset=Offset or 2 - -- Measurement of visibility should not be from the ground, so Adding a hypotethical 2 meters to each Coordinate. + -- Measurement of visibility should not be from the ground, so Adding a hypothetical 2 meters to each Coordinate. local FromVec3 = self:GetVec3() FromVec3.y = FromVec3.y + Offset @@ -2952,10 +2952,10 @@ do -- COORDINATE end -- corrected Track to be direction of travel of bogey (self in this case) - local track = "Maneuver" - - if self.Heading then - track = UTILS.BearingToCardinal(self.Heading) or "North" + local track = "Maneuver" + + if self.Heading then + track = UTILS.BearingToCardinal(self.Heading) or "North" end if rangeNM > 3 then @@ -3100,6 +3100,44 @@ do -- COORDINATE local MGRS = coord.LLtoMGRS( lat, lon ) return "MGRS " .. UTILS.tostringMGRS( MGRS, MGRS_Accuracy ) end + + --- Provides a COORDINATE from an MGRS String + -- @param #COORDINATE self + -- @param #string MGRSString MGRS String, e.g. "MGRS 37T DK 12345 12345" + -- @return #COORDINATE self + function COORDINATE:NewFromMGRSString( MGRSString ) + local myparts = UTILS.Split(MGRSString," ") + UTILS.PrintTableToLog(myparts,1) + local MGRS = { + UTMZone = myparts[2], + MGRSDigraph = myparts[3], + Easting = tonumber(myparts[4]), + Northing = tonumber(myparts[5]), + } + local lat, lon = coord.MGRStoLL(MGRS) + local point = coord.LLtoLO(lat, lon, 0) + local coord = COORDINATE:NewFromVec2({x=point.x,y=point.z}) + return coord + end + + --- Provides a COORDINATE from an MGRS Coordinate + -- @param #COORDINATE self + -- @param #string UTMZone UTM Zone, e.g. "37T" + -- @param #string MGRSDigraph Digraph, e.g. "DK" + -- @param #number Easting Meters easting + -- @param #number Northing Meters northing + -- @return #COORDINATE self + function COORDINATE:NewFromMGRS( UTMZone, MGRSDigraph, Easting, Northing ) + local MGRS = { + UTMZone = UTMZone, + MGRSDigraph = MGRSDigraph, + Easting = Easting, + Northing = Northing, + } + local lat, lon = coord.MGRStoLL(MGRS) + local point = coord.LLtoLO(lat, lon, 0) + local coord = COORDINATE:NewFromVec2({x=point.x,y=point.z}) + end --- Provides a coordinate string of the point, based on a coordinate format system: -- * Uses default settings in COORDINATE. @@ -3613,7 +3651,7 @@ end do -- POINT_VEC2 - --- @type POINT_VEC2 + -- @type POINT_VEC2 -- @field DCS#Distance x The x coordinate in meters. -- @field DCS#Distance y the y coordinate in meters. -- @extends Core.Point#COORDINATE