Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NodeMCUWS2812USBUpdateQueue"/> class.
        /// If this constructor is used UDP updates are disabled.
        /// </summary>
        /// <param name="updateTrigger">The update trigger used by this queue.</param>
        /// <param name="hostname">The hostname to connect to.</param>
        public NodeMCUWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, string hostname)
            : base(updateTrigger)
        {
            this._hostname = hostname;

            _sendDataAction = SendHttp;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UpdateQueue{TIdentifier,TData}"/> class.
        /// </summary>
        /// <param name="updateTrigger">The <see cref="IDeviceUpdateTrigger"/> causing this queue to update.</param>
        protected UpdateQueue(IDeviceUpdateTrigger updateTrigger)
        {
            this._updateTrigger = updateTrigger;

            _updateTrigger.Starting += OnStartup;
            _updateTrigger.Update   += OnUpdate;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AsusUpdateQueue"/> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 public OpenRGBUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceid, OpenRGBClient client, int ledcount)
     : base(updateTrigger)
 {
     this._deviceid = deviceid;
     this._openRGB  = client;
     this._ledcount = ledcount;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CoolerMasterUpdateQueue"/> class.
        /// </summary>
        /// <param name="updateTrigger">The update trigger used by this queue.</param>
        /// <param name="deviceIndex">The <see cref="CoolerMasterDevicesIndexes"/> of the device this queue performs updates for.</param>
        public CoolerMasterUpdateQueue(IDeviceUpdateTrigger updateTrigger, CoolerMasterDevicesIndexes deviceIndex)
            : base(updateTrigger)
        {
            this._deviceIndex = deviceIndex;

            _deviceMatrix          = new _CoolerMasterColorMatrix();
            _deviceMatrix.KeyColor = new _CoolerMasterKeyColor[_CoolerMasterColorMatrix.ROWS, _CoolerMasterColorMatrix.COLUMNS];
        }
Exemplo n.º 5
0
 public PowerPlayUpdateQueue(IDeviceUpdateTrigger updateTrigger, PowerPlayController?powerPlayController)
     : base(updateTrigger)
 {
     if (powerPlayController != null)
     {
         _powerPlayController = powerPlayController;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LogitechZoneUpdateQueue"/> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="deviceType">The tpye of the device this queue is updating.</param>
 public LogitechZoneUpdateQueue(IDeviceUpdateTrigger updateTrigger, RGBDeviceType deviceType)
     : base(updateTrigger)
 {
     if (!DEVICE_TYPE_MAPPING.TryGetValue(deviceType, out _deviceType))
     {
         throw new ArgumentException($"Invalid type '{deviceType.ToString()}'", nameof(deviceType));
     }
 }
Exemplo n.º 7
0
        /// <inheritdoc />
        public IEnumerable <IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger)
        {
            BitwizardWS2812USBUpdateQueue queue = new BitwizardWS2812USBUpdateQueue(updateTrigger, SerialConnection);
            string name = Name ?? $"Bitwizard WS2812 USB ({Port})";
            BitwizardWS2812USBDevice device = new BitwizardWS2812USBDevice(new BitwizardWS2812USBDeviceInfo(name), queue);

            device.Initialize(StripLength);
            yield return(device);
        }
 public OpenRGBUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceid, OpenRGBClient client, OpenRGBDevice device)
     : base(updateTrigger)
 {
     _deviceid = deviceid;
     _openRGB  = client;
     _device   = device;
     _colors   = Enumerable.Range(0, _device.Colors.Length)
                 .Select(_ => new OpenRGBColor())
                 .ToArray();
 }
Exemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NodeMCUWS2812USBUpdateQueue"/> class.
        /// If this constructor is used UDP updates are enabled.
        /// </summary>
        /// <param name="updateTrigger">The update trigger used by this queue.</param>
        /// <param name="hostname">The hostname to connect to.</param>
        /// <param name="udpPort">The port used by the UDP-connection.</param>
        public NodeMCUWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, string hostname, int udpPort)
            : base(updateTrigger)
        {
            this._hostname = hostname;

            _udpClient = new UdpClient();
            EnableUdp(udpPort);

            _sendDataAction = SendUdp;
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes the device.
        /// </summary>
        public void Initialize(IDeviceUpdateTrigger updateTrigger)
        {
            InitializeLayout();

            if (Size == Size.Invalid)
            {
                Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
                Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
            }

            UpdateQueue = new CoolerMasterUpdateQueue(updateTrigger, DeviceInfo.DeviceIndex);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Initializes the device.
        /// </summary>
        public void Initialize(IDeviceUpdateTrigger updateTrigger)
        {
            InitializeLayout();

            if (Size == Size.Invalid)
            {
                Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
                Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
            }

            UpdateQueue = new AsusUpdateQueue(updateTrigger);
            UpdateQueue.Initialize(GetUpdateColorAction(), DeviceInfo.Handle, LedMapping.Count);
        }
Exemplo n.º 12
0
        /// <inheritdoc />
        public IEnumerable <IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger)
        {
            ArduinoWS2812USBUpdateQueue queue = new ArduinoWS2812USBUpdateQueue(updateTrigger, SerialConnection);
            IEnumerable <(int channel, int ledCount)> channels = queue.GetChannels();
            int counter = 0;

            foreach ((int channel, int ledCount) in channels)
            {
                string name = string.Format(Name ?? $"Arduino WS2812 USB ({Port}) [{{0}}]", ++counter);
                ArduinoWS2812USBDevice device = new ArduinoWS2812USBDevice(new ArduinoWS2812USBDeviceInfo(name), queue, channel);
                device.Initialize(ledCount);
                yield return(device);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Initializes the device.
        /// </summary>
        public void Initialize(IDeviceUpdateTrigger updateTrigger)
        {
            InitializeLayout();

            if (Size == Size.Invalid)
            {
                Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
                Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
            }

            if (DeviceInfo.ColorCapabilities == NovationColorCapabilities.LimitedRG)
            {
                UpdateQueue = new LimitedColorUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Initializes the device.
        /// </summary>
        public void Initialize(IDeviceUpdateTrigger updateTrigger)
        {
            InitializeLayout();

            if (Size == Size.Invalid)
            {
                Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
                Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
            }

            UpdateQueue = DeviceInfo.ColorCapabilities switch
            {
                NovationColorCapabilities.LimitedRG => new LimitedColorUpdateQueue(updateTrigger, DeviceInfo.DeviceId),
                NovationColorCapabilities.RGB => new RGBColorUpdateQueue(updateTrigger, DeviceInfo.DeviceId),
                _ => throw new ArgumentOutOfRangeException()
            };
        }
        public AdalightUpdateQueue(IDeviceUpdateTrigger updateTrigger, int port, int ledCount)
            : base(updateTrigger)
        {
            _strip = new Adalight(port, ledCount);

            _refreshTimer           = new Timer(5000);
            _refreshTimer.Elapsed  += _refreshTimer_Elapsed;
            _refreshTimer.AutoReset = true;

            _reconnectTimer           = new Timer(5000);
            _reconnectTimer.Elapsed  += _reconnectTimer_Elapsed;
            _reconnectTimer.AutoReset = true;
            _reconnectTimer.Start();

            _fixLastFrameTimer           = new Timer(100);
            _fixLastFrameTimer.Elapsed  += _fixLastFrameTimer_Elapsed;
            _fixLastFrameTimer.AutoReset = false;
            _fixLastFrameTimer.Start();
        }
Exemplo n.º 16
0
        void ISoIPRGBDevice.Initialize(IDeviceUpdateTrigger updateTrigger)
        {
            int count = 0;

            foreach (LedId id in _leds)
            {
                InitializeLed(id, new Rectangle((count++) * 10, 0, 10, 10));
            }

            //TODO DarthAffe 10.06.2018: Allow to load a layout.

            if (Size == Size.Invalid)
            {
                Rectangle ledRectangle = new Rectangle(this.Select(x => x.LedRectangle));
                Size = ledRectangle.Size + new Size(ledRectangle.Location.X, ledRectangle.Location.Y);
            }

            _tcpServer.Start(DeviceInfo.Port);
            _updateQueue = new SoIPServerUpdateQueue(updateTrigger, _tcpServer);
        }
Exemplo n.º 17
0
        /// <inheritdoc />
        public IEnumerable <IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger)
        {
            NodeMCUWS2812USBUpdateQueue queue = UpdateMode switch
            {
                NodeMCUUpdateMode.Http => new NodeMCUWS2812USBUpdateQueue(updateTrigger, Hostname),
                NodeMCUUpdateMode.Udp => new NodeMCUWS2812USBUpdateQueue(updateTrigger, Hostname, Port),
                _ => throw new ArgumentOutOfRangeException()
            };

            IEnumerable <(int channel, int ledCount)> channels = queue.GetChannels();
            int counter = 0;

            foreach ((int channel, int ledCount) in channels)
            {
                string name = string.Format(Name ?? $"NodeMCU WS2812 WIFI ({Hostname}) [{{0}}]", ++counter);
                NodeMCUWS2812USBDevice device = new NodeMCUWS2812USBDevice(new NodeMCUWS2812USBDeviceInfo(name), queue, channel);
                device.Initialize(ledCount);
                yield return(device);
            }
        }

        #endregion
    }
Exemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CoolerMasterUpdateQueue"/> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="deviceIndex">The <see cref="CoolerMasterDevicesIndexes"/> of the device this queue performs updates for.</param>
 public CoolerMasterUpdateQueue(IDeviceUpdateTrigger updateTrigger, CoolerMasterDevicesIndexes deviceIndex)
     : base(updateTrigger)
 {
     this._deviceIndex = deviceIndex;
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LimitedColorUpdateQueue"/> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="deviceId">The device-id of the device this queue is performing updates for.</param>
 public LimitedColorUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceId)
     : base(updateTrigger, deviceId)
 {
 }
Exemplo n.º 20
0
 /// <inheritdoc />
 /// <summary>
 /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.SoIP.Server.SoIPServerUpdateQueue" /> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="tcpServer">The hostname of the device this queue is performing updates for.</param>
 public SoIPServerUpdateQueue(IDeviceUpdateTrigger updateTrigger, SimpleTcpServer tcpServer)
     : base(updateTrigger)
 {
     this._tcpServer = tcpServer;
 }
Exemplo n.º 21
0
 /// <inheritdoc />
 protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerMousepadUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
Exemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WootingUpdateQueue"/> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 public WootingUpdateQueue(IDeviceUpdateTrigger updateTrigger)
     : base(updateTrigger)
 {
 }
Exemplo n.º 23
0
 public MsiusbDeviceUpdateQueue(IDeviceUpdateTrigger updateTrigger, int deviceID)
     : base(updateTrigger)
 {
     this._deviceID = deviceID;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ArduinoWS2812USBUpdateQueue"/> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="portName">The name of the serial-port to connect to.</param>
 /// <param name="baudRate">The baud-rate used by the serial-connection.</param>
 public ArduinoWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection)
     : base(updateTrigger, serialConnection)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RazerChromaLinkUpdateQueue" /> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used to update this queue.</param>
 /// <param name="deviceId">The id of the device updated by this queue.</param>
 public RazerChromaLinkUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId)
     : base(updateTrigger, deviceId)
 {
 }
Exemplo n.º 26
0
 /// <inheritdoc />
 /// <summary>
 /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.WS281X.Bitwizard.BitwizardWS2812USBUpdateQueue" /> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="portName">The name of the serial-port to connect to.</param>
 /// <param name="baudRate">The baud-rate used by the serial-connection.</param>
 public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection)
     : base(updateTrigger, serialConnection)
 {
 }
Exemplo n.º 27
0
 /// <inheritdoc />
 protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerChromaLinkUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
 public YeeLightUpdateQueue(IDeviceUpdateTrigger updateTrigger, Device light, bool placeHolder = false)
     : base(updateTrigger)
 {
     _light       = light;
     _placeHolder = placeHolder;
 }
Exemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RazerHeadsetUpdateQueue" /> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used to update this queue.</param>
 /// <param name="deviceId">The id of the device updated by this queue.</param>
 public RazerHeadsetUpdateQueue(IDeviceUpdateTrigger updateTrigger, Guid deviceId)
     : base(updateTrigger, deviceId)
 {
 }
Exemplo n.º 30
0
 /// <inheritdoc />
 /// <summary>
 /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.WS281X.Bitwizard.BitwizardWS2812USBUpdateQueue" /> class.
 /// </summary>
 /// <param name="updateTrigger">The update trigger used by this queue.</param>
 /// <param name="portName">The name of the serial-port to connect to.</param>
 /// <param name="baudRate">The baud-rate used by the serial-connection.</param>
 public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, string portName, int baudRate = 115200)
     : base(updateTrigger, portName, baudRate)
 {
 }