Beispiel #1
0
        private void SetPerPlanetList()
        {
            signalMinDirect = new List <double> ();
            signalMaxDirect = new List <double> ();
            signalMinRelay  = new List <double> ();
            signalMaxRelay  = new List <double> ();

            foreach (MyTuple planet in AHUtil.signalPlanetList)
            {
                signalMinDirect.Add(AHUtil.GetSignalStrength(directBetterRange, planet.item2));
                signalMaxDirect.Add(AHUtil.GetSignalStrength(directBetterRange, planet.item3));
                signalMinRelay.Add(AHUtil.GetSignalStrength(relayBetterRange, planet.item2));
                signalMaxRelay.Add(AHUtil.GetSignalStrength(relayBetterRange, planet.item3));
            }
        }
        private void SetPerPlanetList()
        {
            signalMinDirect = new List <double> ();
            signalMaxDirect = new List <double> ();
            signalMinRelay  = new List <double> ();
            signalMaxRelay  = new List <double> ();

            //for (int p = AHUtil.signalPlanetList.Count - 1; p >= 0; p--)
            for (int p = 0; p < AHUtil.signalPlanetList.Count; p++)
            {
                var planet = AHUtil.signalPlanetList[p];

                //foreach (MyTuple planet in AHUtil.signalPlanetList) {
                signalMinDirect.Add(AHUtil.GetSignalStrength(directBetterRange, planet.item2));
                signalMaxDirect.Add(AHUtil.GetSignalStrength(directBetterRange, planet.item3));
                signalMinRelay.Add(AHUtil.GetSignalStrength(relayBetterRange, planet.item2));
                signalMaxRelay.Add(AHUtil.GetSignalStrength(relayBetterRange, planet.item3));
            }
        }
Beispiel #3
0
 private void SetActiveConnect()
 {
     if (vessel.Connection == null || !vessel.Connection.IsConnected)
     {
         connectedToDSN = false;
         connectedTo    = null;
         targetPower    = 0;
         targetMaxRange = 0;
         targetDistance = 0;
         sSToTarget     = 0;
         sSTargetToDSN  = 0;
         sSToDSN        = 0;
     }
     else if (vessel.Connection.ControlPath [0].b.isHome)
     {
         connectedToDSN = true;
         connectedTo    = null;
         targetPower    = dsnPower;
         targetMaxRange = dsnRange;
         targetDistance = Vector3.Distance(vessel.GetWorldPos3D(), Relay.DSN.position) - Relay.DSN.distanceOffset;
         targetDistance = (targetDistance < 0) ? 0 : targetDistance;
         sSToTarget     = AHUtil.GetSignalStrength(targetMaxRange, targetDistance);
         sSTargetToDSN  = 0;
         sSToDSN        = sSToTarget;
     }
     else
     {
         connectedToDSN = false;
         connectedTo    = vessel.Connection.ControlPath [0].b.transform.GetComponent <Vessel> ();
         targetPower    = relays [connectedTo].linkList [0].relayA.relayPower;
         targetMaxRange = AHUtil.GetRange(vesselPower, relays [connectedTo].endRelayPower);
         targetDistance = Vector3.Distance(vessel.vesselTransform.position, connectedTo.vesselTransform.position);
         sSToTarget     = AHUtil.GetSignalStrength(targetMaxRange, targetDistance);
         sSTargetToDSN  = relays [connectedTo].endRelaySignalStrength;
         sSToDSN        = sSToTarget * sSTargetToDSN;
     }
 }
Beispiel #4
0
 public static void CalcCustomDistance()
 {
     signalCustomDistanceDirect = AHUtil.GetSignalStrength(directBetterRange, Double.Parse(customDistance));
     signalCustomDistanceRelay  = AHUtil.GetSignalStrength(relayBetterRange, Double.Parse(customDistance));
 }
Beispiel #5
0
 private double _signalStrength()
 {
     return(AHUtil.GetSignalStrength(maxRange, distance));
 }