Exemple #1
0
 /// <summary>
 /// Zobrazí stav konkrétního motoru
 /// </summary>
 /// <param name="motorView">vizualizace motoru</param>
 /// <param name="state">stav</param>
 /// <param name="message">zpráva ke stavu</param>
 /// <param name="motorId">id motoru</param>
 private void showMotorState(Label motorView, MotorState state, String message, MotorId motorId, int speed, int position) {
     switch (state)
     {
         case MotorState.error:
             motorView.BackColor = Color.Red;
             break;
         case MotorState.enabled:
             motorView.BackColor = Color.Green;
             break;
         case MotorState.disabled:
             motorView.BackColor = Color.LightSlateGray;
             break;
         case MotorState.running:
             motorView.BackColor = Color.Orange;
             break;
     }
     this.Invoke((MethodInvoker)delegate
     {
         ((Label)motorView.GetChildAtPoint(new Point(0,0))).Text = speed.ToString();
         motorView.Text = position.ToString();
         toolTip.SetToolTip(motorView, "ID motoru: " + motorId + "\nStav motoru: " + state + "\nZpráva: " + message);
         motorView.Update();
     });
 }