Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2abda2d14 | |||
| 97810b5575 | |||
| 1185770a94 | |||
| 25d88b0609 | |||
| 85c77787ce | |||
| 2181ff5602 | |||
| 9505468efc | |||
| 2cbb1fb68c | |||
| ba0ae056ea | |||
| dff7bce6b0 | |||
| a155e27eac | |||
| 438ec779b4 | |||
| 307517ded0 | |||
| 8efa8752df | |||
| 7f6f478dfc | |||
| 7a92581fa8 | |||
| 7f8c2cb559 | |||
| 3dc87e3724 | |||
| 670a5ccf81 | |||
| 9af0613183 | |||
| 5df0e21a58 | |||
| 149bad2d31 | |||
| 276f0352e3 | |||
| f22e9cdd02 | |||
| ee3862f949 | |||
| 2972ae31aa | |||
| 79cdd60d07 | |||
| f92f21ab72 | |||
| 2a56cfa700 | |||
| babb2a7492 | |||
| 23960d8c7c | |||
| cb97358100 | |||
| 28889bdb49 | |||
| 5efde9f6e0 | |||
| 12e46edc74 | |||
| 9969fce375 | |||
| 97e77c839a | |||
| 0ea195e073 |
@@ -56,8 +56,8 @@
|
|||||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Moq, Version=4.12.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
<Reference Include="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Moq.4.12.0\lib\net45\Moq.dll</HintPath>
|
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||||
@@ -65,8 +65,8 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
||||||
<package id="Moq" version="4.12.0" targetFramework="net472" />
|
<package id="Moq" version="4.13.0" targetFramework="net472" />
|
||||||
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>ASCOM.MeadeGeneric</RootNamespace>
|
<RootNamespace>ASCOM.MeadeGeneric</RootNamespace>
|
||||||
<AssemblyName>ASCOM.MeadeGeneric.Test</AssemblyName>
|
<AssemblyName>ASCOM.MeadeGeneric.Test</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
<TargetFrameworkProfile>
|
<TargetFrameworkProfile>
|
||||||
</TargetFrameworkProfile>
|
</TargetFrameworkProfile>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
|
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ using ASCOM.DriverAccess;
|
|||||||
|
|
||||||
namespace ASCOM.MeadeGeneric
|
namespace ASCOM.MeadeGeneric
|
||||||
{
|
{
|
||||||
class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
public static void Main()
|
||||||
{
|
{
|
||||||
// Uncomment the code that's required
|
// Uncomment the code that's required
|
||||||
#if UseChooser
|
#if UseChooser
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||||
|
|||||||
@@ -401,13 +401,13 @@ namespace Meade.net.Focuser.UnitTests
|
|||||||
|
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
{
|
{
|
||||||
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":F-#"), Times.AtLeastOnce);
|
_sharedResourcesWrapperMock.Verify( x => x.SendBlind("#:F-#"), Times.AtLeastOnce);
|
||||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never);
|
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Never);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Never);
|
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F-#"), Times.Never);
|
||||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.AtLeastOnce);
|
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.AtLeastOnce);
|
||||||
}
|
}
|
||||||
|
|
||||||
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once);
|
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once);
|
||||||
|
|||||||
@@ -71,8 +71,8 @@
|
|||||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Moq, Version=4.12.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
<Reference Include="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Moq.4.12.0\lib\net45\Moq.dll</HintPath>
|
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||||
@@ -80,8 +80,8 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
||||||
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
||||||
<package id="Moq" version="4.12.0" targetFramework="net472" />
|
<package id="Moq" version="4.13.0" targetFramework="net472" />
|
||||||
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -25,9 +25,9 @@
|
|||||||
<![CDATA[Installed OR ASCOMPLATFORMVERSION >= "6.4.1"]]>
|
<![CDATA[Installed OR ASCOMPLATFORMVERSION >= "6.4.1"]]>
|
||||||
</Condition>
|
</Condition>
|
||||||
|
|
||||||
<PropertyRef Id="NETFRAMEWORK40FULL"/>
|
<PropertyRef Id="NETFRAMEWORK45"/>
|
||||||
<Condition Message="This application requires .NET Framework 4.0 or higher. Please install the .NET Framework then run this installer again.">
|
<Condition Message="This application requires .NET Framework 4.5 or higher. Please install the .NET Framework then run this installer again.">
|
||||||
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
|
<![CDATA[Installed OR NETFRAMEWORK45]]>
|
||||||
</Condition>
|
</Condition>
|
||||||
|
|
||||||
<!-- <Condition Message="Please use the correct installer for your operating system - x86 for 32-bit, x64 for 64-bit.">
|
<!-- <Condition Message="Please use the correct installer for your operating system - x86 for 32-bit, x64 for 64-bit.">
|
||||||
|
|||||||
@@ -92,8 +92,8 @@
|
|||||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Moq, Version=4.12.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
<Reference Include="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Moq.4.12.0\lib\net45\Moq.dll</HintPath>
|
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
|
<HintPath>..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
|
||||||
@@ -101,8 +101,8 @@
|
|||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
|||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
||||||
<package id="Castle.Core" version="4.4.0" targetFramework="net45" />
|
<package id="Castle.Core" version="4.4.0" targetFramework="net45" />
|
||||||
<package id="Moq" version="4.12.0" targetFramework="net45" />
|
<package id="Moq" version="4.13.0" targetFramework="net472" />
|
||||||
<package id="NUnit" version="3.12.0" targetFramework="net40" requireReinstallation="true" />
|
<package id="NUnit" version="3.12.0" targetFramework="net40" requireReinstallation="true" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net45" requireReinstallation="true" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -22,7 +22,7 @@ namespace ASCOM.Meade.net.AstroMaths
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle )
|
private double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle )
|
||||||
{
|
{
|
||||||
var gst = UTtoGst(utcDateTime);
|
var gst = UTtoGst(utcDateTime);
|
||||||
var lst = GsTtoLst( gst, longitude);
|
var lst = GsTtoLst( gst, longitude);
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ namespace ASCOM.Meade.net.AstroMaths
|
|||||||
public interface IAstroMaths
|
public interface IAstroMaths
|
||||||
{
|
{
|
||||||
double RightAscensionToHourAngle(DateTime utcDateTime, double longitude, double rightAscension);
|
double RightAscensionToHourAngle(DateTime utcDateTime, double longitude, double rightAscension);
|
||||||
double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle );
|
//double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle );
|
||||||
EquatorialCoordinates ConvertHozToEq( DateTime utcDateTime, double latitude, double longitude, HorizonCoordinates altAz);
|
EquatorialCoordinates ConvertHozToEq( DateTime utcDateTime, double latitude, double longitude, HorizonCoordinates altAz);
|
||||||
HorizonCoordinates ConvertEqToHoz(double hourAngle, double latitude, EquatorialCoordinates raDec);
|
HorizonCoordinates ConvertEqToHoz(double hourAngle, double latitude, EquatorialCoordinates raDec);
|
||||||
double DegreesToRadians(double degrees);
|
//double DegreesToRadians(double degrees);
|
||||||
double RadiansToDegrees(double radians);
|
//double RadiansToDegrees(double radians);
|
||||||
double DateTimeToDecimalHours( DateTime utcDateTime);
|
//double DateTimeToDecimalHours( DateTime utcDateTime);
|
||||||
double UTtoGst(DateTime utcDateTime);
|
//double UTtoGst(DateTime utcDateTime);
|
||||||
double GsTtoLst(double gst, double longitude);
|
//double GsTtoLst(double gst, double longitude);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace ASCOM.Meade.net
|
||||||
|
{
|
||||||
|
public enum ComparisonResult
|
||||||
|
{
|
||||||
|
Lower,
|
||||||
|
Equals,
|
||||||
|
Greater
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,5 +10,18 @@ namespace ASCOM.Meade.net
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ComparisonResult Compare(this double value, double comparison)
|
||||||
|
{
|
||||||
|
var result = value.CompareTo(comparison);
|
||||||
|
|
||||||
|
if (result < 0)
|
||||||
|
return ComparisonResult.Lower;
|
||||||
|
|
||||||
|
if (result == 0)
|
||||||
|
return ComparisonResult.Equals;
|
||||||
|
|
||||||
|
return ComparisonResult.Greater;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<UpgradeBackupLocation>
|
<UpgradeBackupLocation>
|
||||||
</UpgradeBackupLocation>
|
</UpgradeBackupLocation>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
||||||
@@ -62,10 +62,12 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
<OutputPath>..\bin\Release\</OutputPath>
|
<OutputPath>..\bin\Release\</OutputPath>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<OutputPath>..\bin\Debug\</OutputPath>
|
<OutputPath>..\bin\Debug\</OutputPath>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
@@ -118,6 +120,7 @@
|
|||||||
<Compile Include="AstroMaths\EquatorialCoordinates.cs" />
|
<Compile Include="AstroMaths\EquatorialCoordinates.cs" />
|
||||||
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
|
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
|
||||||
<Compile Include="AstroMaths\IAstroMaths.cs" />
|
<Compile Include="AstroMaths\IAstroMaths.cs" />
|
||||||
|
<Compile Include="ComparisonResult.cs" />
|
||||||
<Compile Include="DoubleExtensions.cs" />
|
<Compile Include="DoubleExtensions.cs" />
|
||||||
<Compile Include="StringExtensions.cs" />
|
<Compile Include="StringExtensions.cs" />
|
||||||
<Compile Include="Telescope.cs" />
|
<Compile Include="Telescope.cs" />
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
|||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(true)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("8b9fccb9-87ae-42f7-90af-079e13de6efb")]
|
[assembly: Guid("8b9fccb9-87ae-42f7-90af-079e13de6efb")]
|
||||||
|
|||||||
+19
-25
@@ -8,16 +8,10 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System.CodeDom.Compiler;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace ASCOM.Meade.net.Properties {
|
namespace ASCOM.Meade.net.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -25,27 +19,27 @@ namespace ASCOM.Meade.net.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
[DebuggerNonUserCode()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[CompilerGenerated()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|
||||||
private static ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
@@ -56,8 +50,8 @@ namespace ASCOM.Meade.net.Properties {
|
|||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
@@ -69,20 +63,20 @@ namespace ASCOM.Meade.net.Properties {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static Bitmap ASCOM {
|
internal static System.Drawing.Bitmap ASCOM {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
||||||
return ((Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static Icon DefaultIcon {
|
internal static System.Drawing.Icon DefaultIcon {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
|
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
|
||||||
return ((Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-8
@@ -8,18 +8,14 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System.CodeDom.Compiler;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace ASCOM.Meade.net.Properties {
|
namespace ASCOM.Meade.net.Properties {
|
||||||
|
|
||||||
|
|
||||||
[CompilerGenerated()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||||
internal sealed partial class Settings : ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
public static Settings Default {
|
public static Settings Default {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@@ -82,16 +82,17 @@ namespace ASCOM.Meade.net
|
|||||||
switch (axis)
|
switch (axis)
|
||||||
{
|
{
|
||||||
case TelescopeAxes.axisPrimary:
|
case TelescopeAxes.axisPrimary:
|
||||||
|
case TelescopeAxes.axisSecondary:
|
||||||
// TODO Initialize this array with any Primary axis rates that your driver may provide
|
// TODO Initialize this array with any Primary axis rates that your driver may provide
|
||||||
// Example: m_Rates = new Rate[] { new Rate(10.5, 30.2), new Rate(54.0, 43.6) }
|
// Example: m_Rates = new Rate[] { new Rate(10.5, 30.2), new Rate(54.0, 43.6) }
|
||||||
//this.rates = new Rate[0];
|
//this.rates = new Rate[0];
|
||||||
_rates = new[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
_rates = new[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
||||||
break;
|
break;
|
||||||
case TelescopeAxes.axisSecondary:
|
|
||||||
// TODO Initialize this array with any Secondary axis rates that your driver may provide
|
//// TODO Initialize this array with any Secondary axis rates that your driver may provide
|
||||||
//this.rates = new Rate[0];
|
////this.rates = new Rate[0];
|
||||||
_rates = new[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
//_rates = new[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
||||||
break;
|
//break;
|
||||||
case TelescopeAxes.axisTertiary:
|
case TelescopeAxes.axisTertiary:
|
||||||
// TODO Initialize this array with any Tertiary axis rates that your driver may provide
|
// TODO Initialize this array with any Tertiary axis rates that your driver may provide
|
||||||
_rates = new Rate[0];
|
_rates = new Rate[0];
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ namespace ASCOM.Meade.net
|
|||||||
return int.Parse(str);
|
return int.Parse(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double ToDouble(this string str)
|
//public static double ToDouble(this string str)
|
||||||
{
|
//{
|
||||||
return double.Parse(str);
|
// return double.Parse(str);
|
||||||
}
|
//}
|
||||||
|
|
||||||
public static int Position(this string str, char find, int instance)
|
public static int Position(this string str, char find, int instance)
|
||||||
{
|
{
|
||||||
|
|||||||
+254
-197
@@ -5,6 +5,8 @@ using System.Collections;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
using ASCOM.Astrometry;
|
using ASCOM.Astrometry;
|
||||||
using ASCOM.Astrometry.AstroUtils;
|
using ASCOM.Astrometry.AstroUtils;
|
||||||
using ASCOM.Astrometry.NOVAS;
|
using ASCOM.Astrometry.NOVAS;
|
||||||
@@ -35,6 +37,7 @@ namespace ASCOM.Meade.net
|
|||||||
[ProgId("ASCOM.MeadeGeneric.Telescope")]
|
[ProgId("ASCOM.MeadeGeneric.Telescope")]
|
||||||
[ServedClassName("Meade Generic")]
|
[ServedClassName("Meade Generic")]
|
||||||
[ClassInterface(ClassInterfaceType.None)]
|
[ClassInterface(ClassInterfaceType.None)]
|
||||||
|
[ComVisible(true)]
|
||||||
public class Telescope : ReferenceCountedObjectBase, ITelescopeV3
|
public class Telescope : ReferenceCountedObjectBase, ITelescopeV3
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -42,7 +45,7 @@ namespace ASCOM.Meade.net
|
|||||||
/// The DeviceID is used by ASCOM applications to load the driver at runtime.
|
/// The DeviceID is used by ASCOM applications to load the driver at runtime.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
//internal static string driverID = "ASCOM.Meade.net.Telescope";
|
//internal static string driverID = "ASCOM.Meade.net.Telescope";
|
||||||
private static readonly string DriverId = Marshal.GenerateProgIdForType(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly string DriverId = Marshal.GenerateProgIdForType(MethodBase.GetCurrentMethod().DeclaringType ?? throw new System.InvalidOperationException());
|
||||||
|
|
||||||
// TODO Change the descriptive string for your driver then remove this line
|
// TODO Change the descriptive string for your driver then remove this line
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -78,15 +81,45 @@ namespace ASCOM.Meade.net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Telescope()
|
public Telescope()
|
||||||
{
|
{
|
||||||
//todo move this out to IOC
|
try
|
||||||
var util = new Util(); //Initialise util object
|
{
|
||||||
_utilities = util;
|
//todo move this out to IOC
|
||||||
_utilitiesExtra = util; //Initialise util object
|
var util = new Util(); //Initialise util object
|
||||||
_astroUtilities = new AstroUtils(); // Initialise astro utilities object
|
_utilities = util;
|
||||||
_sharedResourcesWrapper = new SharedResourcesWrapper();
|
_utilitiesExtra = util; //Initialise util object
|
||||||
_astroMaths = new AstroMaths.AstroMaths();
|
_astroUtilities = new AstroUtils(); // Initialise astro utilities object
|
||||||
|
_sharedResourcesWrapper = new SharedResourcesWrapper();
|
||||||
|
_astroMaths = new AstroMaths.AstroMaths();
|
||||||
|
|
||||||
Initialise();
|
Initialise();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
var currentException = e;
|
||||||
|
|
||||||
|
while (currentException != null)
|
||||||
|
{
|
||||||
|
AppendException(sb, currentException);
|
||||||
|
|
||||||
|
currentException = currentException.InnerException;
|
||||||
|
|
||||||
|
if (currentException != null)
|
||||||
|
sb.AppendLine("-----");
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.Show(sb.ToString());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AppendException(StringBuilder sb, Exception currentException)
|
||||||
|
{
|
||||||
|
sb.AppendLine(currentException.Message);
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(currentException.StackTrace);
|
||||||
|
sb.AppendLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Telescope( IUtil util, IUtilExtra utilExtra, IAstroUtils astroUtilities, ISharedResourcesWrapper sharedResourcesWrapper, IAstroMaths astroMaths)
|
public Telescope( IUtil util, IUtilExtra utilExtra, IAstroUtils astroUtilities, ISharedResourcesWrapper sharedResourcesWrapper, IAstroMaths astroMaths)
|
||||||
@@ -169,68 +202,68 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
//Read the screen
|
//Read the screen
|
||||||
case "readdisplay":
|
case "readdisplay":
|
||||||
var output = _sharedResourcesWrapper.SendString(":ED#");
|
var output = _sharedResourcesWrapper.SendString("#:ED#");
|
||||||
return output;
|
return output;
|
||||||
|
|
||||||
//top row of buttons
|
//top row of buttons
|
||||||
case "enter":
|
case "enter":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK13#");
|
_sharedResourcesWrapper.SendBlind("#:EK13#");
|
||||||
break;
|
break;
|
||||||
case "mode":
|
case "mode":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK9#");
|
_sharedResourcesWrapper.SendBlind("#:EK9#");
|
||||||
break;
|
break;
|
||||||
case "longmode":
|
case "longmode":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK11#");
|
_sharedResourcesWrapper.SendBlind("#:EK11#");
|
||||||
break;
|
break;
|
||||||
case "goto":
|
case "goto":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK24#");
|
_sharedResourcesWrapper.SendBlind("#:EK24#");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "0": //light and 0
|
case "0": //light and 0
|
||||||
_sharedResourcesWrapper.SendBlind(":EK48#");
|
_sharedResourcesWrapper.SendBlind("#:EK48#");
|
||||||
break;
|
break;
|
||||||
case "1":
|
case "1":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK49#");
|
_sharedResourcesWrapper.SendBlind("#:EK49#");
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK50#");
|
_sharedResourcesWrapper.SendBlind("#:EK50#");
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK51#");
|
_sharedResourcesWrapper.SendBlind("#:EK51#");
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK52#");
|
_sharedResourcesWrapper.SendBlind("#:EK52#");
|
||||||
break;
|
break;
|
||||||
case "5":
|
case "5":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK53#");
|
_sharedResourcesWrapper.SendBlind("#:EK53#");
|
||||||
break;
|
break;
|
||||||
case "6":
|
case "6":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK54#");
|
_sharedResourcesWrapper.SendBlind("#:EK54#");
|
||||||
break;
|
break;
|
||||||
case "7":
|
case "7":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK55#");
|
_sharedResourcesWrapper.SendBlind("#:EK55#");
|
||||||
break;
|
break;
|
||||||
case "8":
|
case "8":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK56#");
|
_sharedResourcesWrapper.SendBlind("#:EK56#");
|
||||||
break;
|
break;
|
||||||
case "9":
|
case "9":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK57#");
|
_sharedResourcesWrapper.SendBlind("#:EK57#");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "up":
|
case "up":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK94#");
|
_sharedResourcesWrapper.SendBlind("#:EK94#");
|
||||||
break;
|
break;
|
||||||
case "down":
|
case "down":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK118#");
|
_sharedResourcesWrapper.SendBlind("#:EK118#");
|
||||||
break;
|
break;
|
||||||
case "back":
|
case "back":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK87#");
|
_sharedResourcesWrapper.SendBlind("#:EK87#");
|
||||||
break;
|
break;
|
||||||
case "forward":
|
case "forward":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK69#");
|
_sharedResourcesWrapper.SendBlind("#:EK69#");
|
||||||
break;
|
break;
|
||||||
case "?":
|
case "?":
|
||||||
_sharedResourcesWrapper.SendBlind(":EK63#");
|
_sharedResourcesWrapper.SendBlind("#:EK63#");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
||||||
@@ -388,6 +421,7 @@ namespace ASCOM.Meade.net
|
|||||||
if (connectionInfo.SameDevice == 1)
|
if (connectionInfo.SameDevice == 1)
|
||||||
{
|
{
|
||||||
LogMessage("Connected Set", "Making first connection telescope adjustments");
|
LogMessage("Connected Set", "Making first connection telescope adjustments");
|
||||||
|
|
||||||
//These settings are applied only when the first device connects to the telescope.
|
//These settings are applied only when the first device connects to the telescope.
|
||||||
SetLongFormat(true);
|
SetLongFormat(true);
|
||||||
|
|
||||||
@@ -402,6 +436,9 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
LogMessage("Connected Set", $"Skipping first connection telescope adjustments (current connections: {connectionInfo.SameDevice})");
|
LogMessage("Connected Set", $"Skipping first connection telescope adjustments (current connections: {connectionInfo.SameDevice})");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var raAndDec = GetTelescopeRaAndDec();
|
||||||
|
LogMessage("Connected Set", $"Connected OK. Current RA = {_utilitiesExtra.HoursToHMS(raAndDec.RightAscension)} Dec = {_utilitiesExtra.DegreesToDMS(raAndDec.Declination)}");
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -488,11 +525,14 @@ namespace ASCOM.Meade.net
|
|||||||
IsLongFormat = false;
|
IsLongFormat = false;
|
||||||
|
|
||||||
if (!IsLongFormatSupported())
|
if (!IsLongFormatSupported())
|
||||||
|
{
|
||||||
|
LogMessage("SetLongFormat", "Long coordinate format not supported for this mount");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_sharedResourcesWrapper.Lock(() =>
|
_sharedResourcesWrapper.Lock(() =>
|
||||||
{
|
{
|
||||||
var result = _sharedResourcesWrapper.SendString(":GZ#");
|
var result = _sharedResourcesWrapper.SendString("#:GZ#");
|
||||||
//:GZ# Get telescope azimuth
|
//:GZ# Get telescope azimuth
|
||||||
//Returns: DDD*MM# or DDD*MM’SS#
|
//Returns: DDD*MM# or DDD*MM’SS#
|
||||||
//The current telescope Azimuth depending on the selected precision.
|
//The current telescope Azimuth depending on the selected precision.
|
||||||
@@ -502,19 +542,21 @@ namespace ASCOM.Meade.net
|
|||||||
if (IsLongFormat != setLongFormat)
|
if (IsLongFormat != setLongFormat)
|
||||||
{
|
{
|
||||||
_utilities.WaitForMilliseconds(500);
|
_utilities.WaitForMilliseconds(500);
|
||||||
_sharedResourcesWrapper.SendBlind(":U#");
|
_sharedResourcesWrapper.SendBlind("#:U#");
|
||||||
//:U# Toggle between low/hi precision positions
|
//:U# Toggle between low/hi precision positions
|
||||||
//Low - RA displays and messages HH:MM.T sDD*MM
|
//Low - RA displays and messages HH:MM.T sDD*MM
|
||||||
//High - Dec / Az / El displays and messages HH:MM: SS sDD*MM:SS
|
//High - Dec / Az / El displays and messages HH:MM: SS sDD*MM:SS
|
||||||
// Returns Nothing
|
// Returns Nothing
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
LogMessage("SetLongFormat", $"Long coordinate format: {setLongFormat} ");
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TogglePrecision()
|
private bool TogglePrecision()
|
||||||
{
|
{
|
||||||
LogMessage("TogglePrecision", "Toggling slewing precision");
|
LogMessage("TogglePrecision", "Toggling slewing precision");
|
||||||
var result = _sharedResourcesWrapper.SendChar(":P#");
|
var result = _sharedResourcesWrapper.SendChar("#:P#");
|
||||||
//:P# Toggles High Precsion Pointing. When High precision pointing is enabled scope will first allow the operator to center a nearby bright star before moving to the actual target.
|
//:P# Toggles High Precsion Pointing. When High precision pointing is enabled scope will first allow the operator to center a nearby bright star before moving to the actual target.
|
||||||
//Returns: <string>
|
//Returns: <string>
|
||||||
//“HIGH PRECISION” Current setting after this command.
|
//“HIGH PRECISION” Current setting after this command.
|
||||||
@@ -552,33 +594,35 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
public void SelectSite(int site)
|
public void SelectSite(int site)
|
||||||
{
|
{
|
||||||
CheckConnected("SelectSite");
|
CheckConnectedAndValidateSite(site, "SelectSite");
|
||||||
|
|
||||||
if (site < 1)
|
_sharedResourcesWrapper.SendBlind($"#:W{site}#");
|
||||||
throw new ArgumentOutOfRangeException(nameof(site),site,Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
|
|
||||||
if (site > 4)
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
|
|
||||||
|
|
||||||
_sharedResourcesWrapper.SendBlind($":W{site}#");
|
|
||||||
//:W<n>#
|
//:W<n>#
|
||||||
//Set current site to<n>, an ASCII digit in the range 1..4
|
//Set current site to<n>, an ASCII digit in the range 1..4
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetSiteName(int site, string sitename)
|
private void CheckConnectedAndValidateSite(int site, string message)
|
||||||
{
|
{
|
||||||
CheckConnected("SetSiteName");
|
CheckConnected(message);
|
||||||
|
|
||||||
if (site < 1)
|
if (site < 1)
|
||||||
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
|
throw new ArgumentOutOfRangeException(nameof(site), site,
|
||||||
|
Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
|
||||||
if (site > 4)
|
if (site > 4)
|
||||||
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
|
throw new ArgumentOutOfRangeException(nameof(site), site,
|
||||||
|
Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
|
||||||
|
}
|
||||||
|
|
||||||
string command = String.Empty;
|
private void SetSiteName(int site, string sitename)
|
||||||
|
{
|
||||||
|
CheckConnectedAndValidateSite(site, "SetSiteName");
|
||||||
|
|
||||||
|
string command;
|
||||||
switch (site)
|
switch (site)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
command = $":SM{sitename}#";
|
command = $"#:SM{sitename}#";
|
||||||
//:SM<string>#
|
//:SM<string>#
|
||||||
//Set site 1’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
//Set site 1’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
||||||
// Returns:
|
// Returns:
|
||||||
@@ -586,7 +630,7 @@ namespace ASCOM.Meade.net
|
|||||||
//1 - Valid
|
//1 - Valid
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
command = $":SN{sitename}#";
|
command = $"#:SN{sitename}#";
|
||||||
//:SN<string>#
|
//:SN<string>#
|
||||||
//Set site 2’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
//Set site 2’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
||||||
// Returns:
|
// Returns:
|
||||||
@@ -594,7 +638,7 @@ namespace ASCOM.Meade.net
|
|||||||
//1 - Valid
|
//1 - Valid
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
command = $":SO{sitename}#";
|
command = $"#:SO{sitename}#";
|
||||||
//:SO<string>#
|
//:SO<string>#
|
||||||
//Set site 3’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
//Set site 3’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
||||||
// Returns:
|
// Returns:
|
||||||
@@ -602,14 +646,15 @@ namespace ASCOM.Meade.net
|
|||||||
//1 - Valid
|
//1 - Valid
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
command = $":SP{sitename}#";
|
command = $"#:SP{sitename}#";
|
||||||
//:SP<string>#
|
//:SP<string>#
|
||||||
//Set site 4’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
//Set site 4’s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
|
||||||
// Returns:
|
// Returns:
|
||||||
//0 – Invalid
|
//0 – Invalid
|
||||||
//1 - Valid
|
//1 - Valid
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_GetSiteName_Site_out_of_range);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendChar(command);
|
var result = _sharedResourcesWrapper.SendChar(command);
|
||||||
@@ -621,38 +666,33 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
private string GetSiteName(int site)
|
private string GetSiteName(int site)
|
||||||
{
|
{
|
||||||
CheckConnected("GetSiteName");
|
CheckConnectedAndValidateSite(site, "GetSiteName");
|
||||||
|
|
||||||
if (site < 1)
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
|
|
||||||
if (site > 4)
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
|
|
||||||
|
|
||||||
switch (site)
|
switch (site)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
return _sharedResourcesWrapper.SendString(":GM#");
|
return _sharedResourcesWrapper.SendString("#:GM#");
|
||||||
//:GM# Get Site 1 Name
|
//:GM# Get Site 1 Name
|
||||||
//Returns: <string>#
|
//Returns: <string>#
|
||||||
//A ‘#’ terminated string with the name of the requested site.
|
//A ‘#’ terminated string with the name of the requested site.
|
||||||
case 2:
|
case 2:
|
||||||
return _sharedResourcesWrapper.SendString(":GN#");
|
return _sharedResourcesWrapper.SendString("#:GN#");
|
||||||
//:GN# Get Site 2 Name
|
//:GN# Get Site 2 Name
|
||||||
//Returns: <string>#
|
//Returns: <string>#
|
||||||
//A ‘#’ terminated string with the name of the requested site.
|
//A ‘#’ terminated string with the name of the requested site.
|
||||||
case 3:
|
case 3:
|
||||||
return _sharedResourcesWrapper.SendString(":GO#");
|
return _sharedResourcesWrapper.SendString("#:GO#");
|
||||||
//:GO# Get Site 3 Name
|
//:GO# Get Site 3 Name
|
||||||
//Returns: <string>#
|
//Returns: <string>#
|
||||||
//A ‘#’ terminated string with the name of the requested site.
|
//A ‘#’ terminated string with the name of the requested site.
|
||||||
case 4:
|
case 4:
|
||||||
return _sharedResourcesWrapper.SendString(":GP#");
|
return _sharedResourcesWrapper.SendString("#:GP#");
|
||||||
//:GP# Get Site 4 Name
|
//:GP# Get Site 4 Name
|
||||||
//Returns: <string>#
|
//Returns: <string>#
|
||||||
//A ‘#’ terminated string with the name of the requested site.
|
//A ‘#’ terminated string with the name of the requested site.
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_GetSiteName_Site_out_of_range);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_GetSiteName_Site_out_of_range);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Description
|
public string Description
|
||||||
@@ -703,11 +743,11 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
//string name = "Short driver name - please customise";
|
//string name = "Short driver name - please customise";
|
||||||
|
|
||||||
//var telescopeProduceName = _sharedResourcesWrapper.SendString(":GVP#");
|
//var telescopeProduceName = _sharedResourcesWrapper.SendString("#:GVP#");
|
||||||
////:GVP# Get Telescope Product Name
|
////:GVP# Get Telescope Product Name
|
||||||
////Returns: <string>#
|
////Returns: <string>#
|
||||||
|
|
||||||
//var firmwareVersion = _sharedResourcesWrapper.SendString(":GVN#");
|
//var firmwareVersion = _sharedResourcesWrapper.SendString("#:GVN#");
|
||||||
////:GVN# Get Telescope Firmware Number
|
////:GVN# Get Telescope Firmware Number
|
||||||
////Returns: dd.d#
|
////Returns: dd.d#
|
||||||
|
|
||||||
@@ -727,7 +767,7 @@ namespace ASCOM.Meade.net
|
|||||||
CheckConnected("AbortSlew");
|
CheckConnected("AbortSlew");
|
||||||
|
|
||||||
LogMessage("AbortSlew", "Aborting slew");
|
LogMessage("AbortSlew", "Aborting slew");
|
||||||
_sharedResourcesWrapper.SendBlind(":Q#");
|
_sharedResourcesWrapper.SendBlind("#:Q#");
|
||||||
//:Q# Halt all current slewing
|
//:Q# Halt all current slewing
|
||||||
//Returns:Nothing
|
//Returns:Nothing
|
||||||
|
|
||||||
@@ -756,7 +796,7 @@ namespace ASCOM.Meade.net
|
|||||||
//todo implement GW Command - Supported in Autostar 43Eg and above
|
//todo implement GW Command - Supported in Autostar 43Eg and above
|
||||||
//if FirmwareIsGreaterThan(TelescopeList.Autostar497_43EG)
|
//if FirmwareIsGreaterThan(TelescopeList.Autostar497_43EG)
|
||||||
//{
|
//{
|
||||||
//var alignmentString = SerialPort.CommandTerminated(":GW#", "#");
|
//var alignmentString = SerialPort.CommandTerminated("#:GW#", "#");
|
||||||
//:GW# Get Scope Alignment Status
|
//:GW# Get Scope Alignment Status
|
||||||
//Returns: <mount><tracking><alignment>#
|
//Returns: <mount><tracking><alignment>#
|
||||||
// where:
|
// where:
|
||||||
@@ -798,13 +838,13 @@ namespace ASCOM.Meade.net
|
|||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case AlignmentModes.algAltAz:
|
case AlignmentModes.algAltAz:
|
||||||
_sharedResourcesWrapper.SendBlind(":AA#");
|
_sharedResourcesWrapper.SendBlind("#:AA#");
|
||||||
//:AA# Sets telescope the AltAz alignment mode
|
//:AA# Sets telescope the AltAz alignment mode
|
||||||
//Returns: nothing
|
//Returns: nothing
|
||||||
break;
|
break;
|
||||||
case AlignmentModes.algPolar:
|
case AlignmentModes.algPolar:
|
||||||
case AlignmentModes.algGermanPolar:
|
case AlignmentModes.algGermanPolar:
|
||||||
_sharedResourcesWrapper.SendBlind(":AP#");
|
_sharedResourcesWrapper.SendBlind("#:AP#");
|
||||||
//:AP# Sets telescope to Polar alignment mode
|
//:AP# Sets telescope to Polar alignment mode
|
||||||
//Returns: nothing
|
//Returns: nothing
|
||||||
break;
|
break;
|
||||||
@@ -828,7 +868,7 @@ namespace ASCOM.Meade.net
|
|||||||
return altAz.Altitude;
|
return altAz.Altitude;
|
||||||
|
|
||||||
////todo firmware bug in 44Eg, :GA# is returning the dec, not the altitude!
|
////todo firmware bug in 44Eg, :GA# is returning the dec, not the altitude!
|
||||||
//var result = _sharedResourcesWrapper.SendString(":GA#");
|
//var result = _sharedResourcesWrapper.SendString("#:GA#");
|
||||||
////:GA# Get Telescope Altitude
|
////:GA# Get Telescope Altitude
|
||||||
////Returns: sDD* MM# or sDD*MM’SS#
|
////Returns: sDD* MM# or sDD*MM’SS#
|
||||||
////The current scope altitude. The returned format depending on the current precision setting.
|
////The current scope altitude. The returned format depending on the current precision setting.
|
||||||
@@ -849,11 +889,7 @@ namespace ASCOM.Meade.net
|
|||||||
UtcDateTime = UTCDate,
|
UtcDateTime = UTCDate,
|
||||||
SiteLongitude = SiteLongitude,
|
SiteLongitude = SiteLongitude,
|
||||||
SiteLatitude = SiteLatitude,
|
SiteLatitude = SiteLatitude,
|
||||||
EquatorialCoordinates = new EquatorialCoordinates
|
EquatorialCoordinates = GetTelescopeRaAndDec()
|
||||||
{
|
|
||||||
RightAscension = RightAscension,
|
|
||||||
Declination = Declination
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
double hourAngle = _astroMaths.RightAscensionToHourAngle(altitudeData.UtcDateTime, altitudeData.SiteLongitude,
|
double hourAngle = _astroMaths.RightAscensionToHourAngle(altitudeData.UtcDateTime, altitudeData.SiteLongitude,
|
||||||
@@ -862,6 +898,15 @@ namespace ASCOM.Meade.net
|
|||||||
return altAz;
|
return altAz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EquatorialCoordinates GetTelescopeRaAndDec()
|
||||||
|
{
|
||||||
|
return new EquatorialCoordinates
|
||||||
|
{
|
||||||
|
RightAscension = RightAscension,
|
||||||
|
Declination = Declination
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public double ApertureArea
|
public double ApertureArea
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -913,7 +958,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
CheckConnected("Azimuth Get");
|
CheckConnected("Azimuth Get");
|
||||||
|
|
||||||
//var result = _sharedResourcesWrapper.SendString(":GZ#");
|
//var result = _sharedResourcesWrapper.SendString("#:GZ#");
|
||||||
//:GZ# Get telescope azimuth
|
//:GZ# Get telescope azimuth
|
||||||
//Returns: DDD*MM#T or DDD*MM’SS#
|
//Returns: DDD*MM#T or DDD*MM’SS#
|
||||||
//The current telescope Azimuth depending on the selected precision.
|
//The current telescope Azimuth depending on the selected precision.
|
||||||
@@ -1095,7 +1140,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
CheckConnected("Declination Get");
|
CheckConnected("Declination Get");
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendString(":GD#");
|
var result = _sharedResourcesWrapper.SendString("#:GD#");
|
||||||
//:GD# Get Telescope Declination.
|
//:GD# Get Telescope Declination.
|
||||||
//Returns: sDD*MM# or sDD*MM’SS#
|
//Returns: sDD*MM# or sDD*MM’SS#
|
||||||
//Depending upon the current precision setting for the telescope.
|
//Depending upon the current precision setting for the telescope.
|
||||||
@@ -1183,7 +1228,7 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogMessage($"{propertyName} Set", $"Setting new guiderate {value.ToString(CultureInfo.CurrentCulture)} arc seconds/second ({value.ToString(CultureInfo.CurrentCulture)} degrees/second)");
|
LogMessage($"{propertyName} Set", $"Setting new guiderate {value.ToString(CultureInfo.CurrentCulture)} arc seconds/second ({value.ToString(CultureInfo.CurrentCulture)} degrees/second)");
|
||||||
_sharedResourcesWrapper.SendBlind($":Rg{value:00.0}#");
|
_sharedResourcesWrapper.SendBlind($"#:Rg{value:00.0}#");
|
||||||
//:RgSS.S#
|
//:RgSS.S#
|
||||||
//Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking
|
//Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking
|
||||||
//Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed
|
//Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed
|
||||||
@@ -1264,22 +1309,22 @@ namespace ASCOM.Meade.net
|
|||||||
//do nothing, it's ok this time as we're halting the slew.
|
//do nothing, it's ok this time as we're halting the slew.
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
_sharedResourcesWrapper.SendBlind(":RG#");
|
_sharedResourcesWrapper.SendBlind("#:RG#");
|
||||||
//:RG# Set Slew rate to Guiding Rate (slowest)
|
//:RG# Set Slew rate to Guiding Rate (slowest)
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
_sharedResourcesWrapper.SendBlind(":RC#");
|
_sharedResourcesWrapper.SendBlind("#:RC#");
|
||||||
//:RC# Set Slew rate to Centering rate (2nd slowest)
|
//:RC# Set Slew rate to Centering rate (2nd slowest)
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
_sharedResourcesWrapper.SendBlind(":RM#");
|
_sharedResourcesWrapper.SendBlind("#:RM#");
|
||||||
//:RM# Set Slew rate to Find Rate (2nd Fastest)
|
//:RM# Set Slew rate to Find Rate (2nd Fastest)
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
_sharedResourcesWrapper.SendBlind(":RS#");
|
_sharedResourcesWrapper.SendBlind("#:RS#");
|
||||||
//:RS# Set Slew rate to max (fastest)
|
//:RS# Set Slew rate to max (fastest)
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
@@ -1290,56 +1335,57 @@ namespace ASCOM.Meade.net
|
|||||||
switch (axis)
|
switch (axis)
|
||||||
{
|
{
|
||||||
case TelescopeAxes.axisPrimary:
|
case TelescopeAxes.axisPrimary:
|
||||||
if (rate == 0)
|
switch (rate.Compare(0))
|
||||||
{
|
{
|
||||||
_movingPrimary = false;
|
case ComparisonResult.Equals:
|
||||||
_sharedResourcesWrapper.SendBlind(":Qe#");
|
_movingPrimary = false;
|
||||||
//:Qe# Halt eastward Slews
|
_sharedResourcesWrapper.SendBlind("#:Qe#");
|
||||||
//Returns: Nothing
|
//:Qe# Halt eastward Slews
|
||||||
_sharedResourcesWrapper.SendBlind(":Qw#");
|
//Returns: Nothing
|
||||||
//:Qw# Halt westward Slews
|
_sharedResourcesWrapper.SendBlind("#:Qw#");
|
||||||
//Returns: Nothing
|
//:Qw# Halt westward Slews
|
||||||
}
|
//Returns: Nothing
|
||||||
else if (rate > 0)
|
break;
|
||||||
{
|
case ComparisonResult.Greater:
|
||||||
_sharedResourcesWrapper.SendBlind(":Me#");
|
|
||||||
//:Me# Move Telescope East at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_movingPrimary = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_sharedResourcesWrapper.SendBlind(":Mw#");
|
|
||||||
//:Mw# Move Telescope West at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_movingPrimary = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
_sharedResourcesWrapper.SendBlind("#:Me#");
|
||||||
|
//:Me# Move Telescope East at current slew rate
|
||||||
|
//Returns: Nothing
|
||||||
|
_movingPrimary = true;
|
||||||
|
break;
|
||||||
|
case ComparisonResult.Lower:
|
||||||
|
_sharedResourcesWrapper.SendBlind("#:Mw#");
|
||||||
|
//:Mw# Move Telescope West at current slew rate
|
||||||
|
//Returns: Nothing
|
||||||
|
_movingPrimary = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TelescopeAxes.axisSecondary:
|
case TelescopeAxes.axisSecondary:
|
||||||
if (rate == 0)
|
switch (rate.Compare(0))
|
||||||
{
|
{
|
||||||
_movingSecondary = false;
|
case ComparisonResult.Equals:
|
||||||
_sharedResourcesWrapper.SendBlind(":Qn#");
|
_movingSecondary = false;
|
||||||
//:Qn# Halt northward Slews
|
_sharedResourcesWrapper.SendBlind("#:Qn#");
|
||||||
//Returns: Nothing
|
//:Qn# Halt northward Slews
|
||||||
_sharedResourcesWrapper.SendBlind(":Qs#");
|
//Returns: Nothing
|
||||||
//:Qs# Halt southward Slews
|
_sharedResourcesWrapper.SendBlind("#:Qs#");
|
||||||
//Returns: Nothing
|
//:Qs# Halt southward Slews
|
||||||
}
|
//Returns: Nothing
|
||||||
else if (rate > 0)
|
break;
|
||||||
{
|
case ComparisonResult.Greater:
|
||||||
_sharedResourcesWrapper.SendBlind(":Mn#");
|
_sharedResourcesWrapper.SendBlind("#:Mn#");
|
||||||
//:Mn# Move Telescope North at current slew rate
|
//:Mn# Move Telescope North at current slew rate
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
_movingSecondary = true;
|
_movingSecondary = true;
|
||||||
}
|
break;
|
||||||
else
|
case ComparisonResult.Lower:
|
||||||
{
|
_sharedResourcesWrapper.SendBlind("#:Ms#");
|
||||||
_sharedResourcesWrapper.SendBlind(":Ms#");
|
//:Ms# Move Telescope South at current slew rate
|
||||||
//:Ms# Move Telescope South at current slew rate
|
//Returns: Nothing
|
||||||
//Returns: Nothing
|
_movingSecondary = true;
|
||||||
_movingSecondary = true;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -1356,7 +1402,7 @@ namespace ASCOM.Meade.net
|
|||||||
if (AtPark)
|
if (AtPark)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_sharedResourcesWrapper.SendBlind(":hP#");
|
_sharedResourcesWrapper.SendBlind("#:hP#");
|
||||||
//:hP# Autostar, Autostar II and LX 16”Slew to Park Position
|
//:hP# Autostar, Autostar II and LX 16”Slew to Park Position
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
AtPark = true;
|
AtPark = true;
|
||||||
@@ -1369,27 +1415,29 @@ namespace ASCOM.Meade.net
|
|||||||
LogMessage("PulseGuide", $"pulse guide direction {direction} duration {duration}");
|
LogMessage("PulseGuide", $"pulse guide direction {direction} duration {duration}");
|
||||||
CheckConnected("PulseGuide");
|
CheckConnected("PulseGuide");
|
||||||
|
|
||||||
string d = string.Empty;
|
var coordinatesBeforeMove = GetTelescopeRaAndDec();
|
||||||
switch (direction)
|
|
||||||
{
|
|
||||||
case GuideDirections.guideEast:
|
|
||||||
d = "e";
|
|
||||||
break;
|
|
||||||
case GuideDirections.guideNorth:
|
|
||||||
d = "n";
|
|
||||||
break;
|
|
||||||
case GuideDirections.guideSouth:
|
|
||||||
d = "s";
|
|
||||||
break;
|
|
||||||
case GuideDirections.guideWest:
|
|
||||||
d = "w";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_userNewerPulseGuiding && duration < 10000)
|
if (_userNewerPulseGuiding && duration < 10000)
|
||||||
{
|
{
|
||||||
|
string d = string.Empty;
|
||||||
|
switch (direction)
|
||||||
|
{
|
||||||
|
case GuideDirections.guideEast:
|
||||||
|
d = "e";
|
||||||
|
break;
|
||||||
|
case GuideDirections.guideNorth:
|
||||||
|
d = "n";
|
||||||
|
break;
|
||||||
|
case GuideDirections.guideSouth:
|
||||||
|
d = "s";
|
||||||
|
break;
|
||||||
|
case GuideDirections.guideWest:
|
||||||
|
d = "w";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
LogMessage("PulseGuide", "Using new pulse guiding technique");
|
LogMessage("PulseGuide", "Using new pulse guiding technique");
|
||||||
_sharedResourcesWrapper.SendBlind($":Mg{d}{duration:0000}#");
|
_sharedResourcesWrapper.SendBlind($"#:Mg{d}{duration:0000}#");
|
||||||
//:MgnDDDD#
|
//:MgnDDDD#
|
||||||
//:MgsDDDD#
|
//:MgsDDDD#
|
||||||
//:MgeDDDD#
|
//:MgeDDDD#
|
||||||
@@ -1402,33 +1450,35 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogMessage("PulseGuide", "Using old pulse guiding technique");
|
switch (direction)
|
||||||
_sharedResourcesWrapper.Lock(() =>
|
|
||||||
{
|
{
|
||||||
_sharedResourcesWrapper.SendBlind(":RG#"); //Make sure we are at guide rate
|
case GuideDirections.guideEast:
|
||||||
//:RG# Set Slew rate to Guiding Rate (slowest)
|
MoveAxis(TelescopeAxes.axisPrimary, 1);
|
||||||
//Returns: Nothing
|
_utilities.WaitForMilliseconds(duration);
|
||||||
_sharedResourcesWrapper.SendBlind($":M{d}#");
|
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
//:Me# Move Telescope East at current slew rate
|
break;
|
||||||
//Returns: Nothing
|
case GuideDirections.guideNorth:
|
||||||
//:Mn# Move Telescope North at current slew rate
|
MoveAxis(TelescopeAxes.axisSecondary, 1);
|
||||||
//Returns: Nothing
|
_utilities.WaitForMilliseconds(duration);
|
||||||
//:Ms# Move Telescope South at current slew rate
|
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
//Returns: Nothing
|
break;
|
||||||
//:Mw# Move Telescope West at current slew rate
|
case GuideDirections.guideSouth:
|
||||||
//Returns: Nothing
|
MoveAxis(TelescopeAxes.axisSecondary, -1);
|
||||||
_utilities.WaitForMilliseconds(duration);
|
_utilities.WaitForMilliseconds(duration);
|
||||||
_sharedResourcesWrapper.SendBlind($":Q{d}#");
|
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
//:Qe# Halt eastward Slews
|
break;
|
||||||
//Returns: Nothing
|
case GuideDirections.guideWest:
|
||||||
//:Qn# Halt northward Slews
|
MoveAxis(TelescopeAxes.axisPrimary, -1);
|
||||||
//Returns: Nothing
|
_utilities.WaitForMilliseconds(duration);
|
||||||
//:Qs# Halt southward Slews
|
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
//Returns: Nothing
|
break;
|
||||||
//:Qw# Halt westward Slews
|
}
|
||||||
//Returns: Nothing
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var coordinatesAfterMove = GetTelescopeRaAndDec();
|
||||||
|
|
||||||
|
LogMessage("PulseGuide", $"Complete Before RA: {_utilitiesExtra.HoursToHMS(coordinatesBeforeMove.RightAscension)} Dec:{_utilitiesExtra.DegreesToDMS(coordinatesBeforeMove.Declination)}");
|
||||||
|
LogMessage("PulseGuide", $"Complete Before RA: {_utilitiesExtra.HoursToHMS(coordinatesAfterMove.RightAscension)} Dec:{_utilitiesExtra.DegreesToDMS(coordinatesAfterMove.Declination)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public double RightAscension
|
public double RightAscension
|
||||||
@@ -1436,9 +1486,9 @@ namespace ASCOM.Meade.net
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
CheckConnected("RightAscension Get");
|
CheckConnected("RightAscension Get");
|
||||||
var result = _sharedResourcesWrapper.SendString(":GR#");
|
var result = _sharedResourcesWrapper.SendString("#:GR#");
|
||||||
//:GR# Get Telescope RA
|
//:GR# Get Telescope RA
|
||||||
//Returns: HH: MM.T# or HH:MM:SS#
|
//Returns: HH:MM.T# or HH:MM:SS#
|
||||||
//Depending which precision is set for the telescope
|
//Depending which precision is set for the telescope
|
||||||
|
|
||||||
double rightAscension = _utilities.HMSToHours(result);
|
double rightAscension = _utilities.HMSToHours(result);
|
||||||
@@ -1532,7 +1582,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
CheckConnected("SiteLatitude Get");
|
CheckConnected("SiteLatitude Get");
|
||||||
|
|
||||||
var latitude = _sharedResourcesWrapper.SendString(":Gt#");
|
var latitude = _sharedResourcesWrapper.SendString("#:Gt#");
|
||||||
//:Gt# Get Current Site Latitude
|
//:Gt# Get Current Site Latitude
|
||||||
//Returns: sDD* MM#
|
//Returns: sDD* MM#
|
||||||
//The latitude of the current site. Positive inplies North latitude.
|
//The latitude of the current site. Positive inplies North latitude.
|
||||||
@@ -1558,7 +1608,7 @@ namespace ASCOM.Meade.net
|
|||||||
var absValue = Math.Abs(value);
|
var absValue = Math.Abs(value);
|
||||||
int d = Convert.ToInt32(Math.Floor(absValue));
|
int d = Convert.ToInt32(Math.Floor(absValue));
|
||||||
int m = Convert.ToInt32(60 * (absValue - d));
|
int m = Convert.ToInt32(60 * (absValue - d));
|
||||||
var commandString = $":St{sign}{d:00}*{m:00}#";
|
var commandString = $"#:St{sign}{d:00}*{m:00}#";
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendChar(commandString);
|
var result = _sharedResourcesWrapper.SendChar(commandString);
|
||||||
//:StsDD*MM#
|
//:StsDD*MM#
|
||||||
@@ -1577,7 +1627,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
CheckConnected("SiteLongitude Get");
|
CheckConnected("SiteLongitude Get");
|
||||||
|
|
||||||
var longitude = _sharedResourcesWrapper.SendString(":Gg#");
|
var longitude = _sharedResourcesWrapper.SendString("#:Gg#");
|
||||||
//:Gg# Get Current Site Longitude
|
//:Gg# Get Current Site Longitude
|
||||||
//Returns: sDDD*MM#
|
//Returns: sDDD*MM#
|
||||||
//The current site Longitude. East Longitudes are expressed as negative
|
//The current site Longitude. East Longitudes are expressed as negative
|
||||||
@@ -1613,7 +1663,7 @@ namespace ASCOM.Meade.net
|
|||||||
int d = Convert.ToInt32(Math.Floor(newLongitude));
|
int d = Convert.ToInt32(Math.Floor(newLongitude));
|
||||||
int m = Convert.ToInt32(60 * (newLongitude - d));
|
int m = Convert.ToInt32(60 * (newLongitude - d));
|
||||||
|
|
||||||
var commandstring = $":Sg{d:000}*{m:00}#";
|
var commandstring = $"#:Sg{d:000}*{m:00}#";
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendChar(commandstring);
|
var result = _sharedResourcesWrapper.SendChar(commandstring);
|
||||||
//:SgDDD*MM#
|
//:SgDDD*MM#
|
||||||
@@ -1671,7 +1721,7 @@ namespace ASCOM.Meade.net
|
|||||||
// var dms = _utilities.DegreesToDMS(value, "*", "'", "",0);
|
// var dms = _utilities.DegreesToDMS(value, "*", "'", "",0);
|
||||||
// var s = value < 0 ? string.Empty : "+";
|
// var s = value < 0 ? string.Empty : "+";
|
||||||
|
|
||||||
// var result = _sharedResourcesWrapper.SendChar($":Sa{s}{dms}#");
|
// var result = _sharedResourcesWrapper.SendChar($"#:Sa{s}{dms}#");
|
||||||
// //:SasDD*MM#
|
// //:SasDD*MM#
|
||||||
// //Set target object altitude to sDD*MM# or sDD*MM’SS# [LX 16”, Autostar, Autostar II]
|
// //Set target object altitude to sDD*MM# or sDD*MM’SS# [LX 16”, Autostar, Autostar II]
|
||||||
// //Returns:
|
// //Returns:
|
||||||
@@ -1699,7 +1749,7 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
// var dms = _utilitiesExtra.DegreesToDM(value, "*" );
|
// var dms = _utilitiesExtra.DegreesToDM(value, "*" );
|
||||||
|
|
||||||
// var result = _sharedResourcesWrapper.SendChar($":Sz{dms}#");
|
// var result = _sharedResourcesWrapper.SendChar($"#:Sz{dms}#");
|
||||||
// //:SzDDD*MM#
|
// //:SzDDD*MM#
|
||||||
// //Sets the target Object Azimuth[LX 16” and Autostar II only]
|
// //Sets the target Object Azimuth[LX 16” and Autostar II only]
|
||||||
// //Returns:
|
// //Returns:
|
||||||
@@ -1761,7 +1811,7 @@ namespace ASCOM.Meade.net
|
|||||||
switch (polar)
|
switch (polar)
|
||||||
{
|
{
|
||||||
case true:
|
case true:
|
||||||
var response = _sharedResourcesWrapper.SendChar(":MS#");
|
var response = _sharedResourcesWrapper.SendChar("#:MS#");
|
||||||
//:MS# Slew to Target Object
|
//:MS# Slew to Target Object
|
||||||
//Returns:
|
//Returns:
|
||||||
//0 Slew is Possible
|
//0 Slew is Possible
|
||||||
@@ -1792,7 +1842,7 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case false:
|
case false:
|
||||||
var maResponse = _sharedResourcesWrapper.SendChar(":MA#");
|
var maResponse = _sharedResourcesWrapper.SendChar("#:MA#");
|
||||||
//:MA# Autostar, LX 16”, Autostar II – Slew to target Alt and Az
|
//:MA# Autostar, LX 16”, Autostar II – Slew to target Alt and Az
|
||||||
//Returns:
|
//Returns:
|
||||||
//0 - No fault
|
//0 - No fault
|
||||||
@@ -1857,7 +1907,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
CheckConnected("SlewToTargetAsync");
|
CheckConnected("SlewToTargetAsync");
|
||||||
|
|
||||||
if (TargetDeclination == InvalidParameter || TargetRightAscension == InvalidParameter)
|
if (TargetDeclination.Equals(InvalidParameter) || TargetRightAscension.Equals(InvalidParameter))
|
||||||
throw new InvalidOperationException("No target selected to slew to.");
|
throw new InvalidOperationException("No target selected to slew to.");
|
||||||
|
|
||||||
DoSlewAsync(true);
|
DoSlewAsync(true);
|
||||||
@@ -1880,7 +1930,7 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
CheckConnected("Slewing Get");
|
CheckConnected("Slewing Get");
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendString(":D#");
|
var result = _sharedResourcesWrapper.SendString("#:D#");
|
||||||
//:D# Requests a string of bars indicating the distance to the current target location.
|
//:D# Requests a string of bars indicating the distance to the current target location.
|
||||||
//Returns:
|
//Returns:
|
||||||
//LX200's – a string of bar characters indicating the distance.
|
//LX200's – a string of bar characters indicating the distance.
|
||||||
@@ -1923,7 +1973,7 @@ namespace ASCOM.Meade.net
|
|||||||
LogMessage("SyncToTarget", "Executing");
|
LogMessage("SyncToTarget", "Executing");
|
||||||
CheckConnected("SyncToTarget");
|
CheckConnected("SyncToTarget");
|
||||||
|
|
||||||
var result = _sharedResourcesWrapper.SendString(":CM#");
|
var result = _sharedResourcesWrapper.SendString("#:CM#");
|
||||||
//:CM# Synchronizes the telescope's position with the currently selected database object's coordinates.
|
//:CM# Synchronizes the telescope's position with the currently selected database object's coordinates.
|
||||||
//Returns:
|
//Returns:
|
||||||
//LX200's - a "#" terminated string with the name of the object that was synced.
|
//LX200's - a "#" terminated string with the name of the object that was synced.
|
||||||
@@ -1938,10 +1988,10 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_targetDeclination == InvalidParameter)
|
if (_targetDeclination.Equals(InvalidParameter))
|
||||||
throw new InvalidOperationException("Target not set");
|
throw new InvalidOperationException("Target not set");
|
||||||
|
|
||||||
//var result = SerialPort.CommandTerminated(":Gd#", "#");
|
//var result = SerialPort.CommandTerminated("#:Gd#", "#");
|
||||||
////:Gd# Get Currently Selected Object/Target Declination
|
////:Gd# Get Currently Selected Object/Target Declination
|
||||||
////Returns: sDD* MM# or sDD*MM’SS#
|
////Returns: sDD* MM# or sDD*MM’SS#
|
||||||
////Depending upon the current precision setting for the telescope.
|
////Depending upon the current precision setting for the telescope.
|
||||||
@@ -1969,7 +2019,7 @@ namespace ASCOM.Meade.net
|
|||||||
var dms = _utilities.DegreesToDMS(value, "*", ":", ":", 2);
|
var dms = _utilities.DegreesToDMS(value, "*", ":", ":", 2);
|
||||||
var s = value < 0 ? string.Empty : "+";
|
var s = value < 0 ? string.Empty : "+";
|
||||||
|
|
||||||
var command = $":Sd{s}{dms}#";
|
var command = $"#:Sd{s}{dms}#";
|
||||||
|
|
||||||
LogMessage("TargetDeclination Set", $"{command}");
|
LogMessage("TargetDeclination Set", $"{command}");
|
||||||
var result = _sharedResourcesWrapper.SendChar(command);
|
var result = _sharedResourcesWrapper.SendChar(command);
|
||||||
@@ -1993,10 +2043,10 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_targetRightAscension == InvalidParameter)
|
if (_targetRightAscension.Equals(InvalidParameter))
|
||||||
throw new InvalidOperationException("Target not set");
|
throw new InvalidOperationException("Target not set");
|
||||||
|
|
||||||
//var result = SerialPort.CommandTerminated(":Gr#", "#");
|
//var result = SerialPort.CommandTerminated("#:Gr#", "#");
|
||||||
////:Gr# Get current/target object RA
|
////:Gr# Get current/target object RA
|
||||||
////Returns: HH: MM.T# or HH:MM:SS
|
////Returns: HH: MM.T# or HH:MM:SS
|
||||||
////Depending upon which precision is set for the telescope
|
////Depending upon which precision is set for the telescope
|
||||||
@@ -2020,7 +2070,7 @@ namespace ASCOM.Meade.net
|
|||||||
//todo implement the low precision version
|
//todo implement the low precision version
|
||||||
|
|
||||||
var hms = _utilities.HoursToHMS(value, ":", ":", ":", 2);
|
var hms = _utilities.HoursToHMS(value, ":", ":", ":", 2);
|
||||||
var response = _sharedResourcesWrapper.SendChar($":Sr{hms}#");
|
var response = _sharedResourcesWrapper.SendChar($"#:Sr{hms}#");
|
||||||
//:SrHH:MM.T#
|
//:SrHH:MM.T#
|
||||||
//:SrHH:MM:SS#
|
//:SrHH:MM:SS#
|
||||||
//Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting.
|
//Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting.
|
||||||
@@ -2058,7 +2108,7 @@ namespace ASCOM.Meade.net
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
//todo implement this with the GW command
|
//todo implement this with the GW command
|
||||||
//var result = SerialPort.CommandTerminated(":GT#", "#");
|
//var result = SerialPort.CommandTerminated("#:GT#", "#");
|
||||||
|
|
||||||
//double rate = double.Parse(result);
|
//double rate = double.Parse(result);
|
||||||
|
|
||||||
@@ -2080,17 +2130,17 @@ namespace ASCOM.Meade.net
|
|||||||
switch (value)
|
switch (value)
|
||||||
{
|
{
|
||||||
case DriveRates.driveSidereal:
|
case DriveRates.driveSidereal:
|
||||||
_sharedResourcesWrapper.SendBlind(":TQ#");
|
_sharedResourcesWrapper.SendBlind("#:TQ#");
|
||||||
//:TQ# Selects sidereal tracking rate
|
//:TQ# Selects sidereal tracking rate
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
case DriveRates.driveLunar:
|
case DriveRates.driveLunar:
|
||||||
_sharedResourcesWrapper.SendBlind(":TL#");
|
_sharedResourcesWrapper.SendBlind("#:TL#");
|
||||||
//:TL# Set Lunar Tracking Rage
|
//:TL# Set Lunar Tracking Rage
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
//case DriveRates.driveSolar:
|
//case DriveRates.driveSolar:
|
||||||
// SerialPort.Command(":TS#");
|
// SerialPort.Command("#:TS#");
|
||||||
// //:TS# Select Solar tracking rate. [LS Only]
|
// //:TS# Select Solar tracking rate. [LS Only]
|
||||||
// //Returns: Nothing
|
// //Returns: Nothing
|
||||||
// break;
|
// break;
|
||||||
@@ -2122,7 +2172,7 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
private TimeSpan GetUtcCorrection()
|
private TimeSpan GetUtcCorrection()
|
||||||
{
|
{
|
||||||
string utcOffSet = _sharedResourcesWrapper.SendString(":GG#");
|
string utcOffSet = _sharedResourcesWrapper.SendString("#:GG#");
|
||||||
//:GG# Get UTC offset time
|
//:GG# Get UTC offset time
|
||||||
//Returns: sHH# or sHH.H#
|
//Returns: sHH# or sHH.H#
|
||||||
//The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the
|
//The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the
|
||||||
@@ -2151,11 +2201,11 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
var tdd = new TelescopeDateDetails
|
var tdd = new TelescopeDateDetails
|
||||||
{
|
{
|
||||||
TelescopeDate = _sharedResourcesWrapper.SendString(":GC#"),
|
TelescopeDate = _sharedResourcesWrapper.SendString("#:GC#"),
|
||||||
//:GC# Get current date.
|
//:GC# Get current date.
|
||||||
//Returns: MM/DD/YY#
|
//Returns: MM/DD/YY#
|
||||||
//The current local calendar date for the telescope.
|
//The current local calendar date for the telescope.
|
||||||
TelescopeTime = _sharedResourcesWrapper.SendString(":GL#"),
|
TelescopeTime = _sharedResourcesWrapper.SendString("#:GL#"),
|
||||||
//:GL# Get Local Time in 24 hour format
|
//:GL# Get Local Time in 24 hour format
|
||||||
//Returns: HH:MM:SS#
|
//Returns: HH:MM:SS#
|
||||||
//The Local Time in 24 - hour Format
|
//The Local Time in 24 - hour Format
|
||||||
@@ -2196,7 +2246,7 @@ namespace ASCOM.Meade.net
|
|||||||
var utcCorrection = GetUtcCorrection();
|
var utcCorrection = GetUtcCorrection();
|
||||||
var localDateTime = value - utcCorrection;
|
var localDateTime = value - utcCorrection;
|
||||||
|
|
||||||
string localStingCommand = $":SL{localDateTime:HH:mm:ss}#";
|
string localStingCommand = $"#:SL{localDateTime:HH:mm:ss}#";
|
||||||
var timeResult = _sharedResourcesWrapper.SendChar(localStingCommand);
|
var timeResult = _sharedResourcesWrapper.SendChar(localStingCommand);
|
||||||
//:SLHH:MM:SS#
|
//:SLHH:MM:SS#
|
||||||
//Set the local Time
|
//Set the local Time
|
||||||
@@ -2208,7 +2258,7 @@ namespace ASCOM.Meade.net
|
|||||||
throw new InvalidOperationException("Failed to set local time");
|
throw new InvalidOperationException("Failed to set local time");
|
||||||
}
|
}
|
||||||
|
|
||||||
string localDateCommand = $":SC{localDateTime:MM/dd/yy}#";
|
string localDateCommand = $"#:SC{localDateTime:MM/dd/yy}#";
|
||||||
var dateResult = _sharedResourcesWrapper.SendChar(localDateCommand);
|
var dateResult = _sharedResourcesWrapper.SendChar(localDateCommand);
|
||||||
//:SCMM/DD/YY#
|
//:SCMM/DD/YY#
|
||||||
//Change Handbox Date to MM/DD/YY
|
//Change Handbox Date to MM/DD/YY
|
||||||
@@ -2242,6 +2292,13 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
#region ASCOM Registration
|
#region ASCOM Registration
|
||||||
|
|
||||||
|
private static IProfileFactory _profileFactory;
|
||||||
|
public static IProfileFactory ProfileFactory
|
||||||
|
{
|
||||||
|
get => _profileFactory ?? (_profileFactory = new ProfileFactory());
|
||||||
|
set => _profileFactory = value;
|
||||||
|
}
|
||||||
|
|
||||||
// Register or unregister driver for ASCOM. This is harmless if already
|
// Register or unregister driver for ASCOM. This is harmless if already
|
||||||
// registered or unregistered.
|
// registered or unregistered.
|
||||||
//
|
//
|
||||||
@@ -2252,7 +2309,7 @@ namespace ASCOM.Meade.net
|
|||||||
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
|
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
|
||||||
private static void RegUnregAscom(bool bRegister)
|
private static void RegUnregAscom(bool bRegister)
|
||||||
{
|
{
|
||||||
using (var p = new Profile())
|
using (IProfileWrapper p = ProfileFactory.Create())
|
||||||
{
|
{
|
||||||
p.DeviceType = "Telescope";
|
p.DeviceType = "Telescope";
|
||||||
if (bRegister)
|
if (bRegister)
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<#
|
||||||
|
This script initializes a bare minimum set of registry entries required for ASCOM.Utilities.Profile to work
|
||||||
|
without throwing any exceptions. When building on a build server, or on a computer without the ASCOM Platform installed,
|
||||||
|
it may be useful to execute this script as a build step prior to running any unit tests, or calling any code that relies on
|
||||||
|
ASCOM.Utilities.Profile. The alternative is to install the ASCOM Platform on the build agent.
|
||||||
|
|
||||||
|
NOTE: This script equires elevated permissions because it creates registry keys in the LocalMachine hive.
|
||||||
|
#>
|
||||||
|
|
||||||
|
$wow = Test-Path HKLM:\SOFTWARE\Wow6432Node
|
||||||
|
if ($wow)
|
||||||
|
{
|
||||||
|
$root = "HKLM:\SOFTWARE\Wow6432Node"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$root = "HKLM:\SOFTWARE"
|
||||||
|
}
|
||||||
|
$ascomRoot = $root + "\ASCOM"
|
||||||
|
|
||||||
|
if (Test-Path $ascomRoot)
|
||||||
|
{
|
||||||
|
<# Don't upset an already-existing ASCOM registry #>
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
<# Create the ASCOM root key and set it's ACL to allow all users read/write access #>
|
||||||
|
New-Item -Path $root -Name ASCOM –Force
|
||||||
|
$ascomAcl = Get-Acl $ascomRoot
|
||||||
|
$aclRule = New-Object System.Security.AccessControl.RegistryAccessRule ("Users","FullControl","Allow")
|
||||||
|
$ascomAcl.SetAccessRule($aclRule)
|
||||||
|
$ascomAcl | Set-Acl -Path $ascomRoot
|
||||||
|
|
||||||
|
<# Now create the bare minimum keys required so that ASCOM.Utilities.Profile doesn't crash and burn #>
|
||||||
|
New-ItemProperty -Path $ascomRoot -Name PlatformVersion -Value "6.1" -PropertyType String –Force
|
||||||
|
New-ItemProperty -Path $ascomRoot -Name SerTraceFile -Value "C:\SerialTraceAuto.txt" -PropertyType String –Force
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Meade.net.UnitTests</RootNamespace>
|
||||||
|
<AssemblyName>Meade.net.UnitTests</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="SharedResourcesUnitTests.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
|
||||||
|
<Project>{3689a2cb-94c5-4012-a5cf-7e7d1dd27143}</Project>
|
||||||
|
<Name>Meade.net</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
|
<None Include="BootstrapAscomProfileStore.ps1" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Meade.net.UnitTests")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Meade.net.UnitTests")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("21ef28b4-d574-4a2d-a61d-5df96af46ab2")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using ASCOM.Meade.net;
|
||||||
|
using ASCOM.Meade.net.Wrapper;
|
||||||
|
using ASCOM.Utilities.Interfaces;
|
||||||
|
using Moq;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Meade.net.UnitTests
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class SharedResourcesUnitTests
|
||||||
|
{
|
||||||
|
private Mock<ISerial> _serialMock;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
_serialMock = new Mock<ISerial>();
|
||||||
|
_serialMock.SetupAllProperties();
|
||||||
|
|
||||||
|
SharedResources.SharedSerial = _serialMock.Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void CheckThatSerialPortIsSetToUseMock()
|
||||||
|
{
|
||||||
|
Assert.That(SharedResources.SharedSerial,Is.EqualTo(_serialMock.Object));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void SendBlind_WhenCalled_Then_ClearsBuffersAndSendsMessage()
|
||||||
|
{
|
||||||
|
var expectedMessage = "Test";
|
||||||
|
|
||||||
|
SharedResources.SendBlind(expectedMessage);
|
||||||
|
|
||||||
|
_serialMock.Verify(x=> x.ClearBuffers(), Times.Once);
|
||||||
|
_serialMock.Verify(x=>x.Transmit(expectedMessage), Times.Once);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void SendChar_WhenCalled_ThenSendsMessageAndReadsExpectedNumberOfCharacters()
|
||||||
|
{
|
||||||
|
var expectedMessage = "Test";
|
||||||
|
var expectedResult = "A";
|
||||||
|
|
||||||
|
_serialMock.Setup(x => x.ReceiveCounted(1)).Returns(expectedResult);
|
||||||
|
|
||||||
|
var result = SharedResources.SendChar(expectedMessage);
|
||||||
|
|
||||||
|
_serialMock.Verify(x => x.ClearBuffers(), Times.Once);
|
||||||
|
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once);
|
||||||
|
_serialMock.Verify(x => x.ReceiveCounted(1), Times.Once);
|
||||||
|
Assert.That(result, Is.EqualTo(expectedResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void SendString_WhenCalled_ThenSendsMessageAndReadsResultUntilTerminatorFound()
|
||||||
|
{
|
||||||
|
var expectedMessage = "Test";
|
||||||
|
var expectedResult = "TestMessage#";
|
||||||
|
|
||||||
|
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(expectedResult);
|
||||||
|
|
||||||
|
var result = SharedResources.SendString(expectedMessage);
|
||||||
|
|
||||||
|
_serialMock.Verify(x => x.ClearBuffers(), Times.Once);
|
||||||
|
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once);
|
||||||
|
_serialMock.Verify(x => x.ReceiveTerminated("#"), Times.Once);
|
||||||
|
Assert.That(result, Is.EqualTo(expectedResult.TrimEnd('#')));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ReadTerminated_WhenCalled_ThenReadsResultUntilTerminatorFound()
|
||||||
|
{
|
||||||
|
var expectedResult = "TestMessage#";
|
||||||
|
|
||||||
|
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(expectedResult);
|
||||||
|
|
||||||
|
var result = SharedResources.ReadTerminated();
|
||||||
|
|
||||||
|
_serialMock.Verify(x => x.ReceiveTerminated("#"), Times.Once);
|
||||||
|
Assert.That(result, Is.EqualTo(expectedResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ReadCharacters_WhenCalled_ThenReadsSpecificNumberOfCharacters()
|
||||||
|
{
|
||||||
|
var numberOfCharacters = 5;
|
||||||
|
|
||||||
|
SharedResources.ReadCharacters(numberOfCharacters);
|
||||||
|
|
||||||
|
_serialMock.Verify(x => x.ReceiveCounted(numberOfCharacters), Times.Once);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void WriteProfile_WhenCalled_WritesExpectedProfileSettings()
|
||||||
|
{
|
||||||
|
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||||
|
|
||||||
|
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||||
|
profileWrapperMock.SetupAllProperties();
|
||||||
|
|
||||||
|
IProfileWrapper profeWrapper = profileWrapperMock.Object;
|
||||||
|
|
||||||
|
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||||
|
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||||
|
|
||||||
|
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||||
|
|
||||||
|
var profileProperties = new ProfileProperties
|
||||||
|
{
|
||||||
|
TraceLogger = false,
|
||||||
|
ComPort = "TestComPort"
|
||||||
|
};
|
||||||
|
|
||||||
|
SharedResources.WriteProfile(profileProperties);
|
||||||
|
|
||||||
|
Assert.That(profeWrapper.DeviceType, Is.EqualTo("Telescope"));
|
||||||
|
profileWrapperMock.Verify( x => x.WriteValue(DriverId, "Trace Level", profileProperties.TraceLogger.ToString()), Times.Once);
|
||||||
|
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "COM Port", profileProperties.ComPort), Times.Once);
|
||||||
|
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Guide Rate Arc Seconds Per Second", profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.CurrentCulture)), Times.Once);
|
||||||
|
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Precision", profileProperties.Precision), Times.Once);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ReadProfile_WhenCalled_ReturnsExpectedDefaultValues()
|
||||||
|
{
|
||||||
|
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||||
|
|
||||||
|
string ComPortDefault = "COM1";
|
||||||
|
string TraceStateDefault = "false";
|
||||||
|
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||||
|
string PrecisionDefault = "Unchanged";
|
||||||
|
|
||||||
|
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||||
|
profileWrapperMock.SetupAllProperties();
|
||||||
|
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||||
|
.Returns(TraceStateDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
|
||||||
|
.Returns(ComPortDefault);
|
||||||
|
profileWrapperMock
|
||||||
|
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||||
|
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
|
||||||
|
.Returns(PrecisionDefault);
|
||||||
|
|
||||||
|
IProfileWrapper profeWrapper = profileWrapperMock.Object;
|
||||||
|
|
||||||
|
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||||
|
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||||
|
|
||||||
|
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||||
|
|
||||||
|
var profileProperties = SharedResources.ReadProfile();
|
||||||
|
|
||||||
|
Assert.That(profeWrapper.DeviceType, Is.EqualTo("Telescope"));
|
||||||
|
Assert.That(profileProperties.ComPort, Is.EqualTo(ComPortDefault));
|
||||||
|
Assert.That(profileProperties.GuideRateArcSecondsPerSecond,
|
||||||
|
Is.EqualTo(double.Parse(GuideRateProfileNameDefault)));
|
||||||
|
Assert.That(profileProperties.TraceLogger, Is.EqualTo(bool.Parse(TraceStateDefault)));
|
||||||
|
Assert.That(profileProperties.Precision, Is.EqualTo(PrecisionDefault));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase("TCP")]
|
||||||
|
[TestCase("Carrier Pigeon")]
|
||||||
|
public void Connect_WhenDeviceIdIsNotSerial_ThenThrowsException( string deviceId)
|
||||||
|
{
|
||||||
|
var result = Assert.Throws<ArgumentException>( () => { SharedResources.Connect(deviceId, string.Empty); } );
|
||||||
|
|
||||||
|
Assert.That( result.Message, Is.EqualTo($"deviceId {deviceId} not currently supported") );
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Connect_WhenDeviceIdIsSerialButGVPEchos_ThenThrowsException()
|
||||||
|
{
|
||||||
|
string deviceId = "Serial";
|
||||||
|
|
||||||
|
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||||
|
|
||||||
|
string ComPortDefault = "COM1";
|
||||||
|
string TraceStateDefault = "false";
|
||||||
|
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||||
|
string PrecisionDefault = "Unchanged";
|
||||||
|
|
||||||
|
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||||
|
profileWrapperMock.SetupAllProperties();
|
||||||
|
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||||
|
.Returns(TraceStateDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
|
||||||
|
.Returns(ComPortDefault);
|
||||||
|
profileWrapperMock
|
||||||
|
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||||
|
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
|
||||||
|
.Returns(PrecisionDefault);
|
||||||
|
|
||||||
|
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||||
|
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||||
|
|
||||||
|
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||||
|
|
||||||
|
string serialPortReturn = string.Empty;
|
||||||
|
|
||||||
|
_serialMock.Setup(x => x.Transmit(":GVP#")).Callback(() => { serialPortReturn = ":GVP#"; });
|
||||||
|
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns( () => serialPortReturn);
|
||||||
|
|
||||||
|
var result = Assert.Throws<Exception>(() => { SharedResources.Connect(deviceId, string.Empty); });
|
||||||
|
Assert.That(result.Message, Is.EqualTo("Serial port is looping back data, something is wrong with the hardware."));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Connect_WhenDeviceIdIsSerialButGVPNotSupported_ThenConnectsAndSetsProductToLX200Classic()
|
||||||
|
{
|
||||||
|
string deviceId = "Serial";
|
||||||
|
|
||||||
|
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||||
|
|
||||||
|
string ComPortDefault = "COM1";
|
||||||
|
string TraceStateDefault = "false";
|
||||||
|
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||||
|
string PrecisionDefault = "Unchanged";
|
||||||
|
|
||||||
|
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||||
|
profileWrapperMock.SetupAllProperties();
|
||||||
|
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||||
|
.Returns(TraceStateDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
|
||||||
|
.Returns(ComPortDefault);
|
||||||
|
profileWrapperMock
|
||||||
|
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||||
|
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
|
||||||
|
.Returns(PrecisionDefault);
|
||||||
|
|
||||||
|
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||||
|
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||||
|
|
||||||
|
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||||
|
|
||||||
|
_serialMock.Setup(x => x.Transmit(":GVP#")).Callback(() => { });
|
||||||
|
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => throw new Exception("Testerror"));
|
||||||
|
|
||||||
|
var connectionResult = SharedResources.Connect(deviceId, string.Empty);
|
||||||
|
|
||||||
|
Assert.That(connectionResult.SameDevice, Is.EqualTo(1));
|
||||||
|
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.LX200CLASSIC));
|
||||||
|
|
||||||
|
SharedResources.Disconnect(deviceId, String.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Connect_WhenDeviceIdIsSerialButGVPIsAutostar_ThenConnectsAndSetsProductToAutostarAndFirmware()
|
||||||
|
{
|
||||||
|
string deviceId = "Serial";
|
||||||
|
|
||||||
|
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||||
|
|
||||||
|
string ComPortDefault = "COM1";
|
||||||
|
string TraceStateDefault = "false";
|
||||||
|
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||||
|
string PrecisionDefault = "Unchanged";
|
||||||
|
|
||||||
|
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||||
|
profileWrapperMock.SetupAllProperties();
|
||||||
|
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||||
|
.Returns(TraceStateDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
|
||||||
|
.Returns(ComPortDefault);
|
||||||
|
profileWrapperMock
|
||||||
|
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||||
|
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||||
|
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
|
||||||
|
.Returns(PrecisionDefault);
|
||||||
|
|
||||||
|
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||||
|
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||||
|
|
||||||
|
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||||
|
|
||||||
|
string serialPortReturn = string.Empty;
|
||||||
|
|
||||||
|
_serialMock.Setup(x => x.Transmit(":GVP#")).Callback(() => { serialPortReturn = TelescopeList.Autostar497; });
|
||||||
|
_serialMock.Setup(x => x.Transmit(":GVN#")).Callback(() => { serialPortReturn = TelescopeList.Autostar497_43Eg; });
|
||||||
|
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => serialPortReturn);
|
||||||
|
|
||||||
|
var connectionResult = SharedResources.Connect(deviceId, string.Empty);
|
||||||
|
|
||||||
|
Assert.That(connectionResult.SameDevice, Is.EqualTo(1));
|
||||||
|
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.Autostar497));
|
||||||
|
Assert.That(SharedResources.FirmwareVersion, Is.EqualTo(TelescopeList.Autostar497_43Eg));
|
||||||
|
|
||||||
|
SharedResources.Disconnect(deviceId, String.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
||||||
|
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
||||||
|
<package id="Moq" version="4.13.0" targetFramework="net472" />
|
||||||
|
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
@@ -30,6 +30,7 @@ namespace ASCOM.Meade.net
|
|||||||
[ProgId("ASCOM.MeadeGeneric.focuser")]
|
[ProgId("ASCOM.MeadeGeneric.focuser")]
|
||||||
[ServedClassName("Meade Generic")]
|
[ServedClassName("Meade Generic")]
|
||||||
[ClassInterface(ClassInterfaceType.None)]
|
[ClassInterface(ClassInterfaceType.None)]
|
||||||
|
[ComVisible(true)]
|
||||||
public class Focuser : ReferenceCountedObjectBase, IFocuserV3
|
public class Focuser : ReferenceCountedObjectBase, IFocuserV3
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -365,7 +366,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
_sharedResourcesWrapper.Lock(() =>
|
_sharedResourcesWrapper.Lock(() =>
|
||||||
{
|
{
|
||||||
//_sharedResourcesWrapper.SendBlind(":FF#");
|
//_sharedResourcesWrapper.SendBlind("#:FF#");
|
||||||
//:FF# Set Focus speed to fastest setting
|
//:FF# Set Focus speed to fastest setting
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
|
|
||||||
@@ -382,7 +383,7 @@ namespace ASCOM.Meade.net
|
|||||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
Stopwatch stopwatch = Stopwatch.StartNew();
|
||||||
while (stopwatch.ElapsedMilliseconds < steps)
|
while (stopwatch.ElapsedMilliseconds < steps)
|
||||||
{
|
{
|
||||||
_sharedResourcesWrapper.SendBlind(directionOut ? ":F+#" : ":F-#");
|
_sharedResourcesWrapper.SendBlind(directionOut ? "#:F+#" : "#:F-#");
|
||||||
//:F+# Start Focuser moving inward (toward objective)
|
//:F+# Start Focuser moving inward (toward objective)
|
||||||
//Returns: None
|
//Returns: None
|
||||||
|
|
||||||
@@ -451,6 +452,13 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
#region ASCOM Registration
|
#region ASCOM Registration
|
||||||
|
|
||||||
|
private static IProfileFactory _profileFactory;
|
||||||
|
public static IProfileFactory ProfileFactory
|
||||||
|
{
|
||||||
|
get => _profileFactory ?? (_profileFactory = new ProfileFactory());
|
||||||
|
set => _profileFactory = value;
|
||||||
|
}
|
||||||
|
|
||||||
// Register or unregister driver for ASCOM. This is harmless if already
|
// Register or unregister driver for ASCOM. This is harmless if already
|
||||||
// registered or unregistered.
|
// registered or unregistered.
|
||||||
//
|
//
|
||||||
@@ -461,7 +469,7 @@ namespace ASCOM.Meade.net
|
|||||||
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
|
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
|
||||||
private static void RegUnregAscom(bool bRegister)
|
private static void RegUnregAscom(bool bRegister)
|
||||||
{
|
{
|
||||||
using (var p = new Profile())
|
using (IProfileWrapper p = ProfileFactory.Create())
|
||||||
{
|
{
|
||||||
p.DeviceType = "Focuser";
|
p.DeviceType = "Focuser";
|
||||||
if (bRegister)
|
if (bRegister)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<UpgradeBackupLocation>
|
<UpgradeBackupLocation>
|
||||||
</UpgradeBackupLocation>
|
</UpgradeBackupLocation>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
||||||
@@ -69,6 +69,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
<OutputPath>..\bin\Release\</OutputPath>
|
<OutputPath>..\bin\Release\</OutputPath>
|
||||||
@@ -78,6 +79,7 @@
|
|||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
|||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(true)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("4ad7a6d4-6d54-4a9a-bbf3-895353e318f8")]
|
[assembly: Guid("4ad7a6d4-6d54-4a9a-bbf3-895353e318f8")]
|
||||||
|
|||||||
+19
-25
@@ -8,16 +8,10 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System.CodeDom.Compiler;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace ASCOM.Meade.net.Properties {
|
namespace ASCOM.Meade.net.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -25,27 +19,27 @@ namespace ASCOM.Meade.net.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
[DebuggerNonUserCode()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[CompilerGenerated()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|
||||||
private static ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
@@ -56,8 +50,8 @@ namespace ASCOM.Meade.net.Properties {
|
|||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
@@ -69,20 +63,20 @@ namespace ASCOM.Meade.net.Properties {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static Bitmap ASCOM {
|
internal static System.Drawing.Bitmap ASCOM {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
||||||
return ((Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static Icon DefaultIcon {
|
internal static System.Drawing.Icon DefaultIcon {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
|
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
|
||||||
return ((Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-8
@@ -8,18 +8,14 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using System.CodeDom.Compiler;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace ASCOM.Meade.net.Properties {
|
namespace ASCOM.Meade.net.Properties {
|
||||||
|
|
||||||
|
|
||||||
[CompilerGenerated()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||||
internal sealed partial class Settings : ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
public static Settings Default {
|
public static Settings Default {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.Telescope.UnitTes
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.Focuser.UnitTests", "Meade.net.Focuser.UnitTests\Meade.net.Focuser.UnitTests.csproj", "{A3991FA7-23C3-405A-96F9-5AB03AC58F30}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.Focuser.UnitTests", "Meade.net.Focuser.UnitTests\Meade.net.Focuser.UnitTests.csproj", "{A3991FA7-23C3-405A-96F9-5AB03AC58F30}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.UnitTests", "Meade.net.UnitTests\Meade.net.UnitTests.csproj", "{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -137,6 +139,18 @@ Global
|
|||||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x64.Build.0 = Release|Any CPU
|
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x86.ActiveCfg = Release|Any CPU
|
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x86.Build.0 = Release|Any CPU
|
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -147,6 +161,7 @@ Global
|
|||||||
{AD4959DD-33D7-4C3F-8DB0-7361D8E74A95} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
{AD4959DD-33D7-4C3F-8DB0-7361D8E74A95} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||||
{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
{A3991FA7-23C3-405A-96F9-5AB03AC58F30} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||||
|
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {3C0509DC-C7F5-48DC-920D-DCFD9C879BD2}
|
SolutionGuid = {3C0509DC-C7F5-48DC-920D-DCFD9C879BD2}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
<Settings>
|
<Settings>
|
||||||
<AllowParallelTestExecution>True</AllowParallelTestExecution>
|
<AllowParallelTestExecution>True</AllowParallelTestExecution>
|
||||||
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
|
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
|
||||||
|
<MetricsExclusionList>
|
||||||
|
<Value>FocuserTestConsole\FocuserTestConsole.csproj</Value>
|
||||||
|
<Value>TelescopeTestConsole\TelescopeTestConsole.csproj</Value>
|
||||||
|
</MetricsExclusionList>
|
||||||
<SolutionConfigured>True</SolutionConfigured>
|
<SolutionConfigured>True</SolutionConfigured>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SolutionConfiguration>
|
</SolutionConfiguration>
|
||||||
@@ -11,6 +11,6 @@
|
|||||||
<ShowUnexecutedTestsMenuOption>true</ShowUnexecutedTestsMenuOption>
|
<ShowUnexecutedTestsMenuOption>true</ShowUnexecutedTestsMenuOption>
|
||||||
<ShowIgnoredTestsMenuOption>false</ShowIgnoredTestsMenuOption>
|
<ShowIgnoredTestsMenuOption>false</ShowIgnoredTestsMenuOption>
|
||||||
</TestsWindowMenuOptions>
|
</TestsWindowMenuOptions>
|
||||||
<TestsWindowSplitterDistance>451</TestsWindowSplitterDistance>
|
<TestsWindowSplitterDistance>544</TestsWindowSplitterDistance>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SolutionConfiguration>
|
</SolutionConfiguration>
|
||||||
@@ -2,7 +2,7 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
public class ConnectionInfo
|
public class ConnectionInfo
|
||||||
{
|
{
|
||||||
public int Connections { get; set; }
|
//public int Connections { get; set; }
|
||||||
public int SameDevice { get; set; }
|
public int SameDevice { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+14
-12
@@ -173,8 +173,10 @@ namespace ASCOM.Meade.net
|
|||||||
_sComObjectTypes = new ArrayList();
|
_sComObjectTypes = new ArrayList();
|
||||||
|
|
||||||
// put everything into one folder, the same as the server.
|
// put everything into one folder, the same as the server.
|
||||||
string assyPath = Assembly.GetEntryAssembly().Location;
|
string assyPath = Assembly.GetEntryAssembly()?.Location;
|
||||||
assyPath = Path.GetDirectoryName(assyPath);
|
assyPath = Path.GetDirectoryName(assyPath);
|
||||||
|
if (assyPath == null)
|
||||||
|
throw new System.InvalidOperationException();
|
||||||
|
|
||||||
DirectoryInfo d = new DirectoryInfo(assyPath);
|
DirectoryInfo d = new DirectoryInfo(assyPath);
|
||||||
foreach (FileInfo fi in d.GetFiles("*.dll"))
|
foreach (FileInfo fi in d.GetFiles("*.dll"))
|
||||||
@@ -295,9 +297,9 @@ namespace ASCOM.Meade.net
|
|||||||
//
|
//
|
||||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey("APPID\\" + _sAppId))
|
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey("APPID\\" + _sAppId))
|
||||||
{
|
{
|
||||||
key.SetValue(null, assyDescription);
|
key?.SetValue(null, assyDescription);
|
||||||
key.SetValue("AppID", _sAppId);
|
key?.SetValue("AppID", _sAppId);
|
||||||
key.SetValue("AuthenticationLevel", 1, RegistryValueKind.DWord);
|
key?.SetValue("AuthenticationLevel", 1, RegistryValueKind.DWord);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// HKCR\APPID\exename.ext
|
// HKCR\APPID\exename.ext
|
||||||
@@ -305,7 +307,7 @@ namespace ASCOM.Meade.net
|
|||||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(
|
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(
|
||||||
$"APPID\\{Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf('\\') + 1)}"))
|
$"APPID\\{Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf('\\') + 1)}"))
|
||||||
{
|
{
|
||||||
key.SetValue("AppID", _sAppId);
|
key?.SetValue("AppID", _sAppId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -333,20 +335,20 @@ namespace ASCOM.Meade.net
|
|||||||
|
|
||||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey($"CLSID\\{clsid}"))
|
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey($"CLSID\\{clsid}"))
|
||||||
{
|
{
|
||||||
key.SetValue(null, progid); // Could be assyTitle/Desc??, but .NET components show ProgId here
|
key?.SetValue(null, progid); // Could be assyTitle/Desc??, but .NET components show ProgId here
|
||||||
key.SetValue("AppId", _sAppId);
|
key?.SetValue("AppId", _sAppId);
|
||||||
using (RegistryKey key2 = key.CreateSubKey("Implemented Categories"))
|
using (RegistryKey key2 = key.CreateSubKey("Implemented Categories"))
|
||||||
{
|
{
|
||||||
key2.CreateSubKey("{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
|
key2?.CreateSubKey("{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
|
||||||
}
|
}
|
||||||
using (RegistryKey key2 = key.CreateSubKey("ProgId"))
|
using (RegistryKey key2 = key.CreateSubKey("ProgId"))
|
||||||
{
|
{
|
||||||
key2.SetValue(null, progid);
|
key2?.SetValue(null, progid);
|
||||||
}
|
}
|
||||||
key.CreateSubKey("Programmable");
|
key.CreateSubKey("Programmable");
|
||||||
using (RegistryKey key2 = key.CreateSubKey("LocalServer32"))
|
using (RegistryKey key2 = key.CreateSubKey("LocalServer32"))
|
||||||
{
|
{
|
||||||
key2.SetValue(null, Application.ExecutablePath);
|
key2?.SetValue(null, Application.ExecutablePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@@ -354,10 +356,10 @@ namespace ASCOM.Meade.net
|
|||||||
//
|
//
|
||||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(progid))
|
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(progid))
|
||||||
{
|
{
|
||||||
key.SetValue(null, assyTitle);
|
key?.SetValue(null, assyTitle);
|
||||||
using (RegistryKey key2 = key.CreateSubKey("CLSID"))
|
using (RegistryKey key2 = key.CreateSubKey("CLSID"))
|
||||||
{
|
{
|
||||||
key2.SetValue(null, clsid);
|
key2?.SetValue(null, clsid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
||||||
<AssemblyName>ASCOM.Meade.net.Server</AssemblyName>
|
<AssemblyName>ASCOM.Meade.net.Server</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>2.0</OldToolsVersion>
|
<OldToolsVersion>2.0</OldToolsVersion>
|
||||||
@@ -82,6 +82,7 @@
|
|||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||||
@@ -133,10 +134,12 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GarbageCollection.cs" />
|
<Compile Include="GarbageCollection.cs" />
|
||||||
<Compile Include="LocalServer.cs" />
|
<Compile Include="LocalServer.cs" />
|
||||||
|
<Compile Include="ProfileFactory.cs" />
|
||||||
<Compile Include="ProfileProperties.cs" />
|
<Compile Include="ProfileProperties.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="TelescopeList.cs" />
|
<Compile Include="TelescopeList.cs" />
|
||||||
<Compile Include="Win32Utilities.cs" />
|
<Compile Include="Win32Utilities.cs" />
|
||||||
|
<Compile Include="Wrapper\IProfileWrapper.cs" />
|
||||||
<Compile Include="Wrapper\SharedResourcesWrapper.cs" />
|
<Compile Include="Wrapper\SharedResourcesWrapper.cs" />
|
||||||
<EmbeddedResource Include="frmMain.resx">
|
<EmbeddedResource Include="frmMain.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using ASCOM.Meade.net.Wrapper;
|
||||||
|
|
||||||
|
namespace ASCOM.Meade.net
|
||||||
|
{
|
||||||
|
public interface IProfileFactory
|
||||||
|
{
|
||||||
|
IProfileWrapper Create();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProfileFactory : IProfileFactory
|
||||||
|
{
|
||||||
|
public IProfileWrapper Create()
|
||||||
|
{
|
||||||
|
return new ProfileWrapper();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ using System.ComponentModel;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO.Ports;
|
using System.IO.Ports;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using ASCOM.Meade.net.Properties;
|
using ASCOM.Meade.net.Properties;
|
||||||
@@ -54,8 +55,7 @@ namespace ASCOM.Meade.net
|
|||||||
chkTrace.Checked = profileProperties.TraceLogger;
|
chkTrace.Checked = profileProperties.TraceLogger;
|
||||||
// set the list of com ports to those that are currently available
|
// set the list of com ports to those that are currently available
|
||||||
comboBoxComPort.Items.Clear();
|
comboBoxComPort.Items.Clear();
|
||||||
comboBoxComPort.Items.AddRange(SerialPort
|
comboBoxComPort.Items.AddRange(SerialPort.GetPortNames().ToArray<object>()); // use System.IO because it's static
|
||||||
.GetPortNames()); // use System.IO because it's static
|
|
||||||
// select the current port if possible
|
// select the current port if possible
|
||||||
if (comboBoxComPort.Items.Contains(profileProperties.ComPort))
|
if (comboBoxComPort.Items.Contains(profileProperties.ComPort))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using ASCOM.Meade.net.Wrapper;
|
||||||
using ASCOM.Utilities;
|
using ASCOM.Utilities;
|
||||||
|
using ASCOM.Utilities.Interfaces;
|
||||||
|
|
||||||
namespace ASCOM.Meade.net
|
namespace ASCOM.Meade.net
|
||||||
{
|
{
|
||||||
@@ -36,7 +38,7 @@ namespace ASCOM.Meade.net
|
|||||||
private static readonly object LockObject = new object();
|
private static readonly object LockObject = new object();
|
||||||
|
|
||||||
// Shared serial port. This will allow multiple drivers to use one single serial port.
|
// Shared serial port. This will allow multiple drivers to use one single serial port.
|
||||||
private static Serial _sSharedSerial; // Shared serial port
|
private static ISerial _sSharedSerial; // Shared serial port
|
||||||
|
|
||||||
//
|
//
|
||||||
// Public access to shared resources
|
// Public access to shared resources
|
||||||
@@ -59,9 +61,19 @@ namespace ASCOM.Meade.net
|
|||||||
//
|
//
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shared serial port
|
/// Shared serial port. Do not directly access this method.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static Serial SharedSerial => _sSharedSerial ?? (_sSharedSerial = new Serial());
|
public static ISerial SharedSerial
|
||||||
|
{
|
||||||
|
get => _sSharedSerial ?? (_sSharedSerial = new Serial());
|
||||||
|
set => _sSharedSerial = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IProfileFactory ProfileFactory
|
||||||
|
{
|
||||||
|
get => _profileFactory ?? ( _profileFactory = new ProfileFactory());
|
||||||
|
set => _profileFactory = value;
|
||||||
|
}
|
||||||
|
|
||||||
public static void SendBlind(string message)
|
public static void SendBlind(string message)
|
||||||
{
|
{
|
||||||
@@ -127,17 +139,17 @@ namespace ASCOM.Meade.net
|
|||||||
private const string TraceStateProfileName = "Trace Level";
|
private const string TraceStateProfileName = "Trace Level";
|
||||||
private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second";
|
private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second";
|
||||||
private const string PrecisionProfileName = "Precision";
|
private const string PrecisionProfileName = "Precision";
|
||||||
|
|
||||||
public static void WriteProfile(ProfileProperties profileProperties)
|
public static void WriteProfile(ProfileProperties profileProperties)
|
||||||
{
|
{
|
||||||
lock (LockObject)
|
lock (LockObject)
|
||||||
{
|
{
|
||||||
using (Profile driverProfile = new Profile())
|
using (IProfileWrapper driverProfile = ProfileFactory.Create())
|
||||||
{
|
{
|
||||||
driverProfile.DeviceType = "Telescope";
|
driverProfile.DeviceType = "Telescope";
|
||||||
driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString());
|
driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString());
|
||||||
driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort);
|
driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort);
|
||||||
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.CurrentCulture));
|
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.InvariantCulture));
|
||||||
driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision);
|
driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,12 +165,12 @@ namespace ASCOM.Meade.net
|
|||||||
lock (LockObject)
|
lock (LockObject)
|
||||||
{
|
{
|
||||||
ProfileProperties profileProperties = new ProfileProperties();
|
ProfileProperties profileProperties = new ProfileProperties();
|
||||||
using (Profile driverProfile = new Profile())
|
using (IProfileWrapper driverProfile = ProfileFactory.Create())
|
||||||
{
|
{
|
||||||
driverProfile.DeviceType = "Telescope";
|
driverProfile.DeviceType = "Telescope";
|
||||||
profileProperties.ComPort = driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault);
|
profileProperties.ComPort = driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault);
|
||||||
profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault));
|
profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault));
|
||||||
profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault));
|
profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault), NumberFormatInfo.InvariantInfo);
|
||||||
profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault);
|
profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,6 +229,7 @@ namespace ASCOM.Meade.net
|
|||||||
private static readonly Dictionary<string, DeviceHardware> ConnectedDevices = new Dictionary<string, DeviceHardware>();
|
private static readonly Dictionary<string, DeviceHardware> ConnectedDevices = new Dictionary<string, DeviceHardware>();
|
||||||
|
|
||||||
private static readonly Dictionary<string, DeviceHardware> ConnectedDeviceIds = new Dictionary<string, DeviceHardware>();
|
private static readonly Dictionary<string, DeviceHardware> ConnectedDeviceIds = new Dictionary<string, DeviceHardware>();
|
||||||
|
private static IProfileFactory _profileFactory ;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -231,15 +244,13 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
if (!ConnectedDevices.ContainsKey(deviceId))
|
if (!ConnectedDevices.ContainsKey(deviceId))
|
||||||
ConnectedDevices.Add(deviceId, new DeviceHardware());
|
ConnectedDevices.Add(deviceId, new DeviceHardware());
|
||||||
ConnectedDevices[deviceId].Count++; // increment the value
|
|
||||||
|
|
||||||
if (!ConnectedDeviceIds.ContainsKey(driverId))
|
if (!ConnectedDeviceIds.ContainsKey(driverId))
|
||||||
ConnectedDeviceIds.Add(driverId, new DeviceHardware());
|
ConnectedDeviceIds.Add(driverId, new DeviceHardware());
|
||||||
ConnectedDeviceIds[driverId].Count++; // increment the value
|
|
||||||
|
|
||||||
if (deviceId == "Serial")
|
if (deviceId == "Serial")
|
||||||
{
|
{
|
||||||
if (ConnectedDevices[deviceId].Count == 1)
|
if (ConnectedDevices[deviceId].Count == 0)
|
||||||
{
|
{
|
||||||
var profileProperties = ReadProfile();
|
var profileProperties = ReadProfile();
|
||||||
SharedSerial.PortName = profileProperties.ComPort;
|
SharedSerial.PortName = profileProperties.ComPort;
|
||||||
@@ -252,14 +263,35 @@ namespace ASCOM.Meade.net
|
|||||||
SharedSerial.Handshake = SerialHandshake.None;
|
SharedSerial.Handshake = SerialHandshake.None;
|
||||||
SharedSerial.Connected = true;
|
SharedSerial.Connected = true;
|
||||||
|
|
||||||
ProductName = SendString(":GVP#");
|
try
|
||||||
FirmwareVersion = SendString(":GVN#");
|
{
|
||||||
|
ProductName = SendString(":GVP#");
|
||||||
|
FirmwareVersion = SendString(":GVN#");
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
ProductName = TelescopeList.LX200CLASSIC;
|
||||||
|
FirmwareVersion = "Unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ProductName == ":GVP")
|
||||||
|
{
|
||||||
|
//This means that the serial port is looping back what's been sent, something is very wrong.
|
||||||
|
SharedSerial.Connected = false;
|
||||||
|
|
||||||
|
throw new Exception("Serial port is looping back data, something is wrong with the hardware.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
throw new ArgumentException($"deviceId {deviceId} not currently supported");
|
||||||
|
|
||||||
|
ConnectedDevices[deviceId].Count++; // increment the value
|
||||||
|
ConnectedDeviceIds[driverId].Count++; // increment the value
|
||||||
|
|
||||||
return new ConnectionInfo
|
return new ConnectionInfo
|
||||||
{
|
{
|
||||||
Connections = ConnectedDevices[deviceId].Count,
|
//Connections = ConnectedDevices[deviceId].Count,
|
||||||
SameDevice = ConnectedDeviceIds[driverId].Count
|
SameDevice = ConnectedDeviceIds[driverId].Count
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#region LX200EMC
|
#region LX200EMC
|
||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public static readonly string LX200CLASSIC = ":GVP"; //GVP command is not supported!
|
public static readonly string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported!
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using ASCOM.Utilities;
|
||||||
|
using ASCOM.Utilities.Interfaces;
|
||||||
|
|
||||||
|
namespace ASCOM.Meade.net.Wrapper
|
||||||
|
{
|
||||||
|
public interface IProfileWrapper : IProfile, IProfileExtra, IDisposable
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ProfileWrapper : IProfileWrapper
|
||||||
|
{
|
||||||
|
private readonly Profile _profile = new Profile();
|
||||||
|
|
||||||
|
public ArrayList RegisteredDevices(string deviceType)
|
||||||
|
{
|
||||||
|
return _profile.RegisteredDevices(deviceType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsRegistered(string driverId)
|
||||||
|
{
|
||||||
|
return _profile.IsRegistered(driverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Register(string driverId, string descriptiveName)
|
||||||
|
{
|
||||||
|
_profile.Register(driverId, descriptiveName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Unregister(string driverId)
|
||||||
|
{
|
||||||
|
_profile.Unregister(driverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetValue(string driverId, string name, string subKey, string defaultValue)
|
||||||
|
{
|
||||||
|
return _profile.GetValue(driverId, name, subKey, defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteValue(string driverId, string name, string value, string subKey)
|
||||||
|
{
|
||||||
|
_profile.WriteValue(driverId, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList Values(string driverId, string subKey)
|
||||||
|
{
|
||||||
|
return _profile.Values(driverId, subKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteValue(string driverId, string name, string subKey)
|
||||||
|
{
|
||||||
|
_profile.DeleteValue(driverId, name, subKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateSubKey(string driverId, string subKey)
|
||||||
|
{
|
||||||
|
_profile.CreateSubKey(driverId, subKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList SubKeys(string driverId, string subKey)
|
||||||
|
{
|
||||||
|
return _profile.SubKeys(driverId, subKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteSubKey(string driverId, string subKey)
|
||||||
|
{
|
||||||
|
_profile.DeleteSubKey(driverId, subKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetProfileXML(string deviceId)
|
||||||
|
{
|
||||||
|
return _profile.GetProfileXML(deviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetProfileXML(string deviceId, string xml)
|
||||||
|
{
|
||||||
|
_profile.SetProfileXML(deviceId, xml);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string DeviceType
|
||||||
|
{
|
||||||
|
get => _profile.DeviceType;
|
||||||
|
set => _profile.DeviceType = value;
|
||||||
|
}
|
||||||
|
public ArrayList RegisteredDeviceTypes => _profile.RegisteredDeviceTypes;
|
||||||
|
|
||||||
|
public void MigrateProfile(string currentPlatformVersion)
|
||||||
|
{
|
||||||
|
_profile.MigrateProfile(currentPlatformVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteValue(string driverId, string name)
|
||||||
|
{
|
||||||
|
_profile.DeleteValue(driverId, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetValue(string driverId, string name)
|
||||||
|
{
|
||||||
|
return _profile.GetValue(driverId, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetValue(string driverId, string name, string subKey)
|
||||||
|
{
|
||||||
|
return _profile.GetValue(driverId, name, subKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList SubKeys(string driverId)
|
||||||
|
{
|
||||||
|
return _profile.SubKeys(driverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList Values(string driverId)
|
||||||
|
{
|
||||||
|
return _profile.Values(driverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteValue(string driverId, string name, string value)
|
||||||
|
{
|
||||||
|
_profile.WriteValue(driverId, name, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ASCOMProfile GetProfile(string driverId)
|
||||||
|
{
|
||||||
|
return _profile.GetProfile(driverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetProfile(string driverId, ASCOMProfile xmlProfileKey)
|
||||||
|
{
|
||||||
|
_profile.SetProfile(driverId, xmlProfileKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
_profile.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||||
|
|||||||
@@ -9,26 +9,29 @@
|
|||||||
#define UseChooser
|
#define UseChooser
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using ASCOM.DeviceInterface;
|
||||||
using ASCOM.DriverAccess;
|
using ASCOM.DriverAccess;
|
||||||
|
|
||||||
namespace ASCOM.Meade.net
|
namespace ASCOM.Meade.net
|
||||||
{
|
{
|
||||||
class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
public static void Main()
|
||||||
{
|
{
|
||||||
// Uncomment the code that's required
|
// Uncomment the code that's required
|
||||||
#if UseChooser
|
//#if UseChooser
|
||||||
// choose the device
|
// choose the device
|
||||||
string id = Telescope.Choose("ASCOM.MeadeGeneric.Telescope");
|
string id = Telescope.Choose("ASCOM.Meade.net.Telescope");
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
return;
|
return;
|
||||||
// create this device
|
// create this device
|
||||||
Telescope device = new Telescope(id);
|
Telescope device = new Telescope(id);
|
||||||
#else
|
//#else
|
||||||
// this can be replaced by this code, it avoids the chooser and creates the driver class directly.
|
// this can be replaced by this code, it avoids the chooser and creates the driver class directly.
|
||||||
ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
|
//ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
|
||||||
#endif
|
//#endif
|
||||||
// now run some tests, adding code to your driver so that the tests will pass.
|
// now run some tests, adding code to your driver so that the tests will pass.
|
||||||
// these first tests are common to all drivers.
|
// these first tests are common to all drivers.
|
||||||
|
|
||||||
@@ -50,9 +53,46 @@ namespace ASCOM.Meade.net
|
|||||||
//Console.WriteLine($"Ra {device.RightAscension}");
|
//Console.WriteLine($"Ra {device.RightAscension}");
|
||||||
//Console.WriteLine($"Dec {device.Declination}");
|
//Console.WriteLine($"Dec {device.Declination}");
|
||||||
|
|
||||||
Console.WriteLine($"Altitude {device.Altitude}");
|
//Console.WriteLine($"Altitude {device.Altitude}");
|
||||||
Console.WriteLine($"Azimuth {device.Azimuth}");
|
//Console.WriteLine($"Azimuth {device.Azimuth}");
|
||||||
|
|
||||||
|
var seconds = 10;
|
||||||
|
|
||||||
|
Console.WriteLine("Slewing tests 10 second in each direction");
|
||||||
|
Console.WriteLine("test 1");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, 4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
|
Console.WriteLine("test 2");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, -4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
|
|
||||||
|
Console.WriteLine("test 3");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, 4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
|
|
||||||
|
Console.WriteLine("test 4");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, -4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
|
Console.WriteLine("Slewing tests complete");
|
||||||
|
|
||||||
|
|
||||||
|
seconds = 120;
|
||||||
|
|
||||||
|
Console.WriteLine($"Guiding for {seconds} seconds!");
|
||||||
|
|
||||||
|
foreach( var direction in Enum.GetValues(typeof(GuideDirections)).Cast<GuideDirections>())
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{direction.ToString()}");
|
||||||
|
device.PulseGuide(direction, seconds* 1000);
|
||||||
|
}
|
||||||
|
Console.WriteLine("Guiding Finished");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
device.Connected = false;
|
device.Connected = false;
|
||||||
Console.WriteLine("Press Enter to finish");
|
Console.WriteLine("Press Enter to finish");
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
||||||
<AssemblyName>ASCOM.Meade.net.Test</AssemblyName>
|
<AssemblyName>ASCOM.Meade.net.Test</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
<TargetFrameworkProfile>
|
<TargetFrameworkProfile>
|
||||||
</TargetFrameworkProfile>
|
</TargetFrameworkProfile>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
|
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||||
|
|||||||
Reference in New Issue
Block a user