Exemplo n.º 1
0
 public Led(int number, sbyte inputNumber, LedType type)
 {
     Number       = number;
     _state       = false;
     _type        = type;
     _inputNumber = inputNumber;
 }
Exemplo n.º 2
0
 public Led()
 {
     Number       = 0;
     _state       = false;
     _type        = LedType.Normal;
     _inputNumber = 0;
 }
Exemplo n.º 3
0
 public Led(int number)
 {
     Number       = number;
     _state       = false;
     _type        = LedType.Normal;
     _inputNumber = 0;
 }
Exemplo n.º 4
0
        public static void RefreshLEDs(LedType ledType, bool append = false, bool remove = false)
        {
            if (!Manager.Instance.Inited)
            {
                return;
            }

            if (append)
            {
                _currentLEDState = ledType | _currentLEDState;
            }
            else if (remove)
            {
                _currentLEDState = _currentLEDState & ~ledType;
            }
            else
            {
                _currentLEDState = ledType;
            }

            //if (blinkerOn)
            //{
            //    //b = b.AddBit(2);
            //}
            //if (player != null/* && player.IsPlaying*/)
            //{
            //    b = b.AddBit(4);
            //}
            var message = new Message(DeviceAddress.Telephone, DeviceAddress.FrontDisplay, "Set LEDs", 0x2B, (byte)_currentLEDState);

            Manager.Instance.EnqueueMessage(message);
        }
Exemplo n.º 5
0
 internal MotherboardLedLayoutImpl(Raw.GLedAPIv1_0_0Wrapper api, int maxDivisions)
 {
     this.Length = maxDivisions;
     myLayout    = new Lazy <LedType[]>(() => {
         byte[] rawLayout = api.GetLedLayout(maxDivisions);
         if (maxDivisions != rawLayout.Length)
         {
             throw new GLedAPIException(string.Format("GetLedLayout({0}) returned {1} divisions", maxDivisions, rawLayout.Length));
         }
         LedType[] layout = new LedType[rawLayout.Length];
         for (int i = 0; i < layout.Length; i++)
         {
             layout[i] = (LedType)rawLayout[i];
         }
         return(layout);
     });
 }
Exemplo n.º 6
0
 public void SetLed(LedType ledType, uint ledIndex, LedState state, bool autoExecute = true)
 {
     if ((uint)ledIndex > 7 && (uint)ledIndex != 0xff)
     {
         throw new IndexOutOfRangeException("ledIndex");
     }
     lock (this) {
         BasicTypeSerializer.Put(SendContext, (byte)Command.SetLedState);
         BasicTypeSerializer.Put(SendContext, (byte)ledType);
         BasicTypeSerializer.Put(SendContext, (byte)ledIndex);
         BasicTypeSerializer.Put(SendContext, (byte)state);
         if (autoExecute)
         {
             Execute();
         }
     }
 }
Exemplo n.º 7
0
        private void FrontDisplayEmulator_LedChanged(LedType ledType)
        {
            this.Dispatcher.Invoke(() =>
            {
                RedIndicator.Fill    = OrangeIndicator.Fill = GreenIndicator.Fill = new SolidColorBrush(Colors.White);
                RedIndicator.Opacity = OrangeIndicator.Opacity = GreenIndicator.Opacity = 1;

                if ((ledType & LedType.Red) != 0 || (ledType & LedType.RedBlinking) != 0)
                {
                    RedIndicator.Fill = new SolidColorBrush(Colors.Red);
                    if (ledType == LedType.RedBlinking)
                    {
                        RedIndicator.Opacity = 0.5;
                    }
                }
                if ((ledType & LedType.Orange) != 0 || (ledType & LedType.OrangeBlinking) != 0)
                {
                    OrangeIndicator.Fill = new SolidColorBrush(Colors.Orange);
                    if (ledType == LedType.OrangeBlinking)
                    {
                        OrangeIndicator.Opacity = 0.5;
                    }
                }
                if ((ledType & LedType.Green) != 0 || (ledType & LedType.GreenBlinking) != 0)
                {
                    GreenIndicator.Fill = new SolidColorBrush(Colors.Green);
                    if (ledType == LedType.GreenBlinking)
                    {
                        GreenIndicator.Opacity = 0.5;
                    }
                }
                if (ledType == LedType.Empty)
                {
                    RedIndicator.Fill    = new SolidColorBrush(Colors.White);
                    OrangeIndicator.Fill = new SolidColorBrush(Colors.White);
                    GreenIndicator.Fill  = new SolidColorBrush(Colors.White);
                }
            });
        }
Exemplo n.º 8
0
Arquivo: Led.cs Projeto: iseebi/EbIRC
 public static void SetLedStatus(LedType led, LedStatus status)
 {
     SetLedStatus((uint)led, (int)status);
 }
Exemplo n.º 9
0
Arquivo: Led.cs Projeto: iseebi/EbIRC
 public static bool AvailableLed(LedType led)
 {
     return AvailableLed((int)led);
 }
Exemplo n.º 10
0
 //
 // Constructor
 //    
 /// <summary>
 /// Creates a new LED object given the LED type
 /// </summary>
 /// <param name="type">The type of LED that should be created</param>
 public Led(LedType type)
 {
     m_base = new LedBase(type);
 }
 /// <summary>
 /// Constructs an animated led without an led class. The LED class will be
 /// created internally for the animated led.
 /// </summary>
 /// <param name="type">The type of LED that should be created</param>
 /// <param name="boolThatMeansNothingForWinRt">Means nothing, only needed to make WinRT happy</param>
 public AnimatedLed(LedType type, bool boolThatMeansNothingForWinRt)
 {
     m_base = new AnimatedLedBase(type);
 }
Exemplo n.º 12
0
 public LedBase(LedType type)
 {
     m_type = type;
 }
Exemplo n.º 13
0
 //
 // Internal Functions
 //
 // Called by the controller to query the current state of the LED
 public void GetLedState(out LedType type, out double red, out double green, out double blue, out double intesity)
 {
     type = m_type;
     red = m_red;
     green = m_green;
     blue = m_blue;
     intesity = m_intensity;
 }
Exemplo n.º 14
0
 public static void SetLedStatus(LedType led, LedStatus status)
 {
     SetLedStatus((uint)led, (int)status);
 }
Exemplo n.º 15
0
 public static bool AvailableLed(LedType led)
 {
     return(AvailableLed((int)led));
 }
 //
 // Constructor
 //
 public AnimatedLedBase(LedType type)
 {
     m_led = new Led(type);
     InitValues();
     ToggleResigerForAnimationTicks(true);
 }