do
iranIADS = SkynetIADS:create('IRIAF')

---debug settings remove from here on if you do not wan't any output on what the IADS is doing
local iadsDebug = iranIADS:getDebugSettings()
iadsDebug.IADSStatus = true
--iadsDebug.samWentDark = true
iadsDebug.contacts = true
--iadsDebug.radarWentLive = true
--iadsDebug.noWorkingCommmandCenter = true
--iadsDebug.ewRadarNoConnection = true
--iadsDebug.samNoConnection = true
--iadsDebug.jammerProbability = true
--iadsDebug.addedEWRadar = true
--iadsDebug.addedSAMSite = true
--iadsDebug.hasNoPower = true
--iadsDebug.harmDefence = true
--iadsDebug.warnings = true
iadsDebug.samSiteStatusEnvOutput = true
iadsDebug.earlyWarningRadarStatusEnvOutput = true

---end remove debug ---

iranIADS:addEarlyWarningRadarsByPrefix('EW')
iranIADS:addSAMSitesByPrefix('SAM')
iranIADS:setUpdateInterval(10)
iranIADS:addRadioMenu()


iranIADS:setupSAMSitesAndThenActivate()

--COMMAND CENTER ADD:

local commandCenter = StaticObject.getByName("CMDwest")
local comPowerSource = StaticObject.getByName("Static-Electric-powerbox-CMDwest")
local conNode = Unit.getByName("NODEwest")
iranIADS:addCommandCenter(commandCenter):addPowerSource(comPowerSource):addConnectionNode(conNode)

local commandCenter = StaticObject.getByName("CMDcentral")
local comPowerSource = StaticObject.getByName("Static-Electric-powerbox-CMDcentral")
local conNode = Unit.getByName("NODEcentral")
iranIADS:addCommandCenter(commandCenter):addPowerSource(comPowerSource):addConnectionNode(conNode)

local commandCenter = StaticObject.getByName("CMDeast")
local comPowerSource = StaticObject.getByName("Static-Electric-powerbox-CMDeast")
local conNode = Unit.getByName("NODEeast")
iranIADS:addCommandCenter(commandCenter):addPowerSource(comPowerSource):addConnectionNode(conNode)

local commandCenter = StaticObject.getByName("CMDfareast")
local comPowerSource = StaticObject.getByName("Static-Electric-powerbox-CMDfareast")
local conNode = Unit.getByName("NODEfareast")
iranIADS:addCommandCenter(commandCenter):addPowerSource(comPowerSource):addConnectionNode(conNode)

--EW RADAR ADD:

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15 point-defence EW-west')
local connectionNodeEW = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-west")
iranIADS:getEarlyWarningRadarByUnitName('EW-west'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-west2')
local connectionNodeEW = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-west2")
iranIADS:getEarlyWarningRadarByUnitName('EW-west2'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-west3')
local connectionNodeEW = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-west3")
iranIADS:getEarlyWarningRadarByUnitName('EW-west3'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-center')
local connectionNodeEW = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-center")
iranIADS:getEarlyWarningRadarByUnitName('EW-center'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-center2')
local connectionNodeEW = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-center2")
iranIADS:getEarlyWarningRadarByUnitName('EW-center2'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)


local connectionNodeEW = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-center3")
iranIADS:getEarlyWarningRadarByUnitName('EW-center3'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-fareast')
local connectionNodeEW = Unit.getByName("NODEfareast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-fareast")
iranIADS:getEarlyWarningRadarByUnitName('EW-fareast'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-east2')
local connectionNodeEW = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-east2")
iranIADS:getEarlyWarningRadarByUnitName('EW-east2'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-point-defence-EW-east3')
local connectionNodeEW = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-EW-east3")
iranIADS:getEarlyWarningRadarByUnitName('EW-east3'):addConnectionNode(connectionNodeEW):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

--SAM SITE ADD:

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-western-SA-2-point-defence')
local connectionNode = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-2-westcentral")
iranIADS:getSAMSiteByGroupName('SAM-SA-2'):addPowerSource(powerSource):addConnectionNode(connectionNode):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local connectionNode = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-11-EW-west")
iranIADS:getSAMSiteByGroupName('SAM-SA-11-EW-west-airdefence'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-6-Shiraz")
iranIADS:getSAMSiteByGroupName('SAM-SA-6-IRAN-Nuke-Facility-Shiraz'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-Shiraz-Intl-point-defence')
local connectionNode = Unit.getByName("NODEwest")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-10-Shiraz")
iranIADS:getSAMSiteByGroupName('SAM-SA-10-Shiraz-Intl-Airport'):addPowerSource(powerSource):addConnectionNode(connectionNode):setActAsEW(true):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local connectionNode = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-6-EW-center3")
iranIADS:getSAMSiteByGroupName('SAM-SA-6-defence-EW-center3'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-3-EW-center3")  
iranIADS:getSAMSiteByGroupName('SAM-SA-3-defence-EW-center3'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-6-Bandar-Lengeh")  
iranIADS:getSAMSiteByGroupName('SAM-SA-6'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-Hawk-Qeshm")
iranIADS:getSAMSiteByGroupName('SAM-Hawk-Air-Defence-Qeshm'):addConnectionNode(connectionNode):addPowerSource(powerSource)

local connectionNode = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-Hawk-Missle-Facility")
iranIADS:getSAMSiteByGroupName('SAM-Hawk-IRAN-Missle-Facility'):addConnectionNode(connectionNode):addPowerSource(powerSource)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-EW-center2-point-defence')
local connectionNode = Unit.getByName("NODEcentral")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-Buk-11-EW-center2")
iranIADS:getSAMSiteByGroupName('SAM-SA-11-EW-center2-defence'):addConnectionNode(connectionNode):addPowerSource(powerSource):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-Bandar-Abbas-point-defence')
local connectionNode = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-10-Bandar-Abbas") 
iranIADS:getSAMSiteByGroupName('SAM-SA-10-Bandar-Abbas'):addPowerSource(powerSource):addConnectionNode(connectionNode):setActAsEW(true):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local connectionNode = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-11-EW-east3")
iranIADS:getSAMSiteByGroupName('SAM-SA-11'):addPowerSource(powerSource):addConnectionNode(connectionNode)


local connectionNode = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-6-EW-east2")
iranIADS:getSAMSiteByGroupName('SAM-SA-6-Kub-defence-EW-east2'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-Kerman-Airport-point-defence')
local connectionNode = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-10-Kerman")  
iranIADS:getSAMSiteByGroupName('SAM-SA-10-Kerman-Airport'):addPowerSource(powerSource):addConnectionNode(connectionNode):setActAsEW(true):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-Jiroft-point-defence')
local connectionNode = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-10-Jiroft")  
iranIADS:getSAMSiteByGroupName('SAM-SA-10-Jiroft-Airport'):addPowerSource(powerSource):addConnectionNode(connectionNode):setActAsEW(true):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-HQ-7-Bandar-e-Jask-point-defence')
local connectionNode = Unit.getByName("NODEeast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-2-Bandar-e-Jask") 
iranIADS:getSAMSiteByGroupName('SAM-SA-2-Bandar-e-Jask'):addPowerSource(powerSource):addConnectionNode(connectionNode):setActAsEW(true):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

local SA15PointDEF = iranIADS:getSAMSiteByGroupName('SAM-SA-15-SA-10-fareast-point-defence')
local connectionNode = Unit.getByName("NODEfareast")
local powerSource = StaticObject.getByName("Static-Electric-powerbox-SA-10-fareast")  
iranIADS:getSAMSiteByGroupName('SAM-SA-10-fareast'):addPowerSource(powerSource):addConnectionNode(connectionNode):addPointDefence(SA15PointDEF):setIgnoreHARMSWhilePointDefencesHaveAmmo(true)

--AWACS EW NODE connections:

local connectionNodeEW = Unit.getByName('NODEwest')
ewRadar = iranIADS:getEarlyWarningRadarByUnitName('EW-K-50')
ewRadar:addConnectionNode(connectionNodeEW)

local connectionNodeEW = Unit.getByName('NODEeast')
ewRadar = iranIADS:getEarlyWarningRadarByUnitName('EW-IRAN-A-50')
ewRadar:addConnectionNode(connectionNodeEW)

local connectionNodeEW = Unit.getByName('NODEfareast')
ewRadar = iranIADS:getEarlyWarningRadarByUnitName('EW-IRAN-A-50')
ewRadar:addConnectionNode(connectionNodeEW)

--USSR Grisha FFL1124.4 EW NODE connections:

local connectionNodeEW = Unit.getByName('NODEcentral')
ewRadar = iranIADS:getEarlyWarningRadarByUnitName('EW-USSR Grisha FFL1124.4')
ewRadar:addConnectionNode(connectionNodeEW)

--PRC Amphibious Transport Dock NODE connections:

local connectionNodeEW = Unit.getByName('NODEfareast')
ewRadar = iranIADS:getEarlyWarningRadarByUnitName('EW-PRC-Amphibious-Transport-Dock')
ewRadar:addConnectionNode(connectionNodeEW)


local jammerSource = Unit.getByName("USA-Jammer-Emmitter")
jammer = SkynetIADSJammer:create(jammerSource, iranIADS)


jammer:setMaximumEffectiveDistance(110)


end
