Пример #1
0
        public void LedEffect(Color color, EffectType effectType, int effectLength, int effectInterval)
        {
            LedProxy.LogiLedStopEffects();
            Thread.Sleep(100);
            LedProxy.LogiLedSetLighting(Constants.DEFAULT_RED_PCT, Constants.DEFAULT_GREEN_PCT, Constants.DEFAULT_BLUE_PCT);
            Thread.Sleep(100);

            switch (effectType)
            {
            case (EffectType.FLASH):
                LedProxy
                .LogiLedFlashLighting(
                    color.Red,
                    color.Green,
                    color.Blue,
                    effectLength,
                    effectInterval);
                break;

            case (EffectType.PULSE):
                LedProxy
                .LogiLedPulseLighting(
                    color.Red,
                    color.Green,
                    color.Blue,
                    effectLength,
                    effectInterval);
                break;
            }

            Task.Run(() => ResetLightingAfterEffect(effectLength));
        }
Пример #2
0
        public Connection(string appFriendlyName = "testapp")
        {
            AppFriendlyName = appFriendlyName;

            LcdProxy.LogiLcdInit(AppFriendlyName, Constants.LOGI_LCD_TYPE_MONO);
            Success = LcdProxy.LogiLcdIsConnected(Constants.LOGI_LCD_TYPE_MONO);
            if (Success)
            {
                LedSuccess = LedProxy.LogiLedInit();
            }
        }
Пример #3
0
        public async Task ResetLightingAfterEffect(int effectLength)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            while (stopwatch.ElapsedMilliseconds < effectLength)
            {
                Thread.Sleep(50);
            }
            LedProxy.LogiLedSetLighting(Constants.DEFAULT_RED_PCT, Constants.DEFAULT_GREEN_PCT, Constants.DEFAULT_BLUE_PCT);
        }
Пример #4
0
 public bool SaveCurrentLighting()
 {
     return(LedProxy.LogiLedSaveCurrentLighting());
 }
Пример #5
0
 public void SetLightingToDefault()
 {
     LedProxy.LogiLedSetLighting(DefaultColor.Red, DefaultColor.Green, DefaultColor.Blue);
 }