Ejemplo n.º 1
0
        private void UpdateSensorDisplay()
        {
            SensorPacketGroup spg = (SensorPacketGroup)sensorGroupList.SelectedItem;

            sensorTextBox.Clear();
            for (int i = 0; i < spg.numItems; i++)
            {
                sensorTextBox.AppendText(Sensors.sd[spg.offsetInSensorDesc + i].name + Environment.NewLine);
            }
        }
Ejemplo n.º 2
0
 public Sensors(byte[] buf, SensorPacketGroup spg)
 {
     bytes = buf;
     if (spg != null)
     {
         valid   = (bytes.Length == spg.numBytes);
         spGroup = spg;
     }
     else
     {
         valid = false;
     }
 }
Ejemplo n.º 3
0
        private void UpdateSensorDisplay(Sensors s)
        {
            SensorPacketGroup spg = (SensorPacketGroup)sensorGroupList.SelectedItem;

            sensorTextBox.Clear();
            for (int i = 0; i < spg.numItems; i++)
            {
                sensorTextBox.AppendText(Sensors.sd[spg.offsetInSensorDesc + i].name + ": " + s.GetValue((Sensors.SensorID)(spg.offsetInSensorDesc + i)) + Environment.NewLine);
            }

            // drawing update
            canvas1.rotateRoomba(s.GetValue(Sensors.SensorID.Angle));
            canvas1.moveRoomba(s.GetValue(Sensors.SensorID.Distance));
        }
Ejemplo n.º 4
0
 private void sensorGroupList_SelectedIndexChanged(object sender, EventArgs e)
 {
     currentSpg = (SensorPacketGroup)sensorGroupList.SelectedItem;
     UpdateSensorDisplay();
 }
Ejemplo n.º 5
0
 internal void requestSensorStream(SensorPacketGroup spg)
 {
     byte[] buf = { 148, 1, (byte)(spg.packetID) };
     Send(buf, 0, buf.Length);
 }
Ejemplo n.º 6
0
 public void requestSensorPacket(SensorPacketGroup spg)
 {
     byte[] buf = { 142, (byte)(spg.packetID) };
     lastRequestedPacket = spg;
     Send(buf, 0, buf.Length);
 }