Skip to content

Commit

Permalink
Merge pull request #37 from walder/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
walder authored Mar 19, 2021
2 parents 0a340ea + 3653bcf commit ed5953b
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 7 deletions.
Binary file not shown.
6 changes: 5 additions & 1 deletion demo-missions/skynet-iads-compiled.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
env.info("--- SKYNET VERSION: 2.0.1 | BUILD TIME: 04.01.2021 0706Z ---")
env.info("--- SKYNET VERSION: 2.0.2 | BUILD TIME: 19.03.2021 1837Z ---")
do
--this file contains the required units per sam type
samTypesDB = {
Expand Down Expand Up @@ -2545,6 +2545,10 @@ end
function SkynetIADSAbstractRadarElement.finishHarmDefence(self)
mist.removeFunction(self.harmSilenceID)
self.harmSilenceID = nil

if ( self:getAutonomousState() == true ) then
self:goAutonomous()
end
end

function SkynetIADSAbstractRadarElement:getDetectedTargets()
Expand Down
Binary file modified demo-missions/skynet-test-persian-gulf -stress-test.miz
Binary file not shown.
Binary file modified demo-missions/skynet-test-persian-gulf.miz
Binary file not shown.
4 changes: 4 additions & 0 deletions skynet-iads-source/skynet-iads-abstract-radar-element.lua
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ end
function SkynetIADSAbstractRadarElement.finishHarmDefence(self)
mist.removeFunction(self.harmSilenceID)
self.harmSilenceID = nil

if ( self:getAutonomousState() == true ) then
self:goAutonomous()
end
end

function SkynetIADSAbstractRadarElement:getDetectedTargets()
Expand Down
Binary file modified unit-tests/highdigitsams/highdigitsams-unit-tests.miz
Binary file not shown.
9 changes: 3 additions & 6 deletions unit-tests/highdigitsams/test-skynet-high-digit-sam-sites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function TestSyknetIADSHighDigitSAMSites:testSA23GladiatorOrGiant()
local launcher1 = launchers[2]
lu.assertEquals(launcher1:getTypeName(), "S-300VM 9A82ME ln")
lu.assertEquals(launcher1:getRange(), 200000)
lu.assertEquals(launcher1:getMaximumFiringAltitude(), 40000)
lu.assertEquals(launcher1:getMaximumFiringAltitude(), 37000)
lu.assertEquals(launcher1:getInitialNumberOfMissiles(), 2)

local searchRadars = self.samSite:getSearchRadars()
Expand Down Expand Up @@ -252,8 +252,7 @@ function TestSyknetIADSHighDigitSAMSites:testSA2GuidelineWithV7595V23()
lu.assertEquals(launcher1:getTypeName(), "S_75M_Volhov_V759")
lu.assertEquals(launcher1:getRange(), 56000)
lu.assertEquals(launcher1:getMaximumFiringAltitude(), 30000)
--should read as 1, bugreport filed: https://github.com/Auranis/HighDigitSAMs/issues/11
lu.assertEquals(launcher1:getInitialNumberOfMissiles(), 4)
lu.assertEquals(launcher1:getInitialNumberOfMissiles(), 1)
end

function TestSyknetIADSHighDigitSAMSites:testSA3GoaWithV601P5V27()
Expand All @@ -268,7 +267,6 @@ function TestSyknetIADSHighDigitSAMSites:testSA3GoaWithV601P5V27()
lu.assertEquals(launcher1:getTypeName(), "5p73 V-601P ln")
lu.assertEquals(launcher1:getRange(), 25000)
lu.assertEquals(launcher1:getMaximumFiringAltitude(), 18000)
--should read as 1, bugreport filed: https://github.com/Auranis/HighDigitSAMs/issues/11
lu.assertEquals(launcher1:getInitialNumberOfMissiles(), 4)
end

Expand All @@ -284,8 +282,7 @@ function TestSyknetIADSHighDigitSAMSites:testSA2GuidelineWithHQ2()
lu.assertEquals(launcher1:getTypeName(), "HQ_2_Guideline_LN")
lu.assertEquals(launcher1:getRange(), 50000)
lu.assertEquals(launcher1:getMaximumFiringAltitude(), 30000)
--should read as 1, bugreport filed: https://github.com/Auranis/HighDigitSAMs/issues/11
lu.assertEquals(launcher1:getInitialNumberOfMissiles(), 4)
lu.assertEquals(launcher1:getInitialNumberOfMissiles(), 1)

end

Expand Down
Binary file modified unit-tests/skynet-unit-tests.miz
Binary file not shown.
9 changes: 9 additions & 0 deletions unit-tests/test-skynet-iads-abstract-radar-element.lua
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ function TestSkynetIADSAbstractRadarElement:testSetToCorrectAutonomousState()

end

function TestSkynetIADSAbstractRadarElement:testWillGoLiveWhenAutonomousAndHARMDefenceFinished()
self.samSiteName = "SAM-SA-6-2"
self:setUp()
self.samSite:setAutonomousBehaviour(SkynetIADSAbstractRadarElement.AUTONOMOUS_STATE_DCS_AI)
self.samSite:goSilentToEvadeHARM(1)
self.samSite:finishHarmDefence()
lu.assertEquals(self.samSite:isActive(), true)
end

-- TODO: write test for updateMissilesInFlight in AbstractRadarElement
function TestSkynetIADSAbstractRadarElement:testUpdateMissilesInFlight()
self.samSiteName = "SAM-SA-6-2"
Expand Down

0 comments on commit ed5953b

Please sign in to comment.