Beispiel #1
0
        private void CosmoColorChange_Click(object sender, RoutedEventArgs e)
        {
            EnttecStatus();

            if (ColorThreadStartet)
            {
                CT.Abort();
                ColorThreadStartet = false;
            }

            var currentLights = GetCurrentLights();

            foreach (var currentLight in currentLights)
            {
                OpenDMX.setDmxValue(currentLight.StartChannel + currentLight.IntensityOffset, 255);

                var red = new BaseClass.Objects.LightDefinitions.Color();
                red.ColorName  = "Red";
                red.ColorValue = 6;
                currentLight.Colors.Add(red);

                var green = new BaseClass.Objects.LightDefinitions.Color();
                green.ColorName  = "Green";
                green.ColorValue = 15;
                currentLight.Colors.Add(green);

                var blue = new BaseClass.Objects.LightDefinitions.Color();
                blue.ColorName  = "Blue";
                blue.ColorValue = 20;
                currentLight.Colors.Add(blue);
            }

            CosmoColorChange = true;
            CosmoColorChangeShow(currentLights);
        }
Beispiel #2
0
 private void BO_Button_Click(object sender, RoutedEventArgs e)
 {
     if (BO == false)
     {
         OpenDMX.setDmxValue(1, 0);
         OpenDMX.setDmxValue(173, 0);
         OpenDMX.setDmxValue(174, 0);
         Show1_Button.IsEnabled = false;
         Show2_Button.IsEnabled = false;
         Show3_Button.IsEnabled = false;
         Show4_Button.IsEnabled = false;
         Show5_Button.IsEnabled = false;
         Show6_Button.IsEnabled = false;
         LED.IsEnabled          = false;
         ShowBool1 = false;
         BO        = true;
     }
     else
     {
         OpenDMX.setDmxValue(174, 255);
         OpenDMX.setDmxValue(1, 255);
         Show1_Button.IsEnabled = true;
         Show2_Button.IsEnabled = true;
         Show3_Button.IsEnabled = true;
         Show4_Button.IsEnabled = true;
         Show5_Button.IsEnabled = true;
         Show6_Button.IsEnabled = true;
         LED.IsEnabled          = true;
         BO = false;
     }
 }
Beispiel #3
0
        public static void ProfilShow2_thread()
        {
            while (true)
            {
                OpenDMX.setDmxValue(Profil1_Color, 255);
                OpenDMX.setDmxValue(Profil1_Strope, 255);
                OpenDMX.setDmxValue(Profil1_Intensity, 255);

                OpenDMX.setDmxValue(Profil1_Pan, 255);
                OpenDMX.setDmxValue(Profil1_Tilt, 255);

                OpenDMX.setDmxValue(Profil2_Color, 255);
                OpenDMX.setDmxValue(Profil2_Strope, 255);
                OpenDMX.setDmxValue(Profil2_Intensity, 255);

                OpenDMX.setDmxValue(Profil2_Pan, 255);
                OpenDMX.setDmxValue(Profil2_Tilt, 255);

                Thread.Sleep(2000);

                OpenDMX.setDmxValue(Profil1_Pan, 0);
                OpenDMX.setDmxValue(Profil1_Tilt, 0);


                OpenDMX.setDmxValue(Profil2_Pan, 0);
                OpenDMX.setDmxValue(Profil2_Tilt, 0);

                Thread.Sleep(2000);
            }
        }
Beispiel #4
0
        public static void Show2() // Color Change
        {
            while (ShowBool2 == true)
            {
                OpenDMX.setDmxValue(187, 6);

                if (ShowBool2 == false)
                {
                    break;
                }
                Thread.Sleep(1000);
                OpenDMX.setDmxValue(187, 15);

                if (ShowBool2 == false)
                {
                    break;
                }
                Thread.Sleep(1000);
                OpenDMX.setDmxValue(187, 20);

                if (ShowBool2 == false)
                {
                    break;
                }
                Thread.Sleep(1000);
            }
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
    void SendDMXTestData()
    {
        OpenDMX.setDmxValue(0, 0x00);
        OpenDMX.setDmxValue(1, 0xFF);
        OpenDMX.setDmxValue(2, 0x00);

        OpenDMX.setDmxValue(4, 0x00);
        OpenDMX.setDmxValue(5, 0xAA);
        OpenDMX.setDmxValue(6, 0xFF);
    }
Beispiel #8
0
        public static void StropeShow1_thread()
        {
            while (true)
            {
                OpenDMX.setDmxValue(Strope_Intensity, 255);
                OpenDMX.setDmxValue(Strope_Strope, 250);

                OpenDMX.setDmxValue(Strope_White, 255);
            }
        }
Beispiel #9
0
        public static void CosmoKillCommand()
        {
            OpenDMX.setDmxValue(Cosmos1_Turn, 0);
            OpenDMX.setDmxValue(Cosmos1_Control_All_Led, 1);
            OpenDMX.setDmxValue(Cosmos1_Continues_Roll, 0);
            OpenDMX.setDmxValue(Cosmos1_Auto, 0);

            CosmoShow1Started = false;
            CosmoShow4Started = false;
        }
        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();
        }
Beispiel #11
0
 public static void Show4() // Green Color
 {
     while (ShowBool4 == true)
     {
         OpenDMX.setDmxValue(187, 15);
         if (ShowBool4 == false)
         {
             break;
         }
     }
 }
Beispiel #12
0
        public static void CosmosShow4_thread()
        {
            CosmoShow4Started = true;

            while (CosmoShow4Started)
            {
                OpenDMX.setDmxValue(Cosmos1_Intensity, 255);
                OpenDMX.setDmxValue(Cosmos1_Auto, 255);
            }
            OpenDMX.setDmxValue(Cosmos1_Auto, 0);
        }
Beispiel #13
0
        public static void Show5() //Blue Color
        {
            while (ShowBool5 == true)
            {
                OpenDMX.setDmxValue(187, 20);

                if (ShowBool5 == false)
                {
                    break;
                }
            }
        }
Beispiel #14
0
        public static void Show6() //White Color
        {
            while (ShowBool6 == true)
            {
                OpenDMX.setDmxValue(187, 25);

                if (ShowBool6 == false)
                {
                    break;
                }
            }
        }
Beispiel #15
0
        public static void Show3() //Red Color

        {
            while (ShowBool3 == true)
            {
                OpenDMX.setDmxValue(187, 6);

                if (ShowBool3 == false)
                {
                    break;
                }
            }
        }
Beispiel #16
0
        public static void Show9() //Auto Program
        {
            while (ShowBool9 == true)
            {
                OpenDMX.setDmxValue(188, 255);

                if (ShowBool9 == false)
                {
                    break;
                }
            }
            OpenDMX.setDmxValue(188, 0);
        }
Beispiel #17
0
 public static void Show8() // 3 Red
 {
     while (ShowBool8 == true)
     {
         OpenDMX.setDmxValue(175, 6);
         OpenDMX.setDmxValue(178, 6);
         // OpenDMX.setDmxValue(177, 6);
         if (ShowBool8 == false)
         {
             break;
         }
     }
 }
Beispiel #18
0
        public static void CosmoAutoShow() //Auto Program
        {
            while (CosmoAutoProgram == true)
            {
                OpenDMX.setDmxValue(188, 255);

                if (CosmoAutoProgram == false)
                {
                    break;
                }
            }
            OpenDMX.setDmxValue(188, 0);
        }
Beispiel #19
0
 private void LED_Click(object sender, RoutedEventArgs e)
 {
     if (bool_LED == false)
     {
         OpenDMX.setDmxValue(5, 170);
         bool_LED = true;
     }
     else
     {
         OpenDMX.setDmxValue(5, 0);
         bool_LED = false;
     }
 }
Beispiel #20
0
        private void CosmoAuto_Click(object sender, RoutedEventArgs e)
        {
            EnttecStatus();

            var currentLights = GetCurrentLights();

            foreach (var currentLight in currentLights)
            {
                OpenDMX.setDmxValue(currentLight.StartChannel + currentLight.IntensityOffset, 255);
                BaseClass.Logic.LightControl.SetColors(currentLight.StartChannel + currentLight.AllLedsOffset, new List <string> {
                    "Auto"
                });
            }
        }
Beispiel #21
0
 /*
  * This method will control the light lively with current scene values
  */
 public void liveControl(object sender, EventArgs e)
 {
     //update data
     this.setSceneValue(this.mainForm.getData());
     //TODO control the light by passing currentSceneValue array like example below
     //someMethod(currentSceneValue) whereas currentSceneValue is an array if int stores all values of the slider
     for (int i = 0; i < currentSceneValue.Length; i++)
     {
         OpenDMX.setDmxValue((startAddress - 1 + i), Convert.ToByte(currentSceneValue[i]));
     }
     // Console.WriteLine(System.DateTime.Now);
     // Console.WriteLine(currentSceneValue[0] + "---" + currentSceneValue[1]
     //     + "---" + currentSceneValue[2] + "---" + currentSceneValue[3] + "---" + currentSceneValue[4]);
 }
Beispiel #22
0
        public void SetChannelValue(Control ctrl,
                                    //ref byte val,
                                    Headbanger light,
                                    HeadBangerCommandSet command,
                                    Func <byte, byte> incDecCallback)
        {
            byte _channel = LightConfiguration.getChannel(light, command);
            var  val      = light.getValuefromCommand(command);

            val = incDecCallback(val);
            OpenDMX.setDmxValue(_channel, val);
            light.setValuefromCommand(command, val);
            ctrl.Text = val.ToString();
        }
Beispiel #23
0
 private void first_scene_click(object sender, EventArgs e)
 {
     if (OpenDMX.status == FT_STATUS.FT_DEVICE_NOT_FOUND)
     {
         DMXStatusLabel.Text      = "No DMX Device";
         DMXStatusLabel.BackColor = Color.DarkOrange;
     }
     else if (OpenDMX.status == FT_STATUS.FT_OK)
     {
         // set it all to zero
         for (int x = 1; x < 513; x++)
         {
             OpenDMX.setDmxValue(x, 0);
         }
     }
 }
Beispiel #24
0
        public static void ProfilShow1_thread()
        {
            while (true)
            {
                OpenDMX.setDmxValue(Profil1_Intensity, 255);
                OpenDMX.setDmxValue(Profil1_Pan, 127);
                OpenDMX.setDmxValue(Profil1_Tilt, 127);

                Thread.Sleep(2000);

                OpenDMX.setDmxValue(Profil1_Pan, 0);
                OpenDMX.setDmxValue(Profil1_Tilt, 0);

                Thread.Sleep(2000);
            }
        }
Beispiel #25
0
        public static void MovementThread()
        {
            int i = 0;

            MovementThreadStartet = true;

            var myLights = MainWindow.myLights;

            while (ShowBools.TurnRotateCosmo == true)
            {
                bool pause = false;
                foreach (var light in myLights)
                {
                    int channel = 0;

                    if (light.Movements[i].Axis == "x")
                    {
                        channel = light.StartChannel + light.TurnOffset;
                        pause   = true;
                    }
                    else if (light.Movements[i].Axis == "y")
                    {
                        channel = light.StartChannel + light.RotateOffset;
                    }

                    if (light.Movements[i].MovementSpeed > 0)
                    {
                        OpenDMX.setDmxValue(light.StartChannel + light.SpeedOffset, light.Movements[i].MovementSpeed);
                    }

                    OpenDMX.setDmxValue(channel, light.Movements[i].MovementDirection);
                }

                i++;
                if (i > myLights[0].Movements.Count() - 1)
                {
                    i = 0;
                }

                if (pause)
                {
                    Thread.Sleep(MainWindow.MovementDuration);
                }

                pause = false;
            }
        }
Beispiel #26
0
 private void StropeInternational_Click(object sender, RoutedEventArgs e)
 {
     if (StroInternational == false)
     {
         OpenDMX.setDmxValue(2, 185);
         OpenDMX.setDmxValue(3, 255);
         StroInternational = true;
         BO_Button_Click(this, null);
     }
     else
     {
         OpenDMX.setDmxValue(3, 0);
         OpenDMX.setDmxValue(2, 0);
         StroInternational = false;
         BO_Button_Click(this, null);
     }
 }
Beispiel #27
0
        public static void SetColors(int channel, List <string> bools)
        {
            OpenDMX.setDmxValue(channel, 0); //auto off
            foreach (string i in bools)
            {
                switch (i)
                {
                case "Auto": OpenDMX.setDmxValue(channel, 0); break;

                case "Red": OpenDMX.setDmxValue(channel, 6); break;

                case "Green": OpenDMX.setDmxValue(channel, 15);; break;

                case "Blue": OpenDMX.setDmxValue(channel, 20); break;

                case "White": OpenDMX.setDmxValue(channel, 25);; break;
                }
            }
        }
Beispiel #28
0
 public static void Show7() // SLOW
 {
     while (ShowBool7 == true)
     {
         OpenDMX.setDmxValue(172, 255);
         OpenDMX.setDmxValue(168, 255);
         OpenDMX.setDmxValue(173, 255);
         Thread.Sleep(60000);
         if (ShowBool7 == false)
         {
             break;
         }
         OpenDMX.setDmxValue(168, 0);
         if (ShowBool7 == false)
         {
             break;
         }
         Thread.Sleep(60000);
     }
 }
Beispiel #29
0
 public static void Show1()
 {
     while (ShowBool1 == true)
     {
         OpenDMX.setDmxValue(172, 0);
         OpenDMX.setDmxValue(168, 255);
         OpenDMX.setDmxValue(173, 160);
         Thread.Sleep(3000);
         if (ShowBool1 == false)
         {
             break;
         }
         OpenDMX.setDmxValue(168, 0);
         if (ShowBool1 == false)
         {
             break;
         }
         Thread.Sleep(3000);
     }
 }
Beispiel #30
0
        public static void LedParShow1_thread()
        {
            while (true)
            {
                OpenDMX.setDmxValue(LED1_Blue, 0);
                OpenDMX.setDmxValue(LED1_Intensity, 255);
                OpenDMX.setDmxValue(LED1_Red, 255);

                Thread.Sleep(2000);

                OpenDMX.setDmxValue(LED1_Red, 0);
                OpenDMX.setDmxValue(LED1_Green, 255);

                Thread.Sleep(2000);

                OpenDMX.setDmxValue(LED1_Green, 0);
                OpenDMX.setDmxValue(LED1_Blue, 255);

                Thread.Sleep(2000);
            }
        }