Beispiel #1
0
 public AntTrackerConfig ReadConfig()
 {
     AntTrackerConfig antTrackerCfg = new AntTrackerConfig();
     byte[] buffer = Read(Comandos.AntTrackerConfig, 0, 0, antTrackerCfg.size_bytes());
     antTrackerCfg.FromByteArray(buffer);
     return antTrackerCfg;
 }
Beispiel #2
0
        public void WriteConfig(AntTrackerConfig antTrackerCfg)
        {
            byte[] buffer = antTrackerCfg.ToByteArray();

            Write(Comandos.AntTrackerConfig, 0, 0, buffer);
            Flush();
            //RemoteIkarus(1, 0);
        }
 private void button3_Click(object sender, EventArgs e)
 {
     antTrackConfig = antenaTracker.ReadConfig();
     UpdateControles();    
 }
        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;
            }
            
        }
        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;
            }
        }