예제 #1
0
        public void SetLandingGearLED(SwitchPanelPZ55LEDPosition switchPanelPZ55LEDPosition, PanelLEDColor switchPanelPZ55LEDColor)
        {
            try
            {
                switch (switchPanelPZ55LEDPosition)
                {
                case SwitchPanelPZ55LEDPosition.UP:
                {
                    _ledUpperColor = GetSwitchPanelPZ55LEDColor(switchPanelPZ55LEDPosition, switchPanelPZ55LEDColor);
                    break;
                }

                case SwitchPanelPZ55LEDPosition.LEFT:
                {
                    _ledLeftColor = GetSwitchPanelPZ55LEDColor(switchPanelPZ55LEDPosition, switchPanelPZ55LEDColor);
                    break;
                }

                case SwitchPanelPZ55LEDPosition.RIGHT:
                {
                    _ledRightColor = GetSwitchPanelPZ55LEDColor(switchPanelPZ55LEDPosition, switchPanelPZ55LEDColor);
                    break;
                }
                }
                OnLedLightChanged(new SaitekPanelLEDPosition(switchPanelPZ55LEDPosition), switchPanelPZ55LEDColor);
                SetLandingGearLED(_ledUpperColor | _ledLeftColor | _ledRightColor);
            }
            catch (Exception e)
            {
                Common.DebugP("SetLandingGearLED() :\n" + e.Message + e.StackTrace);
                SetLastException(e);
            }
        }
예제 #2
0
 //Do not use directly !
 private void SetLandingGearLED(SwitchPanelPZ55LEDs switchPanelPZ55LEDs)
 {
     try
     {
         if (HIDSkeletonBase.HIDWriteDevice != null)
         {
             var array = new[] { (byte)0x0, (byte)switchPanelPZ55LEDs };
             Common.DebugP("HIDWriteDevice writing feature data " + TypeOfSaitekPanel + " " + GuidString);
             HIDSkeletonBase.HIDWriteDevice.WriteFeatureData(new byte[] { 0, 0 });
             HIDSkeletonBase.HIDWriteDevice.WriteFeatureData(array);
         }
         //if (IsAttached)
         //{
         Common.DebugP("Write ending");
         //}
     }
     catch (Exception e)
     {
         Common.DebugP("SetLandingGearLED(SwitchPanelPZ55LEDs switchPanelPZ55LEDs) :\n" + e.Message + e.StackTrace);
         SetLastException(e);
     }
 }