예제 #1
0
        private GameObject CreateMapMarkerDSN()
        {
            GameObject  markerObject = new GameObject();
            AHMapMarker marker       = markerObject.AddComponent <AHMapMarker> ();

            marker.SetUp(dsnRange, vessel, dsnBody.MapObject.trf, true, 1d);
            return(markerObject);
        }
예제 #2
0
        private IEnumerator SetMarkerList()
        {
            markerDSN = CreateMapMarkerDSN();

            markersRelay = new Dictionary <Vessel, AHMapMarker> ();

            foreach (KeyValuePair <Vessel, LinkPath> relay in relays)
            {
                yield return(timers [0]);

                markersRelay.Add(relay.Key, CreateMapMarkerRelay(relay.Key));
            }
        }
예제 #3
0
        private GameObject CreateMapMarkerRelay(Vessel relay)
        {
            double realSignal = relays [relay].endRelaySignalStrength;            //AHUtil.GetREALSignal (relay.Connection.ControlPath);
            double range      = AHUtil.GetDistanceAt0
                                    (AHUtil.GetRange(vesselPower, relays [relay].endRelayPower));
            GameObject  markerObject = new GameObject();
            AHMapMarker marker       = markerObject.AddComponent <AHMapMarker> ();

            marker.SetUp(range, vessel, relay.mapObject.trf, false, realSignal);


            return(markerObject);
        }
예제 #4
0
        private IEnumerator UpdateCommNet()
        {
            List <Vessel> relayList = FlightGlobals.Vessels.FindAll(
                v => ((v.vesselType == VesselType.Relay) &&
                      (v.Connection.IsConnected) &&
                      (v != vessel)));

            while (true)
            {
                // Check relay state
                foreach (Vessel relay in relayList)
                {
//					relaySS = AHUtil.GetREALSignal (relay.Connection.ControlPath);

                    AHMapMarker marker = markerObjectsRelay [relay].GetComponent <AHMapMarker> ();
                    if ((relays [relay].endRelaySignalStrength > marker.scale + .01d) ||
                        (relays [relay].endRelaySignalStrength < marker.scale - .01d))
                    {
                        marker.SetScale(relays [relay].endRelaySignalStrength);
                    }
                    yield return(timers [0]);
                }
                // Check Active Connect state
                SetActiveConnect();

                // Chech Deployable Antenna state
                foreach (KeyValuePair <ModuleDeployableAntenna, bool> kvp in deployableAntennas)
                {
                    if (((kvp.Key.deployState == ModuleDeployablePart.DeployState.EXTENDED) &&
                         (kvp.Value != true)) ||
                        ((kvp.Key.deployState != ModuleDeployablePart.DeployState.EXTENDED) &&
                         (kvp.Value == true)))
                    {
                        VesselModified();
                    }
                }

                UpdateActiveDetails();
                if (showPotentialRelaysWindow || !hasStarted)
                {
                    UpdateRelaysDetails();
                }

                hasStarted = true;
                if (!doMath || !doUpdate)
                {
                    yield break;
                }
                yield return(timers[1]);
            }
        }