From 3b02e153ba0f7ebdb4c006b9d7f148ed62a86170 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 17 Dec 2024 12:38:57 +0100 Subject: [PATCH] xx --- Moose Development/Moose/Functional/Mantis.lua | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index 860e2fe2e..a62fbe63f 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -1511,6 +1511,9 @@ do elseif not found then self:E(self.lid .. string.format("*****Could not match radar data for %s! Will default to midrange values!",grpname)) end + if string.find(grpname,"SHORAD",1,true) then + type = MANTIS.SamType.SHORT -- force short on match + end return range, height, type, blind end @@ -1674,6 +1677,10 @@ do function MANTIS:_CheckLoop(samset,detset,dlink,limit) self:T(self.lid .. "CheckLoop " .. #detset .. " Coordinates") local switchedon = 0 + local statusreport = REPORT:New("\nMANTIS Status") + local instatusred = 0 + local instatusgreen = 0 + local SEADactive = 0 for _,_data in pairs (samset) do local samcoordinate = _data[2] local name = _data[1] @@ -1696,7 +1703,7 @@ do elseif (not self.UseEmOnOff) and switchedon < limit then samgroup:OptionAlarmStateRed() switchedon = switchedon + 1 - switch = true + switch = true end if self.SamStateTracker[name] ~= "RED" and switch then self:__RedState(1,samgroup) @@ -1714,7 +1721,7 @@ do -- debug output if (self.debug or self.verbose) and switch then local text = string.format("SAM %s in alarm state RED!", name) - local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug) + --local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug if self.verbose then self:I(self.lid..text) end end end --end alive @@ -1732,12 +1739,26 @@ do end if self.debug or self.verbose then local text = string.format("SAM %s in alarm state GREEN!", name) - local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug) + --local m=MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug) if self.verbose then self:I(self.lid..text) end end end --end alive - end --end check - end --for for loop + end --end check + end --for loop + if self.debug then + for _,_status in pairs(self.SamStateTracker) do + if _status == "GREEN" then + instatusgreen=instatusgreen+1 + elseif _status == "RED" then + instatusred=instatusred+1 + end + end + statusreport:Add("+-----------------------+") + statusreport:Add(string.format("+ SAM in RED State: %0d",instatusred)) + statusreport:Add(string.format("+ SAM in GREEN State: %0d",instatusgreen)) + statusreport:Add("+-----------------------+") + MESSAGE:New(statusreport:Text(),10,nil,true):ToAll() + end return self end @@ -1851,7 +1872,7 @@ do end --]] if self.autoshorad then - self.Shorad = SHORAD:New(self.name.."-SHORAD",self.name.."-SHORAD",self.SAM_Group,self.ShoradActDistance,self.ShoradTime,self.coalition,self.UseEmOnOff) + self.Shorad = SHORAD:New(self.name.."-SHORAD","SHORAD",self.SAM_Group,self.ShoradActDistance,self.ShoradTime,self.coalition,self.UseEmOnOff) self.Shorad:SetDefenseLimits(80,95) self.ShoradLink = true self.Shorad.Groupset=self.ShoradGroupSet