Ejemplo n.º 1
0
        public void SendDmxCommands(List <DmxCommand> dmxCommands, int duration = 1000)
        {
            foreach (var dmxCommand in dmxCommands)
            {
                DmxCommandHelper(dmxCommand);
            }

            OpenDMX.WriteData();

            Thread.Sleep(duration);
        }
Ejemplo n.º 2
0
        public void SendDmxCommand(int offset, int value, int duration = 1000)
        {
            DmxCommandHelper(new DmxCommand()
            {
                Offset = offset, Value = value
            });

            OpenDMX.WriteData();

            Thread.Sleep(duration);
        }
Ejemplo n.º 3
0
        private void DmxCommandHelper(DmxCommand dmxCommand)
        {
            if (dmxCommand.Value < 0 || dmxCommand.Value > 255)
            {
                throw new ArgumentOutOfRangeException();
            }

            int channel = DmxAddress + dmxCommand.Offset;

            Console.WriteLine($"Sending value {dmxCommand.Value} to channel {channel}");

            OpenDMX.SetDmxValue(channel, Convert.ToByte(dmxCommand.Value));
        }