private void startFader1_Click(object sender, RoutedEventArgs e)
 {
     double time = Double.Parse(tbxFadeTime.Text);
     PanTiltCoarseFineFader fader1 = new PanTiltCoarseFineFader("TestFader", 1, 2, 20000, 3,4, 10000, time);
     _startTime = DateTime.Now.TimeOfDay;
     fader1.Run(new FaderDoneCallback(Fader1Finished));
 }
Exemple #2
0
        public void MoveTo(Point point, double fadeTime, string sender)
        {
            if (!HasPan || !HasTilt)
            {
                throw new FixtureNotMovableException();
            }

            if (fadeTime == 0)
            {
                int tiltCoarse = (int)point.Y / 256;
                int tiltFine   = (int)point.Y % 256;
                int panCoarse  = (int)point.X / 256;
                int panFine    = (int)point.X % 256;
                DMXController.SetLevel(Name, GetTiltCoarseAttr.Photons[0].Channel, tiltCoarse);
                DMXController.SetLevel(Name, GetTiltFineAttr.Photons[0].Channel, tiltFine);
                DMXController.SetLevel(Name, GetPanCoarseAttr.Photons[0].Channel, panCoarse);
                DMXController.SetLevel(Name, GetPanFineAttr.Photons[0].Channel, panFine);
            }
            else
            {
                //Tilt
                PanTiltCoarseFineFader fader = new PanTiltCoarseFineFader(sender, GetTiltCoarseAttr.Photons[0].Channel, GetTiltFineAttr.Photons[0].Channel, (int)point.Y, GetPanCoarseAttr.Photons[0].Channel, GetPanFineAttr.Photons[0].Channel, (int)point.X, fadeTime);

                lock (m_lock)
                {
                    fader.Run(new FaderDoneCallback(DoneMoving));
                    Monitor.Wait(m_lock);
                }
            }
        }
        private void startFader1_Click(object sender, RoutedEventArgs e)
        {
            double time = Double.Parse(tbxFadeTime.Text);
            PanTiltCoarseFineFader fader1 = new PanTiltCoarseFineFader("TestFader", 1, 2, 20000, 3, 4, 10000, time);

            _startTime = DateTime.Now.TimeOfDay;
            fader1.Run(new FaderDoneCallback(Fader1Finished));
        }
        public void MoveTo(Point point, double fadeTime, string sender)
        {
            if (!HasPan || !HasTilt)
                throw new FixtureNotMovableException();

            if (fadeTime == 0)
            {
                int tiltCoarse = (int)point.Y / 256;
                int tiltFine = (int)point.Y % 256;
                int panCoarse = (int)point.X / 256;
                int panFine = (int)point.X % 256;
                DMXController.SetLevel(Name, GetTiltCoarseAttr.Photons[0].Channel, tiltCoarse);
                DMXController.SetLevel(Name, GetTiltFineAttr.Photons[0].Channel, tiltFine);
                DMXController.SetLevel(Name, GetPanCoarseAttr.Photons[0].Channel, panCoarse);
                DMXController.SetLevel(Name, GetPanFineAttr.Photons[0].Channel, panFine);
            }
            else
            {

                //Tilt
                PanTiltCoarseFineFader fader = new PanTiltCoarseFineFader(sender, GetTiltCoarseAttr.Photons[0].Channel, GetTiltFineAttr.Photons[0].Channel, (int)point.Y, GetPanCoarseAttr.Photons[0].Channel, GetPanFineAttr.Photons[0].Channel, (int)point.X, fadeTime);

                lock (m_lock)
                {
                    fader.Run(new FaderDoneCallback(DoneMoving));
                    Monitor.Wait(m_lock);
                }
            }
        }