using System.Collections.Generic; using RGB.NET.Core; namespace RGB.NET.Devices.WS281X.Bitwizard { // ReSharper disable once InconsistentNaming /// /// /// Represents the update-queue performing updates for a bitwizard WS2812 device. /// public class BitwizardWS2812USBUpdateQueue : SerialPortUpdateQueue { #region Constructors /// /// /// Initializes a new instance of the class. /// /// The update trigger used by this queue. /// The name of the serial-port to connect to. /// The baud-rate used by the serial-connection. public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, string portName, int baudRate = 115200) : base(updateTrigger, portName, baudRate) { } #endregion #region Methods /// protected override void OnStartup(object sender, CustomUpdateData customData) { base.OnStartup(sender, customData); SendCommand(string.Empty); // Get initial prompt } /// protected override IEnumerable GetCommands(Dictionary dataSet) { foreach (KeyValuePair data in dataSet) yield return $"pix {(int)data.Key} {data.Value.AsRGBHexString(false)}"; } #endregion } }