public void initializeDMX() { try { OpenDMX.start(); if (OpenDMX.status == FT_STATUS.FT_DEVICE_NOT_FOUND) { mainForm.getConnectionWarningLabel().Visible = true; //Console.WriteLine("Could not find Enttec USB"); } else if (OpenDMX.status == FT_STATUS.FT_OK) { //Console.WriteLine("We did it. We found it. You are good to go!"); } else { mainForm.getConnectionWarningLabel().Visible = true; //Console.WriteLine("Be-atch, this shit ain't workin"); } } catch (Exception exp) { mainForm.getConnectionWarningLabel().Visible = true; //Console.WriteLine(exp); //Console.WriteLine("This shit encountered a flippy dippy error, gurl!"); } }
public MainWindow() { InitializeComponent(); try { OpenDMX.start(); if (OpenDMX.status == FT_STATUS.FT_DEVICE_NOT_FOUND) { StatusBox.Text = "No Enttec USB Device Found"; } else if (OpenDMX.status == FT_STATUS.FT_OK) { StatusBox.Text = "Found DMX on USB"; } else { StatusBox.Text = "Error Opening Device"; } } catch (Exception exp) { Console.WriteLine(exp); StatusBox.Text = "Error Connecting to Enttec USB Device"; } OpenDMX.setDmxValue(174, 255); Thread t = new Thread(DataThread); t.Start(); OpenDMX.setDmxValue(1, 255); }
private void Connect_DMX(object sender, EventArgs e) { try { OpenDMX.start(); //find and connect to device (first found if multiple) if (OpenDMX.status == FT_STATUS.FT_DEVICE_NOT_FOUND) //update status { DMXStatusLabel.Text = "No DMX Device"; DMXStatusLabel.BackColor = Color.DarkOrange; } else if (OpenDMX.status == FT_STATUS.FT_OK) { DMXStatusLabel.Text = "DMX Connected"; DMXStatusLabel.BackColor = Color.Green; } else { DMXStatusLabel.Text = "DMX Error"; DMXStatusLabel.BackColor = Color.DarkOrange; } } catch (Exception exp) { Console.WriteLine(exp); DMXStatusLabel.Text = "USB Error"; DMXStatusLabel.BackColor = Color.Red; } //for (byte channel = byte.MinValue; channel < byte.MaxValue; channel++ ) //{ // OpenDMX.setDmxValue(channel, 0); //} foreach (HeadBangerCommandSet command in Enum.GetValues(typeof(HeadBangerCommandSet))) { byte value; //backleft value = hb_BackLeft.getValuefromCommand(command); OpenDMX.setDmxValue(hb_BackLeft.address + (byte)command, value); Console.WriteLine(command.ToString(), value); //front left value = hb_FrontLeft.getValuefromCommand(command); OpenDMX.setDmxValue(hb_FrontLeft.address + (byte)command, value); Console.WriteLine(command.ToString(), value); //back right value = hb_BackRight.getValuefromCommand(command); OpenDMX.setDmxValue(hb_BackRight.address + (byte)command, value); Console.WriteLine(command.ToString(), value); //front right value = hb_FrontLeft.getValuefromCommand(command); OpenDMX.setDmxValue(hb_FrontLeft.address + (byte)command, value); Console.WriteLine(command.ToString(), value); } }
static void Main(string[] args) { var settings = new Settings { AzureServiceBusConnectionString = Environment.GetEnvironmentVariable("DNOLights__AzureServiceBusConnectionString") }; try { OpenDMX.start(); // Find and connect to device (first found if multiple) if (OpenDMX.status == FT_STATUS.FT_DEVICE_NOT_FOUND) { System.Console.WriteLine("No DMX Device"); } else if (OpenDMX.status == FT_STATUS.FT_OK) { System.Console.WriteLine("DMX Connected"); } else { System.Console.WriteLine("DMX Error"); } } catch (Exception exp) { System.Console.WriteLine(exp); System.Console.WriteLine("USB Error"); } new MessageQueueHelper(settings, Queues.HardwareCommands) .SubscribeAsync(msg => { var sliderData = JsonConvert.DeserializeObject <SliderData>(msg); switch (sliderData.Type) { case "Pan": Con.WriteLine($"setting pan to {sliderData.Value}"); OpenDMX.setDmxValue(1, (byte)sliderData.Value); break; case "Tilt": Con.WriteLine($"setting tilt to {sliderData.Value}"); OpenDMX.setDmxValue(3, (byte)sliderData.Value); break; default: Con.WriteLine($"Unhandled slider type: {sliderData.Type}"); break; } }); System.Console.WriteLine("Waiting for messages..."); System.Console.ReadLine(); }
public MainWindow() { InitializeComponent(); OpenDMX.start(); Thread t = new Thread(DataThread); t.Start(); EnttecStatus(); }
// Use this for initialization void Start() { if (colors == null || colors.Length == 0) { colors = new Color[colorCount]; for (int i = 0; i < colors.Length; i++) { colors[i] = Color.HSVToRGB(i / (float)colorCount, 1, 0.7f); } } receiver = new UDPColorchordReceiver(ColorchordUdpInputPort, colorCount); receiver.Start(); LedDestination = new IPEndPoint(IPAddress.Loopback, LEDOutPort); LEDDataChannel = new UdpClient(LEDOutPort + 1); //Debug.Log(openDMXSO.init()); OpenDMX.start(); Debug.Log(OpenDMX.status); mr = GetComponent <MeshRenderer>(); }
public MainWindow() { CosmoLight = new BaseClass.Objects.LightDefinitions.CosmoLight(); CosmoLight.CosmoLightID = 1; CosmoLight.StartChannel = 168; CosmoLight.AllLedsOffset = 19; CosmoLight.AutoOffset = 20; CosmoLight.IntensityOffset = 6; CosmoLight.TurnOffset = 0; CosmoLight.RotateOffset = 5; CosmoLight.SpeedOffset = 4; CosmoLight.Colors = new List <BaseClass.Objects.LightDefinitions.Color>(); CosmoLight.Movements = new List <BaseClass.Objects.LightDefinitions.Movement>(); var turn3 = new BaseClass.Objects.LightDefinitions.Movement(); turn3.MovementName = "Turn3"; turn3.Axis = "y"; turn3.MovementDirection = 0; turn3.MovementSpeed = 0; CosmoLight.Movements.Add(turn3); var turn1 = new BaseClass.Objects.LightDefinitions.Movement(); turn1.MovementName = "Turn1"; turn1.Axis = "x"; turn1.MovementDirection = 255; turn1.MovementSpeed = 1; CosmoLight.Movements.Add(turn1); var turn2 = new BaseClass.Objects.LightDefinitions.Movement(); turn2.MovementName = "Turn2"; turn2.Axis = "x"; turn2.MovementSpeed = 1; turn2.MovementDirection = 1; CosmoLight.Movements.Add(turn2); CosmoLight2 = new BaseClass.Objects.LightDefinitions.CosmoLight(); CosmoLight2.CosmoLightID = 2; CosmoLight2.StartChannel = 189; CosmoLight2.AllLedsOffset = 19; CosmoLight2.AutoOffset = 20; CosmoLight2.IntensityOffset = 6; CosmoLight2.TurnOffset = 0; CosmoLight2.RotateOffset = 5; CosmoLight2.SpeedOffset = 4; CosmoLight2.Colors = new List <BaseClass.Objects.LightDefinitions.Color>(); CosmoLight2.Movements = new List <BaseClass.Objects.LightDefinitions.Movement>(); turn3.MovementName = "Turn3"; turn3.MovementDirection = 160; turn3.MovementSpeed = 0; CosmoLight2.Movements.Add(turn3); turn1.MovementName = "Turn1"; turn1.MovementDirection = 255; turn1.MovementSpeed = 1; CosmoLight2.Movements.Add(turn1); turn2.MovementName = "Turn2"; turn2.MovementDirection = 1; turn2.MovementSpeed = 1; CosmoLight2.Movements.Add(turn2); InitializeComponent(); OpenDMX.setDmxValue(1, 255); OpenDMX.start(); EnttecStatus(); Thread t = new Thread(DataThread); t.Start(); }
private void Bw_DoWork(object sender, DoWorkEventArgs e) { OpenDMX.start(); ListenPort(); }