Пример #1
0
        /// <summary>
        /// Changes the color of a numbered fan's power status led on main panel.
        /// </summary>
        /// <param name="fan">Fan to change LED of.</param>
        /// <param name="ledColor">Color to change LED to.</param>
        private void UpdateFanLED(Fan fan, LEDColors ledColor)
        {
            PictureBox ledPictureBox = null;

            Debug.Assert(fan != null);

            //Lookup the LED WinForm picture box to redraw.
            switch (fan.Number)
            {
            case 1: ledPictureBox = pictureBoxFan1LED; break;

            case 2: ledPictureBox = pictureBoxFan2LED; break;

            case 3: ledPictureBox = pictureBoxFan3LED; break;

            default:
                throw new ArgumentOutOfRangeException("Fan fan",
                                                      string.Format("Invalid Fan Number. Found: {0}",
                                                                    fan.Number));
            }

            //Redraw the the LED image for the fan.
            Debug.Assert(ledPictureBox != null);

            LEDHelper.ChangeColor(ledPictureBox, ledColor);
        }
Пример #2
0
 /// <summary>
 /// Changes the color of the primary status LED in the lower-right corner.
 /// </summary>
 /// <param name="ledColor">Color to change LED to.</param>
 private void UpdateStatusLED(LEDColors ledColor)
 {
     if (this.InvokeRequired == true)
     {
         Invoke(new Action(() => { LEDHelper.ChangeColor(pictureBoxStatusLED, ledColor); }));
     }
     else
     {
         LEDHelper.ChangeColor(pictureBoxStatusLED, ledColor);
     }
 }
Пример #3
0
 public NotificationWebSocket(LEDHelper LedHelper)
 {
     instance   = this;
     _ledHelper = LedHelper;
 }
Пример #4
0
 public LEDController(LEDHelper LedHelper)
 {
     _ledHelper = LedHelper;
 }