Beispiel #1
0
 /// <summary>
 /// Changes the selected COM Port
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void comboBoxCOMPort_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBoxCOMPort.Enabled) //If enabled (it gets dissabled if there are no ports
     {
         TreadmillController.ClearSerialPortName();
         TreadmillController.SetSerialPortName(comboBoxCOMPort.Items[comboBoxCOMPort.SelectedIndex].ToString());
         treadmillStatus = comboBoxCOMPort.Items[comboBoxCOMPort.SelectedIndex].ToString();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Redetects avaliable COM ports
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonRestartTM_Click(object sender, EventArgs e)
 {
     comboBoxCOMPort.Items.Clear();
     TreadmillController.ClearSerialPortName();
     DetectTreadmill();
 }