예제 #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (antenaTracker.IsOpen())
            {
                if (firstTime)
                {
                    firstTime = false;

                    antTrackConfig = antenaTracker.ReadConfig();
                    UpdateControles();
                    panel1.Enabled = true;
                    control_pan    = (short)(int)numericUpDownServoPANcenter.Value;
                    control_tilt   = (short)(int)numericUpDownServoTILTcenter.Value;
                }
                labelStatus.Text      = "Connected!";
                labelStatus.ForeColor = Color.Green;

                // Aqui se envia realmente el comando.... mover de sitio?
                AntTrackerDebug dbg = new AntTrackerDebug();
                dbg.pan         = control_pan;
                dbg.tilt        = control_tilt;
                dbg.EnableDebug = 0x05;
                antenaTracker.WriteDebugInfo(dbg);
            }
            else
            {
                labelStatus.Text      = "Not connected.";
                labelStatus.ForeColor = Color.Red;
            }
        }
예제 #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            AntenaTracker antenaTracker = new AntenaTracker();

            if (antenaTracker.IsOpen())
            {
                if (firstTime)
                {
                    antTrackConfig = antenaTracker.ReadConfig();
                    UpdateControles();
                    panel1.Enabled = true;
                    firstTime      = false;
                    control_pan    = numericUpDownServoPANcenter;
                    control_tilt   = numericUpDownServoTILTcenter;
                }
                labelStatus.Text      = "Connected!";
                labelStatus.ForeColor = Color.Green;
                AntTrackerDebug dbg = new AntTrackerDebug();
                dbg.pan         = (short)control_pan.Value;
                dbg.tilt        = (short)control_tilt.Value;
                dbg.EnableDebug = 0x05;
                antenaTracker.WriteDebugInfo(dbg);
                antenaTracker.Close();
            }
            else
            {
                labelStatus.Text      = "Not connected.";
                labelStatus.ForeColor = Color.Red;
            }
        }
예제 #3
0
 public USBXpress.ReturnCodes WriteDebugInfo(AntTrackerDebug debug)
 {
     if (this.IsOpen() && debug != null)
     {
         byte[] buffer = debug.ToByteArray();
         return(Write(Comandos.DebugInfo, 0, 0, buffer));
     }
     return(USBXpress.ReturnCodes.SI_WRITE_ERROR);
 }
예제 #4
0
 private void FormConfigurarAntracker_FormClosing(object sender, FormClosingEventArgs e)
 {
     timer1.Enabled = false;
     if (antenaTracker.IsOpen())
     {
         AntTrackerDebug dbg = new AntTrackerDebug();
         dbg.EnableDebug = 0x00;
         antenaTracker.WriteDebugInfo(dbg);
         antenaTracker.Close();
     }
 }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled        = false;
            labelStatus.Text      = "Closed!";
            labelStatus.ForeColor = Color.DarkRed;
            if (antenaTracker.IsOpen())
            {
                AntTrackerDebug dbg = new AntTrackerDebug();
                dbg.EnableDebug = 0x00;
                antenaTracker.WriteDebugInfo(dbg);
                antenaTracker.Close();
            }

            FormActualizarFirmware form = new FormActualizarFirmware(FormActualizarFirmware.Devices.AntTracker);

            form.Show(this);
        }
예제 #6
0
        //FiltroMediana filtroLat = new FiltroMediana(10);
        //FiltroMediana filtroLon = new FiltroMediana(10);
        //FiltroMediana filtroAlt = new FiltroMediana(10);


        public AntTracker()
        {
            planeStateUpdated = false;
            terminate         = false;
            antenaTracker     = new AntenaTracker();
            datosAvion        = new AntTrackerDatosAvion();
            datosAvion.LoadDefaults();

            debug = new AntTrackerDebug();
            debug.LoadDefaults();

            if (antenaTracker.IsOpen())
            {
                timer = new System.Threading.Timer(TimerTask, this, 1000, 1000 / 5);
            }
            else if (singleton.Idioma == 0)
            {
                MessageBox.Show("No se puede abrir dispositivo AntTracker");
            }
            else
            {
                MessageBox.Show("Cannot open AntTracker device");
            }
        }