
redIADS = SkynetIADS:create('RED')

local iadsDebug = redIADS:getDebugSettings()
iadsDebug.IADSStatus = true
iadsDebug.contacts = true
iadsDebug.jammerProbability = true
iadsDebug.addedEWRadar = true
iadsDebug.addedSAMSite = true
iadsDebug.warnings = true
iadsDebug.radarWentLive = true
iadsDebug.radarWentDark = true
iadsDebug.harmDefence = true
iadsDebug.noWorkingCommmandCenter = true
iadsDebug.samNoConnection = true
iadsDebug.samSiteStatusEnvOutput = true
iadsDebug.earlyWarningRadarStatusEnvOutput = true
iadsDebug.commandCenterStatusEnvOutput = true

redIADS:addSAMSitesByPrefix('SAM')
redIADS:addEarlyWarningRadarsByPrefix('EWR')

local connectionNode = Unit.getByName('Command-NODE-NW')
local commandCenter = StaticObject.getByName("Command-Center-NW")
redIADS:addCommandCenter(commandCenter):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName('Bandar-Abbas-Command-NODE-1')
local commandCenter = StaticObject.getByName("Command-Center-Bandar-Abbas")
redIADS:addCommandCenter(commandCenter):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName('Command-NODE-N')
local commandCenter = StaticObject.getByName("Command-Center-N")
redIADS:addCommandCenter(commandCenter):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName('Bandar-Abbas-Command-NODE-1')
redIADS:getSAMSiteByGroupName('SAM-Bandar-Abbas-SA-17'):addConnectionNode(connectionNode):setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

local connectionNode = Unit.getByName('Command-NODE-N')
redIADS:getSAMSiteByGroupName('SAM-BUK-N-1'):addConnectionNode(connectionNode):setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

local connectionNode = Unit.getByName('Command-NODE-N')
redIADS:getSAMSiteByGroupName('SAM-SA-15-EWR-N-point-defence'):addConnectionNode(connectionNode):setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

local connectionNode = Unit.getByName('Command-NODE-NW')
redIADS:getSAMSiteByGroupName('SAM-BUK-NW-2'):addConnectionNode(connectionNode):setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

local connectionNode = Unit.getByName('Command-NODE-NW')
redIADS:getSAMSiteByGroupName('SAM-SA-15-EWR-point-defence-NW'):addConnectionNode(connectionNode):setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

local connectionNode = Unit.getByName('Command-NODE-NW')
redIADS:getSAMSiteByGroupName('SAM-HQ-22-AD-Iran-Oil-Platforms'):addConnectionNode(connectionNode):setActAsEW(true)

local powerSource = StaticObject.getByName('Power-Supply-Bandar-Abbas-1')
local connectionNode = Unit.getByName('Bandar-Abbas-Command-NODE-1')
redIADS:getEarlyWarningRadarByUnitName('EWR-Bandar-Abbas'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local connectionNode = Unit.getByName('Bandar-Abbas-Command-NODE-1')
redIADS:getEarlyWarningRadarByUnitName('EWR-Central-Shiraz-China'):addConnectionNode(connectionNode)

local powerSource = StaticObject.getByName('Power-Supply-EWR-NW')
local connectionNode = Unit.getByName('Command-NODE-NW')
redIADS:getEarlyWarningRadarByUnitName('EWR-NW'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local powerSource = StaticObject.getByName('Power-Supply-EWR-N')
local connectionNode = Unit.getByName('Command-NODE-N')
redIADS:getEarlyWarningRadarByUnitName('EWR-N'):addPowerSource(powerSource):addConnectionNode(connectionNode)

local SA15PointDEF = redIADS:getSAMSiteByGroupName('SAM-SA-23-point-defence-NW')
local connectionNode = Unit.getByName('Command-NODE-NW')
redIADS:getSAMSiteByGroupName('SAM-SA-23-NW'):addConnectionNode(connectionNode):addPointDefence(SA15PointDEF):
setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

local SA15PointDEF = redIADS:getSAMSiteByGroupName('SAM-Bandar-Abbas-SA-23-point-defence')
local connectionNode = Unit.getByName('Bandar-Abbas-Command-NODE-1')
redIADS:getSAMSiteByGroupName('SAM-Bandar-Abbas-EWR-defence'):addConnectionNode(connectionNode):addPointDefence(SA15PointDEF):
setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE):setGoLiveRangeInPercent(100)

redIADS:setUpdateInterval(20)

redIADS:addRadioMenu()

redIADS:activate()


