public void TestDriverSupportedFeatures()
        {
            using (var device = new ASCOM.DriverAccess.Telescope("ASCOM.EQ500X.Telescope"))
            {
                Assert.AreEqual(0, device.SupportedActions.Count);

                /* Moving */
                //Assert.ThrowsException<ASCOM.NotConnectedException>(() => device.MoveAxis(TelescopeAxes.axisPrimary, 0));
                //Assert.ThrowsException<ASCOM.NotConnectedException>(() => device.MoveAxis(TelescopeAxes.axisSecondary, 0));
                Assert.IsTrue(device.CanMoveAxis(TelescopeAxes.axisPrimary));
                Assert.IsTrue(device.CanMoveAxis(TelescopeAxes.axisSecondary));
                Assert.IsFalse(device.CanMoveAxis(TelescopeAxes.axisTertiary));

                /* Tracking */
                Assert.IsFalse(device.CanSetDeclinationRate);
                Assert.IsFalse(device.CanSetRightAscensionRate);
                Assert.IsFalse(device.CanSetTracking);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.DeclinationRate);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.DeclinationRate = 0);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.RightAscensionRate);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.RightAscensionRate = 0);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.Tracking);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.Tracking = false);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.TrackingRate);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.TrackingRate = DriveRates.driveSidereal);

                /* Slewing */
                Assert.IsTrue(device.CanSlew);
                Assert.IsFalse(device.CanSlewAltAz);
                Assert.IsFalse(device.CanSlewAltAzAsync);
                Assert.IsTrue(device.CanSlewAsync);
                //Assert.ThrowsException<ASCOM.MethodNotImplementedException>(device.AbortSlew);
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(() => device.SlewToAltAz(0, 0));
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(() => device.SlewToAltAzAsync(0, 0));
                //Assert.ThrowsException<ASCOM.MethodNotImplementedException>(() => device.SlewToCoordinates(0, 0));
                //Assert.ThrowsException<ASCOM.MethodNotImplementedException>(() => device.SlewToCoordinatesAsync(0, 0));
                //Assert.ThrowsException<ASCOM.MethodNotImplementedException>(device.SlewToTarget);
                //Assert.ThrowsException<ASCOM.MethodNotImplementedException>(device.SlewToTargetAsync);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.Slewing);
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(() => device.DestinationSideOfPier(0, 0));
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.SlewSettleTime);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.SlewSettleTime = 0);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.TargetDeclination);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.TargetDeclination = 0);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.TargetRightAscension);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.TargetRightAscension = 0);

                /* Parking */
                Assert.IsFalse(device.CanFindHome);
                Assert.IsFalse(device.CanPark);
                Assert.IsFalse(device.CanSetPark);
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(device.FindHome);
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(device.FindHome);
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(device.SetPark);
                Assert.ThrowsException <ASCOM.MethodNotImplementedException>(device.Unpark);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.AtHome);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.AtPark);

                /* Guiding */
                Assert.IsTrue(device.CanPulseGuide);
                Assert.IsFalse(device.CanSetGuideRates);
                //Assert.ThrowsException<ASCOM.MethodNotImplementedException>(() => device.PulseGuide(GuideDirections.guideEast, 0));
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.GuideRateDeclination);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.GuideRateDeclination = 0);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.GuideRateRightAscension);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.GuideRateRightAscension = 0);
                //Assert.ThrowsException<ASCOM.PropertyNotImplementedException>(() => device.IsPulseGuiding);

                /* Optical */
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.ApertureArea);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.ApertureDiameter);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.ApertureArea);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.DoesRefraction);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.DoesRefraction = false);
                Assert.ThrowsException <ASCOM.PropertyNotImplementedException>(() => device.FocalLength);
            }
        }
예제 #2
0
 public bool CanMoveAxis(TelescopeAxes Axis)
 {
     CheckConnected();
     // TODO: should this return false when tracking?
     return(m_mount.CanMoveAxis(Axis));
 }