예제 #1
0
        public void SlewDomeAzimuth()
        {
            // Start at Park.

            _svc.MockAtPark  = true;
            _svc.MockAzimuth = _svc.ParkAzimuth;

            Random rnd     = new Random();
            double azimuth = Double.NaN;

            do
            {
                azimuth = rnd.NextDouble() * 360.0;

                // Pick a random azimuth that is at least 30 degrees from the park azimuth.

                azimuth = (Math.Abs(azimuth - _svc.MockAzimuth) < 30.0) ? Double.NaN : azimuth;
            }while (Double.IsNaN(azimuth));

            _mgr.SlewDomeToAzimuth(azimuth);

            // If this fails, it is most likely due to the fact that the slew is already complete
            // before we get here. That is why we pick a destination azimuth that is at least 30
            // degrees away from the starting azimuth.

            Assert.IsTrue(_mgr.Status.Slewing, "The dome has not started slewing to Home!");

            while (_mgr.Status.Slewing)
            {
                Thread.Sleep(100);
            }

            Assert.IsFalse(_mgr.Status.Slewing);
            Assert.AreEqual(azimuth, _mgr.Azimuth, _tolerance);
        }
        public void SlewDomeAzimuth()
        {
            // Start at Park.
            _svc.MockAtPark  = true;
            _svc.MockAzimuth = _svc.ParkAzimuth;

            Random rnd     = new Random();
            double azimuth = Double.NaN;

            do
            {
                azimuth = rnd.NextDouble() * 360.0;
                azimuth = (azimuth == _svc.ParkAzimuth) ? Double.NaN : azimuth;
            }while (Double.IsNaN(azimuth));

            _mgr.SlewDomeToAzimuth(azimuth);

            Thread.Sleep(100);

            Assert.IsTrue(_mgr.Status.Slewing, "The dome has not started slewing to Home!");

            while (_mgr.Status.Slewing)
            {
                Thread.Sleep(100);
            }

            Assert.IsFalse(_mgr.Status.Slewing);
            Assert.AreEqual(azimuth, _mgr.Azimuth, _tolerance);
        }