Ejemplo n.º 1
0
 private void TimerSerial_Tick(object sender, EventArgs e)
 {
     if (SerialPort.GetPortNames().Length != comboBoxSerial.Items.Count)
     {
         comboBoxSerial.Items.Clear();
         comboBoxSerial.Items.AddRange(SerialPort.GetPortNames());
         comboBoxSerial.SelectedIndex = comboBoxSerial.Items.Count - 1;
     }
     if (comboBoxSerial.Items.Count == 0)
     {
         buttonConnect.Enabled = false;
     }
     else
     {
         buttonConnect.Enabled = true;
     }
     labelSpeedX.Text        = "X: " + Vx.ToString();
     labelSpeedY.Text        = "Y: " + Vy.ToString();
     labelSpeedZ.Text        = "Z: " + Rw.ToString();
     labelMA.Text            = "MA: " + dataVal[0];
     labelMB.Text            = "MB: " + dataVal[1];
     labelMC.Text            = "MC: " + dataVal[2];
     labelMD.Text            = "MD: " + dataVal[3];
     labelStepperHeight.Text = "H: " + dataVal[4];
     labelServo.Text         = "S: " + dataVal[5];
     labelP.Text             = "P: " + dataVal[6];
     labelI.Text             = "I: " + dataVal[7];
     textBoxP.Text           = "P: " + P.ToString();
     textBoxI.Text           = "I: " + I.ToString();
     textBoxStpHeight.Text   = StepperHeight.ToString();
 }
Ejemplo n.º 2
0
 void SetSendContent()
 {
     textBoxSend.Text = "(" + Vx.ToString() + " " +
                        Vy.ToString() + " " +
                        Rw.ToString() + " " +
                        StepperHeight.ToString() + " " +
                        pulleyAState.ToString() + " " +
                        pulleyBState.ToString() + " " +
                        pulleyCState.ToString() + " " +
                        pulleyCHook.ToString() + " " +
                        P.ToString() + " " +
                        I.ToString() + ")";
     return;
 }