Beispiel #1
0
 /// <summary>
 /// stop情况下电机off
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_Stop_Click(object sender, EventArgs e)
 {
     JohnbeeSerialPort.Send_ComData(1, TopId, (byte)FormSetId.ID_Motor_Stop);
     btn_MotorOn.Text = "MotorOn";
     tb_State.Text    = "OFF";
     JohnbeeSerialPort.Send_ComData(0, TopId, (byte)FormSetId.ID_Motor_State);
 }
Beispiel #2
0
 private void btn_MotorOn_Click(object sender, EventArgs e)
 {
     if (btn_MotorOn.Text == "MotorOn")
     {
         btn_MotorOn.Text = "MotorOff";
         tb_State.Text    = "ON";
         JohnbeeSerialPort.Send_ComData(1, TopId, (byte)FormSetId.ID_Motor_State);
         nUD_MaxAmprage.Enabled = false;
         nUD_MaxSpd.Enabled     = false;
         Comb_Mode.Enabled      = false;
         if (Comb_Mode.SelectedIndex == 0)
         {
             nUD_SetDistance.Enabled = true;
         }
         else if (Comb_Mode.SelectedIndex == 1)
         {
             nUD_SetSpd.Enabled = true;
         }
     }
     else
     {
         btn_MotorOn.Text = "MotorOn";
         tb_State.Text    = "OFF";
         JohnbeeSerialPort.Send_ComData(0, TopId, (byte)FormSetId.ID_Motor_State);
         nUD_MaxAmprage.Enabled  = true;
         nUD_MaxSpd.Enabled      = true;
         Comb_Mode.Enabled       = true;
         nUD_SetDistance.Enabled = false;
         nUD_SetSpd.Enabled      = false;
     }
 }
Beispiel #3
0
 private void FormSet_Load(object sender, EventArgs e)
 {
     JohnbeeSerialPort.ComDataChangeEvent += Reflash_Form;
     //先off电机
     JohnbeeSerialPort.Send_ComData(0, TopId, (byte)FormSetId.ID_Motor_State);
     nUD_SetDistance.Enabled = false;
     nUD_SetSpd.Enabled      = false;
     //richTextBox1.Enabled = false;
     MyRecongizer.SpeechRecognized += MyRecongizer_SpeechRecognized;
     MotorGrammar.Add(MyCallHelpGrammar);
     MotorGrammar.Add(MySetParamGrammar);
     MotorGrammar.Add(MyMotorOperatingGrammar);
     foreach (TopGrammar gra in MotorGrammar)
     {
         MyRecongizer.LoadGrammar(gra.RootGrammar);
         richTextBox1.Text += gra.RootGrammar_ShowPhrase + "\n";
     }
     MyRecongizer.SetInputToDefaultAudioDevice();         //设置输入为麦克风
     MyRecongizer.RecognizeAsync(RecognizeMode.Multiple); //异步执行识别
 }
Beispiel #4
0
 private void Comb_Mode_SelectedIndexChanged(object sender, EventArgs e)
 {
     JohnbeeSerialPort.Send_ComData(Comb_Mode.SelectedIndex, TopId, (byte)FormSetId.ID_Motor_Mode);
 }
 private void numericUpDown_Loc_Kd3_ValueChanged(object sender, EventArgs e)
 {
     JohnbeeSerialPort.Send_ComData(numericUpDown_Loc_Kd3.Value, TopId, (byte)(byte)(byte)FormPIDId.ID_Loc_Kd3);
 }
 private void numericUpDown_Psi_Ki2_ValueChanged(object sender, EventArgs e)
 {
     JohnbeeSerialPort.Send_ComData(numericUpDown_Psi_Ki2.Value, TopId, (byte)FormPIDId.ID_Psi_Ki2);
 }