Пример #1
0
        private static void TestPanMovementWithStartBeforeEndReached(ICommunication communication)
        {
            Console.WriteLine("Start");
            var panTiltControl  = new EneoPanTiltControl(communication);
            var positionChecker = new PositionChecker(panTiltControl);

            panTiltControl.PositionChanged += PanTiltControl_OnPositionChanged;

            while (true)
            {
                panTiltControl.PanAbsolute(0);
                positionChecker.ComparePosition(new PanTiltPosition(0, 0), 0.5, 20, 100);

                panTiltControl.PanAbsolute(40);
                positionChecker.ComparePosition(new PanTiltPosition(40, 0), 0.5, 20, 100);

                panTiltControl.PanRelative(-40);
                Thread.Sleep(500);

                panTiltControl.PanRelative(40);
                Thread.Sleep(500);

                panTiltControl.PanAbsolute(0);

                Console.WriteLine("Loop done");
            }
        }
Пример #2
0
        public void CheckEneoProtocoll()
        {
            using (var communication = new MockCommunication())
            {
                communication.SendData += this.SendData;

                using (var control = new EneoPanTiltControl(communication, true))
                {
                    for (var pan = -180.0M; pan < 180; pan += 0.05M)
                    {
                        control.PanAbsolute(Convert.ToDouble(pan));
                    }

                    for (var tilt = -90.0M; tilt < 90; tilt += 0.05M)
                    {
                        control.TiltAbsolute(Convert.ToDouble(tilt));
                    }
                }

                communication.SendData -= this.SendData;
            }

            Assert.IsTrue(this._successful);
        }