//  ==================================================
//  All part descriptions assume the RT root model and a
//  DSN range of 1.14e14 meters. If either changes, the
//  parameters of the antennae need to be updated.

//  Calculating the maximum effective range can be done
//  via the following equation:

//      EffectiveRange = min(AntennaRange1, AntennaRange2) + SQRT(AntennaRange1 * AntennaRange2)

//  For omnidirectional antennae the actual effective
//  range will be clipped at 100 times the calculated
//  effective range and for the directional at 1000 times.

//  ==================================================
//  Reflectron DP-10 omnidirectional antenna.
//  ==================================================

@PART[RTShortAntenna1]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	@mass = 0.005
	@node_attach = 0.46, 0.0, 0.0, 1.0, 0.0, 0.0, 1

    @description ^=:$: <b><color=#00eaf0>Effective range to Earth DSN: 10 Mm. Power Consumption: 5 Watts. Use Case: Low Earth Orbit</color></b>

	@MODULE[ModuleRTAntenna]
	{
		// The DP-10 is for getting off the ground, not talking
		// to the moon. Drop it down to a very reasonable 100k
		@Mode0OmniRange = 1e5
		@Mode1OmniRange = 1e5
		@EnergyCost = 0.005
		@TRANSMITTER
		{
			@PacketInterval = 0.4
			@PacketSize = 0.27
			@PacketResourceCost = 0.005
		}
	}
}

//  ==================================================
//  Communotron 32 omnidirectional antenna.
//  ==================================================

@PART[RTLongAntenna2]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	@mass = 0.005
	@description = Using integrated circuits, the Communotron 32 outperforms its smaller sibling in any conceivable way, at comparable weight and power demands. Considerable range even when retracted, always on. <b><color=#00eaf0>Effective range to Earth DSN: 1.6 Gm. Power Consumption: 15 Watts. Maximum Data Rate: 512 kbit/s. Use Case: Moon</color></b>
	@MODULE[ModuleRTAntenna]
	{
		@Mode0OmniRange = 1e6
		@Mode1OmniRange = 1.6e7
		@EnergyCost = 0.0015
		@TRANSMITTER
		{
			@PacketInterval = 0.4
			@PacketSize = 0.512
			@PacketResourceCost = 0.004
		}
	}
}

//  ==================================================
//  CommTech EXP-VR-2T omnidirectional antenna.
//  ==================================================

@PART[RTLongAntenna3]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	@mass = 0.015
	@node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0

    @description ^=:$: <b><color=#00eaf0>Effective range to Earth DSN: 1.0 Gm. Power Consumption: 20 Watts. Maximum Data Rate: 512 kbit/s. Use Case: Moon</color></b>

	@MODULE[ModuleRTAntenna]
	{
		@Mode0OmniRange = 1e6
		@Mode1OmniRange = 1e7
		@EnergyCost = 0.02
		@TRANSMITTER
		{
			@PacketInterval = 0.1
			@PacketSize = 0.512
			@PacketResourceCost = 0.1
		}
	}
}

//  ==================================================
//  Reflectron KR-7 parabolic antenna.

//  Diameter: 1.4 m
//  ==================================================

@PART[RTShortDish2]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	%rescaleFactor = 0.5  //70cm
	@mass = 0.025  //heavy!
	@node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0
	@node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 2
	@description = An early, small high-gain antenna. Rather wide cone and high bandwidth for Comm satellites in GEO, live video from the Moon, and similar tasks. <b><color=#00eaf0>Effective range to Earth DSN: 75 Gm. Power Consumption: 50 Watts. Maximum Data Rate: 1 Mbit/s. Use Case: Moon</color></b>
	@MODULE[ModuleRTAntenna]
	{
		@Mode0DishRange = 0
		@Mode1DishRange = 75e6
		@EnergyCost = 0.05  //equals early return core
		@MaxQ = 6000
		@DishAngle = 25
		@TRANSMITTER
		{
			@PacketInterval = 0.1
			@PacketSize = 1.024
			@PacketResourceCost = 0.01
		}
	}
}

//  ==================================================
//  Reflectron SS-5 parabolic antenna.

//  Diameter: N/A (deprecated)
//  ==================================================

@PART[RTShortDish1]:AFTER[RemoteTech]
{
	%RSSROConfig = False
	@mass = 0.110
	@description = Replacing the LL-5, this dish will carry your signal beyond Duna looking fancier than ever.
	@node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1
	@node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1
	@MODULE[ModuleRTAntenna]
	{
		@Mode0DishRange = 0
		@Mode1DishRange = 240000000000
		@EnergyCost = 0.12
		@MaxQ = 6000
		@DishAngle = 1.7
		@TRANSMITTER
		{
			@PacketInterval = 0.3
			@PacketSize = 0.88
			@PacketResourceCost = 0.6
		}
	}
}

//  ==================================================
//  Pioneer 10 & 11 parabolic antenna.

//  Dimensions: 2.77 m x 1.3 m
//  Inert Mass: 40 kg
//  ==================================================

@PART[RTLongDish2]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	@title=Pioneer 10/11 Class Antenna
	@mass = 0.04
	@description = Dish approximating those found on Pioneer 10/11 with low bandwith. <b><color=#00eaf0>Effective range to Earth DSN: 1.7 Tm. Power Consumption: 57 Watts. Maximum Data Rate: 256 kbit/s. Use Case: Saturn</color></b>
	@node_stack_bottom = 0.0, -0.2, 0.0, 0.0, -1.0, 0.0, 1
	@node_attach = 0.0, -0.2, 0.0, 0.0, -1.0, 0.0, 1
	@MODULE[ModuleRTAntenna]
	{
		%IsRTActive = false
		@Mode0DishRange = 0
		@Mode1DishRange = 2.5e10
		@EnergyCost = 0.057
		@MaxQ = 6000
		@DishAngle = 3.3
		%ProgressFxModules = 1

		@TRANSMITTER
		{
			@PacketInterval = 1.0
			@PacketSize = 0.256
			@PacketResourceCost = 0.008
		}
	}
}

//  ==================================================
//  CommTech-1 parabolic antenna.

//  Diameter: 2.49 m
//  ==================================================

@PART[RTGigaDish2]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	@title=Voyager Antenna
	// antenna diameter source: https://nssdc.gsfc.nasa.gov/nmc/spacecraft/display.action?id=1977-076A
	// Voyager: 3.66 m, 48dB, 100x more bandwidth than pioneer10/11
	
	%rescaleFactor=1.47
	@mass = 0.100
	@node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 2
	@node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 2
	@description = Large dish suitable for deep-space missions well past Pluto; integrated circuitry largely makes up for the weight of the wider dish. Pretty good data rate. <b><color=#00eaf0>Effective range to Earth DSN: 11.67 Tm. Power Consumption: 93 Watts. Maximum Data Rate: 1 Mbit/s. Use Case: Pluto (and beyond)</color></b>
	@MODULE[ModuleRTAntenna]
	{
		@Mode0DishRange = 0
		@Mode1DishRange = 1e12
		@EnergyCost = 0.093
		@MaxQ = 6000
		@DishAngle = 1
		@TRANSMITTER
		{
			@PacketInterval = 0.1
			@PacketSize = 1.024
			@PacketResourceCost = 0.05
		}
	}
}

//  ==================================================
//  Reflectron GX-128 retractable parabolic antenna.

//  Diameter retracted: 1.4 m
//  Diameter extended: 6.4 m
//  ==================================================

@PART[RTGigaDish1]:AFTER[RemoteTech]
{
	%RSSROConfig = True
	@mass = 0.070
	@description = The folding mechanism doesn't really save mass. However, the huge 6.4m dish can provide a very decent data rate at comparatively little power. <b><color=#00eaf0>Effective range to Earth DSN: 11.67 Tm. Power Consumption: 60 Watts. Maximum Data Rate: 2 Mbit/s. Use Case: Pluto (and beyond)</color></b>
	@node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1
	@node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1
	@MODULE[ModuleRTAntenna]
	{
		@Mode0DishRange = 0
		@Mode1DishRange = 1e12
		@EnergyCost = 0.06
		@MaxQ = 6000
		@DishAngle = 0.2
		@TRANSMITTER
		{
			@PacketInterval = 0.2
			@PacketSize = 2.048
			@PacketResourceCost = 0.1
		}
	}
}

//  ==================================================
//  Reflectron GX-256 retractable parabolic antenna.

//  Diameter retracted: 2.2 m
//  Diameter extended: 10.5 m
//  ==================================================

+PART[RTGigaDish1]:AFTER[RemoteTech]
{
	@name = RO_gx256
	!mesh = DELETE
	MODEL
	{
		model = RemoteTech/Parts/GigaDish1/model
		scale = 2.0, 2.0, 2.0
	}
	@scale = 2.0
	%rescaleFactor = 1.0
	@node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 2
	@node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 2
	@title = Reflectron GX-256
	@description = A massive dish, useful for high speed, long range communications, but its power usage and size make it largely unsuitable for use on interplanetary probes. It is, however, very useful as an orbital relay, or even a extra ground station. 40 Tm range to other antennas. <b><color=#00eaf0>Effective range to Earth DSN: 107 Tm. Power Consumption: 850 Watts. Maximum Data Rate: 4 Mbit/s. Use Case: Ground Station</color></b>
	@mass = 0.100
	@MODULE[ModuleRTAntenna]
	{
		@Mode1DishRange = 4e13 // 40Tm
		@EnergyCost = 0.85
		@DishAngle = 0.5
		@TRANSMITTER
		{
			@PacketInterval = 1.2
			@PacketSize = 4.048
			@PacketResourceCost = 4.25
		}
	}
}
