Exemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of our transmitting phone
        /// with default configuration and graphics.
        /// </summary>
        /// <returns>A new SimpleDigitalTransmitter.</returns>
        private SimpleDigitalTransmitter CreateTransmittingPhone()
        {
            var earth = CentralBodiesFacet.GetFromContext().Earth;

            // Create a new SimpleDigitalTransmitter and assign its basic properties.
            // Even though we are using a static location for our transmitter,
            // it can easily be changed to a moving one by simply modifying the
            // LocationPoint to something else, for example a route generated
            // with the Route Design Library.
            double longitude = Trig.DegreesToRadians(39.6333);
            double latitude  = Trig.DegreesToRadians(11.1333);
            var    phone     = new SimpleDigitalTransmitter
            {
                Name             = "Dessie, Ethiopia",
                LocationPoint    = new PointCartographic(earth, new Cartographic(longitude, latitude, 0.0)),
                CarrierFrequency = m_intendedSignal.TargetFrequency,
                EffectiveIsotropicRadiatedPower = CommunicationAnalysis.FromDecibels(m_transmitPowerTrackBar.Value),
                DataRate = 50000.0
            };

            //Add a default marker
            phone.Extensions.Add(new MarkerGraphicsExtension(new MarkerGraphics
            {
                Texture = new ConstantGraphicsParameter <Texture2D>(m_phoneTexture)
            }));

            //Add a label based on the name and show just below the marker.
            var textGraphics = new TextGraphics
            {
                Color             = new ConstantGraphicsParameter <Color>(Color.Yellow),
                Font              = new ConstantGraphicsParameter <Font>(m_labelFont),
                Outline           = new ConstantGraphicsParameter <bool>(true),
                OutlineColor      = new ConstantGraphicsParameter <Color>(Color.Black),
                Text              = new ConstantGraphicsParameter <string>(phone.Name),
                Origin            = new ConstantGraphicsParameter <Origin>(Origin.TopCenter),
                PixelOffset       = new ConstantGraphicsParameter <PointF>(new PointF(0, -m_phoneTexture.Template.Height / 2)),
                DisplayParameters =
                {
                    MaximumDistance = new ConstantGraphicsParameter <double>(75000000.0)
                }
            };

            if (TextureFilter2D.Supported(TextureWrap.ClampToEdge))
            {
                textGraphics.TextureFilter = new ConstantGraphicsParameter <TextureFilter2D>(TextureFilter2D.NearestClampToEdge);
            }

            phone.Extensions.Add(new TextGraphicsExtension(textGraphics));

            return(phone);
        }
Exemplo n.º 2
0
        /// <summary>
        /// "Places" the call by enabling the display of
        /// the link budget results as well as showing a line
        /// indicating if the link is currently valid. If links
        /// signal to noise ratio gets to high, it becomes invalid
        /// and the line disappears.
        /// </summary>
        private void OnPlaceCallClick(object sender, EventArgs e)
        {
            m_callPlaced = true;
            m_placeCallButton.Enabled                 = false;
            m_hangUpButton.Enabled                    = true;
            m_transmitPowerTrackBar.Enabled           = false;
            m_linkBudgetOverlayHelper.Overlay.Display = true;

            // We want to draw link lines representing the link, but we don't want to draw the
            // lines unless the signal quality is acceptable. We already configured the
            // link itself to take the curvature of the earth into account to ensure line
            // of sight for our assets. The next step is to choice an acceptable signal
            // quality. Below we create an AccessQuery that is only valid when the
            // carrier to noise ratio of the final downlink is over -16 dB.
            // We then pass this query to UpdateLinkGraphics which will use it to
            // configure the Display property of the link graphics. Finally, we call
            // ApplyChanges to update the display.
            var         linkBudgetScalars = m_communicationSystem.GetLinkBudgetScalars(m_iridium4ToReceiverDownLink, m_intendedSignal);
            AccessQuery query             = new ScalarConstraint(linkBudgetScalars.CarrierToNoise, CommunicationAnalysis.FromDecibels(-16.0));

            UpdateLinkGraphics(m_callerToIridium49UpLink, query);
            UpdateLinkGraphics(m_iridium4ToReceiverDownLink, query);
            UpdateLinkGraphics(m_iridium49To58Crosslink, query);
            UpdateLinkGraphics(m_iridium58To4Crosslink, query);
            m_display.ApplyChanges();

            // Manually fire the combo box change event in order to
            // properly initialize the link budget overlay.
            OnLinkComboBoxSelectedIndexChanged(this, EventArgs.Empty);

            // Start animation if it's not going.
            if (!SceneManager.Animation.IsAnimating)
            {
                SceneManager.Animation.PlayForward();
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// We allow the user to modify the transmission power via a track bar. Whenever it is changed,
 /// assign the new power. This does not affect anything until until we create new evaluators.
 /// </summary>
 private void OnTransmitPowerValueChanged(object sender, EventArgs e)
 {
     m_transmittingPhone.EffectiveIsotropicRadiatedPower = CommunicationAnalysis.FromDecibels(m_transmitPowerTrackBar.Value);
 }