Esempio n. 1
0
 public WebMapBackgrnd(IkarusMapControl map)
 {
     mapControl = map;
     if (me.GoogleMapsCookie == null)
         imageProxy = new MicrosoftProxy();
     else
         imageProxy = new GoogleProxy(me.GoogleMapsCookie);
     
     imageProxy.listeners += notify;
     
     geo = new GeoPos(new WayPoint("gps", -6.003753, 37.391162), 10);
 }
Esempio n. 2
0
        public WebMapBackgrnd(IkarusMapControl map)
        {
            mapControl = map;
            if (me.GoogleMapsCookie == null)
            {
                imageProxy = new MicrosoftProxy();
            }
            else
            {
                imageProxy = new GoogleProxy(me.GoogleMapsCookie);
            }

            imageProxy.listeners += notify;

            geo = new GeoPos(new WayPoint("gps", -6.003753, 37.391162), 10);
        }
Esempio n. 3
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (button7.Text == "FIXED")
            {
                if (comboBoxTeam.SelectedItem != null)
                {
                    string nombre = comboBoxTeam.SelectedItem.ToString();
                    if (jthread != null && nombre != null)
                    {
                        WayPoint wpt;
                        if (mapControl1.team_pos.TryGetValue(nombre, out wpt))
                        {
                            jthread.modem_lon = (float)wpt.Longitude;
                            jthread.modem_lat = (float)wpt.Latitude;
                            jthread.modem_alt = (float)wpt.Altitude;
                        }
                        else
                        {
                            button7.Text = "Fail";
                        }
                    }
                }
                else
                {
                    button7.Text = "Track";
                }
            }

            if (button2.Text == "STOP")
            {
                mapControl1.SetCenter(mapControl1.plane);
                mapControl1.Invalidate();
            }
            else if (button3.Text == "STOP")
            {
                int texel = 256;
                GeoPos geo = new GeoPos(mapControl1.plane,mapControl1.GetZoom());
                double x = Math.Abs(geo.getdX(mapControl1.home))* texel;
                double y = Math.Abs(geo.getdY(mapControl1.home)) * texel;
                int zoom;

                // zona de seguridad
                x = x * 1.2f;
                y = y * 1.2f;

                while ((x > mapControl1.Width || y > mapControl1.Height) && (geo.getZoom() > 0))
                {
                    geo.setZoom(geo.getZoom() - 1);
                    x = Math.Abs(geo.getdX(mapControl1.home)) * texel;
                    y = Math.Abs(geo.getdY(mapControl1.home)) * texel;
                }

                while ((x < mapControl1.Width / 2) && (y < mapControl1.Height / 2) && (geo.getZoom() < 17))
                {
                    zoom = geo.getZoom();
                    geo.setZoom(geo.getZoom() + 1);
                    x = Math.Abs(geo.getdX(mapControl1.home)) * texel;
                    y = Math.Abs(geo.getdY(mapControl1.home)) * texel;
                }

                WayPoint medio=new WayPoint("",(mapControl1.plane.Longitude+mapControl1.home.Longitude)/2,
                    (mapControl1.plane.Latitude+mapControl1.home.Latitude)/2);
                mapControl1.SetCenter(medio);
                mapControl1.SetZoom(geo.getZoom());
                mapControl1.Invalidate();
            }/* */

            RefreshInstruments();
            UpdateTeams();
            
            if (antTracker != null)
            {
                antTracker.Send(knob_anttracker.Manual, knob_anttracker.Valor, 10);
            }
        }
Esempio n. 4
0
 public GeoPos(GeoPos geo)
 {
     Zoom      = geo.Zoom;
     Longitude = geo.Longitude;
     Latitude  = geo.Latitude;
 }
Esempio n. 5
0
        public double getdY(WayPoint wpt)
        {
            GeoPos geo = new GeoPos(wpt, this.getZoom());

            return(geo.getY() - this.getY());
        }
Esempio n. 6
0
 public GeoPos(GeoPos geo)
 {
     Zoom = geo.Zoom;
     Longitude = geo.Longitude;
     Latitude = geo.Latitude;
 }
Esempio n. 7
0
 public double getdY(WayPoint wpt)
 {
     GeoPos geo = new GeoPos(wpt, this.getZoom());
     return geo.getY() - this.getY();
 }