Example #1
0
 public static void AllOff()
 {
     for (int i = 1; i <= 20; i++)
     {
         OpenDMX.setDmxValue(i, 0);
     }
     OpenDMX.writeData();
 }
Example #2
0
        public static void SetTiltFine(Light l, Int32 deg)
        {
            if (deg > 255 || deg < 0)
            {
                return;
            }

            OpenDMX.setDmxValue(getChan(l, 9), Convert.ToByte(deg));
            OpenDMX.writeData();
        }
Example #3
0
        public static void SetPan(Int32 deg)
        {
            if (deg > 255 || deg < 0)
            {
                return;
            }

            OpenDMX.setDmxValue(getChan(Light.LIGHT1, 7), Convert.ToByte(deg));
            OpenDMX.setDmxValue(getChan(Light.LIGHT2, 7), Convert.ToByte(deg));
            OpenDMX.writeData();
        }
Example #4
0
        public static void SetStrobe(Light l, Boolean on)
        {
            if (on)
            {
                OpenDMX.setDmxValue(getChan(l, 3), 131);
            }
            else
            {
                OpenDMX.setDmxValue(getChan(l, 3), 0);
            }

            OpenDMX.writeData();
        }
        public LightCommandServerForm()
        {
            InitializeComponent();

            this.FormClosing += LightCommandServerForm_Closing;

            Logger.Initialize(this);

            Logger.Log("Starting socket thread.");
            socketThread = new Thread(AsynchronousSocketListener.StartListening);
            socketThread.Start();
            Logger.Log("Socket thread started.");

            try
            {
                OpenDMX.start();                                           //find and connect to devive (first found if multiple)
                if (OpenDMX.status == FT_STATUS.FT_DEVICE_NOT_FOUND)       //update status
                {
                    Logger.Log("No Enttec USB Device Found");
                }
                else if (OpenDMX.status == FT_STATUS.FT_OK)
                {
                    Logger.Log("Found DMX on USB");
                }
                else
                {
                    Logger.Log("Error Opening Device");
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp);
                Logger.Log("Error Connecting to Enttec USB Device");
            }

            Array itemNames = System.Enum.GetNames(typeof(LightScript));

            foreach (var x in itemNames)
            {
                comboBox_scripts.Items.Add(x.ToString());
            }

            this.log_richTextBox.TextChanged += (sender, e) =>
            {
                if (this.log_richTextBox.Visible)
                {
                    this.log_richTextBox.SelectionStart = this.log_richTextBox.TextLength;
                    this.log_richTextBox.ScrollToCaret();
                }
            };
        }
Example #6
0
 public static void LightOnOff(Light l, Boolean on)
 {
     if (on)
     {
         OpenDMX.setDmxValue(getChan(l, 1), 255);
         OpenDMX.setDmxValue(getChan(l, 2), 255);
         OpenDMX.setDmxValue(getChan(l, 3), 255);
     }
     else
     {
         OpenDMX.setDmxValue(getChan(l, 1), 0);
         OpenDMX.setDmxValue(getChan(l, 2), 0);
         OpenDMX.setDmxValue(getChan(l, 3), 0);
     }
     OpenDMX.writeData();
 }
Example #7
0
        public static void SetGobo(Light l, Gobo g)
        {
            switch (g)
            {
            case Gobo.OPEN:
                OpenDMX.setDmxValue(getChan(l, 5), 0);
                break;

            case Gobo.SWIRL:
                OpenDMX.setDmxValue(getChan(l, 5), 15);
                break;

            case Gobo.CIRCLE:
                OpenDMX.setDmxValue(getChan(l, 5), 30);
                break;

            case Gobo.SQUARE:
                OpenDMX.setDmxValue(getChan(l, 5), 45);
                break;

            case Gobo.DOTS:
                OpenDMX.setDmxValue(getChan(l, 5), 60);
                break;

            case Gobo.LINE:
                OpenDMX.setDmxValue(getChan(l, 5), 75);
                break;

            case Gobo.OCT:
                OpenDMX.setDmxValue(getChan(l, 5), 90);
                break;

            case Gobo.SWIRLCROSS:
                OpenDMX.setDmxValue(getChan(l, 5), 105);
                break;

            case Gobo.STARS:
                OpenDMX.setDmxValue(getChan(l, 5), 120);
                break;

            case Gobo.ROTATE:
                OpenDMX.setDmxValue(getChan(l, 5), 200);
                break;
            }

            OpenDMX.writeData();
        }
Example #8
0
        public static void SetColor(Light l, Color c)
        {
            switch (c)
            {
            case Color.WHITE:
                OpenDMX.setDmxValue(getChan(l, 4), 0);
                break;

            case Color.RED:
                OpenDMX.setDmxValue(getChan(l, 4), 15);
                break;

            case Color.ORANGE:
                OpenDMX.setDmxValue(getChan(l, 4), 30);
                break;

            case Color.YELLOW:
                OpenDMX.setDmxValue(getChan(l, 4), 45);
                break;

            case Color.LGREEN:
                OpenDMX.setDmxValue(getChan(l, 4), 60);
                break;

            case Color.DBLUE:
                OpenDMX.setDmxValue(getChan(l, 4), 75);
                break;

            case Color.MAGENTA:
                OpenDMX.setDmxValue(getChan(l, 4), 90);
                break;

            case Color.LBLUE:
                OpenDMX.setDmxValue(getChan(l, 4), 105);
                break;

            case Color.PINK:
                OpenDMX.setDmxValue(getChan(l, 4), 120);
                break;

            case Color.ROTATE:
                OpenDMX.setDmxValue(getChan(l, 4), 193);
                break;
            }

            OpenDMX.writeData();
        }