├── .editorconfig ├── .gitignore ├── ASCOM.Alpaca.Device ├── ASCOM.Alpaca.Device.csproj ├── Discovery │ └── Responder.cs ├── NameSpaceDoc.cs └── README.md ├── ASCOM.Alpaca ├── ASCOM.Alpaca.Clients │ ├── AlpacaClient.cs │ ├── AlpacaDevices │ │ ├── AlpacaCamera.cs │ │ ├── AlpacaCoverCalibrator.cs │ │ ├── AlpacaDome.cs │ │ ├── AlpacaFilterWheel.cs │ │ ├── AlpacaFocuser.cs │ │ ├── AlpacaObservingConditions.cs │ │ ├── AlpacaRotator.cs │ │ ├── AlpacaSafetyMonitor.cs │ │ ├── AlpacaSwitch.cs │ │ ├── AlpacaTelescope.cs │ │ └── BaseClass │ │ │ ├── AlpacaDeviceBaseClass.cs │ │ │ └── ClientConfiguration.cs │ ├── AxisRates.cs │ ├── BaseClassInterfaces │ │ ├── IAlpacaClientV1.cs │ │ └── IalpacaClientV2.cs │ ├── DynamicClientDriver.cs │ ├── EntityClasses │ │ └── NoReturnValue.cs │ ├── NameSpaceDoc.cs │ ├── Rate.cs │ └── TrackingRates.cs ├── ASCOM.Alpaca.Discovery │ ├── AlpacaDiscovery.cs │ ├── AlpacaDiscoveryResponse.cs │ ├── Entity Classes │ │ ├── AlpacaDevice.cs │ │ ├── AscomDevice.cs │ │ ├── BroadcastResponse.cs │ │ └── DnsResponse.cs │ ├── Finder.cs │ ├── NameSpaceDoc.cs │ └── README.md ├── ASCOM.Alpaca.csproj ├── Alpaca.png ├── AlpacaClients.sln ├── GlobalSuppressions.cs └── README.md ├── ASCOM.AstrometryTools ├── ASCOM - Backup.Tools.csproj ├── ASCOM.AstrometryTools.csproj ├── ASCOM.AstrometryTools.props ├── ASCOMBoarderless.png ├── AstroUtilities.cs ├── Body.cs ├── BodyPositionVelocity.cs ├── Constants.cs ├── Coordinates.cs ├── Ephemeris.cs ├── Exceptions │ ├── TransformInvalidOperationException.cs │ └── TransformUninitialisedException.cs ├── Interfaces │ └── IEphemeris.cs ├── JPLEPH ├── Kepler │ ├── Ear404Data.cs │ ├── Jup404Data.cs │ ├── KeplerSupport.cs │ ├── Mar404Data.cs │ ├── Mer404Data.cs │ ├── Mlat404Data.cs │ ├── Mlr404Data.cs │ ├── Nep404Data.cs │ ├── Orbit.cs │ ├── PlanetTable.cs │ ├── Plu404Data.cs │ ├── Sat404Data.cs │ ├── Ura404Data.cs │ └── Ven404Data.cs ├── NameSpaceDoc.cs ├── NamespaceDocs.xml ├── Novas.cs ├── NovasCom │ ├── Earth.cs │ ├── NovasComSupport.cs │ ├── Planet.cs │ ├── PositionVector.cs │ ├── Site.cs │ ├── Star.cs │ └── VelocityVector.cs ├── NovasLibraries │ ├── MakeFiles │ │ ├── linux-64 │ │ │ └── makefile │ │ ├── linux-arm │ │ │ └── makefile │ │ ├── linux-arm64 │ │ │ └── makefile │ │ └── osx │ │ │ ├── README.txt │ │ │ └── makefile │ ├── Source │ │ └── novasc3.1.zip │ ├── android-arm │ │ ├── cio_ra.bin │ │ └── libnovas.so │ ├── android-arm64 │ │ ├── cio_ra.bin │ │ └── libnovas.so │ ├── linux-arm │ │ ├── cio_ra.bin │ │ └── libnovas.so │ ├── linux-arm64 │ │ ├── cio_ra.bin │ │ └── libnovas.so │ ├── linux-x64 │ │ ├── cio_ra.bin │ │ └── libnovas.so │ ├── osx-arm64 │ │ ├── cio_ra.bin │ │ └── libnovas.dylib │ ├── osx-x64 │ │ ├── cio_ra.bin │ │ └── libnovas.dylib │ ├── win-arm64 │ │ ├── cio_ra.bin │ │ └── libnovas.dll │ ├── win-x64 │ │ ├── cio_ra.bin │ │ └── libnovas.dll │ └── win-x86 │ │ ├── cio_ra.bin │ │ └── libnovas.dll ├── OrbitDataSource.cs ├── README.md ├── RiseSetTimes.cs ├── SOFALibraries │ ├── READ_ME.txt │ ├── Source │ │ └── sofa_c-20231011.zip │ ├── android-arm │ │ └── libsofa.so │ ├── android-arm64 │ │ └── libsofa.so │ ├── linux-arm │ │ └── libsofa.so │ ├── linux-arm64 │ │ └── libsofa.so │ ├── linux-x64 │ │ └── libsofa.so │ ├── osx-arm64 │ │ └── libsofa.dylib │ ├── osx-x64 │ │ └── libsofa.dylib │ ├── win-arm64 │ │ └── libsofa.dll │ ├── win-x64 │ │ └── libsofa.dll │ └── win-x86 │ │ └── libsofa.dll ├── Sofa.cs ├── SolarSystemBody.cs └── Transform.cs ├── ASCOM.Com.ChooserSA ├── ASCOM.Com.ChooserSA.csproj ├── ASCOM.snk ├── CheckedMessageBox.Designer.cs ├── CheckedMessageBox.cs ├── CheckedMessageBox.resx ├── ChooserAlpacaConfigurationForm.Designer.cs ├── ChooserAlpacaConfigurationForm.cs ├── ChooserAlpacaConfigurationForm.resx ├── ChooserCustomToolStripRenderer.cs ├── ChooserForm.Designer.cs ├── ChooserForm.cs ├── ChooserForm.resX ├── ChooserItem.cs ├── ChooserSA.cs ├── Configuration.cs ├── DriverCompatibility.cs ├── EventLog.cs ├── Exceptions.cs ├── Extensions.cs ├── GlobalConstants.cs ├── GlobalSuppressions.cs ├── NamespaceDocumentation.xml ├── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── README.md ├── ReadPeCharacteristics.cs ├── RegistryAccess.cs └── Resources │ ├── ASCOM.ico │ ├── ASCOMAlpacaMidRes.jpg │ ├── Resources.Designer.cs │ └── Resources.resx ├── ASCOM.Com ├── ASCOM.Com.DriverAccess │ ├── BaseClass │ │ ├── ASCOMDevice.cs │ │ └── DynamicAccess.cs │ ├── Camera.cs │ ├── CoverCalibrator.cs │ ├── Dome.cs │ ├── FilterWheel.cs │ ├── Focuser.cs │ ├── NameSpaceDoc.cs │ ├── ObservingConditions.cs │ ├── Rotator.cs │ ├── SafetyMonitor.cs │ ├── Switch.cs │ ├── Telescope.cs │ └── Video.cs ├── ASCOM.Com.csproj ├── Chooser.cs ├── NameSpaceDoc.cs ├── PlatformUtilities.cs ├── Profile │ ├── ASCOMRegistration.cs │ └── Profile.cs └── README.md ├── ASCOM.Common ├── ASCOM.Common.Alpaca │ ├── AlpacaErrors.cs │ ├── AlpacaResponses │ │ ├── AlignmentModeResponse.cs │ │ ├── AxisRatesResponse.cs │ │ ├── Base64ArrayHandOffResponse.cs │ │ ├── BoolResponse.cs │ │ ├── CalibratorStatusResponse.cs │ │ ├── CameraStateResponse.cs │ │ ├── CommandCompleteResponse.cs │ │ ├── CoverStatusResponse.cs │ │ ├── DateTimeResponse.cs │ │ ├── DeviceStateResponse.cs │ │ ├── DeviceStateResponseIList.cs │ │ ├── DoubleArray2DResponse.cs │ │ ├── DoubleArray3DResponse.cs │ │ ├── DoubleJaggedArray2DResponse.cs │ │ ├── DoubleJaggedArray3DResponse.cs │ │ ├── DoubleResponse.cs │ │ ├── DriveRateResponse.cs │ │ ├── DriveRatesResponse.cs │ │ ├── EquatorialCoordinateTypeResponse.cs │ │ ├── ErrorResponse.cs │ │ ├── ImageArrayResponseBase.cs │ │ ├── IntArray1DResponse.cs │ │ ├── IntArray2DResponse.cs │ │ ├── IntArray3DResponse.cs │ │ ├── IntJaggedArray2DResponse.cs │ │ ├── IntJaggedArray3DResponse.cs │ │ ├── IntListResponse.cs │ │ ├── IntResponse.cs │ │ ├── Interfaces │ │ │ ├── IArrayResponse.cs │ │ │ ├── IErrorResponse.cs │ │ │ ├── IResponse.cs │ │ │ └── IValueResponse.cs │ │ ├── MethodResponse.cs │ │ ├── PointingStateResponse.cs │ │ ├── Response.cs │ │ ├── SensorTypeResponse.cs │ │ ├── ShortArray2DResponse.cs │ │ ├── ShortArray3DResponse.cs │ │ ├── ShortJaggedArray2DResponse.cs │ │ ├── ShortJaggedArray3DResponse.cs │ │ ├── ShortResponse.cs │ │ ├── ShutterStateResponse.cs │ │ ├── StringArrayResponse.cs │ │ ├── StringListResponse.cs │ │ ├── StringResponse.cs │ │ └── TrackingRatesResponse.cs │ ├── AlpacaTools.cs │ ├── Constants │ │ └── AlpacaConstants.cs │ ├── Discovery │ │ ├── Constants.cs │ │ ├── Entity Classes │ │ │ ├── AlpacaConfiguredDevice.cs │ │ │ └── AlpacaDeviceDescription.cs │ │ └── Response Classes │ │ │ ├── AlpacaConfiguredDevicesResponse.cs │ │ │ └── AlpacaDescriptionResponse.cs │ ├── Enums │ │ ├── ArrayType.cs │ │ ├── ImageArrayCompression.cs │ │ ├── ImageArrayElementTypes.cs │ │ ├── ImageArrayTransferType.cs │ │ └── ServiceType.cs │ ├── NameSpaceDoc.cs │ └── Structs │ │ └── ArrayMetadataV1.cs ├── ASCOM.Common.Com │ ├── ComErrorCodes.cs │ └── NameSpaceDoc.cs ├── ASCOM.Common.DeviceInterfaces │ ├── Classes │ │ ├── AxisRate.cs │ │ ├── DeviceCapabilities.cs │ │ ├── OperationalStateProperty.cs │ │ ├── StateValue.cs │ │ └── VideoFrame.cs │ ├── Enums │ │ ├── AlignmentMode.cs │ │ ├── CalibratorStatus.cs │ │ ├── CameraState.cs │ │ ├── CoverStatus.cs │ │ ├── DriveRate.cs │ │ ├── EquatorialCoordinateType.cs │ │ ├── GuideDirection.cs │ │ ├── PointingState.cs │ │ ├── SensorType.cs │ │ ├── ShutterState.cs │ │ ├── TelescopeAxis.cs │ │ ├── VideoCameraFrameRate.cs │ │ └── VideoCameraState.cs │ ├── IAscomDevice.cs │ ├── IAscomDeviceV2.cs │ ├── IAxisRates.cs │ ├── ICameraV3.cs │ ├── ICameraV4.cs │ ├── ICoverCalibratorV1.cs │ ├── ICoverCalibratorV2.cs │ ├── IDomeV2.cs │ ├── IDomeV3.cs │ ├── IFilterWheelV2.cs │ ├── IFilterWheelV3.cs │ ├── IFocuserV3.cs │ ├── IFocuserV4.cs │ ├── IObservingConditions.cs │ ├── IObservingConditionsV2.cs │ ├── IRate.cs │ ├── IRotatorV3.cs │ ├── IRotatorV4.cs │ ├── ISafetyMonitor.cs │ ├── ISafetyMonitorV3.cs │ ├── IStateValue.cs │ ├── ISwitchV2.cs │ ├── ISwitchV3.cs │ ├── ITelescopeV3.cs │ ├── ITelescopeV4.cs │ ├── ITrackingRates.cs │ ├── IVideo.cs │ ├── IVideoFrame.cs │ ├── IVideoV2.cs │ └── NameSpaceDoc.cs ├── ASCOM.Common.DeviceStateClasses │ ├── CameraDeviceState.cs │ ├── CoverCalibratorState.cs │ ├── DomeState.cs │ ├── FilterWheelState.cs │ ├── FocuserState.cs │ ├── ObservingConditionsState.cs │ ├── RotatorState.cs │ ├── SafetyMonitorState.cs │ ├── TelescopeState.cs │ └── VideoState.cs ├── ASCOM.Common.Helpers │ ├── ExceptionHelpers.cs │ ├── NameSpaceDoc.cs │ └── ResponseHelpers.cs ├── ASCOM.Common.Interfaces │ ├── Enums │ │ └── LogLevel.cs │ ├── ILogger.cs │ ├── IProfile.cs │ ├── ITraceLogger.cs │ └── NameSpaceDoc.cs ├── ASCOM.Common.csproj ├── ClientExtensions.cs ├── Devices │ ├── DeviceTypes.cs │ ├── Devices.cs │ └── MemberNames.cs ├── LoggerExtensions.cs ├── NameSpaceDoc.cs └── README.md ├── ASCOM.Tools ├── ASCOM - Backup.Tools.csproj ├── ASCOM.Tools.csproj ├── ASCOMBoarderless.png ├── ConsoleLogger.cs ├── Constants.cs ├── Enums │ └── Units.cs ├── Exceptions │ └── HelperException.cs ├── NameSpaceDoc.cs ├── NamespaceDocs.xml ├── README.md ├── TraceLogger.cs ├── Utilities.cs └── XMLProfile.cs ├── ASCOM.png ├── ASCOM.snk ├── ASCOMBoarderless.png ├── ASCOMLibrary.sln ├── Alpaca.png ├── Directory.Build.props ├── Help ├── ASCOMLibraryHelp.sln ├── ChooserSAHelp │ ├── ChooserSAHelp.shfbproj │ ├── Content │ │ ├── ExampleCode.aml │ │ ├── VersionHistory │ │ │ ├── VersionHistory.aml │ │ │ ├── v1.0.109.aml │ │ │ └── v2.0.0.aml │ │ └── Welcome.aml │ ├── ContentLayout.content │ └── icons │ │ └── Help.png ├── LibraryHelp │ ├── ASCOMLibrary.content │ ├── ASCOMLibraryHelp.shfbproj │ ├── AlpacaAndAscomDevices.aml │ ├── ApplicationDeveloperPointers.aml │ ├── AstroUtilitiesNativeLibraries.aml │ ├── Async Methods.aml │ ├── AsyncClientExtensions.aml │ ├── DeviceDriverPointers.aml │ ├── HelpExamples │ │ ├── AsyncMethodsAwait.cs │ │ ├── AsyncMethodsTask.cs │ │ ├── AsynchronousDiscovery.cs │ │ ├── ClientAsyncMethods.cs │ │ ├── DetailedClientCreation.cs │ │ ├── DeviceSelection.cs │ │ ├── HelpExamples.csproj │ │ ├── HelpExamples.sln │ │ ├── ManualClientCreation.cs │ │ ├── Program.cs │ │ ├── SeamlessClientAccess.cs │ │ ├── SimpleClientCreation.cs │ │ ├── SynchronousDiscovery.cs │ │ └── maml.xsd │ ├── How to create clients for discovered Alpaca devices.aml │ ├── How to discover Alpaca devices.aml │ ├── How to select an Alpaca device.aml │ ├── Introduction.aml │ ├── PackageMapping.aml │ ├── SeamlessAlpacaAndCom.aml │ ├── UsingAsyncClientExtensions.aml │ └── VersionHistory.aml ├── PackageAccessProject │ ├── ASCOM.Exceptions.dll │ ├── ASCOM.Exceptions.xml │ ├── PackageAccessProject.csproj │ └── Program.cs └── PackageAccessProjectFramework │ ├── App.config │ ├── PackageAccessProjectFramework.csproj │ ├── Program.cs │ └── Properties │ └── AssemblyInfo.cs ├── LICENSE ├── NuGet.config ├── README.md ├── Tester ├── OrbitalElements.cs ├── Program.cs ├── Tester.csproj └── cio_ra.bin └── test └── ASCOMStandard.Tests ├── Alpaca └── AlpacaDiscoveryTests.cs ├── Astrometry └── SolarSystemTests.cs ├── Clients └── ExtensionTests.cs ├── Devices ├── AlpacaDeviceStateTests.cs ├── ComDeviceStateTests.cs ├── DeviceTypeTests.cs └── InterfaceHasMember.cs ├── DriverAccess └── SwitchAsyncTests.cs ├── Extensions.cs ├── GlobalSuppressions.cs ├── ImageArray ├── ImageArray2DObjectByte.cs ├── ImageArray2DObjectInt16.cs ├── ImageArray2DObjectUInt16.cs └── ImageArrayTests.cs ├── NOVAS └── NovasTests.cs ├── PlatformUtilities ├── InterfaceVersionTests.cs └── PlatformUtilitiesTests.cs ├── Profile ├── IsRegisteredTests.cs ├── ProfileDeleteTests.cs ├── ProfileReadTests.cs ├── ProfileWriteTests.cs ├── SubKeyTests.cs └── Test.cs ├── Responses ├── ImageArray2DObjectInt16.cs └── ImageArrayInt3DResponseIsInitialisedWith.cs ├── SOFA └── SofaTests.cs ├── TestSupport.cs ├── TraceLogger └── TraceLoggerTests.cs ├── Transform ├── TransformFunctionalTests.cs └── TransformLoggerTests.cs ├── UnitTests.csproj └── cio_ra.bin /ASCOM.Alpaca.Device/ASCOM.Alpaca.Device.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | netstandard2.0 6 | 7 | 8 | ASCOM.Alpaca 9 | true 10 | Daniel Van Noord and Peter Simpson 11 | Copyright ASCOM Initiative 2022 12 | ASCOM Initiative 13 | A .Net Standard library providing ASCOM Alpaca device / driver specific components. 14 | MIT 15 | ASCOMBoarderless.png 16 | Initial release supporting all device types except Video and targeting .NET Standard 2.0. 17 | ASCOM.Alpaca.Device 18 | https://www.myget.org/F/ascom-initiative/api/v3/index.json 19 | true 20 | ..\ASCOM.snk 21 | false 22 | Debug;Release 23 | True 24 | README.md 25 | 26 | 27 | 28 | embedded 29 | true 30 | 31 | 32 | 33 | 34 | 35 | True 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ASCOM.Alpaca.Device/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Device 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Tools for Alpaca devices that support device discovery. This namespace is delivered in NuGet package: ASCOM.Alpaca.Device. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Alpaca.Device/README.md: -------------------------------------------------------------------------------- 1 | # ASCOM.Alpaca.Device 2 | 3 | A set of tools to support development of Alpaca devices. Written to .Net Standard 2.0 for maximum applicability. 4 | 5 | This release supports the interface updates introduced in ASCOM Platform 7. 6 | 7 | # Version History 8 | The version history only contains entries when a change is made, if a release version is not listed below, there was no change to this component in that release. 9 | 10 | ***Release 2.0.0*** 11 | * No change. 12 | 13 | ***Release 2.0.0-rc.28*** 14 | * No change. 15 | 16 | ***Release 2.0.0-rc.23*** 17 | * No change. 18 | 19 | ***Release 1.0.112*** 20 | * No change. 21 | 22 | ***Release 1.0.111*** 23 | * No change. 24 | 25 | ***Release 1.0.110*** 26 | * Re-release of version 1.0.109 without additional features and changes that are intended for a future release. 27 | 28 | ***Release 1.0.109*** 29 | * No change. 30 | 31 | ***Release 1.0.108*** 32 | * No change. 33 | 34 | ***Release 1.0.107*** 35 | * No change. 36 | 37 | ***Release 1.0.106*** 38 | * No change -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Clients/BaseClassInterfaces/IAlpacaClientV1.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace ASCOM.Alpaca.Clients 7 | { 8 | /// 9 | /// Interface to expose the common ASCOM methods plus the Alpaca device configuration property 10 | /// 11 | public interface IAlpacaClientV1 : IAscomDevice 12 | { 13 | /// 14 | /// Client configuration state 15 | /// 16 | ClientConfiguration ClientConfiguration { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Clients/BaseClassInterfaces/IalpacaClientV2.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Alpaca.Clients; 2 | using ASCOM.Common.DeviceInterfaces; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace ASCOM.Alpaca.Clients 8 | { 9 | /// 10 | /// Interface to expose the common Platform 7 ASCOM methods plus the Alpaca device configuration property 11 | /// 12 | public interface IAlpacaClientV2 : IAscomDeviceV2 13 | { 14 | /// 15 | /// Client configuration state 16 | /// 17 | ClientConfiguration ClientConfiguration { get; } 18 | 19 | /// 20 | /// Updates the internal HTTP client with a new instance. 21 | /// 22 | /// This method must be called after changing the client configuration through the property. 23 | void RefreshClient(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Clients/EntityClasses/NoReturnValue.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Clients 2 | { 3 | // Empty class acts as a type to indicate that there is no return value from a call to the remote device 4 | internal class NoReturnValue 5 | { 6 | public NoReturnValue() 7 | { } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Clients/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Clients 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Alpaca Client toolkit providing a standard interface to Alpaca devices. This namespace is delivered in NuGet package: ASCOM.Alpaca.Components. 7 | /// 8 | /// 9 | /// Please note that you will need to add this PropertyGroup to .NET projects that target Android in order for Alpaca discovery to work as expected: 10 | /// 11 | /// <PropertyGroup Condition = "$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"> 12 | /// <UseNativeHttpHandler>false</UseNativeHttpHandler> 13 | /// </PropertyGroup> 14 | /// 15 | /// This may also be the case for projects that target IOS, but has not yet been confirmed 16 | /// 17 | [System.Runtime.CompilerServices.CompilerGenerated()] 18 | class NamespaceDoc 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Clients/Rate.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Alpaca.Clients 4 | { 5 | #region Rate class 6 | // 7 | // The Rate class implements IRate, and is used to hold values 8 | // for AxisRates. You do not need to change this class. 9 | // 10 | // The Guid attribute sets the CLSID for the DynamicRemoteClient Rate class 11 | // The ClassInterface/None attribute prevents an empty interface called 12 | // _Rate from being created and used as the [default] interface 13 | // 14 | internal class Rate : IRate 15 | { 16 | private double maximum = 0; 17 | private double minimum = 0; 18 | 19 | // 20 | // Default constructor - Internal prevents public creation 21 | // of instances. These are values for AxisRates. 22 | // 23 | internal Rate(double minimum, double maximum) 24 | { 25 | this.maximum = maximum; 26 | this.minimum = minimum; 27 | } 28 | 29 | #region Implementation of IRate 30 | 31 | public void Dispose() 32 | { 33 | } 34 | 35 | public double Maximum 36 | { 37 | get { return this.maximum; } 38 | set { this.maximum = value; } 39 | } 40 | 41 | public double Minimum 42 | { 43 | get { return this.minimum; } 44 | set { this.minimum = value; } 45 | } 46 | 47 | #endregion 48 | } 49 | #endregion 50 | } 51 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Discovery/AlpacaDiscoveryResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Discovery 2 | { 3 | /// 4 | /// Class representing the IP port of the Alpaca device 5 | /// 6 | public class AlpacaDiscoveryResponse 7 | { 8 | /// 9 | /// Lower-case for serialiser 10 | /// 11 | public int AlpacaPort 12 | { 13 | get; 14 | set; 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Discovery/Entity Classes/BroadcastResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | namespace ASCOM.Alpaca.Discovery 4 | { 5 | /// 6 | /// Response to an Alpaca discovery broadcast. 7 | /// 8 | public class BroadcastResponse 9 | { 10 | /// 11 | /// Create a new instance of the BroadcastResponse class using the provided IP endpoint and response bytes 12 | /// 13 | /// IP endpoint of the device. 14 | /// Device's response as a byte array. 15 | public BroadcastResponse(IPEndPoint iPEndpoint, byte[] response) 16 | { 17 | IPEndpoint = iPEndpoint; 18 | Response = response; 19 | } 20 | 21 | /// 22 | /// IP address of the responding device 23 | /// 24 | public IPEndPoint IPEndpoint 25 | { 26 | get; private set; 27 | } 28 | 29 | /// 30 | /// Response in the returned UDP packet. 31 | /// 32 | public byte[] Response 33 | { 34 | get; private set; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Discovery/Entity Classes/DnsResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Threading; 3 | 4 | namespace ASCOM.Alpaca.Discovery 5 | { 6 | 7 | /// 8 | /// Define the state object for the callback. 9 | /// Use hostName to correlate calls with the proper result. 10 | /// 11 | public class DnsResponse 12 | { 13 | private IPHostEntry f_IpHostEntry; 14 | 15 | /// 16 | /// Initialise the class with a new ManualResetEvent 17 | /// 18 | public DnsResponse() 19 | { 20 | CallComplete = new ManualResetEvent(false); 21 | } 22 | 23 | /// 24 | /// The IPHostEntry for the discovered Alpaca device 25 | /// 26 | public IPHostEntry IpHostEntry 27 | { 28 | get 29 | { 30 | return f_IpHostEntry; 31 | } 32 | 33 | set 34 | { 35 | // Save the value and populate the other DnsResponse fields 36 | f_IpHostEntry = value; 37 | HostName = value.HostName; 38 | Aliases = value.Aliases; 39 | AddressList = value.AddressList; 40 | } 41 | } 42 | 43 | /// 44 | /// The discovery's ManualResetEvent 45 | /// 46 | public ManualResetEvent CallComplete { get; set; } 47 | 48 | /// 49 | /// The Alpaca device's host name 50 | /// 51 | public string HostName { get; set; } 52 | 53 | /// 54 | /// The device's aliases 55 | /// 56 | public string[] Aliases { get; set; } 57 | 58 | /// 59 | /// The list of IP addresses presented by the discovered device 60 | /// 61 | public IPAddress[] AddressList { get; set; } 62 | } 63 | } -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Discovery/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Discovery 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Tools providing Alpaca Discovery capabilities for Alpaca clients and devices. This namespace is delivered in NuGet package: ASCOM.Alpaca.Components 7 | /// except for the Responder class, which is delivered in NuGet package: ASCOM.Alpaca.Device to minimise its footprint. 8 | /// 9 | [System.Runtime.CompilerServices.CompilerGenerated()] 10 | class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.Discovery/README.md: -------------------------------------------------------------------------------- 1 | This is an implantation of the Alpaca Discovery Protocol. It supports IDispose, options for responding only on local host and options for limiting local host responses to loopback only (only respond on loopback, not on hardware interfaces). 2 | 3 | A client implementation is coming soon. -------------------------------------------------------------------------------- /ASCOM.Alpaca/ASCOM.Alpaca.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | netstandard2.0 6 | 7 | 8 | ASCOM.Alpaca 9 | true 10 | Daniel Van Noord and Peter Simpson 11 | ASCOM Initiative 12 | 13 | A .Net Standard library providing ASCOM Alpaca client and discovery components. 14 | 15 | Includes support for the interface updates introduced in ASCOM Platform 7. 16 | 17 | Copyright ASCOM Initiative 2022 18 | MIT 19 | ASCOMBoarderless.png 20 | Initial release supporting all device types except Video and targeting .NET Standard 2.0. 21 | ASCOM.Alpaca.Components 22 | https://www.myget.org/F/ascom-initiative/api/v3/index.json 23 | true 24 | ..\ASCOM.snk 25 | false 26 | Debug;Release 27 | True 28 | README.md 29 | 30 | 31 | 32 | embedded 33 | true 34 | 35 | 36 | 37 | 38 | 39 | True 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/Alpaca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.Alpaca/Alpaca.png -------------------------------------------------------------------------------- /ASCOM.Alpaca/AlpacaClients.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31515.178 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASCOM.Standard.AlpacaClients", "ASCOM.Standard.AlpacaClients.csproj", "{16836689-C5B7-411D-9156-B0E64FC9ED8B}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClientTester", "ClientTester\ClientTester.csproj", "{5A7E2C47-D339-4FE4-A153-9848783E0E10}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {16836689-C5B7-411D-9156-B0E64FC9ED8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {16836689-C5B7-411D-9156-B0E64FC9ED8B}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {16836689-C5B7-411D-9156-B0E64FC9ED8B}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {16836689-C5B7-411D-9156-B0E64FC9ED8B}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {5A7E2C47-D339-4FE4-A153-9848783E0E10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {5A7E2C47-D339-4FE4-A153-9848783E0E10}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {5A7E2C47-D339-4FE4-A153-9848783E0E10}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {5A7E2C47-D339-4FE4-A153-9848783E0E10}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {19E5D0DB-6267-4409-B718-30F97096454C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /ASCOM.Alpaca/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("Style", "IDE0270:Use coalesce expression", Justification = "", Scope = "member", Target = "~M:ASCOM.Alpaca.Clients.DynamicClientDriver.SendToRemoteDevice``1(System.UInt32,System.Net.Http.HttpClient,System.Int32,System.String,System.Boolean,ASCOM.Common.Interfaces.ILogger,System.String,System.Collections.Generic.Dictionary{System.String,System.String},System.Net.Http.HttpMethod,ASCOM.Common.Alpaca.ImageArrayTransferType,ASCOM.Common.Alpaca.ImageArrayCompression,System.Reflection.MemberTypes)~``0")] 9 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/ASCOM.AstrometryTools.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/ASCOMBoarderless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/ASCOMBoarderless.png -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/Body.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Tools 2 | { 3 | /// 4 | /// Body number starting with Mercury = 1 5 | /// 6 | /// 7 | public enum Body : int 8 | { 9 | /// 10 | /// Default uninitialised body value 11 | /// 12 | Uninitialised=0, 13 | /// 14 | /// Mercury 15 | /// 16 | /// 17 | Mercury = 1, 18 | /// 19 | /// Venus 20 | /// 21 | /// 22 | Venus = 2, 23 | /// 24 | /// Earth 25 | /// 26 | /// 27 | Earth = 3, 28 | /// 29 | /// Mars 30 | /// 31 | /// 32 | Mars = 4, 33 | /// 34 | /// Jupiter 35 | /// 36 | /// 37 | Jupiter = 5, 38 | /// 39 | /// Saturn 40 | /// 41 | /// 42 | Saturn = 6, 43 | /// 44 | /// Uranus 45 | /// 46 | /// 47 | Uranus = 7, 48 | /// 49 | /// Neptune 50 | /// 51 | /// 52 | Neptune = 8, 53 | /// 54 | /// Pluto 55 | /// 56 | /// 57 | Pluto = 9, 58 | /// 59 | /// Sun 60 | /// 61 | /// 62 | Sun = 10, 63 | /// 64 | /// Moon 65 | /// 66 | /// 67 | Moon = 11 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/Coordinates.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Tools 2 | { 3 | /// 4 | /// Solar system body coordinates. 5 | /// 6 | public class Coordinates 7 | { 8 | /// 9 | /// Right Ascension coordinate 10 | /// 11 | public double RightAscension = 0.0; 12 | 13 | /// 14 | /// Declination coordinate 15 | /// 16 | public double Declination = 0.0; 17 | 18 | /// 19 | /// Distance coordinate 20 | /// 21 | public double Distance = 0.0; 22 | 23 | /// 24 | /// Altitude coordinate 25 | /// 26 | public double Altitude = 0.0; 27 | 28 | /// 29 | /// Azimuth coordinate 30 | /// 31 | public double Azimuth = 0.0; 32 | 33 | /// 34 | /// Format the class's values 35 | /// 36 | /// Formatted string comprising the class's RA, declination, distance, azimuth and altitude values. 37 | public override string ToString() 38 | { 39 | return $"RA: {Utilities.HoursToHMS(RightAscension, ":", ":", "", 3)}, Declination: {Utilities.DegreesToDMS(Declination, ":", ":", "", 2)}, Distance: {Distance:0.000} AU, Azimuth: {Utilities.DegreesToDMS(Azimuth, ":", ":", "", 2)},Altitude: {Utilities.DegreesToDMS(Altitude, ":", ":", "", 2)}"; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/Exceptions/TransformInvalidOperationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ASCOM 6 | { 7 | /// 8 | /// Exception thrown what an invalid operation is attempted on the Transform component 9 | /// 10 | public class TransformInvalidOperationException : HelperException 11 | { 12 | /// 13 | /// Create a new exception with message 14 | /// 15 | /// Message to be reported by the exception 16 | /// 17 | public TransformInvalidOperationException(string message) : base(message) 18 | { 19 | } 20 | /// 21 | /// Create a new exception with message 22 | /// 23 | /// Message to be reported by the exception 24 | /// Exception to be reported as the inner exception 25 | /// 26 | public TransformInvalidOperationException(string message, Exception inner) : base(message, inner) 27 | { 28 | } 29 | /// 30 | /// Serialise the exception 31 | /// 32 | /// Serialisation information 33 | /// Serialisation context 34 | /// 35 | public TransformInvalidOperationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) 36 | { 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/Exceptions/TransformUninitialisedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ASCOM 4 | { 5 | /// 6 | /// Exception thrown when an attempt is made to read from the transform component before it has had co-ordinates 7 | /// set once by SetJ2000 or SetJNow. 8 | /// 9 | /// 10 | public class TransformUninitialisedException : HelperException 11 | { 12 | 13 | /// 14 | /// Create a new exception with message 15 | /// 16 | /// Message to be reported by the exception 17 | /// 18 | public TransformUninitialisedException(string message) : base(message) 19 | { 20 | } 21 | 22 | /// 23 | /// Create a new exception with message 24 | /// 25 | /// Message to be reported by the exception 26 | /// Exception to be reported as the inner exception 27 | /// 28 | public TransformUninitialisedException(string message, Exception inner) : base(message, inner) 29 | { 30 | } 31 | 32 | /// 33 | /// Serialise the exception 34 | /// 35 | /// Serialisation information 36 | /// Serialisation context 37 | /// 38 | public TransformUninitialisedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) 39 | { 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/JPLEPH: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/JPLEPH -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/Kepler/PlanetTable.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Tools.Kepler 2 | { 3 | internal class PlanetTable 4 | { 5 | internal int maxargs; 6 | internal int[] max_harmonic; 7 | internal int max_power_of_t; 8 | internal int[] arg_tbl; 9 | internal double[] lon_tbl; 10 | internal double[] lat_tbl; 11 | internal double[] rad_tbl; 12 | internal double distance; 13 | internal double timescale; 14 | internal double trunclvl; 15 | 16 | internal PlanetTable() { } 17 | 18 | internal PlanetTable(int ma, int[] mh, int mpt, int[] at, double[] lot, double[] lat, double[] rat, double dis, double ts, double tl) 19 | { 20 | maxargs = ma; 21 | max_harmonic = mh; 22 | max_power_of_t = mpt; 23 | arg_tbl = at; 24 | lon_tbl = lot; 25 | lat_tbl = lat; 26 | rad_tbl = rat; 27 | distance = dis; 28 | timescale = ts; 29 | trunclvl = tl; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | // Dummy classes to hold comments that appear at the namespace level in the compiled Help file 6 | 7 | namespace ASCOM.Tools 8 | { 9 | /// 10 | /// Tools and components that support all application, device and driver development. This namespace includes the SOFA, Transform, TracLogger, XMLProfile and Utilities tools and is delivered in NuGet package: ASCOM.Tools. 11 | /// 12 | [System.Runtime.CompilerServices.CompilerGenerated()] 13 | class NamespaceDoc 14 | { 15 | } 16 | } 17 | 18 | namespace ASCOM.Tools.Novas31 19 | { 20 | /// 21 | /// USNO NOVAS 3.1 implementation.. 22 | /// 23 | [System.Runtime.CompilerServices.CompilerGenerated()] 24 | class NamespaceDoc 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/MakeFiles/linux-64/makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | 3 | main: nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c 4 | $(CC) nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -shared -fPIC -o libnovas.so 5 | $(CC) checkout-stars-full.c nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -o checkout-stars-full 6 | $(CC) cio_file.c -lm -o createciofile 7 | @./createciofile 8 | clean: 9 | @rm -f *.o libnovas.so checkout-stars-full createciofile 10 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/MakeFiles/linux-arm/makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | main: nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c 4 | $(CC) nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -shared -fPIC -o libnovas.so 5 | $(CC) checkout-stars-full.c nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -o checkout-stars-full 6 | 7 | clean: 8 | @rm -f *.o libnovas.so checkout-stars-full 9 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/MakeFiles/linux-arm64/makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | main: nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c 4 | $(CC) nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -shared -fPIC -o libnovas.so 5 | $(CC) checkout-stars-full.c nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -o checkout-stars-full 6 | 7 | clean: 8 | @rm -f *.o libnovas.so checkout-stars-full 9 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/MakeFiles/osx/README.txt: -------------------------------------------------------------------------------- 1 | This make file creates a "universal"" binary containing both Intel x64 and Apple Silicon Arm binaries. 2 | 3 | The make file creates a universal dylib (OSX dynamic library) file that must be copied to both the osx-x64 and the osx-arm64 executable folders. -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/MakeFiles/osx/makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | 3 | main: nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c 4 | $(CC) nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -shared -fPIC -arch x86_64 -o libnovas_intel.dylib 5 | $(CC) checkout-stars-full.c nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -arch x86_64 -o checkout-stars-full_intel 6 | $(CC) nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -shared -fPIC -arch arm64 -o libnovas_arm.dylib 7 | $(CC) checkout-stars-full.c nutation.c novascon.c novas.c solsys1.c readeph0.c eph_manager.c -lm -arch arm64 -o checkout-stars-full_arm 8 | $(CC) cio_file.c -lm -arch arm64 -o createciofile 9 | codesign --options runtime --timestamp --sign "Developer ID Application: Peter Simpson (D8V242YV2M)" --force --deep --digest-algorithm=sha1,sha256 --entitlements ./entitlements.plist libnovas_intel.dylib 10 | @otool -hv libnovas_intel.dylib 11 | @echo "Signed Intel" 12 | @codesign --options runtime --timestamp --sign "Developer ID Application: Peter Simpson (D8V242YV2M)" --force --deep --digest-algorithm=sha1,sha256 --entitlements ./entitlements.plist libnovas_arm.dylib 13 | @otool -hv libnovas_arm.dylib 14 | @echo "Signed Arm" 15 | lipo -create -output libnovas.dylib libnovas_intel.dylib libnovas_arm.dylib 16 | file libnovas.dylib 17 | chmod +x libnovas.dylib 18 | codesign --options runtime --timestamp --sign "Developer ID Application: Peter Simpson (D8V242YV2M)" --force --deep --digest-algorithm=sha1,sha256 --entitlements ./entitlements.plist libnovas.dylib 19 | otool -hf libnovas.dylib 20 | codesign -dv --verbose=4 libnovas.dylib 21 | @echo "Universal NOVAS shared library created and signed." 22 | codesign --options runtime --timestamp --sign "Developer ID Application: Peter Simpson (D8V242YV2M)" --force --deep --digest-algorithm=sha1,sha256 --entitlements ./entitlements.plist createciofile 23 | ./createciofile 24 | @rm -f *.o libnovas_intel.dylib checkout-stars-full_intel libnovas_arm.dylib checkout-stars-full_arm libnovas.dylib 25 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/Source/novasc3.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/Source/novasc3.1.zip -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/android-arm/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/android-arm/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/android-arm/libnovas.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/android-arm/libnovas.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/android-arm64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/android-arm64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/android-arm64/libnovas.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/android-arm64/libnovas.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/linux-arm/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/linux-arm/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/linux-arm/libnovas.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/linux-arm/libnovas.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/linux-arm64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/linux-arm64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/linux-arm64/libnovas.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/linux-arm64/libnovas.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/linux-x64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/linux-x64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/linux-x64/libnovas.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/linux-x64/libnovas.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/osx-arm64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/osx-arm64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/osx-arm64/libnovas.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/osx-arm64/libnovas.dylib -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/osx-x64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/osx-x64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/osx-x64/libnovas.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/osx-x64/libnovas.dylib -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/win-arm64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/win-arm64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/win-arm64/libnovas.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/win-arm64/libnovas.dll -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/win-x64/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/win-x64/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/win-x64/libnovas.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/win-x64/libnovas.dll -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/win-x86/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/win-x86/cio_ra.bin -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/NovasLibraries/win-x86/libnovas.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/NovasLibraries/win-x86/libnovas.dll -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/OrbitDataSource.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Tools 2 | { 3 | 4 | public partial class SolarSystemBody 5 | { 6 | /// 7 | /// Sources of comet and asteroid orbit data 8 | /// 9 | public enum OrbitDataSource 10 | { 11 | /// 12 | /// Minor Planet Centre comet orbit 13 | /// 14 | MpcCometOrbit, 15 | /// 16 | /// Minor Planet Centre asteroid orbit 17 | /// 18 | MpcAsteroidOrbit, 19 | /// 20 | /// Jet Propulsion Lab comet orbit 21 | /// 22 | JplCometOrbit, 23 | /// 24 | /// Jet Propulsion Lab numbered asteroid orbit 25 | /// 26 | JplNumberedAsteroidOrbit, 27 | /// 28 | /// Jet Propulsion Lab un-numbered asteroid orbit 29 | /// 30 | JplUnNumberedAsteroidOrbit, 31 | /// 32 | /// Lowell observatory asteroid orbit 33 | /// 34 | LowellAsteroid 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/RiseSetTimes.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ASCOM.Tools 4 | { 5 | /// 6 | /// Rise and set information for an astronomical event. 7 | /// 8 | public class RiseSetTimes 9 | { 10 | /// 11 | /// Create instance and initialise the RiseEvents and SetEvents lists 12 | /// 13 | public RiseSetTimes() 14 | { 15 | RiseEvents = new List(); 16 | SetEvents = new List(); 17 | } 18 | 19 | /// 20 | /// True if the body is above the horizon at midnight 21 | /// 22 | public bool AboveHorizonAtMidnight { get; set; } 23 | 24 | /// 25 | /// List of rise event times. 26 | /// 27 | public List RiseEvents { get; set; } 28 | 29 | /// 30 | /// List of set event times 31 | /// 32 | public List SetEvents { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/READ_ME.txt: -------------------------------------------------------------------------------- 1 | The libraries in these folders are compiled native libraries, which means they must be prepared on their target systems and copied here. 2 | The SOFA component uses the library name "libsofa", which means that all native libraries must be named "libsofa.dylib" (MacOS), "libsofa.so" (Linux variants) or "libsofa.dll" (Windows). 3 | 4 | It is best to build the library and test application using ths as supplied make file: 5 | make 6 | make test 7 | 8 | This builds a static library file and runs the test program using it. 9 | 10 | We need shared rather than static libraries so these can be build after the SOFA routine object files have been created above, using the command 11 | gcc *.o -pedantic -Wall -shared -o libsofa.so (or libsofa.dylib for MacOS) -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/Source/sofa_c-20231011.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/Source/sofa_c-20231011.zip -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/android-arm/libsofa.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/android-arm/libsofa.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/android-arm64/libsofa.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/android-arm64/libsofa.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/linux-arm/libsofa.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/linux-arm/libsofa.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/linux-arm64/libsofa.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/linux-arm64/libsofa.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/linux-x64/libsofa.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/linux-x64/libsofa.so -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/osx-arm64/libsofa.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/osx-arm64/libsofa.dylib -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/osx-x64/libsofa.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/osx-x64/libsofa.dylib -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/win-arm64/libsofa.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/win-arm64/libsofa.dll -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/win-x64/libsofa.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/win-x64/libsofa.dll -------------------------------------------------------------------------------- /ASCOM.AstrometryTools/SOFALibraries/win-x86/libsofa.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.AstrometryTools/SOFALibraries/win-x86/libsofa.dll -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/ASCOM.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.Com.ChooserSA/ASCOM.snk -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/CheckedMessageBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace ASCOM.Com 5 | { 6 | /// 7 | /// Create a message dialogue with a "suppress in future" checkbox. 8 | /// 9 | public partial class CheckedMessageBox 10 | { 11 | /// 12 | /// 13 | /// 14 | public CheckedMessageBox() 15 | { 16 | // This call is required by the designer. 17 | InitializeComponent(); 18 | 19 | // Initialise the state of the suppress dialogue checkbox 20 | ChkDoNotShowAgain.Checked = Configuration.GetBool(GlobalConstants.SUPPRESS_ALPACA_DRIVER_ADMIN_DIALOGUE, GlobalConstants.SUPPRESS_ALPACA_DRIVER_ADMIN_DIALOGUE_DEFAULT); 21 | CenterToParent(); 22 | } 23 | 24 | private void BtnOk_Click(object sender, EventArgs e) 25 | { 26 | DialogResult = DialogResult.OK; 27 | Close(); 28 | } 29 | 30 | private void ChkDoNotShowAgain_CheckedChanged(object sender, EventArgs e) 31 | { 32 | // The checkbox has been clicked so record the new value 33 | Configuration.SetName(GlobalConstants.SUPPRESS_ALPACA_DRIVER_ADMIN_DIALOGUE, ChkDoNotShowAgain.Checked.ToString()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/ChooserCustomToolStripRenderer.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace ASCOM.Com 5 | { 6 | /// 7 | /// Custom renderer for the Chooser tool strip 8 | /// 9 | public class ChooserCustomToolStripRenderer : ToolStripProfessionalRenderer 10 | { 11 | /// 12 | /// Prevent "selected "colour changes when hovering over disabled menu items 13 | /// 14 | /// 15 | protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) 16 | { 17 | if (e.Item.Enabled) 18 | { 19 | base.OnRenderMenuItemBackground(e); 20 | } 21 | } 22 | 23 | /// 24 | /// Respect the BackColor property set for labels - without this they always appear with a grey background. 25 | /// 26 | /// 27 | protected override void OnRenderLabelBackground(ToolStripItemRenderEventArgs e) 28 | { 29 | if (!(e.Item.BackColor == Color.WhiteSmoke)) 30 | { 31 | var myBrush = new SolidBrush(e.Item.BackColor); 32 | e.Graphics.FillRectangle(myBrush, e.Item.ContentRectangle); 33 | myBrush.Dispose(); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Microsoft.Win32; 4 | 5 | namespace ASCOM.Com 6 | { 7 | static class Configuration 8 | { 9 | internal static bool GetBool(string keyName, bool defaultValue) 10 | { 11 | var value = default(bool); 12 | RegistryKey hkcuKey, settingsKey; 13 | 14 | hkcuKey = Registry.CurrentUser; 15 | hkcuKey.CreateSubKey(GlobalConstants.REGISTRY_UTILITIES_FOLDER); 16 | settingsKey = hkcuKey.OpenSubKey(GlobalConstants.REGISTRY_UTILITIES_FOLDER, true); 17 | 18 | try 19 | { 20 | if (settingsKey.GetValueKind(keyName) == RegistryValueKind.String) // Value does exist 21 | { 22 | value = Convert.ToBoolean(settingsKey.GetValue(keyName)); 23 | } 24 | } 25 | catch (IOException) // Value doesn't exist so create it 26 | { 27 | try 28 | { 29 | SetName(keyName, defaultValue.ToString()); 30 | value = defaultValue; 31 | } 32 | catch (Exception) // Unable to create value so just return the default value 33 | { 34 | value = defaultValue; 35 | } 36 | } 37 | catch (Exception) 38 | { 39 | value = defaultValue; 40 | } 41 | 42 | // Clean up registry keys 43 | settingsKey.Flush(); 44 | settingsKey.Close(); 45 | hkcuKey.Flush(); 46 | hkcuKey.Close(); 47 | 48 | return value; 49 | } 50 | 51 | internal static void SetName(string keyName, string value) 52 | { 53 | RegistryKey hkcuKey, settingsKey; 54 | 55 | hkcuKey = Registry.CurrentUser; 56 | hkcuKey.CreateSubKey(GlobalConstants.REGISTRY_UTILITIES_FOLDER); 57 | settingsKey = hkcuKey.OpenSubKey(GlobalConstants.REGISTRY_UTILITIES_FOLDER, true); 58 | 59 | settingsKey.SetValue(keyName, value.ToString(), RegistryValueKind.String); 60 | settingsKey.Flush(); // Clean up registry keys 61 | settingsKey.Close(); 62 | hkcuKey.Flush(); 63 | hkcuKey.Close(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ASCOM.Com 4 | { 5 | /// 6 | /// 7 | /// 8 | public static class Extensions 9 | { 10 | /// 11 | /// Get substring of specified number of characters on the right. 12 | /// 13 | public static string Right(this string value, int length) 14 | { 15 | if (String.IsNullOrEmpty(value)) return string.Empty; 16 | 17 | return value.Length <= length ? value : value.Substring(value.Length - length); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 |  2 | // This file is used by Code Analysis to maintain SuppressMessage 3 | // attributes that are applied to this project. 4 | // Project-level suppressions either have no target or are given 5 | // a specific target and scoped to a namespace, type, member, etc. 6 | 7 | -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/NamespaceDocumentation.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ASCOM.Com.ChooserSA 5 | 6 | NAMESPACE - ASSEMBLY - Stand alone Chooser 7 | 8 | 9 | 10 | 11 | 12 | 13 |

ASCOM.Common.Com Namespace

14 |

Summary

15 |

16 | This namespace contains components that support COM applications and drivers that run on Windows. 17 |

18 |
19 |
20 | 21 | 22 | 23 |

ASCOM Namespace

24 |

Summary

25 |

26 | This namespace contains ASCOM developer components. 27 |

28 |
29 |
30 | 31 | 32 | 33 |

ASCOM.Com Namespace

34 |

Summary

35 |

36 | This namespace contains components that support COM applications and drivers that run on Windows. 37 |

38 |
39 |
40 | 41 | 42 | 43 |

ASCOM.Common.Com Namespace

44 |

Summary

45 |

46 | This namespace contains components that support COM applications and drivers that run on Windows. 47 |

48 |
49 |
50 |
51 | 52 |
-------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/README.md: -------------------------------------------------------------------------------- 1 | # ASCOM.COM 2 | 3 | A stand-alone implementation of the Chooser that can be used in applications that target .NET Framework 4.7.2 and later and .NET 6.0 and later. 4 | 5 | Please note that this component only works on Windows operating systems and requires the ASCOM Platform to be installed. 6 | 7 | # Version History 8 | The version history only contains entries when a change is made, if a release version is not listed below, there was no change to this component in that release. 9 | 10 | ***Release 2.1.0*** 11 | * This version has been updated to support use in .NET 8 and .NET 9 applications but, due to Microsoft library version restrictions, cannot be used in .NET 7.0 or earlier versions. 12 | * There are no functional changes in this release. 13 | 14 | ***Release 2.0.0*** 15 | * No change. 16 | 17 | ***Release 2.0.0-rc.28*** 18 | * No change. 19 | 20 | ***Release 2.0.0-rc.23*** 21 | * No changes. 22 | 23 | ***Release 1.0.109*** 24 | * Initial release -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/Resources/ASCOM.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.Com.ChooserSA/Resources/ASCOM.ico -------------------------------------------------------------------------------- /ASCOM.Com.ChooserSA/Resources/ASCOMAlpacaMidRes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.Com.ChooserSA/Resources/ASCOMAlpacaMidRes.jpg -------------------------------------------------------------------------------- /ASCOM.Com/ASCOM.Com.DriverAccess/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Com.DriverAccess 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Client toolkit providing a standard interface to COM devices. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Com/ASCOM.Com.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | ASCOM Initiative, Daniel Van Noord and Peter Simpson 6 | A .Net Standard library for accessing ASCOM COM based drivers on Windows platforms and for reading ASCOM Profile information. 7 | 8 | Includes support for the interface updates introduced in ASCOM Platform 7. 9 | Copyright ASCOM Initiative 2022 10 | true 11 | ASCOM.Com.Components 12 | true 13 | ..\ASCOM.snk 14 | false 15 | ASCOMBoarderless.png 16 | ascom;alpaca;com;driveraccess 17 | ASCOM COM Components 18 | Debug;Release 19 | True 20 | MIT 21 | README.md 22 | 23 | 24 | 25 | embedded 26 | 27 | 28 | 29 | embedded 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | True 39 | 40 | 41 | 42 | True 43 | \ 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ASCOM.Com/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Com 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Components supporting Windows COM clients and drivers 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Com/Profile/ASCOMRegistration.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Com 2 | { 3 | /// 4 | /// A class that represents the registration data for a driver that is stored in the ASCOM Register 5 | /// 6 | public class ASCOMRegistration 7 | { 8 | internal ASCOMRegistration(string progID, string name) 9 | { 10 | this.ProgID = progID; 11 | this.Name = name; 12 | } 13 | 14 | /// 15 | /// The ProgID of the driver used to create an instance of the COM Object 16 | /// 17 | public string ProgID 18 | { 19 | get; 20 | private set; 21 | } 22 | 23 | /// 24 | /// The Name of the driver. Often used to implement a chooser. This is a human readable value. 25 | /// 26 | public string Name 27 | { 28 | get; 29 | private set; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ASCOM.Com/README.md: -------------------------------------------------------------------------------- 1 | # ASCOM.COM 2 | 3 | A set of tools to access ASCOM COM drivers. Written to .Net Standard 2.0 for maximum applicability. 4 | 5 | This release supports the interface updates introduced in ASCOM Platform 7. 6 | 7 | # Version History 8 | The version history only contains entries when a change is made, if a release version is not listed below, there was no change to this component in that release. 9 | 10 | ***Release 2.0.4*** 11 | * Added the PlatformUtiltiies.OSBuildName() and OSBuildName(int buildNumber) functions that will return a descriptive name for a Windows operating system based on its build number. 12 | 13 | ***Release 2.0.0*** 14 | * No change. 15 | 16 | ***Release 2.0.0-rc.28*** 17 | * No change. 18 | 19 | ***Release 2.0.0-rc.23*** 20 | * Add support for new Platform 7 interface members. 21 | * Add device state convenience members that package device state in an easy to use form. 22 | * Fix - Four MethodNotImplementedException replaced with NotImplementedExceptions to match the Library standard. 23 | * Fix - Include the driver's original exception as an inner exception when throwing exceptions from Com.DriverAccess to make behaviour consistent with Platform behaviour. 24 | * Fix - Prevent two unintended NullReferenceExceptions in Com.DriverAccess when handling exceptions returned by drivers. 25 | * Fix - Accept an array of integers for Gains to ensure that drivers remain usable when clients use the ASCOM Library. 26 | * Client async methods now respect timeouts if the target driver/device locks up and does not return from the initiator or polling variable. 27 | 28 | ***Release 1.0.112*** 29 | * No change. 30 | 31 | ***Release 1.0.111*** 32 | * No change. 33 | 34 | ***Release 1.0.110*** 35 | * Re-release of version 1.0.109 without additional features and changes that are intended for a future release. 36 | 37 | ***Release 1.0.109*** 38 | * Added PlatformUtilities.IsPlatformInstalled() function. 39 | * Profile.GetDrivers() now returns an empty list instead of an exception if no drivers are found. 40 | 41 | ***Release 1.0.108*** 42 | * Fixed an issue where interface version 1 Focusers would have Connected called instead of Link 43 | 44 | ***Release 1.0.107*** 45 | * No change. 46 | 47 | ***Release 1.0.106*** 48 | * No change -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/AlignmentModeResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns an value. 7 | /// 8 | public class AlignmentModeResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new AlignmentModeResponse with default values 12 | /// 13 | public AlignmentModeResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new AlignmentModeResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public AlignmentModeResponse(uint clientTransactionID, uint serverTransactionID, AlignmentMode value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new AlignmentModeResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public AlignmentModeResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// Alignment mode returned by the device 47 | /// 48 | public AlignmentMode Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/Base64ArrayHandOffResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// JSON Response returned when base64 encoding will be used to return an image array 5 | /// 6 | public class Base64ArrayHandOffResponse : ImageArrayResponseBase 7 | { 8 | /// 9 | /// The length of the image array's X dimension: Array[X , Y] or Array[X, Y, Z] 10 | /// 11 | public int Dimension0Length { get; set; } = 0; 12 | 13 | /// 14 | /// The length of the image array's Y dimension: Array[X , Y] or Array[X, Y, Z] 15 | /// 16 | public int Dimension1Length { get; set; } = 0; 17 | 18 | /// 19 | /// The length of the image array's Z dimension if present. Returns 0 for a two dimension array: Array[X , Y]. Or >=1 for a three dimension array: Array[X , Y, Z] 20 | /// 21 | public int Dimension2Length { get; set; } = 0; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/BoolResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Alpaca boolean response class 5 | /// 6 | public class BoolResponse : Response, IValueResponse 7 | { 8 | /// 9 | /// Create a new BoolResponse with default values 10 | /// 11 | public BoolResponse() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new BoolResponse with the supplied parameter values 17 | /// 18 | /// Client transaction ID 19 | /// Server transaction ID 20 | /// Value to return 21 | public BoolResponse(uint clientTransactionID, uint serverTransactionID, bool value) 22 | { 23 | base.ServerTransactionID = serverTransactionID; 24 | base.ClientTransactionID = clientTransactionID; 25 | Value = value; 26 | } 27 | 28 | /// 29 | /// Create a new BoolResponse with the supplied parameter values 30 | /// 31 | /// Client transaction ID 32 | /// Server transaction ID 33 | /// Value to return 34 | /// Server transaction ID 35 | public BoolResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 36 | { 37 | base.ServerTransactionID = serverTransactionID; 38 | base.ClientTransactionID = clientTransactionID; 39 | base.ErrorMessage = errorMessage; 40 | base.ErrorNumber = errorCode; 41 | } 42 | 43 | /// 44 | /// Boolean value returned by the device 45 | /// 46 | public bool Value { get; set; } 47 | 48 | /// 49 | /// Return the value as a string 50 | /// 51 | /// String representation of the response value 52 | public override string ToString() 53 | { 54 | return Value.ToString(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/CalibratorStatusResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns an value. 7 | /// 8 | public class CalibratorStatusResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new CalibratorStatusResponse with default values 12 | /// 13 | public CalibratorStatusResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new CalibratorStatusResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public CalibratorStatusResponse(uint clientTransactionID, uint serverTransactionID, CalibratorStatus value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new CalibratorStatusResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public CalibratorStatusResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// CalibratorStatus returned by the device 47 | /// 48 | public CalibratorStatus Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/CameraStateResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns a value. 7 | /// 8 | public class CameraStateResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new CameraStateResponse with default values 12 | /// 13 | public CameraStateResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new CameraStateResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public CameraStateResponse(uint clientTransactionID, uint serverTransactionID, CameraState value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new CameraStateResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public CameraStateResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// Camera state returned by the device 47 | /// 48 | public CameraState Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/CommandCompleteResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Response for methods that do not return a value. 5 | /// 6 | public class CommandCompleteResponse : Response 7 | { 8 | /// 9 | /// Create a new CommandCompleteResponse with default values 10 | /// 11 | public CommandCompleteResponse() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new CommandCompleteResponse with the supplied parameter values 17 | /// 18 | /// Client transaction ID 19 | /// Server transaction ID 20 | public CommandCompleteResponse(uint clientTransactionID, uint serverTransactionID) 21 | { 22 | base.ServerTransactionID = serverTransactionID; 23 | base.ClientTransactionID = clientTransactionID; 24 | } 25 | 26 | /// 27 | /// Create a new CommandCompleteResponse with the supplied parameter values 28 | /// 29 | /// Client transaction ID 30 | /// Server transaction ID 31 | /// Value to return 32 | /// Server transaction ID 33 | public CommandCompleteResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 34 | { 35 | base.ServerTransactionID = serverTransactionID; 36 | base.ClientTransactionID = clientTransactionID; 37 | base.ErrorMessage = errorMessage; 38 | base.ErrorNumber = errorCode; 39 | } 40 | 41 | /// 42 | /// Return a string containing the ClientTransactionID, ServerTransactionID, ErrorMessage and ErrorNumber 43 | /// 44 | /// String representation of the response value 45 | public override string ToString() 46 | { 47 | if (ErrorMessage == null) return $"ClientTransactionID: {ClientTransactionID}, ServerTransactionID: {ServerTransactionID}, ErrorMessage:, ErrorNumber: {ErrorNumber}"; 48 | return $"ClientTransactionID: {ClientTransactionID}, ServerTransactionID: {ServerTransactionID}, ErrorMessage: {ErrorMessage}, ErrorNumber: {ErrorNumber}"; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/CoverStatusResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns an value. 7 | /// 8 | public class CoverStatusResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new CoverStatusResponse with default values 12 | /// 13 | public CoverStatusResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new CoverStatusResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public CoverStatusResponse(uint clientTransactionID, uint serverTransactionID, CoverStatus value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new CoverStatusResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public CoverStatusResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// CoverStatus returned by the device 47 | /// 48 | public CoverStatus Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/DoubleResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Response that returns a double value. 5 | /// 6 | public class DoubleResponse : Response, IValueResponse 7 | { 8 | /// 9 | /// Create a new DoubleResponse with default values 10 | /// 11 | public DoubleResponse() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new DoubleResponse with the supplied parameter values 17 | /// 18 | /// Client transaction ID 19 | /// Server transaction ID 20 | /// Value to return 21 | public DoubleResponse(uint clientTransactionID, uint serverTransactionID, double value) 22 | { 23 | base.ServerTransactionID = serverTransactionID; 24 | base.ClientTransactionID = clientTransactionID; 25 | Value = value; 26 | } 27 | 28 | /// 29 | /// Create a new DoubleResponse with the supplied parameter values 30 | /// 31 | /// Client transaction ID 32 | /// Server transaction ID 33 | /// Value to return 34 | /// Server transaction ID 35 | public DoubleResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 36 | { 37 | base.ServerTransactionID = serverTransactionID; 38 | base.ClientTransactionID = clientTransactionID; 39 | base.ErrorMessage = errorMessage; 40 | base.ErrorNumber = errorCode; 41 | } 42 | 43 | /// 44 | /// Double value returned by the device 45 | /// 46 | public double Value { get; set; } 47 | 48 | /// 49 | /// Return the value as a string 50 | /// 51 | /// String representation of the response value 52 | public override string ToString() 53 | { 54 | return Value.ToString(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/DriveRateResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns a value. 7 | /// 8 | public class DriveRateResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new DriveRateResponse with default values 12 | /// 13 | public DriveRateResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new DriveRateResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public DriveRateResponse(uint clientTransactionID, uint serverTransactionID, DriveRate value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new DriveRateResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public DriveRateResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// Drive rate returned by the device 47 | /// 48 | public DriveRate Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/ImageArrayResponseBase.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Base class for ImageArray responses. 5 | /// 6 | public class ImageArrayResponseBase : Response 7 | { 8 | private int rank = 0; 9 | 10 | private ImageArrayElementTypes type = ImageArrayElementTypes.Unknown; 11 | 12 | /// 13 | /// Array type 14 | /// 15 | public int Type 16 | { 17 | get { return (int)type; } 18 | set { type = (ImageArrayElementTypes)value; } 19 | } 20 | 21 | /// 22 | /// Array rank 23 | /// 24 | public int Rank 25 | { 26 | get { return rank; } 27 | set { rank = value; } 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/IntResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Response that returns an integer value. 5 | /// 6 | public class IntResponse : Response, IValueResponse 7 | { 8 | /// 9 | /// Create a new IntResponse with default values 10 | /// 11 | public IntResponse() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new IntResponse with the supplied parameter values 17 | /// 18 | /// Client transaction ID 19 | /// Server transaction ID 20 | /// Value to return 21 | public IntResponse(uint clientTransactionID, uint serverTransactionID, int value) 22 | { 23 | base.ServerTransactionID = serverTransactionID; 24 | base.ClientTransactionID = clientTransactionID; 25 | Value = value; 26 | } 27 | 28 | /// 29 | /// Create a new IntResponse with the supplied parameter values 30 | /// 31 | /// Client transaction ID 32 | /// Server transaction ID 33 | /// Value to return 34 | /// Server transaction ID 35 | public IntResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 36 | { 37 | base.ServerTransactionID = serverTransactionID; 38 | base.ClientTransactionID = clientTransactionID; 39 | base.ErrorMessage = errorMessage; 40 | base.ErrorNumber = errorCode; 41 | } 42 | 43 | /// 44 | /// Integer value returned by the device 45 | /// 46 | public int Value { get; set; } 47 | 48 | /// 49 | /// Return the value as a string 50 | /// 51 | /// String representation of the response value 52 | public override string ToString() 53 | { 54 | return Value.ToString(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/Interfaces/IArrayResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// ImageArrayResponse interface 5 | /// 6 | /// 7 | public interface IArrayResponse 8 | { 9 | /// 10 | /// The type of data contained in the Value field."/> 11 | /// 12 | ArrayType Type { get; } 13 | 14 | /// 15 | /// The array's rank, will be 2 (single plane image (monochrome)) or 3 (multi-plane image). 16 | /// 17 | int Rank { get; } 18 | 19 | /// 20 | /// Image data array of rank with elements of type . 21 | /// 22 | T Value { get; set; } 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/Interfaces/IErrorResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Defines the base of an Alpaca response. 5 | /// 6 | public interface IErrorResponse 7 | { 8 | /// 9 | /// Zero for a successful transaction, or a non-zero integer(-2147483648 to 2147483647) if the device encountered an issue.Devices must use ASCOM reserved error 10 | /// numbers whenever appropriate so that clients can take informed actions. E.g.returning 0x401 (1025) to indicate that an invalid value was received. 11 | /// 12 | /// 13 | AlpacaErrors ErrorNumber { get; set; } 14 | 15 | /// 16 | /// Empty string for a successful transaction, or a message describing the issue that was encountered. If an error message is returned, 17 | /// a non zero must also be returned. 18 | /// 19 | string ErrorMessage { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/Interfaces/IResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Defines the base of an Alpaca response. 5 | /// 6 | public interface IResponse : IErrorResponse 7 | { 8 | /// 9 | /// Client's transaction ID (0 to 4294967295), as supplied by the client in the command request. 10 | /// 11 | uint ClientTransactionID { get; set; } 12 | 13 | /// 14 | /// Server's transaction ID (0 to 4294967295), should be unique for each client transaction so that log messages on the client can be associated with logs on the device. 15 | /// 16 | uint ServerTransactionID { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/Interfaces/IValueResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Defines an Alpaca response that returns a value. 5 | /// 6 | /// Type of the response 7 | public interface IValueResponse : IResponse 8 | { 9 | /// 10 | /// The value of the response 11 | /// 12 | T Value { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/MethodResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// JSON response for a method that doesn't return a value. 5 | /// 6 | public class MethodResponse : Response 7 | { 8 | /// 9 | /// Create a new uninitialised instance 10 | /// 11 | public MethodResponse() { } 12 | 13 | /// 14 | /// Create a new instance initialised with client transaction ID and server transaction ID 15 | /// 16 | /// Client transaction ID 17 | /// Server transaction ID 18 | public MethodResponse(uint clientTransactionID, uint serverTransactionID) 19 | { 20 | base.ServerTransactionID = serverTransactionID; 21 | base.ClientTransactionID = clientTransactionID; 22 | } 23 | // No additional fields for this class 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/PointingStateResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns a value. 7 | /// 8 | public class PointingStateResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new PointingStateResponse with default values 12 | /// 13 | public PointingStateResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new PointingStateResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public PointingStateResponse(uint clientTransactionID, uint serverTransactionID, PointingState value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new PointingStateResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public PointingStateResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// PointingState value returned by the device 47 | /// 48 | public PointingState Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/Response.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Defines the properties that are common to all Alpaca responses. 7 | /// 8 | /// 9 | /// If a command does not return a value, use instead of this class. 10 | /// 11 | public class Response : ErrorResponse, IResponse 12 | { 13 | /// 14 | /// Client's transaction ID (0 to 4294967295), as supplied by the client in the command request. 15 | /// 16 | [JsonPropertyOrder(10)] 17 | public uint ClientTransactionID { get; set; } 18 | 19 | /// 20 | /// Server's transaction ID (0 to 4294967295), should be unique for each client transaction so that log messages on the client can be associated with logs on the device. 21 | /// 22 | [JsonPropertyOrder(20)] 23 | public uint ServerTransactionID { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/SensorTypeResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns a value. 7 | /// 8 | public class SensorTypeResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new SensorTypeResponse with default values 12 | /// 13 | public SensorTypeResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new SensorTypeResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public SensorTypeResponse(uint clientTransactionID, uint serverTransactionID, SensorType value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Sensor type returned by the device 32 | /// 33 | /// 34 | /// Create a new SensorTypeResponse with the supplied parameter values 35 | /// 36 | /// Client transaction ID 37 | /// Server transaction ID 38 | /// Value to return 39 | /// Server transaction ID 40 | public SensorTypeResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 41 | { 42 | base.ServerTransactionID = serverTransactionID; 43 | base.ClientTransactionID = clientTransactionID; 44 | base.ErrorMessage = errorMessage; 45 | base.ErrorNumber = errorCode; 46 | } 47 | 48 | /// 49 | /// SensorType value returned by the device 50 | /// 51 | public SensorType Value { get; set; } 52 | 53 | /// 54 | /// Return the value as a string 55 | /// 56 | /// String representation of the response value 57 | public override string ToString() 58 | { 59 | return Value.ToString(); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/ShortResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Response that returns a short integer value. 5 | /// 6 | public class ShortResponse : Response 7 | { 8 | /// 9 | /// Create a new ShortResponse with default values 10 | /// 11 | public ShortResponse() { } 12 | 13 | /// 14 | /// Create a new IntResponse with the supplied parameter values 15 | /// 16 | /// Client transaction ID 17 | /// Server transaction ID 18 | /// Value to return 19 | public ShortResponse(uint clientTransactionID, uint serverTransactionID, short value) 20 | { 21 | base.ServerTransactionID = serverTransactionID; 22 | base.ClientTransactionID = clientTransactionID; 23 | Value = value; 24 | } 25 | 26 | /// 27 | /// Integer value returned by the device 28 | /// 29 | public short Value { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/ShutterStateResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that return the value as a 7 | /// 8 | public class ShutterStateResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new ShutterStateResponse with default values 12 | /// 13 | public ShutterStateResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new ShutterStateResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public ShutterStateResponse(uint clientTransactionID, uint serverTransactionID, ShutterState value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new ShutterStateResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public ShutterStateResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// Shutter state returned by the device 47 | /// 48 | public ShutterState Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/StringArrayResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ASCOM.Common.Alpaca 4 | { 5 | /// 6 | /// Response that returns a string array value. 7 | /// 8 | public class StringArrayResponse : Response 9 | { 10 | private string[] stringArray; 11 | 12 | /// 13 | /// Create a new StringArrayResponse with default values 14 | /// 15 | public StringArrayResponse() { } 16 | 17 | /// 18 | /// Create a new StringArrayResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public StringArrayResponse(uint clientTransactionID, uint serverTransactionID, string[] value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | stringArray = value; 27 | base.ClientTransactionID = clientTransactionID; 28 | } 29 | 30 | /// 31 | /// String array returned by the device 32 | /// 33 | [JsonPropertyOrder(1000)] 34 | public string[] Value 35 | { 36 | get { return stringArray; } 37 | set { stringArray = value; } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/StringResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Response that returns a string value 5 | /// 6 | public class StringResponse : Response, IValueResponse 7 | { 8 | /// 9 | /// Create a new StringResponse with default values 10 | /// 11 | public StringResponse() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new StringResponse with the supplied parameter values 17 | /// 18 | /// Client transaction ID 19 | /// Server transaction ID 20 | /// Value to return 21 | public StringResponse(uint clientTransactionID, uint serverTransactionID, string value) 22 | { 23 | base.ServerTransactionID = serverTransactionID; 24 | base.ClientTransactionID = clientTransactionID; 25 | Value = value; 26 | } 27 | 28 | /// 29 | /// Create a new StringResponse with the supplied parameter values 30 | /// 31 | /// Client transaction ID 32 | /// Server transaction ID 33 | /// Value to return 34 | /// Server transaction ID 35 | public StringResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 36 | { 37 | base.ServerTransactionID = serverTransactionID; 38 | base.ClientTransactionID = clientTransactionID; 39 | base.ErrorMessage = errorMessage; 40 | base.ErrorNumber = errorCode; 41 | } 42 | 43 | /// 44 | /// String value returned by the device 45 | /// 46 | public string Value { get; set; } 47 | 48 | /// 49 | /// Return the value as a string 50 | /// 51 | /// String representation of the response value 52 | public override string ToString() 53 | { 54 | // Return the sting value or an empty string if the value is null 55 | if (Value == null) return string.Empty; 56 | return Value.ToString(); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/AlpacaResponses/TrackingRatesResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceInterfaces; 2 | using System.Collections.Generic; 3 | 4 | namespace ASCOM.Common.Alpaca 5 | { 6 | /// 7 | /// Response that returns a tracking rates collection. 8 | /// 9 | public class TrackingRatesResponse : Response 10 | { 11 | private List rates; 12 | 13 | /// 14 | /// Create a new TrackingRatesResponse with default values 15 | /// 16 | public TrackingRatesResponse() { } 17 | 18 | /// 19 | /// Create a new TrackingRatesResponse with the supplied parameter values 20 | /// 21 | /// Client transaction ID 22 | /// Server transaction ID 23 | public TrackingRatesResponse(uint clientTransactionID, uint serverTransactionID) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | } 28 | 29 | /// 30 | /// Set or return a list of tracking rates 31 | /// 32 | public List Value 33 | { 34 | get { return rates; } 35 | set { rates = value; } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Discovery/Constants.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace ASCOM.Alpaca.Discovery 4 | { 5 | /// 6 | /// Constants related to Alpaca discovery 7 | /// 8 | public static class Constants 9 | { 10 | /// 11 | /// Discovery broadcast message from an Alpaca client 12 | /// 13 | public const string DiscoveryMessage = "alpacadiscovery1"; 14 | 15 | /// 16 | /// Default Alpaca discovery broadcast / listening port 17 | /// 18 | public const int DiscoveryPort = 32227; 19 | 20 | /// 21 | /// JSON Property name for the Alpaca device's listening port 22 | /// 23 | public const string ResponseString = "AlpacaPort"; 24 | 25 | /// 26 | /// IPv6 multicast group address for discovery over an IPv6 network 27 | /// 28 | public const string MulticastGroup = "ff12::00a1:9aca"; 29 | 30 | /// 31 | /// Returns the ALpaca discovery message as a byte array 32 | /// 33 | public static byte[] DiscoveryMessageArray 34 | { 35 | get 36 | { 37 | return Encoding.ASCII.GetBytes(DiscoveryMessage); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Discovery/Entity Classes/AlpacaConfiguredDevice.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Discovery 2 | { 3 | /// 4 | /// Returns an array of device description objects, providing unique information for each served device, enabling them to be accessed through the Alpaca Device API. 5 | /// 6 | public class AlpacaConfiguredDevice 7 | { 8 | /// 9 | /// Create a new AlpacaConfiguredDevice with default values. 10 | /// 11 | public AlpacaConfiguredDevice() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new AlpacaConfiguredDevice with set values. 17 | /// 18 | /// A short name for this device that a user would expect to see in a list of available devices. 19 | /// One of the supported ASCOM Devices types such as Telescope, Camera, Focuser etc. 20 | /// The device number that must be used to access this device through the Alpaca Device API. 21 | /// This should be the ProgID for COM devices or a GUID for native Alpaca devices. 22 | public AlpacaConfiguredDevice(string deviceName, string deviceType, int deviceNumber, string uniqueID) 23 | { 24 | DeviceName = deviceName; 25 | DeviceType = deviceType; 26 | DeviceNumber = deviceNumber; 27 | UniqueID = uniqueID; 28 | } 29 | 30 | /// 31 | /// A short name for this device that a user would expect to see in a list of available devices. 32 | /// 33 | public string DeviceName { get; set; } 34 | /// 35 | /// One of the supported ASCOM Devices types such as Telescope, Camera, Focuser etc. 36 | /// 37 | public string DeviceType { get; set; } 38 | /// 39 | /// The device number that must be used to access this device through the Alpaca Device API. 40 | /// 41 | public int DeviceNumber { get; set; } 42 | /// 43 | /// "This should be the ProgID for COM devices or a GUID for native Alpaca devices." 44 | /// 45 | public string UniqueID { get; set; } 46 | } 47 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Discovery/Entity Classes/AlpacaDeviceDescription.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Discovery 2 | { 3 | /// 4 | /// Returns cross-cutting information that applies to all devices available at this URL:Port. 5 | /// 6 | public class AlpacaDeviceDescription 7 | { 8 | /// 9 | /// Create a new AlpacaDeviceDescription with default values. 10 | /// 11 | public AlpacaDeviceDescription() 12 | { 13 | } 14 | 15 | /// 16 | /// Create a new AlpacaDeviceDescription with set values. 17 | /// 18 | /// The device or server's overall name. 19 | /// The manufacturer's name. 20 | /// The device or server's version number. 21 | /// The device or server's location. 22 | public AlpacaDeviceDescription(string serverName, string manufacturer, string manufacturerVersion, string location) 23 | { 24 | ServerName = serverName; 25 | Manufacturer = manufacturer; 26 | ManufacturerVersion = manufacturerVersion; 27 | Location = location; 28 | } 29 | 30 | /// 31 | /// The device or server's overall name. 32 | /// 33 | public string ServerName { get; set; } = string.Empty; 34 | /// 35 | /// The manufacturer's name. 36 | /// 37 | public string Manufacturer { get; set; } = string.Empty; 38 | /// 39 | /// The device or server's version number. 40 | /// 41 | public string ManufacturerVersion { get; set; } = string.Empty; 42 | /// 43 | /// The device or server's location. 44 | /// 45 | public string Location { get; set; } = string.Empty; 46 | } 47 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Discovery/Response Classes/AlpacaDescriptionResponse.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.Alpaca; 2 | 3 | namespace ASCOM.Alpaca.Discovery 4 | { 5 | /// 6 | /// The response for the AlpacaDeviceDescription 7 | /// 8 | public class AlpacaDescriptionResponse : Response, IValueResponse 9 | { 10 | /// 11 | /// Create a new AlpacaDescriptionResponse with default values 12 | /// 13 | public AlpacaDescriptionResponse() 14 | { 15 | } 16 | 17 | /// 18 | /// Create a new AlpacaDescriptionResponse with the supplied parameter values 19 | /// 20 | /// Client transaction ID 21 | /// Server transaction ID 22 | /// Value to return 23 | public AlpacaDescriptionResponse(uint clientTransactionID, uint serverTransactionID, AlpacaDeviceDescription value) 24 | { 25 | base.ServerTransactionID = serverTransactionID; 26 | base.ClientTransactionID = clientTransactionID; 27 | Value = value; 28 | } 29 | 30 | /// 31 | /// Create a new AlpacaDescriptionResponse with the supplied parameter values 32 | /// 33 | /// Client transaction ID 34 | /// Server transaction ID 35 | /// Value to return 36 | /// Server transaction ID 37 | public AlpacaDescriptionResponse(uint clientTransactionID, uint serverTransactionID, string errorMessage, AlpacaErrors errorCode) 38 | { 39 | base.ServerTransactionID = serverTransactionID; 40 | base.ClientTransactionID = clientTransactionID; 41 | base.ErrorMessage = errorMessage; 42 | base.ErrorNumber = errorCode; 43 | } 44 | 45 | /// 46 | /// AlpacaDeviceDescription value returned by the device 47 | /// 48 | public AlpacaDeviceDescription Value { get; set; } 49 | 50 | /// 51 | /// Return the value as a string 52 | /// 53 | /// String representation of the response value 54 | public override string ToString() 55 | { 56 | return Value.ToString(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Enums/ArrayType.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Image array element type enumeration 5 | /// 6 | public enum ArrayType 7 | { 8 | /// 9 | /// Unknown image element type 10 | /// 11 | Unknown = 0, 12 | 13 | /// 14 | /// Short (Int16) image element type 15 | /// 16 | Short = 1, 17 | 18 | /// 19 | /// Int32 image element type 20 | /// 21 | Int = 2, 22 | 23 | /// 24 | /// Double image element type 25 | /// 26 | Double = 3 27 | } 28 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Enums/ImageArrayCompression.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | // Enum used by the dynamic client to indicate what type of compression should be used in responses 4 | /// 5 | /// Compression options for ImageArray transfer, 6 | /// 7 | public enum ImageArrayCompression 8 | { 9 | None = 0, 10 | Deflate = 1, 11 | GZip = 2, 12 | GZipOrDeflate = 3 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Enums/ImageArrayElementTypes.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Camera.ImageArray and ImageArrayVariant array element types 5 | /// 6 | public enum ImageArrayElementTypes 7 | { 8 | Unknown = 0, 9 | Int16 = 1, 10 | Int32 = 2, 11 | Double = 3, 12 | Single = 4, 13 | UInt64 = 5, 14 | Byte = 6, 15 | Int64 = 7, 16 | UInt16 = 8, 17 | UInt32 = 9, 18 | Object=10 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Enums/ImageArrayTransferType.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | // Enum used by the dynamic client to indicate what type of image array transfer should be used 4 | /// 5 | /// Type of image array transfer 6 | /// 7 | public enum ImageArrayTransferType 8 | { 9 | JSON = 0, 10 | Base64HandOff = 1, 11 | ImageBytes = 2, 12 | BestAvailable = 3 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/Enums/ServiceType.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | /// 4 | /// Describes available connection service types used by the Alpaca Clients and by the Discovery component 5 | /// 6 | /// The Enum codes must be valid service types because they are converted to strings and used directly in device URLs of form: {ServiceType}://{Host}:{Port}/api...}in the 7 | public enum ServiceType 8 | { 9 | /// 10 | /// Unencrypted HTTP protocol 11 | /// 12 | Http = 0, 13 | /// 14 | /// Encrypted HTTPS protocol 15 | /// 16 | Https = 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Alpaca/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Alpaca 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Capabilities used by Alpaca devices and Alpaca clients. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Com/ComErrorCodes.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Com 2 | { 3 | /// 4 | /// Error number limits related to Windows COM exceptions (HResult values) 5 | /// 6 | public enum ComErrorCodes 7 | { 8 | /// 9 | /// Offset value that relates the ASCOM Alpaca reserved error number range to the ASCOM COM HResult error number range 10 | /// 11 | ComErrorNumberOffset = unchecked((int)0x80040000), // Offset value that relates the ASCOM Alpaca reserved error number range to the ASCOM COM HResult error number range 12 | ComErrorNumberBase = unchecked((int)0x80040400), // Lowest ASCOM error number 13 | ComErrorNumberMax = unchecked((int)0x80040FFF) // Highest ASCOM error number 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Com/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Com 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Capabilities used by COM drivers and COM clients. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Classes/AxisRate.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Describe a rate at which the telescope may be moved about the specified axis by the MoveAxis(TelescopeAxes, Double) method. 5 | /// 6 | public class AxisRate : IRate 7 | { 8 | /// 9 | /// Create a new AxisRate object with minimum and maximum rates set to 0.0 10 | /// 11 | public AxisRate() 12 | { } 13 | 14 | /// 15 | /// Create a new AxisRate object with the specified minimum and maximum rates 16 | /// 17 | /// The lowest axis movement rate (must be >= 0.0) 18 | /// The highest axis movement rate (must be >= the minimum rate) 19 | public AxisRate(double minimum, double maximum) 20 | { 21 | Minimum = minimum; 22 | Maximum = maximum; 23 | } 24 | 25 | /// 26 | /// The minimum rate (degrees per second) This must always be a positive number. It indicates the maximum rate in either direction about the axis. 27 | /// 28 | public double Minimum { get; set; } 29 | 30 | /// 31 | /// The maximum rate (degrees per second) This must always be a positive number. It indicates the maximum rate in either direction about the axis. 32 | /// 33 | public double Maximum { get; set; } 34 | 35 | public void Dispose() 36 | { 37 | } 38 | 39 | /// 40 | /// Return the minimum and maximum values as a string 41 | /// 42 | /// String representation of AxisRate minimum and maximum values. 43 | public override string ToString() 44 | { 45 | return $"AxisRate range: {Minimum} to {Maximum}"; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Classes/StateValue.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.DeviceStateClasses; 2 | using ASCOM.Common.Interfaces; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text.Json; 7 | 8 | namespace ASCOM.Common.DeviceInterfaces 9 | { 10 | /// 11 | /// Class to hold a state name:value pair. 12 | /// 13 | public class StateValue : IStateValue 14 | { 15 | /// 16 | /// Create a new state value object 17 | /// 18 | public StateValue() { } 19 | 20 | /// 21 | /// Create a new state value object with the given name and value 22 | /// 23 | /// State name 24 | /// State value 25 | public StateValue(string name, object value) 26 | { 27 | Name = name; 28 | Value = value; 29 | } 30 | 31 | /// 32 | /// Create a StateValue object whose Name property is "TimeStamp" and whose Value property is the supplied date-time value. 33 | /// 34 | /// This time-stamp date-time value 35 | public StateValue(DateTime dateTime) 36 | { 37 | Name = "TimeStamp"; 38 | Value = dateTime; 39 | } 40 | 41 | /// 42 | /// State name 43 | /// 44 | public string Name { get; set; } 45 | 46 | /// 47 | /// State value 48 | /// 49 | public object Value { get; set; } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/AlignmentMode.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// The alignment mode of the mount. 5 | /// 6 | public enum AlignmentMode 7 | { 8 | /// 9 | /// Altitude-Azimuth alignment. 10 | /// 11 | AltAz = 0, 12 | 13 | /// 14 | /// Polar(equatorial) mount other than German equatorial. 15 | /// 16 | Polar = 1, 17 | 18 | /// 19 | /// German equatorial mount. 20 | /// 21 | GermanPolar = 2 22 | } 23 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/CalibratorStatus.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Describes the state of a calibration device 5 | /// 6 | /// This has an "Unknown" state because the device may not be able to determine the state of the hardware at power up if it doesn't provide this feedback and needs 7 | /// to be commanded into a known state before use. 8 | public enum CalibratorStatus 9 | { 10 | /// 11 | /// This device does not have a calibration capability 12 | /// 13 | NotPresent = 0, 14 | 15 | /// 16 | /// The calibrator is off 17 | /// 18 | Off = 1, 19 | 20 | /// 21 | /// The calibrator is stabilising or is not yet in the commanded state 22 | /// 23 | NotReady = 2, 24 | 25 | /// 26 | /// The calibrator is ready for use 27 | /// 28 | Ready = 3, 29 | 30 | /// 31 | /// The calibrator state is unknown 32 | /// 33 | Unknown = 4, 34 | 35 | /// 36 | /// The calibrator encountered an error when changing state 37 | /// 38 | Error = 5 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/CameraState.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// ASCOM Camera status values. 5 | /// 6 | public enum CameraState 7 | { 8 | /// 9 | /// Camera status idle 10 | /// 11 | Idle = 0, 12 | /// 13 | /// Camera status waiting 14 | /// 15 | Waiting = 1, 16 | /// 17 | /// Camera status exposing 18 | /// 19 | Exposing = 2, 20 | /// 21 | /// Camera status reading 22 | /// 23 | Reading = 3, 24 | /// 25 | /// Camera status download 26 | /// 27 | Download = 4, 28 | /// 29 | /// Camera status error 30 | /// 31 | Error = 5 32 | } 33 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/CoverStatus.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// The CoverCalibrator device's cover state 5 | /// 6 | public enum CoverStatus 7 | { 8 | /// 9 | /// This device does not have a cover that can be closed independently 10 | /// 11 | NotPresent = 0, 12 | 13 | /// 14 | /// The cover is closed 15 | /// 16 | Closed = 1, 17 | 18 | /// 19 | /// The cover is moving to a new position 20 | /// 21 | Moving = 2, 22 | 23 | /// 24 | /// The cover is open 25 | /// 26 | Open = 3, 27 | 28 | /// 29 | /// The state of the cover is unknown 30 | /// 31 | Unknown = 4, 32 | 33 | /// 34 | /// The device encountered an error when changing state 35 | /// 36 | Error = 5 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/DriveRate.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Well-known telescope tracking rates. 5 | /// 6 | public enum DriveRate 7 | { 8 | /// 9 | /// Sidereal tracking rate (15.041 arcseconds per second). 10 | /// 11 | Sidereal = 0, 12 | 13 | /// 14 | /// Lunar tracking rate (14.685 arcseconds per second). 15 | /// 16 | Lunar = 1, 17 | 18 | /// 19 | /// Solar tracking rate (15.0 arcseconds per second). 20 | /// 21 | Solar = 2, 22 | 23 | /// 24 | /// King tracking rate (15.0369 arcseconds per second). 25 | /// 26 | King = 3 27 | } 28 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/EquatorialCoordinateType.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Equatorial coordinate systems used by telescopes. 5 | /// 6 | public enum EquatorialCoordinateType 7 | { 8 | /// 9 | /// Custom or unknown equinox and/or reference frame. 10 | /// 11 | Other = 0, 12 | 13 | /// 14 | /// Topocentric coordinates.Coordinates of the object at the current date having allowed for annual aberration, 15 | /// precession and nutation.This is the most common coordinate type for amateur telescopes. 16 | /// 17 | Topocentric = 1, 18 | 19 | /// 20 | /// J2000 equator/equinox.Coordinates of the object at mid-day on 1st January 2000, ICRS reference frame. 21 | /// 22 | J2000 = 2, 23 | 24 | /// 25 | /// J2050 equator/equinox, ICRS reference frame. 26 | /// 27 | J2050 = 3, 28 | 29 | /// 30 | /// B1950 equinox, FK4 reference frame. 31 | /// 32 | B1950 = 4 33 | } 34 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/GuideDirection.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// The direction in which the guide-rate motion is to be made. 5 | /// 6 | public enum GuideDirection 7 | { 8 | /// 9 | /// North (+ declination/altitude). 10 | /// 11 | North = 0, 12 | 13 | /// 14 | /// South (- declination/altitude). 15 | /// 16 | South = 1, 17 | 18 | /// 19 | /// East (+ right ascension/azimuth). 20 | /// 21 | East = 2, 22 | 23 | /// 24 | /// West (- right ascension/azimuth) 25 | /// 26 | West = 3 27 | } 28 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/PointingState.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// The pointing state of the mount 5 | /// 6 | /// 7 | /// Please see for more information on pointing state and physical side of pier for German equatorial mounts. 8 | /// 9 | public enum PointingState 10 | { 11 | /// 12 | /// Normal pointing state 13 | /// 14 | Normal = 0, 15 | 16 | /// 17 | /// Unknown or indeterminate. 18 | /// 19 | Unknown = -1, 20 | 21 | /// 22 | /// Through the pole pointing state 23 | /// 24 | ThroughThePole = 1 25 | } 26 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/SensorType.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Sensor type, identifies the type of colour sensor 5 | /// 6 | public enum SensorType 7 | { 8 | /// 9 | ///Camera produces monochrome array with no Bayer encoding 10 | /// 11 | Monochrome = 0, 12 | /// 13 | ///Camera produces color image directly, requiring not Bayer decoding 14 | /// 15 | Color = 1, 16 | /// 17 | ///Camera produces RGGB encoded Bayer array images 18 | /// 19 | RGGB = 2, 20 | /// 21 | ///Camera produces CMYG encoded Bayer array images 22 | /// 23 | CMYG = 3, 24 | /// 25 | ///Camera produces CMYG2 encoded Bayer array images 26 | /// 27 | CMYG2 = 4, 28 | /// 29 | ///Camera produces Kodak TRUESENSE Bayer LRGB array images 30 | /// 31 | LRGB = 5, 32 | } 33 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/ShutterState.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// ASCOM Dome ShutterState status values. 5 | /// 6 | public enum ShutterState 7 | { 8 | /// 9 | /// Dome shutter status open 10 | /// 11 | Open = 0, 12 | 13 | /// 14 | /// Dome shutter status closed 15 | /// 16 | Closed = 1, 17 | 18 | /// 19 | /// Dome shutter status opening 20 | /// 21 | Opening = 2, 22 | 23 | /// 24 | /// Dome shutter status closing 25 | /// 26 | Closing = 3, 27 | 28 | /// 29 | /// Dome shutter status error 30 | /// 31 | Error = 4 32 | } 33 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/TelescopeAxis.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// The telescope axes 5 | /// 6 | public enum TelescopeAxis 7 | { 8 | /// 9 | /// Primary axis (e.g., Right Ascension or Azimuth). 10 | /// 11 | Primary = 0, 12 | 13 | /// 14 | /// Secondary axis (e.g., Declination or Altitude). 15 | /// 16 | Secondary = 1, 17 | 18 | /// 19 | /// Tertiary axis (e.g. imager rotator/de-rotator). 20 | /// 21 | Tertiary = 2 22 | } 23 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/VideoCameraFrameRate.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// ASCOM Video Camera supported frame rates. 5 | /// 6 | public enum VideoCameraFrameRate 7 | { 8 | /// 9 | /// This is a video camera that supports variable frame rates. 10 | /// 11 | Variable = 0, 12 | 13 | /// 14 | /// 25 frames per second (fps) corresponding to a PAL (colour) or CCIR (black and white) video standard. 15 | /// 16 | PAL = 1, 17 | 18 | /// 19 | /// 29.97 frames per second (fps) corresponding to an NTSC (colour) or EIA (black and white) video standard. 20 | /// 21 | NTSC = 2 22 | } 23 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/Enums/VideoCameraState.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// ASCOM Video Camera status values. 5 | /// 6 | public enum VideoCameraState 7 | { 8 | /// 9 | /// Camera status running. The video is receiving signal and video frames are available for viewing or recording. 10 | /// 11 | Running = 0, 12 | 13 | /// 14 | /// Camera status recording. The video camera is recording video to the file system. Video frames are available for viewing. 15 | /// 16 | Recording = 1, 17 | 18 | /// 19 | /// Camera status error. The video camera is in a state of an error and cannot continue its operation. Usually a reset will be required to resolve the error condition. 20 | /// 21 | Error = 2 22 | } 23 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IAscomDeviceV2.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ASCOM.Common.DeviceInterfaces 4 | { 5 | /// 6 | /// Defines additional properties and methods that are common to all ASCOM device interfaces in Platform 7 and later. 7 | /// 8 | public interface IAscomDeviceV2 : IAscomDevice 9 | { 10 | /// 11 | /// Connect to device asynchronously 12 | /// 13 | void Connect(); 14 | 15 | /// 16 | /// Disconnect from device asynchronously 17 | /// 18 | void Disconnect(); 19 | 20 | /// 21 | /// Completion variable for asynchronous connect and disconnect operations 22 | /// 23 | bool Connecting { get; } 24 | 25 | /// 26 | /// Returns the device's operational state in a single call 27 | /// 28 | /// 29 | /// Returns all the device's operational state properties in a single call to reduce polling overhead for clients and devices. 30 | /// See Master Help Document - Interfaces for further information. 31 | /// 32 | List DeviceState { get; } 33 | } 34 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/ICameraV4.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Camera interface version 4, which incorporates the new members in IAscomDeviceV2 and the members present in ICameraV3 5 | /// 6 | public interface ICameraV4 : IAscomDeviceV2, ICameraV3 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/ICoverCalibratorV2.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// CoverCalibrtator interface version 2, which incorporates the new members in IAscomDeviceV2, the members present in ICameraV3 plus new CalibratorRead and CoverMoving properties 5 | /// 6 | public interface ICoverCalibratorV2 : IAscomDeviceV2, ICoverCalibratorV1 7 | { 8 | /// 9 | /// True while the calibrator brightness is not stable. 10 | /// 11 | /// This is the completion variable used to monitor progress of the method. 12 | bool CalibratorChanging { get; } 13 | 14 | /// 15 | /// True while the cover is in motion. 16 | /// 17 | /// This is the completion variable used to monitor progress of the and methods. 18 | bool CoverMoving { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IDomeV3.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Dome interface version 3, which incorporates the new members in IAscomDeviceV2 and the members present in IDomeV2 5 | /// 6 | public interface IDomeV3 : IAscomDeviceV2, IDomeV2 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IFilterWheelV3.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Filter wheel interface version 3, which incorporates the new members in IAscomDeviceV2 and the members present in IFilterWheelV2 5 | /// 6 | public interface IFilterWheelV3 : IAscomDeviceV2, IFilterWheelV2 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IFocuserV4.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Focuser interface version 4, which incorporates the new members in IAscomDeviceV2 and the members present in IFocuserV3 5 | /// 6 | public interface IFocuserV4 : IAscomDeviceV2, IFocuserV3 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IObservingConditionsV2.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Observing conditions interface version 2, which incorporates the new members in IAscomDeviceV2 and the members present in IObservingConditionsV1 5 | /// 6 | public interface IObservingConditionsV2 : IAscomDeviceV2, IObservingConditions 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IRate.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | // ----------------------------------------------------------------------- 4 | // Defines the IRate Interface 5 | // ----------------------------------------------------------------------- 6 | /// 7 | /// Describes a range of rates supported by the method (degrees/per second) 8 | /// These are contained within an collection and serve to describe one or more supported ranges of rates of motion about a mechanical axis. 9 | /// It is possible that the and properties will be equal. In this case, the object expresses a single discrete rate. 10 | /// Both the and properties are always expressed in units of degrees per second. 11 | /// This is only using for Telescope InterfaceVersions 2 and 3 12 | /// 13 | /// Values used must be non-negative and are scalar values. You do not need to supply complementary negative rates for each positive 14 | /// rate that you specify. Movement in both directions is achieved by the application applying an appropriate positive or negative sign to the 15 | /// rate when it is used in the command. 16 | public interface IRate 17 | { 18 | /// 19 | /// Dispose the late-bound interface, if needed. Will release it via COM 20 | /// if it is a COM object, else if native .NET will just dereference it 21 | /// for GC. 22 | /// 23 | void Dispose(); 24 | 25 | /// 26 | /// The maximum rate (degrees per second) 27 | /// This must always be a positive number. It indicates the maximum rate in either direction about the axis. 28 | /// 29 | double Maximum { get; set; } 30 | 31 | /// 32 | /// The minimum rate (degrees per second) 33 | /// This must always be a positive number. It indicates the maximum rate in either direction about the axis. 34 | /// 35 | double Minimum { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IRotatorV4.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Rotator interface version 4, which incorporates the new members in IAscomDeviceV2 and the members present in IRotatorV3 5 | /// 6 | public interface IRotatorV4 : IAscomDeviceV2, IRotatorV3 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/ISafetyMonitor.cs: -------------------------------------------------------------------------------- 1 | // ----------------------------------------------------------------------- 2 | // Defines the ISafetyMonitor Interface 3 | // ----------------------------------------------------------------------- 4 | namespace ASCOM.Common.DeviceInterfaces 5 | { 6 | /// 7 | /// Defines the ISafetyMonitor Interface 8 | /// 9 | public interface ISafetyMonitor : IAscomDevice 10 | { 11 | 12 | /// 13 | /// Indicates whether the monitored state is safe for use. 14 | /// 15 | /// When is False. 16 | /// An error occurred that is not described by one of the more specific ASCOM exceptions. Include sufficient detail in the message text to enable the issue to be accurately diagnosed by someone other than yourself. 17 | /// True if the state is safe, False if it is unsafe. 18 | /// 19 | ///

Must be implemented and must not throw a NotImplementedException.

20 | ///
21 | bool IsSafe { get; } 22 | } 23 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/ISafetyMonitorV3.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Safety monitor interface version 3, which incorporates the new members in IAscomDeviceV2 and the members present in ISafetyMonitorV1 5 | /// 6 | public interface ISafetyMonitorV3 : IAscomDeviceV2, ISafetyMonitor 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IStateValue.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Interface definition for DeviceState objects 5 | /// 6 | public interface IStateValue 7 | { 8 | /// 9 | /// Property name with casing that must match the casing in the relevant interface definition 10 | /// 11 | string Name { get; } 12 | 13 | /// 14 | /// Property value 15 | /// 16 | object Value { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/ITrackingRates.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | 3 | namespace ASCOM.Common.DeviceInterfaces 4 | { 5 | /// 6 | /// Returns a collection of supported DriveRate values that describe the permissible values of the TrackingRate property for this telescope type. 7 | /// 8 | public interface ITrackingRates 9 | { 10 | /// 11 | /// Returns a specified item from the collection 12 | /// 13 | /// Number of the item to return 14 | /// A collection of supported DriveRate values that describe the permissible values of the TrackingRate property for this telescope type. 15 | /// Returns a collection of supported DriveRate values 16 | /// This is only used by telescope interface versions 2 and 3 17 | DriveRate this[int index] { get; } 18 | 19 | /// 20 | /// Number of DriveRates supported by the Telescope 21 | /// 22 | /// Number of DriveRates supported by the Telescope 23 | /// Integer count 24 | int Count { get; } 25 | 26 | /// 27 | /// Returns an enumerator for the collection 28 | /// 29 | /// An enumerator 30 | IEnumerator GetEnumerator(); 31 | 32 | /// 33 | /// Disposes of the TrackingRates object 34 | /// 35 | void Dispose(); 36 | } 37 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/IVideoV2.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | /// 4 | /// Video interface version 2, which incorporates the new members in IAscomDeviceV2 and the members present in IVideov1 5 | /// 6 | public interface IVideoV2 : IAscomDeviceV2, IVideo 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.DeviceInterfaces/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.DeviceInterfaces 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Device interface definitions used by all clients and devices. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Helpers/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Helpers 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Helper classes. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Interfaces/Enums/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Interfaces 2 | { 3 | /// 4 | /// Supported log levels for ILogger devices 5 | /// 6 | public enum LogLevel 7 | { 8 | /// 9 | /// This level logs out everything. It may contain sensitive information. This will create a lot of noise in the logs and is disabled by default. 10 | /// 11 | Verbose, 12 | 13 | /// 14 | /// Log out information that is useful for debugging and development. This generally should be used temporarily. 15 | /// 16 | Debug, 17 | 18 | /// 19 | /// Log the general flow and behavior. This should typically be the default level. 20 | /// 21 | Information, 22 | 23 | /// 24 | /// Something abnormal, unexpected or bad has occurred but the application and all functions are still running 25 | /// 26 | Warning, 27 | 28 | /// 29 | /// Something has failed, however the application is still running, possibly in a degraded state. Some user intervention may be required to resume full operation. 30 | /// 31 | Error, 32 | 33 | /// 34 | /// A critical error has occurred. The application cannot recover, it has crashed or is otherwise not recoverable. It will require immediate attention. 35 | /// 36 | Fatal 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Interfaces/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Interfaces 2 | { 3 | /// 4 | /// Very simple logger interface, LoggerExtensions build on this to add standard functionality 5 | /// 6 | public interface ILogger 7 | { 8 | /// 9 | /// Get the current logging level. The log should write out at this level and higher 10 | /// 11 | LogLevel LoggingLevel 12 | { 13 | get; 14 | } 15 | 16 | /// 17 | /// Set the current minimum logging level. The logger should write out at this level and higher and not write out lower level events. This method should never throw. 18 | /// 19 | /// Required logging level. 20 | void SetMinimumLoggingLevel(LogLevel level); 21 | 22 | /// 23 | /// Log out a message at a given logging level. Only active levels should be added to the log. This method should never throw. 24 | /// 25 | /// The level for this log entry 26 | /// The message to record 27 | void Log(LogLevel level, string message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Interfaces/ITraceLogger.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Interfaces 2 | { 3 | 4 | /// 5 | /// Trace logger interface definition 6 | /// 7 | /// Inherits the ILogger interface and exposed the 8 | public interface ITraceLogger : ILogger 9 | { 10 | /// 11 | /// Log a message to the logger device 12 | /// 13 | /// Name of the initiating method 14 | /// Message to log 15 | void LogMessage(string method, string message); 16 | 17 | /// 18 | /// Create a blank line in the log 19 | /// 20 | void BlankLine(); 21 | 22 | /// 23 | /// Enable or disable the logger 24 | /// 25 | bool Enabled { get; set; } 26 | 27 | /// 28 | /// Set the width in characters of the identifier / method name column in the log file 29 | /// 30 | int IdentifierWidth { get; set; } 31 | 32 | /// 33 | /// False to log local times, true to log UTC times, 34 | /// 35 | bool UseUtcTime { get; set; } 36 | 37 | /// 38 | /// True to honour CrLf sequences (a log message could occupy one or more lines in the log), False to print CrLf as [Cr]{Lf} ensuring that each message only occupies one line in the log. 39 | /// 40 | bool RespectCrLf { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.Interfaces/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common.Interfaces 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Component interfaces used in the library. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Common/ASCOM.Common.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | ASCOM.Common 6 | true 7 | ..\ASCOM.snk 8 | ASCOM Initiative (c) 2022 9 | MIT 10 | ASCOM NetStandard types 11 | A .Net Standard library providing common Interfaces, enums and other types for ASCOM projects. 12 | 13 | Includes support for the interface updates introduced in ASCOM Platform 7. 14 | Daniel Van Noord and Peter Simpson 15 | https://ascom-standards.org/ 16 | true 17 | ASCOM.Common.Components 18 | ASCOMBoarderless.png 19 | Debug;Release 20 | README.md 21 | 22 | 23 | 24 | embedded 25 | False 26 | 27 | 28 | 29 | true 30 | $(NoWarn);1591 31 | 32 | 33 | 34 | 35 | True 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /ASCOM.Common/Devices/DeviceTypes.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common 2 | { 3 | // NOTE 4 | // NOTE - Member spelling in this enumeration must be the same as the expected spelling when using the device type as a string. 5 | // NOTE - If a new device type is added to this enumeration, a corresponding entry must be added to the DeviceTypeNames class 6 | // NOTE 7 | 8 | /// 9 | /// The set of Driver types as of ASCOM 6.5. Rather then directly using strings these are used to request specific types. 10 | /// 11 | public enum DeviceTypes 12 | { 13 | Camera, 14 | CoverCalibrator, 15 | Dome, 16 | FilterWheel, 17 | Focuser, 18 | ObservingConditions, 19 | Rotator, 20 | SafetyMonitor, 21 | Switch, 22 | Telescope, 23 | Video 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ASCOM.Common/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Common 2 | { 3 | // Dummy class to hold comments that appear at the namespace level in the compiled Help file 4 | 5 | /// 6 | /// Capabilities used by Alpaca devices, Alpaca clients, COM drivers and COM clients. 7 | /// 8 | [System.Runtime.CompilerServices.CompilerGenerated()] 9 | class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ASCOM.Tools/ASCOM.Tools.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | ..\ASCOM.snk 6 | true 7 | true 8 | ASCOM.Tools 9 | Daniel Van Noord and Peter Simpson 10 | A set of components to support development of ASCOM clients, drivers and Alpaca devices. 11 | 12 | Includes support for the interface updates introduced in ASCOM Platform 7. 13 | ASCOM Initiative (c) 2022 14 | ASCOMBoarderless.png 15 | Debug;Release 16 | True 17 | MIT 18 | README.md 19 | 20 | 21 | 22 | embedded 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | True 31 | \ 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | True 42 | \ 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ASCOM.Tools/ASCOMBoarderless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.Tools/ASCOMBoarderless.png -------------------------------------------------------------------------------- /ASCOM.Tools/ConsoleLogger.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common; 2 | using ASCOM.Common.Interfaces; 3 | using System; 4 | 5 | namespace ASCOM.Tools 6 | { 7 | /// 8 | /// Simple logger to write to the console 9 | /// 10 | public class ConsoleLogger : ILogger 11 | { 12 | /// 13 | /// Return the current logging level 14 | /// 15 | public LogLevel LoggingLevel 16 | { 17 | get; 18 | private set; 19 | } = LogLevel.Information; 20 | 21 | /// 22 | /// Write a message to the console 23 | /// 24 | /// Logging level 25 | /// Message text 26 | public void Log(LogLevel level, string message) 27 | { 28 | if (this.IsLevelActive(level)) 29 | { 30 | Console.Write($"{DateTime.Now} "); 31 | switch (level) 32 | { 33 | case LogLevel.Verbose: 34 | Console.ForegroundColor = ConsoleColor.White; 35 | break; 36 | case LogLevel.Debug: 37 | Console.ForegroundColor = ConsoleColor.Blue; 38 | break; 39 | case LogLevel.Information: 40 | Console.ForegroundColor = ConsoleColor.Green; 41 | break; 42 | case LogLevel.Warning: 43 | Console.ForegroundColor = ConsoleColor.Yellow; 44 | break; 45 | case LogLevel.Error: 46 | Console.ForegroundColor = ConsoleColor.Red; 47 | break; 48 | case LogLevel.Fatal: 49 | Console.ForegroundColor = ConsoleColor.Magenta; 50 | break; 51 | } 52 | 53 | Console.Write($"[{level}]"); 54 | 55 | Console.ResetColor(); 56 | 57 | Console.WriteLine($" - {message}"); 58 | } 59 | } 60 | 61 | /// 62 | /// Minimum logging level to display. 63 | /// 64 | /// Required logging level. 65 | public void SetMinimumLoggingLevel(LogLevel level) 66 | { 67 | LoggingLevel = level; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /ASCOM.Tools/Constants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ASCOM.Tools 5 | { 6 | 7 | static class Constants 8 | { 9 | internal const double ABSOLUTE_ZERO_CELSIUS = -273.15; // Absolute zero on the Celsius temperature scale 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ASCOM.Tools/Enums/Units.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Tools 2 | { 3 | 4 | /// 5 | /// List of units that can be converted by the ConvertUnits method 6 | /// 7 | public enum Unit : int 8 | { 9 | // Speed 10 | /// 11 | /// Metres per second 12 | /// 13 | metresPerSecond = 0, 14 | /// 15 | /// Miles per hour 16 | /// 17 | milesPerHour = 1, 18 | /// 19 | /// Knots 20 | /// 21 | knots = 2, 22 | 23 | // Temperature 24 | /// 25 | /// Degrees Celsius 26 | /// 27 | degreesCelsius = 10, 28 | /// 29 | /// Degrees Fahrenheit 30 | /// 31 | degreesFarenheit = 11, 32 | /// 33 | /// Degrees kelvin 34 | /// 35 | degreesKelvin = 12, 36 | 37 | // Pressure 38 | /// 39 | /// Hecto pascals 40 | /// 41 | hPa = 20, 42 | /// 43 | /// Millibar 44 | /// 45 | mBar = 21, 46 | /// 47 | /// Millimetres of mercury 48 | /// 49 | mmHg = 22, 50 | /// 51 | /// Inches of mercury 52 | /// 53 | inHg = 23, 54 | 55 | // RainRate 56 | /// 57 | /// Millimetres per hour 58 | /// 59 | mmPerHour = 30, 60 | /// 61 | /// Inches per hour 62 | /// 63 | inPerHour = 31 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /ASCOM.Tools/Exceptions/HelperException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ASCOM 4 | { 5 | 6 | /// 7 | /// General exception for use within Tools components. 8 | /// 9 | public class HelperException : Exception 10 | { 11 | //Exception for Utilities component exceptions 12 | 13 | /// 14 | /// Create a new exception with message 15 | /// 16 | /// Message to be reported by the exception 17 | /// 18 | public HelperException(string message) : base(message) { } 19 | 20 | /// 21 | /// Create a new exception with message and inner exception 22 | /// 23 | /// Message to be reported by the exception 24 | /// Exception to be reported as the inner exception 25 | /// 26 | public HelperException(string message, Exception inner) : base(message, inner) { } 27 | 28 | /// 29 | /// Serialise the exception 30 | /// 31 | /// Serialisation information 32 | /// Serialisation context 33 | /// 34 | public HelperException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } 35 | 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /ASCOM.Tools/NameSpaceDoc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | // Dummy classes to hold comments that appear at the namespace level in the compiled Help file 6 | 7 | namespace ASCOM.Tools 8 | { 9 | /// 10 | /// Tools and components that support all application, device and driver development. This namespace includes the SOFA, Transform, TracLogger, XMLProfile and Utilities tools and is delivered in NuGet package: ASCOM.Tools. 11 | /// 12 | [System.Runtime.CompilerServices.CompilerGenerated()] 13 | class NamespaceDoc 14 | { 15 | } 16 | } 17 | 18 | namespace ASCOM.Tools.Novas31 19 | { 20 | /// 21 | /// USNO NOVAS 3.1 implementation.. 22 | /// 23 | [System.Runtime.CompilerServices.CompilerGenerated()] 24 | class NamespaceDoc 25 | { 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ASCOM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.png -------------------------------------------------------------------------------- /ASCOM.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOM.snk -------------------------------------------------------------------------------- /ASCOMBoarderless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/ASCOMBoarderless.png -------------------------------------------------------------------------------- /Alpaca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/Alpaca.png -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2.1.0 6 | 7 | -------------------------------------------------------------------------------- /Help/ChooserSAHelp/Content/VersionHistory/VersionHistory.aml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | The topics in this section describe the various changes made to the [TODO: Project Title] over the life of the project. 6 | 7 | 8 |
9 | Version History 10 | 11 | Select a version below to see a description of its changes. 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /Help/ChooserSAHelp/Content/VersionHistory/v1.0.109.aml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Version 1.0.109. 6 | 7 | 8 | 9 |
10 | Changes in This Release 11 | 12 | 13 | 14 | 15 | Initial release. 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /Help/ChooserSAHelp/Content/VersionHistory/v2.0.0.aml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Version 2.0.0. 7 | 8 | 9 | 10 |
11 | Changes in This Release 12 | 13 | 14 | 15 | 16 | Added support for .NET 8.0. 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /Help/ChooserSAHelp/ContentLayout.content: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Help/ChooserSAHelp/icons/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/Help/ChooserSAHelp/icons/Help.png -------------------------------------------------------------------------------- /Help/LibraryHelp/ASCOMLibrary.content: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Help/LibraryHelp/ApplicationDeveloperPointers.aml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 9 | 10 | 14 | 15 | Required introduction 16 | 17 | 20 |
21 | Optional section title 22 | 23 | 25 | Add one or more sections with content 26 | 27 | 43 |
44 | 45 | 46 | 47 |
48 |
-------------------------------------------------------------------------------- /Help/LibraryHelp/DeviceDriverPointers.aml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/AsyncMethodsTask.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Alpaca.Discovery; 2 | using ASCOM.Tools; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace HelpExamples 10 | { 11 | internal class AsyncMethodsTaskClass 12 | { 13 | internal static void AsyncMethodsTask() 14 | { 15 | try 16 | { 17 | #region AsynchronousMethodsTask 18 | // Get a list of Alpaca devices asynchronously 19 | Task> alpacadevicesTask = AlpacaDiscovery.GetAlpacaDevicesAsync(); 20 | 21 | // Control returns quickly from AlpacaDiscovery.GetAlpacaDevicesAsync() and there is the opportunity to do other work 22 | DoWork(); 23 | 24 | // Eventually, wait for the discovery task to complete 25 | Task.WaitAll(alpacadevicesTask); 26 | 27 | // Retrieve the list of discovered Alpaca devices 28 | List alpacaDevices = alpacadevicesTask.Result; 29 | Console.WriteLine("AsynchronousTask", $"Discovered {alpacaDevices.Count} Alpaca devices."); 30 | #endregion 31 | } 32 | catch (Exception ex) 33 | { 34 | Console.WriteLine(ex); 35 | } 36 | } 37 | static void DoWork() 38 | { 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/AsynchronousDiscovery.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Alpaca.Discovery; 2 | using ASCOM.Common; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace HelpExamples 10 | { 11 | internal class AsynchronousDiscoveryClass 12 | { 13 | #region Asynchronous Discovery 14 | internal static void AsynchronousDiscovery() 15 | { 16 | // Create a Discovery component that can be used for one or more discoveries 17 | AlpacaDiscovery alpacaDiscovery = new AlpacaDiscovery(); 18 | 19 | // Add an event handler that will be called when discovery is complete. 20 | alpacaDiscovery.DiscoveryCompleted += DiscoveryCompletedEventHandler; 21 | 22 | // Start a discovery using specified parameters: 23 | alpacaDiscovery.StartDiscovery(2, 100, 32227, 1.5, false, true, false, ASCOM.Common.Alpaca.ServiceType.Http); 24 | 25 | // Continue with other processing while the discovery is running 26 | // The DiscoveryCompletedEventHandler method will be called when discovery completes 27 | 28 | //TODO: Dispose of the alpacaDiscovery object when it is no longer required 29 | } 30 | 31 | /// 32 | ///Event handler called when the configured discovery time is reached 33 | /// 34 | static void DiscoveryCompletedEventHandler(object? sender, EventArgs e) 35 | { 36 | // Ensure that the sender is an AlpacaDiscovery object 37 | if (sender is AlpacaDiscovery alpacaDiscovery) 38 | { 39 | // Get a list of available FilterWheel devices and print the number of devices found 40 | List filterWheelDevices = alpacaDiscovery.GetAscomDevices(DeviceTypes.FilterWheel); 41 | Console.WriteLine($"Found {filterWheelDevices.Count} FilterWheel devices."); 42 | } 43 | } 44 | #endregion 45 | } 46 | } -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/HelpExamples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | True 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/HelpExamples.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32922.545 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelpExamples", "HelpExamples.csproj", "{CE38D334-71C9-4A45-93F1-E9AD5E371EDB}" 7 | EndProject 8 | Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "ASCOMLibraryHelp", "..\ASCOMLibraryHelp.shfbproj", "{C067ED42-D85F-42D1-A481-23887FE2E23A}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {CE38D334-71C9-4A45-93F1-E9AD5E371EDB} = {CE38D334-71C9-4A45-93F1-E9AD5E371EDB} 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {CE38D334-71C9-4A45-93F1-E9AD5E371EDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {CE38D334-71C9-4A45-93F1-E9AD5E371EDB}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {CE38D334-71C9-4A45-93F1-E9AD5E371EDB}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {CE38D334-71C9-4A45-93F1-E9AD5E371EDB}.Release|Any CPU.Build.0 = Release|Any CPU 23 | {C067ED42-D85F-42D1-A481-23887FE2E23A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 24 | {C067ED42-D85F-42D1-A481-23887FE2E23A}.Debug|Any CPU.Build.0 = Debug|Any CPU 25 | {C067ED42-D85F-42D1-A481-23887FE2E23A}.Release|Any CPU.ActiveCfg = Release|Any CPU 26 | {C067ED42-D85F-42D1-A481-23887FE2E23A}.Release|Any CPU.Build.0 = Release|Any CPU 27 | EndGlobalSection 28 | GlobalSection(SolutionProperties) = preSolution 29 | HideSolutionNode = FALSE 30 | EndGlobalSection 31 | GlobalSection(ExtensibilityGlobals) = postSolution 32 | SolutionGuid = {70080154-F9D3-4724-92A5-52A7BF28480A} 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/ManualClientCreation.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Alpaca.Clients; 2 | using ASCOM.Common.Alpaca; 3 | using ASCOM.Tools; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace HelpExamples 11 | { 12 | internal class ManualClientCreationClass 13 | { 14 | internal static void ManualClientCreation() 15 | { 16 | try 17 | { 18 | #region Detailed manual client creation 19 | // Create a trace logger 20 | using (TraceLogger logger = new TraceLogger("ManualClient", true)) 21 | { 22 | // Create the telescope Alpaca Client with specified parameters 23 | using (AlpacaTelescope telescopeClient = AlpacaClient.GetDevice(ServiceType.Http, "127.0.0.1", 11111, 0, 3, 5, 100, 34892, "QuY89", "YYu8*9jK", true, logger)) 24 | { 25 | // Connect to the Alpaca device 26 | telescopeClient.Connected = true; 27 | 28 | // Record some information 29 | logger.LogMessage("ManualClient", $"Found device: {telescopeClient.Name} - Driver: {telescopeClient.DriverInfo}, Version: {telescopeClient.DriverVersion} Telescope is tracking: {telescopeClient.Tracking}."); 30 | 31 | // Disconnect from the filter wheel 32 | telescopeClient.Connected = false; 33 | } 34 | } 35 | #endregion 36 | } 37 | catch (Exception ex) 38 | { 39 | Console.WriteLine(ex); 40 | } 41 | 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/Program.cs: -------------------------------------------------------------------------------- 1 | using HelpExamples; 2 | 3 | internal class Program 4 | { 5 | private static async Task Main(string[] args) 6 | { 7 | try 8 | { 9 | Console.WriteLine("Running Client async methods test..."); 10 | await Task.Run(async () => 11 | { 12 | Console.WriteLine("Staring task"); 13 | await ClientAsyncMethods.AsyncMethods(); 14 | }); 15 | 16 | //Task.WaitAll(t); 17 | Console.WriteLine("After WaitAll"); 18 | 19 | 20 | //Console.WriteLine("Running AsynchronousDiscovery test..."); 21 | //AsynchronousDiscoveryClass.AsynchronousDiscovery(); 22 | 23 | //Console.WriteLine("Running AsyncMethodsAwait test..."); 24 | //AsyncMethodsAwaitClass.AsyncMethodsAwait(); 25 | 26 | //Console.WriteLine("Running AsyncMethodsTask test..."); 27 | //AsyncMethodsTaskClass.AsyncMethodsTask(); 28 | 29 | //Console.WriteLine("Running DetailedClientCreation test..."); 30 | //DetailedClientCreationClass.DetailedClientCreation(); 31 | 32 | //Console.WriteLine("Running DeviceSelection test..."); 33 | //DeviceSelectionClass.DeviceSelection(); 34 | 35 | //Console.WriteLine("Running ManualClientCreation test..."); 36 | //ManualClientCreationClass.ManualClientCreation(); 37 | 38 | //Console.WriteLine("Running SeamlessClientAccess test..."); 39 | //SeamlessClientAccessClass.SeamlessClientAccess(); 40 | 41 | //Console.WriteLine("Running SimpleClientCreation test..."); 42 | //SimpleClientCreationClass.SimpleClientCreation(); 43 | 44 | //Console.WriteLine("Running SynchronousDiscovery test..."); 45 | //SynchronousDiscoveryClass.SynchronousDiscovery(); 46 | } 47 | catch (Exception ex) 48 | { 49 | Console.WriteLine(ex.ToString()); 50 | } 51 | 52 | Console.WriteLine("Finished"); 53 | Console.ReadKey(); 54 | } 55 | } -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/SimpleClientCreation.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Alpaca.Clients; 2 | using ASCOM.Alpaca.Discovery; 3 | using ASCOM.Common; 4 | using ASCOM.Common.Alpaca; 5 | using ASCOM.Tools; 6 | 7 | namespace HelpExamples 8 | { 9 | internal class SimpleClientCreationClass 10 | { 11 | internal static async void SimpleClientCreation() 12 | { 13 | try 14 | { 15 | #region Simple client creation using a discovered AscomDevice 16 | // Create a TraceLogger to record operational library messages 17 | using (TraceLogger logger = new TraceLogger("SimpleClient", true)) 18 | { 19 | 20 | // Get a list of filter wheel devices and record the number of devices discovered 21 | List filterWheelDevices = await AlpacaDiscovery.GetAscomDevicesAsync(DeviceTypes.FilterWheel); 22 | logger.LogMessage("SimpleClient", $"Found {filterWheelDevices.Count} FilterWheel devices."); 23 | 24 | // Create an Alpaca client for the first device and use it to display the driver description 25 | if (filterWheelDevices.Count > 0) 26 | { 27 | // Create the filter wheel Alpaca Client 28 | using (AlpacaFilterWheel filterWheelClient = AlpacaClient.GetDevice(filterWheelDevices.First(), logger: logger)) 29 | { 30 | // Connect to the Alpaca device 31 | filterWheelClient.Connected = true; 32 | 33 | // Record some information 34 | logger.LogMessage("SimpleClient", $"Found device: {filterWheelClient.Name} - Driver: {filterWheelClient.DriverInfo}, Version: {filterWheelClient.DriverVersion} containing {filterWheelClient.Names.Count()} filters."); 35 | 36 | // Disconnect from the filter wheel 37 | filterWheelClient.Connected = false; 38 | } 39 | } 40 | } 41 | #endregion 42 | } 43 | catch (Exception ex) 44 | { 45 | Console.WriteLine(ex); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/SynchronousDiscovery.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Alpaca.Discovery; 2 | using ASCOM.Common; 3 | using ASCOM.Common.Alpaca; 4 | using System.Reflection.Metadata; 5 | 6 | namespace HelpExamples 7 | { 8 | internal class SynchronousDiscoveryClass 9 | { 10 | internal static void SynchronousDiscovery() 11 | { 12 | #region SynchronousDiscovery 13 | // Create a Discovery component that can be used for one or more discoveries 14 | using (AlpacaDiscovery alpacaDiscovery = new AlpacaDiscovery()) 15 | { 16 | // Start a discovery with default parameter values 17 | alpacaDiscovery.StartDiscovery(); 18 | 19 | // Wait for the discovery to complete, testing the completion variable every 50ms. 20 | do 21 | { 22 | Thread.Sleep(50); 23 | } while (!alpacaDiscovery.DiscoveryComplete); 24 | 25 | // Get lists of discovered Telescope and FilterWheel devices and print counts of each 26 | List telescopeDevices1 = alpacaDiscovery.GetAscomDevices(DeviceTypes.Telescope); 27 | List filterWheelDevices1 = alpacaDiscovery.GetAscomDevices(DeviceTypes.FilterWheel); 28 | Console.WriteLine($"Found {telescopeDevices1.Count} Telescope devices and {filterWheelDevices1.Count} FilterWheel devices."); 29 | 30 | // Start a discovery with specified parameters 31 | alpacaDiscovery.StartDiscovery(2, 100, 32227, 1.5, false, true, false, ServiceType.Http); 32 | 33 | // Wait for the discovery to complete, testing the completion variable every 50ms. 34 | do 35 | { 36 | Thread.Sleep(50); 37 | } while (!alpacaDiscovery.DiscoveryComplete); 38 | 39 | // Get lists of discovered Telescope and FilterWheel devices and print counts of each 40 | List telescopeDevices2 = alpacaDiscovery.GetAscomDevices(DeviceTypes.Telescope); 41 | List filterWheelDevices2 = alpacaDiscovery.GetAscomDevices(DeviceTypes.FilterWheel); 42 | Console.WriteLine($"Found {telescopeDevices2.Count} Telescope devices and {filterWheelDevices2.Count} FilterWheel devices."); 43 | } 44 | #endregion 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Help/LibraryHelp/HelpExamples/maml.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Help/LibraryHelp/How to discover Alpaca devices.aml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | This topic describes how to discover Alpaca devices and options for creating Alpaca clients to communicate with them. 7 | Please see Alpaca devices and ASCOM devices for information on the Alpaca device / ASCOM device terminology. 8 | 9 | 10 | 11 |
12 | How to discover Alpaca devices. 13 | 14 | 15 | Alpaca devices that support network discovery can be detected using the T:ASCOM.Alpaca.Discovery.AlpacaDiscovery class. 16 | 17 | 18 | The AlpacaDiscovery class supports two ways to discover devices: 19 | 20 | Synchronous Discovery 21 | Asynchronous Discovery 22 | 23 | The following examples illustrate the synchronous discovery pattern where a discovery is initiated and the initiating thread blocks while waiting for the discovery to complete. 24 | 25 | 26 | 27 | This example illustrates the asynchronous, event based, discovery pattern where the application adds a callback to the 28 | E:ASCOM.Alpaca.Discovery.AlpacaDiscovery.DiscoveryCompleted before initiating 29 | the discovery and then continuing with its own processing. 30 | When the discovery is complete the callback will be called and the application can use the returned information. 31 | 32 | 33 | 34 | Please see for information on the library's task based asynchronous methods. 35 | 36 | 37 |
38 | 39 | 40 | 41 | 42 | 43 |
44 |
-------------------------------------------------------------------------------- /Help/PackageAccessProject/ASCOM.Exceptions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/Help/PackageAccessProject/ASCOM.Exceptions.dll -------------------------------------------------------------------------------- /Help/PackageAccessProject/PackageAccessProject.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Library 5 | netstandard2.0 6 | True 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Help/PackageAccessProject/Program.cs: -------------------------------------------------------------------------------- 1 | namespace PackageAccessProject 2 | { 3 | internal class Program 4 | { 5 | static void Main(string[] args) 6 | { 7 | // This project doesn't do anything but is required because it references the ASCOM exceptions package and so makes the exceptions DLL appear 8 | // in the output directory. 9 | // The help projects use the package DLL as a reference source in order to resolve references to exceptions that are supplied in the package. 10 | throw new ASCOM.NotImplementedException("Dummy exception"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Help/PackageAccessProjectFramework/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Help/PackageAccessProjectFramework/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace PackageAccessProjectFramework 8 | { 9 | internal class Program 10 | { 11 | static void Main() 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Help/PackageAccessProjectFramework/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PackageAccessProjectFramework")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PackageAccessProjectFramework")] 13 | [assembly: AssemblyCopyright("Copyright © 2024")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("70fbfa5a-2a22-4cdf-a606-a00754e7cca8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 ASCOM Initiative 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASCOM Cross-Platform libraries 2 | This repository contains cross platform ASCOM Alpaca and Microsoft COM support components that target .NET Standard 2.0 to provide the widest applicability. These are intended to assist developers in creating effective ASCOM Alpaca / COM applications and Alpaca devices / COM drivers. 3 | 4 | For documentation of these libraries see [ASCOM Cross Platform Library Documentation](https://ascom-standards.org/library) 5 | 6 | See [Alpaca Developers on the ASCOM Web Site](https://www.ascom-standards.org/Developer/Alpaca.htm) for further information on ASCOM Alpaca. 7 | 8 | # Library Capabilities 9 | 10 | * Alpaca clients that provide straightforward access to Alpaca devices 11 | * Simple tools to discover available Alpaca devices 12 | * COM clients that provide straightforward access to Windows COM drivers 13 | * Ability for applications to treat Alpaca and COM devices interchangeably 14 | * Asynchronous async/await support for long-running processes such as Telescope.SlewToCoordinates() 15 | * ILogger framework with ConsoleLogger and TraceLogger components 16 | * SOFA and Transform astrometric calculation support components 17 | * Utilities to support development 18 | * Windows specific components 19 | * Chooser and Profile components that provide similar functionality to the ASCOM Platform's components 20 | * Component to create an Alpaca Dynamic Client programmatically 21 | * Whole profile load and save component 22 | * Platform version component 23 | * Please note that components in the ASCOM.Com namespace will not function as expected if the ASCOM Platform is not installed 24 | * A range of lower level definitions, data structures and interfaces to support development 25 | 26 | # Packages 27 | The library is distributed via NuGet and consists of five packages: 28 | 29 | * ASCOM.Alpaca.Components - ASCOM Alpaca Clients and Client Discovery Library 30 | * ASCOM.Alpaca.Device - Device / driver side discovery library 31 | * ASCOM.Com.Components - A .Net Standard (.Net Core / .Net 5+) access library for ASCOM COM drivers 32 | * ASCOM.Tools - A set of CrossPlatform tools for logging, settings and conversions 33 | * ASCOM.Common.Components - The types, interfaces and enums for the ASCOM CrossPlatform library 34 | -------------------------------------------------------------------------------- /Tester/Tester.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | x64 9 | 10 | 11 | 12 | False 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Always 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Tester/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/Tester/cio_ra.bin -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/Extensions.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Tools; 2 | using System; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace ASCOM.Alpaca.Tests 6 | { 7 | internal static class Extensions 8 | { 9 | #region Private Extensions 10 | 11 | /// 12 | /// Convert a structure to a byte array 13 | /// 14 | /// 15 | /// 16 | /// 17 | internal static byte[] ToByteArray(this T structure) where T : struct 18 | { 19 | var bufferSize = Marshal.SizeOf(structure); 20 | var byteArray = new byte[bufferSize]; 21 | 22 | IntPtr handle = Marshal.AllocHGlobal(bufferSize); 23 | try 24 | { 25 | Marshal.StructureToPtr(structure, handle, true); 26 | Marshal.Copy(handle, byteArray, 0, bufferSize); 27 | } 28 | finally 29 | { 30 | Marshal.FreeHGlobal(handle); 31 | } 32 | return byteArray; 33 | } 34 | 35 | /// 36 | /// Convert a byte array to a structure 37 | /// 38 | /// 39 | /// 40 | /// 41 | internal static T ToStructure(this byte[] byteArray) where T : struct 42 | { 43 | var structure = new T(); 44 | var bufferSize = Marshal.SizeOf(structure); 45 | IntPtr handle = Marshal.AllocHGlobal(bufferSize); 46 | try 47 | { 48 | Marshal.Copy(byteArray, 0, handle, bufferSize); 49 | structure = Marshal.PtrToStructure(handle); 50 | 51 | } 52 | finally 53 | { 54 | Marshal.FreeHGlobal(handle); 55 | } 56 | 57 | return structure; 58 | } 59 | 60 | internal static string ToHMS(this double value) 61 | { 62 | return Utilities.HoursToHMS(value, ":", ":", "", 3); 63 | } 64 | 65 | internal static string ToDMS(this double value) 66 | { 67 | return Utilities.DegreesToDMS(value, ":", ":", "", 2); 68 | } 69 | 70 | 71 | #endregion 72 | 73 | 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:ASCOM.Alpaca.Tests.Profile.ProfileComponentTests.RegisterSuccessTests")] 9 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:ASCOM.Alpaca.Tests.Profile.ProfileComponentTests.UnRegisterSuccessTests")] 10 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:DriverAccess.SwitchAsyncTests.CancelAsync")] 11 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:DriverAccess.SwitchAsyncTests.SetAsync")] 12 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:DriverAccess.SwitchAsyncTests.SetAsyncValue")] 13 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:DriverAccess.SwitchAsyncTests.SetSwitch")] 14 | [assembly: SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "", Scope = "member", Target = "~M:DriverAccess.SwitchAsyncTests.SetSwitchValue")] 15 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/ImageArray/ImageArray2DObjectByte.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.Alpaca; 2 | using System; 3 | using System.Diagnostics; 4 | using Xunit; 5 | using Xunit.Abstractions; 6 | 7 | namespace ASCOM.Alpaca.Tests.ImageArray 8 | { 9 | public class ImageArray2DObjectByte 10 | { 11 | private readonly ITestOutputHelper output; 12 | 13 | public ImageArray2DObjectByte(ITestOutputHelper output) 14 | { 15 | this.output = output; 16 | } 17 | 18 | [Fact] 19 | public void Test() 20 | { 21 | const int IMAGE_WIDTH = 4000; 22 | const int IMAGE_HEIGHT = 3000; 23 | 24 | Object[,] imageArray = new Object[IMAGE_WIDTH, IMAGE_HEIGHT]; 25 | for (int i = 0; i < IMAGE_WIDTH; i++) 26 | { 27 | for (int j = 0; j < IMAGE_HEIGHT; j++) 28 | { 29 | imageArray[i, j] = (Byte)((i * j) % 256); 30 | } 31 | } 32 | 33 | Stopwatch sw = Stopwatch.StartNew(); 34 | 35 | byte[] bytes = imageArray.ToByteArray(1, 0, 0, AlpacaErrors.AlpacaNoError, ""); 36 | output.WriteLine($"Time to create byte array: {sw.Elapsed.TotalMilliseconds:0.0}"); 37 | 38 | ArrayMetadataV1 metadata = bytes.GetMetadataV1(); 39 | Assert.True(metadata.TransmissionElementType == ImageArrayElementTypes.Byte); 40 | 41 | sw.Restart(); 42 | Object[,] responseArray = (Object[,])bytes.ToImageArray(); 43 | output.WriteLine($"Time to create return array: {sw.Elapsed.TotalMilliseconds:0.0}"); 44 | Assert.True(TestSupport.CompareArrays(imageArray, responseArray, false, output)); 45 | } 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/ImageArray/ImageArray2DObjectInt16.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.Alpaca; 2 | using System; 3 | using System.Diagnostics; 4 | using Xunit; 5 | using Xunit.Abstractions; 6 | 7 | namespace ASCOM.Alpaca.Tests.ImageArray 8 | { 9 | public class ImageArray2DObjectInt16 10 | { 11 | private readonly ITestOutputHelper output; 12 | 13 | public ImageArray2DObjectInt16(ITestOutputHelper output) 14 | { 15 | this.output = output; 16 | } 17 | 18 | [Fact] 19 | public void Test() 20 | { 21 | const int IMAGE_WIDTH = 4000; 22 | const int IMAGE_HEIGHT = 3000; 23 | 24 | Object[,] imageArray = new Object[IMAGE_WIDTH, IMAGE_HEIGHT]; 25 | for (int i = 0; i < IMAGE_WIDTH; i++) 26 | { 27 | for (int j = 0; j < IMAGE_HEIGHT; j++) 28 | { 29 | imageArray[i, j] = (Int16)((i * j % 65536) - 32768); 30 | } 31 | } 32 | 33 | Stopwatch sw = Stopwatch.StartNew(); 34 | 35 | byte[] bytes = imageArray.ToByteArray(1, 0, 0, AlpacaErrors.AlpacaNoError, ""); 36 | output.WriteLine($"Time to create byte array: {sw.Elapsed.TotalMilliseconds:0.0}"); 37 | 38 | ArrayMetadataV1 metadata = bytes.GetMetadataV1(); 39 | Assert.True(metadata.TransmissionElementType == ImageArrayElementTypes.Int16); 40 | 41 | sw.Restart(); 42 | Object[,] responseArray = (Object[,])bytes.ToImageArray(); 43 | output.WriteLine($"Time to create return array: {sw.Elapsed.TotalMilliseconds:0.0}"); 44 | Assert.True(TestSupport.CompareArrays(imageArray, responseArray, false, output)); 45 | } 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/ImageArray/ImageArray2DObjectUInt16.cs: -------------------------------------------------------------------------------- 1 | namespace ASCOM.Alpaca.Tests.ImageArray 2 | { 3 | internal class ImageArray2DObjectUInt16 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/Responses/ImageArray2DObjectInt16.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.Alpaca; 2 | using Xunit; 3 | 4 | namespace ASCOM.Alpaca.Test.Responses 5 | { 6 | public class ImageArrayInt2DResponseIsInitialisedWith 7 | { 8 | [Fact] 9 | public void Rank2_And_TypeInt() 10 | { 11 | var response = new IntArray2DResponse(); 12 | 13 | Assert.Equal(2, response.Rank); 14 | Assert.Equal(typeof(int[,]), response.Value.GetType()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/Responses/ImageArrayInt3DResponseIsInitialisedWith.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Common.Alpaca; 2 | using Xunit; 3 | 4 | namespace ASCOM.Alpaca.Test.Responses 5 | { 6 | public class ImageArrayInt3DResponseIsInitialisedWith 7 | { 8 | [Fact] 9 | public void ImageArrayInt3DResponse_IsInitialisedWith_Rank2_And_TypeInt() 10 | { 11 | var response = new IntArray3DResponse(); 12 | 13 | Assert.Equal(3, response.Rank); 14 | Assert.Equal(typeof(int[,,]), response.Value.GetType()); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/Transform/TransformLoggerTests.cs: -------------------------------------------------------------------------------- 1 | using ASCOM.Tools; 2 | using Xunit; 3 | 4 | namespace TransformTests 5 | { 6 | public class TransformLoggerTests 7 | { 8 | readonly TraceLogger TL = new("TransformTest1", true); 9 | Transform transform; 10 | 11 | [Fact] 12 | public void CanCreateInstanc() 13 | { 14 | transform = new Transform(null); 15 | Assert.NotNull(transform); 16 | 17 | Assert.Equal(0.0, transform.DeltaUT1); 18 | transform.Dispose(); 19 | transform = null; 20 | 21 | 22 | 23 | ConsoleLogger consLogger = new(); 24 | consLogger.SetMinimumLoggingLevel(ASCOM.Common.Interfaces.LogLevel.Debug); 25 | consLogger.Log(ASCOM.Common.Interfaces.LogLevel.Debug, "Console logger created"); 26 | transform = new Transform(consLogger); 27 | Assert.NotNull(transform); 28 | 29 | transform = new Transform(TL); 30 | Assert.NotNull(transform); 31 | 32 | Assert.Equal(0.0, transform.DeltaUT1); 33 | 34 | //Assert.True(TL.Enabled); 35 | 36 | //TL.LogMessage("CreateLog", FIRST_LOG_LINE); 37 | //TL.Enabled = false; 38 | 39 | //Assert.False(TL.Enabled); 40 | 41 | //TL.LogMessage("CreateLog", FIRST_LOG_LINE); 42 | 43 | //string logFile = Path.Combine(TL.LogFilePath, TL.LogFileName); 44 | 45 | //TL.Enabled = false; 46 | //TL.Dispose(); 47 | 48 | //string[] lines = File.ReadAllLines(logFile); 49 | 50 | //Assert.Single(lines); 51 | 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/UnitTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | 6 | false 7 | 8 | ASCOM.Alpaca.Tests 9 | 10 | Debug;Release 11 | 12 | 13 | 14 | portable 15 | true 16 | 17 | 18 | 19 | 20 | 21 | Always 22 | 23 | 24 | Always 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | all 35 | runtime; build; native; contentfiles; analyzers; buildtransitive 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Always 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /test/ASCOMStandard.Tests/cio_ra.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ASCOMInitiative/ASCOMLibrary/3165c424e3437466c72e32a53ae3d649fc416396/test/ASCOMStandard.Tests/cio_ra.bin --------------------------------------------------------------------------------