Compare commits

...

61 Commits

Author SHA1 Message Date
Olivier Balitch b63bbec629 Merged in feature/SupportMeadeLXD600 (pull request #54)
Initial support of LXD600 mount: no StarPatch, no long format, no park support for this mount.

Approved-by: Colin Dawson
2025-12-30 22:21:40 +00:00
ColinD a0d5eec267 code tidyup 2025-12-28 21:13:45 +00:00
Olivier Balitch c24b4c1161 Initial support of LXD600 mount: no StarPatch, no long format, no park support for this mount. 2025-09-27 11:46:00 +02:00
ColinD a89b1c8fa6 Added Nunit3 test adapter nuget package to the test projects to improve testing for people without NCrunch. 2025-09-19 18:32:16 +01:00
ColinD d1ed5558b2 Changes the code a little more 2025-02-18 14:45:12 +00:00
ColinD ea07c7b625 Fixed unit tests 2025-02-17 15:56:34 +00:00
ColinD 56642267b0 Altered the profile read exception handling a little. 2025-02-17 15:37:40 +00:00
ColinD ddd67b330a Adding NumberFormatInfo.InvariantInfo to integer convsions. 2025-02-05 16:26:14 +00:00
ColinD 0bc4980786 Merged in develop (pull request #52)
Develop
2025-01-08 16:21:12 +00:00
ColinD 8521b3e2d2 Added ability to override the 5 second serial timeout with your own value. 2025-01-08 16:13:46 +00:00
ColinD a81318f4b5 Adding error trap so that the display prompts can be bypassed if it doesn't work, will still try to set the date and time. 2025-01-07 15:49:51 +00:00
ColinD e7e216597a Changing the recieve timeout to 30 seconds, as a test 2025-01-01 17:19:34 +00:00
ColinD a04cc82a46 Merge branch 'master' into develop 2025-01-01 17:17:51 +00:00
ColinD 7a0ee85af6 Merged in develop (pull request #51)
Develop

* Added an extra test to Slewing so that if connected will check with the mount to see if it's actually slewing, which is should have been doing

* Added extra check to ensure that slewing is return true whilst executing one of the ascom slew commands.

* Tweaked the GetSlewing command hopefully this makes the logic function correctly.
Also upgraded the logging to expose whether it's an internal call or not.

* Another slight tweak to the GetSlewing internal call code.

* Fixed problem where the telescope area was in mm when it should be mm squared.  And the driver was incorrect by a factor of 1000.

* Adding more information to the tracelog for get slewing

* Tweaked the code so that the _forceInternal variable doesn't care about if the scope is connected or not.

* Modified the code again, so that the _forceSlewingCount is done last, so that it's at up to date as possible.
2025-01-01 12:10:00 +00:00
ColinD 056484bce9 Modified the code again, so that the _forceSlewingCount is done last, so that it's at up to date as possible. 2024-12-24 17:25:18 +00:00
ColinD 6aa19b869b Tweaked the code so that the _forceInternal variable doesn't care about if the scope is connected or not. 2024-12-24 17:00:03 +00:00
ColinD 431776cfdf Adding more information to the tracelog for get slewing 2024-12-15 21:45:19 +00:00
ColinD 0afb80bd70 Fixed problem where the telescope area was in mm when it should be mm squared. And the driver was incorrect by a factor of 1000. 2024-12-01 22:42:19 +00:00
ColinD 4ef80b448e Another slight tweak to the GetSlewing internal call code. 2024-11-30 18:18:16 +00:00
ColinD cd6e72eb0a Tweaked the GetSlewing command hopefully this makes the logic function correctly.
Also upgraded the logging to expose whether it's an internal call or not.
2024-11-27 22:12:27 +00:00
ColinD c2bc2cfc7e Added extra check to ensure that slewing is return true whilst executing one of the ascom slew commands. 2024-11-26 16:01:07 +00:00
ColinD 7554c1e213 Added an extra test to Slewing so that if connected will check with the mount to see if it's actually slewing, which is should have been doing 2024-11-18 20:21:10 +00:00
ColinD 372c98a22c Merged in develop (pull request #50)
Develop
2024-11-12 18:59:03 +00:00
ColinD 04c2f5e1bb Added unit testing to cover the LX200 not being able to park. 2024-11-12 18:52:03 +00:00
ColinD 5b050c45c6 Removing the attmpt to get the LX200 to park 2024-11-12 18:29:41 +00:00
ColinD 44c59d1a55 Removing these commands as I think they're causing issues. Warning the scope will continue to track in RA after the "Park" is completed. 2024-11-12 18:05:13 +00:00
ColinD bb9fca7e9a Changing the park Alt for the LX200 to 0. 2024-11-12 16:24:00 +00:00
ColinD a0878ce153 Finish LX200ClassicParkingPosition 2024-11-06 16:52:24 +00:00
ColinD 80899b8056 Fixed problem where the tracking rate was using the local culture to convert a string to a double. 2024-11-06 16:48:46 +00:00
ColinD 99b3bce71a Merged in develop (pull request #49)
Develop
2023-06-10 21:41:29 +00:00
ColinD 4c7a40a8e4 Added extra values to GW translation.
Also added extra log message that includes the hour angle when calculating the destination side of pier.
2023-02-22 22:14:38 +00:00
ColinD 003dbe059a . doing the trim of the trailing # after writing the log message.
. for LX800 scopes, trying to use a send string instead of send chars for GW command.
2023-02-18 22:50:57 +00:00
ColinD c673e0c7d6 . doing the trim of the trailing # after writing the log message.
. for LX800 scopes, trying to use a send string instead of send chars for GW command.
2023-02-18 22:37:47 +00:00
ColinD 34dfa9276e Merged in develop (pull request #48)
Develop
2023-01-02 09:37:38 +00:00
ColinD 5678285e0e Added unit test to make sure that the LX200GPS with german firmware works as expected. 2023-01-02 09:31:05 +00:00
ColinD b263d5f3e2 Removed wrong test. 2023-01-01 22:37:22 +00:00
ColinD 4be35eb5d7 Added unit test for LX200GPS with german firmware 2023-01-01 22:31:23 +00:00
ColinD 4b78d8fb4f Added code to check for LX200GPS firmware version 4G0m which does not support the GW command. 2022-12-31 22:03:39 +00:00
ColinD 466d995873 Upgraded max steps to 30000 to allow for much much longer moves. 2022-11-26 17:10:46 +00:00
ColinD 1ce2afe9ce Trying the Ack command instead to see if this can workaround the CM bug. 2022-11-24 15:21:32 +00:00
ColinD d5108cf4db Adding a possible workaround to the Autostart not syncing problem 2022-11-23 16:06:38 +00:00
ColinD 888ab1aa46 Added LX800 series to scope as an autostar II based telescope. 2022-11-12 20:50:48 +00:00
ColinD 21d1d93235 Another attempt at the Dec value 2022-11-12 19:16:41 +00:00
ColinD 005643a7c7 Corrected all unit test setups. 2022-11-12 17:35:33 +00:00
ColinD 8539308cf3 oops 2022-11-12 17:34:24 +00:00
ColinD cd304f5955 Let's see what this does 2022-11-12 17:28:25 +00:00
ColinD da1d1baa30 Another tweak for the low preceion code. 2022-11-12 16:54:12 +00:00
ColinD a2b15f291d Needed to change one more thing 2022-11-12 15:47:35 +00:00
ColinD c380016b71 Changes the low precision target so that it's using seconds, instead of a fraction of a minute for the seconds portion of the coordinates. 2022-11-12 15:33:49 +00:00
ColinD febf52738e Set the path to open the logs folder properly 2022-11-10 20:31:30 +00:00
ColinD 7afa7458c7 Added comments for unit testing 2022-11-10 18:05:39 +00:00
ColinD 3ffa9fbe8b Nuget package updates 2022-11-10 17:57:45 +00:00
ColinD 6db59eaef1 Corrected Typo in name 2022-11-10 17:57:21 +00:00
ColinD cfa7e1d1cf Adding a catch so that when setting the precision, if one mode fails, try the other. 2022-11-10 16:53:27 +00:00
ColinD 129fc23d83 Added an attempt to use the short format to set the TargetRightAscension if the long format fails. 2022-11-10 15:30:16 +00:00
ColinD 5c3bb7d4ad Modified unit tests for force a pass. 2022-11-10 14:58:12 +00:00
ColinD e93da73431 Tried trimming a traingin : if it exists, that should not be part of the command sent to the scope. 2022-11-10 14:43:41 +00:00
ColinD 1e5bb04817 Added attempt to set the TargetRightAscension using the other format if one fails. 2022-11-10 14:34:10 +00:00
ColinD afd1c96671 Merged in develop (pull request #47)
Develop
2022-09-27 13:18:39 +00:00
ColinD e851fd0e01 Adding support for Audiostar to be returned as a Synonym of Autostar for GW detection. 2022-09-25 17:04:24 +01:00
ColinD fa7106a1b4 Adding extra tests to ensure that GetTracking is working correctly for the AudoStar 2022-09-20 12:47:24 +01:00
37 changed files with 1851 additions and 724 deletions
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
+77 -12
View File
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.13.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" /> <Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" />
<Import Project="..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props" Condition="Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" />
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -53,24 +57,75 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath> <HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="Moq, Version=4.15.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> <Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.15.2\lib\net45\Moq.dll</HintPath> <HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.13.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.MSBuild.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.Telemetry, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.TrxReport.Abstractions, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.TrxReport.Abstractions.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.TrxReport.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.VSTestBridge, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.VSTestBridge.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.VSTestBridge.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Platform, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Platform.1.7.3\lib\netstandard2.0\Microsoft.Testing.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.AdapterUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.AdapterUtilities.17.13.0\lib\net462\Microsoft.TestPlatform.AdapterUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.PlatformAbstractions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.18.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.18.2\lib\net462\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<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.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
@@ -104,6 +159,16 @@
<PropertyGroup> <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> <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> </PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.0\build\NUnit.props'))" /> <Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets'))" />
</Target> </Target>
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" />
<Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" />
</Project> </Project>
+1 -1
View File
@@ -8,7 +8,7 @@
</dependentAssembly> </dependentAssembly>
<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-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
+20 -5
View File
@@ -1,9 +1,24 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Castle.Core" version="4.4.1" targetFramework="net472" /> <package id="Castle.Core" version="5.1.0" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
<package id="Moq" version="4.15.2" targetFramework="net472" /> <package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
<package id="NUnit" version="3.13.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.TrxReport.Abstractions" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Extensions.VSTestBridge" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform.MSBuild" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.TestPlatform.AdapterUtilities" version="17.13.0" targetFramework="net472" />
<package id="Microsoft.TestPlatform.ObjectModel" version="17.13.0" targetFramework="net472" />
<package id="Moq" version="4.18.2" targetFramework="net472" />
<package id="NUnit" version="3.13.3" targetFramework="net472" />
<package id="NUnit3TestAdapter" version="5.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="5.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="7.0.0-preview.2.22152.2" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>
+2 -2
View File
@@ -59,8 +59,8 @@
<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" />
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" /> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net45" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net48" />
</packages> </packages>
@@ -364,7 +364,7 @@ namespace Meade.net.Focuser.UnitTests
{ {
var result = _focuser.MaxIncrement; var result = _focuser.MaxIncrement;
Assert.That(result, Is.EqualTo(7000)); Assert.That(result, Is.EqualTo(30000));
} }
[Test] [Test]
@@ -372,7 +372,7 @@ namespace Meade.net.Focuser.UnitTests
{ {
var result = _focuser.MaxStep; var result = _focuser.MaxStep;
Assert.That(result, Is.EqualTo(7000)); Assert.That(result, Is.EqualTo(30000));
} }
[Test] [Test]
@@ -382,8 +382,8 @@ namespace Meade.net.Focuser.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: Move")); Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: Move"));
} }
[TestCase(-7001)] [TestCase(-30001)]
[TestCase(7001)] [TestCase(300001)]
public void Move_WhenLargerThanMaxIncrement_ThenThrowsException(int position) public void Move_WhenLargerThanMaxIncrement_ThenThrowsException(int position)
{ {
ConnectFocuser(); ConnectFocuser();
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.13.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" /> <Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" />
<Import Project="..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props" Condition="Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" />
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -36,56 +40,107 @@
</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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
</Reference> </Reference>
<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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
</Reference> </Reference>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath> <HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="Moq, Version=4.15.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> <Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.15.2\lib\net45\Moq.dll</HintPath> <HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.13.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.MSBuild.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.Telemetry, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.TrxReport.Abstractions, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.TrxReport.Abstractions.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.TrxReport.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.VSTestBridge, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.VSTestBridge.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.VSTestBridge.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Platform, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Platform.1.7.3\lib\netstandard2.0\Microsoft.Testing.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.AdapterUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.AdapterUtilities.17.13.0\lib\net462\Microsoft.TestPlatform.AdapterUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.PlatformAbstractions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.18.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.18.2\lib\net462\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<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.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
@@ -102,7 +157,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="BootstrapAscomProfileStore.ps1" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -120,6 +174,16 @@
<PropertyGroup> <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> <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> </PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.0\build\NUnit.props'))" /> <Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets'))" />
</Target> </Target>
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" />
<Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" />
</Project> </Project>
+1 -1
View File
@@ -8,7 +8,7 @@
</dependentAssembly> </dependentAssembly>
<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-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
+21 -6
View File
@@ -1,10 +1,25 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ASCOM.Platform" version="6.5.1" targetFramework="net472" /> <package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
<package id="Castle.Core" version="4.4.1" targetFramework="net472" /> <package id="Castle.Core" version="5.1.0" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
<package id="Moq" version="4.15.2" targetFramework="net472" /> <package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
<package id="NUnit" version="3.13.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.TrxReport.Abstractions" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Extensions.VSTestBridge" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform.MSBuild" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.TestPlatform.AdapterUtilities" version="17.13.0" targetFramework="net472" />
<package id="Microsoft.TestPlatform.ObjectModel" version="17.13.0" targetFramework="net472" />
<package id="Moq" version="4.18.2" targetFramework="net472" />
<package id="NUnit" version="3.13.3" targetFramework="net472" />
<package id="NUnit3TestAdapter" version="5.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="5.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="7.0.0-preview.2.22152.2" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.13.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" /> <Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" />
<Import Project="..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props" Condition="Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" />
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -57,56 +61,108 @@
</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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
</Reference> </Reference>
<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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
</Reference> </Reference>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath> <HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="Moq, Version=4.15.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> <Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.15.2\lib\net45\Moq.dll</HintPath> <HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.13.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.MSBuild.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.Telemetry, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.TrxReport.Abstractions, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.TrxReport.Abstractions.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.TrxReport.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.VSTestBridge, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.VSTestBridge.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.VSTestBridge.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Platform, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Platform.1.7.3\lib\netstandard2.0\Microsoft.Testing.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.AdapterUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.AdapterUtilities.17.13.0\lib\net462\Microsoft.TestPlatform.AdapterUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.PlatformAbstractions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.18.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.18.2\lib\net462\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<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.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
@@ -132,7 +188,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="BootstrapAscomProfileStore.ps1" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -140,6 +195,16 @@
<PropertyGroup> <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> <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> </PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.0\build\NUnit.props'))" /> <Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets'))" />
</Target> </Target>
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" />
<Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" />
</Project> </Project>
@@ -1,5 +1,7 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.Reflection; using System.Reflection;
using ASCOM; using ASCOM;
using ASCOM.Astrometry.AstroUtils; using ASCOM.Astrometry.AstroUtils;
@@ -18,20 +20,20 @@ namespace Meade.net.Telescope.UnitTests
public class TestProperties public class TestProperties
{ {
public string AlignmentMode { get; internal set; } = "P"; public string AlignmentMode { get; internal set; } = "P";
internal string telescopeRaResult { get; set; } = "HH:MM:SS"; internal string TelescopeRaResult { get; set; } = "HH:MM:SS";
internal double rightAscension { get; set; } = 1.2; //todo rename to declination; internal double RightAscension { get; set; } = 1.2; //todo rename to declination;
internal double declination { get; set; } = 45; internal double Declination { get; set; } = 45;
internal string SiteLatitudeString { get; set; } = "testLatString"; internal string SiteLatitudeString { get; set; } = "testLatString";
internal double SiteLatitudeValue { get; set; } = 12.45; internal double SiteLatitudeValue { get; set; } = 12.45;
internal string telescopeDate { get; set; } = "10/15/20"; internal string TelescopeDate { get; set; } = "10/15/20";
internal string telescopeTime { get; set; } = "20:15:10"; internal string TelescopeTime { get; set; } = "20:15:10";
internal string telescopeUtcCorrection { get; set; } = "-1.0"; internal string TelescopeUtcCorrection { get; set; } = "-1.0";
internal double hourAngle { get; set; } internal double HourAngle { get; set; }
internal int telescopeAltitude { get; set; } = 45; internal int TelescopeAltitude { get; set; } = 45;
internal int telescopeAzimuth { get; set; } = 200; internal int TelescopeAzimuth { get; set; } = 200;
internal char[] AlignmentStatus { get; set; } internal char[] AlignmentStatus { get; set; }
internal string TrackingRate { get; set; } internal string TrackingRate { get; set; }
@@ -58,7 +60,6 @@ namespace Meade.net.Telescope.UnitTests
private bool _isParked; private bool _isParked;
private ParkedPosition _parkedPosition; private ParkedPosition _parkedPosition;
private string _siderealTrackingRate; private string _siderealTrackingRate;
private bool _restartTracking;
[SetUp] [SetUp]
public void Setup() public void Setup()
@@ -138,12 +139,12 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "Gt", false)).Returns( () => _testProperties.SiteLatitudeString); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "Gt", false)).Returns( () => _testProperties.SiteLatitudeString);
_utilMock.Setup(x => x.DMSToDegrees(_testProperties.SiteLatitudeString)).Returns( () => _testProperties.SiteLatitudeValue); _utilMock.Setup(x => x.DMSToDegrees(_testProperties.SiteLatitudeString)).Returns( () => _testProperties.SiteLatitudeValue);
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns( () =>_testProperties.telescopeRaResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns( () =>_testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.HMSToHours(_testProperties.telescopeRaResult)).Returns( () => _testProperties.rightAscension); _utilMock.Setup(x => x.HMSToHours(_testProperties.TelescopeRaResult)).Returns( () => _testProperties.RightAscension);
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GC", false)).Returns(() => _testProperties.telescopeDate); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GC", false)).Returns(() => _testProperties.TelescopeDate);
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GL", false)).Returns(() => _testProperties.telescopeTime); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GL", false)).Returns(() => _testProperties.TelescopeTime);
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns(() => _testProperties.telescopeUtcCorrection); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns(() => _testProperties.TelescopeUtcCorrection);
_testProperties.TrackingRate = _siderealTrackingRate; _testProperties.TrackingRate = _siderealTrackingRate;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GT", false)).Returns(() => _testProperties.TrackingRate); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GT", false)).Returns(() => _testProperties.TrackingRate);
@@ -156,7 +157,6 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SetParked(It.IsAny<bool>(), It.IsAny<ParkedPosition>(), It.IsAny<bool>())).Callback<bool,ParkedPosition,bool>((isParked, parkedPostion, restartTracking) => { _sharedResourcesWrapperMock.Setup(x => x.SetParked(It.IsAny<bool>(), It.IsAny<ParkedPosition>(), It.IsAny<bool>())).Callback<bool,ParkedPosition,bool>((isParked, parkedPostion, restartTracking) => {
_isParked = isParked; _isParked = isParked;
_parkedPosition = parkedPostion; _parkedPosition = parkedPostion;
_restartTracking = restartTracking;
}); });
const char ack = (char)6; const char ack = (char)6;
@@ -169,11 +169,11 @@ namespace Meade.net.Telescope.UnitTests
_astroMathsMock _astroMathsMock
.Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(), .Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(),
It.IsAny<HorizonCoordinates>())).Returns(() => new EquatorialCoordinates { Declination = _testProperties.declination, RightAscension = _testProperties.rightAscension }); It.IsAny<HorizonCoordinates>())).Returns(() => new EquatorialCoordinates { Declination = _testProperties.Declination, RightAscension = _testProperties.RightAscension });
_astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(() =>_testProperties.hourAngle); _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(() =>_testProperties.HourAngle);
_astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.hourAngle, It.IsAny<double>(), It.IsAny<EquatorialCoordinates>())).Returns(new HorizonCoordinates { Altitude = _testProperties.telescopeAltitude, Azimuth = _testProperties.telescopeAzimuth }); _astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.HourAngle, It.IsAny<double>(), It.IsAny<EquatorialCoordinates>())).Returns(new HorizonCoordinates { Altitude = _testProperties.TelescopeAltitude, Azimuth = _testProperties.TelescopeAzimuth });
_telescope.Connected = true; _telescope.Connected = true;
} }
@@ -502,7 +502,7 @@ namespace Meade.net.Telescope.UnitTests
public void Connected_WhenConnectingLX200GPSAndSendDateTimeIsTrue_Then_SpecialStartupInstructionSendOnFirstConnect() public void Connected_WhenConnectingLX200GPSAndSendDateTimeIsTrue_Then_SpecialStartupInstructionSendOnFirstConnect()
{ {
_profileProperties.SendDateTime = true; _profileProperties.SendDateTime = true;
_testProperties.telescopeUtcCorrection = "0"; _testProperties.TelescopeUtcCorrection = "0";
DateTime testNow = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); DateTime testNow = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
_clockMock.Setup(x => x.UtcNow).Returns(() => testNow); _clockMock.Setup(x => x.UtcNow).Returns(() => testNow);
@@ -525,7 +525,7 @@ namespace Meade.net.Telescope.UnitTests
string telescopeTime = "20:36:25"; string telescopeTime = "20:36:25";
string telescopeDate = "10/03/21"; string telescopeDate = "10/03/21";
_testProperties.telescopeUtcCorrection = "0"; _testProperties.TelescopeUtcCorrection = "0";
DateTime endSlewingDatetime = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); DateTime endSlewingDatetime = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
_clockMock.Setup(x => x.UtcNow).Returns(() => endSlewingDatetime); _clockMock.Setup(x => x.UtcNow).Returns(() => endSlewingDatetime);
@@ -551,7 +551,7 @@ namespace Meade.net.Telescope.UnitTests
string telescopeTime = "20:36:25"; string telescopeTime = "20:36:25";
string telescopeDate = "10/03/21"; string telescopeDate = "10/03/21";
_testProperties.telescopeUtcCorrection = "0"; _testProperties.TelescopeUtcCorrection = "0";
DateTime endSlewingDatetime = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); DateTime endSlewingDatetime = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
_clockMock.Setup(x => x.UtcNow).Returns(() => _clockMock.Setup(x => x.UtcNow).Returns(() =>
@@ -793,12 +793,12 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Get")); Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Get"));
} }
[TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)] [TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)]
[TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)] [TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)]
[TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
[TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
[TestCase("G", AlignmentModes.algGermanPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("G", AlignmentModes.algGermanPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
[TestCase("P", AlignmentModes.algPolar, TelescopeList.LX200GPS, TelescopeList.LX200GPS_4G0M)]
public void AlignmentMode_Get_WhenScopeInAltAz_ReturnsAltAz(string telescopeMode, AlignmentModes alignmentMode, string productName, string firmware) public void AlignmentMode_Get_WhenScopeInAltAz_ReturnsAltAz(string telescopeMode, AlignmentModes alignmentMode, string productName, string firmware)
{ {
_testProperties.AlignmentMode = telescopeMode; _testProperties.AlignmentMode = telescopeMode;
@@ -845,9 +845,11 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void ApertureArea_Get_ReturnsExpectedResult() public void ApertureArea_Get_ReturnsExpectedResult()
{ {
_profileProperties.ApertureArea = 130674;
var result = _telescope.ApertureArea; var result = _telescope.ApertureArea;
Assert.That(result, Is.EqualTo(_profileProperties.ApertureArea / 1000)); Assert.That(result, Is.EqualTo(_profileProperties.ApertureArea / (1000*1000)));
} }
[Test] [Test]
@@ -913,12 +915,15 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.EqualTo(expected)); Assert.That(result, Is.EqualTo(expected));
} }
[Test] [TestCase("Autostar", "43Eg", true)]
public void CanPark_Get_ReturnsTrue() [TestCase("LX200 Classic", "", false)]
[TestCase("LXD600", TelescopeList.LXD600_6_12S, false)]
public void CanPark_Get_ReturnsTrue(string productName, string firmware, bool canPark)
{ {
ConnectTelescope(productName, firmware, $"{_testProperties.AlignmentMode}N0");
var result = _telescope.CanPark; var result = _telescope.CanPark;
Assert.That(result, Is.True); Assert.That(result, Is.EqualTo(canPark));
} }
[TestCase("Autostar", "43Eg")] [TestCase("Autostar", "43Eg")]
@@ -1024,8 +1029,8 @@ namespace Meade.net.Telescope.UnitTests
? false ? false
: throw new ArgumentOutOfRangeException(nameof(desiredPresision), desiredPresision, "Should be High or Low")); : throw new ArgumentOutOfRangeException(nameof(desiredPresision), desiredPresision, "Should be High or Low"));
_sharedResourcesWrapperMock.SetupProperty(x => x.IsLongFormat, isLongFormat); _sharedResourcesWrapperMock.SetupProperty(x => x.IsLongFormat, isLongFormat);
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns(() => _testProperties.telescopeRaResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns(() => _testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.HMSToHours(_testProperties.telescopeRaResult)).Returns(() => _testProperties.rightAscension); _utilMock.Setup(x => x.HMSToHours(_testProperties.TelescopeRaResult)).Returns(() => _testProperties.RightAscension);
_profileProperties.Precision = desiredPresision; _profileProperties.Precision = desiredPresision;
@@ -1040,11 +1045,12 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void IsLongFormat_WhenHighPrecisionNotSupportedAndSecondConnectionMade_ThenDigitPrecisionValuesArePreserved() public void IsLongFormat_WhenHighPrecisionNotSupportedAndSecondConnectionMade_ThenDigitPrecisionValuesArePreserved()
{ {
var ra = 12d; double ra = 12;
var dec = 34d; double dec = 34;
_utilMock.Setup(x => x.HoursToHM(ra, ":", "", 1)).Returns(ra + "HM"); _utilMock.Setup(x => x.HoursToHMS(ra, ":", ".", "", 0)).Returns(ra + "HM");
_utilMock.Setup(x => x.DegreesToDM(dec, "*", "", 0)).Returns(dec + "DM"); _utilMock.Setup(x => x.DegreesToDMS(dec, "*", ".", "", 0)).Returns(dec + "DM");
_utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination);
ConnectTelescope(TelescopeList.LX200CLASSIC); ConnectTelescope(TelescopeList.LX200CLASSIC);
@@ -1065,8 +1071,8 @@ namespace Meade.net.Telescope.UnitTests
secondTelescopeInstance.TargetRightAscension = ra; secondTelescopeInstance.TargetRightAscension = ra;
secondTelescopeInstance.TargetDeclination = dec; secondTelescopeInstance.TargetDeclination = dec;
_utilMock.Verify(x => x.HoursToHM(ra, ":", "", 1), Times.Exactly(2)); _utilMock.Verify(x => x.HoursToHMS(ra, ":", ".", "", 0), Times.Exactly(2));
_utilMock.Verify(x => x.DegreesToDM(dec, "*", "", 0), Times.Exactly(2)); _utilMock.Verify(x => x.DegreesToDMS(dec, "*", ".", "", 0), Times.Exactly(2));
_utilMock.Verify(x => x.HoursToHMS(It.IsAny<double>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), 2), Times.Never); _utilMock.Verify(x => x.HoursToHMS(It.IsAny<double>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), 2), Times.Never);
_utilMock.Verify(x => x.DegreesToDMS(It.IsAny<double>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), 2), Times.Never); _utilMock.Verify(x => x.DegreesToDMS(It.IsAny<double>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), 2), Times.Never);
} }
@@ -1118,15 +1124,17 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.False); Assert.That(result, Is.False);
} }
[TestCase(TelescopeList.Autostar497_30Ee, false)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_30Ee, false)]
[TestCase(TelescopeList.Autostar497_43Eg, true)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, true)]
public void CanSetTracking_Get_ReturnsTrueIffGWCommandIsSupported(string firmware, bool supported) [TestCase(TelescopeList.Audiostar, TelescopeList.AudioStar_A4S4, true)]
[TestCase(TelescopeList.Audiostar, TelescopeList.AudioStar_A4S4, true)]
public void CanSetTracking_Get_ReturnsTrueIffGWCommandIsSupported(string product, string firmware, bool expectedSupported)
{ {
ConnectTelescope(firmwareVersion: firmware); ConnectTelescope(product,firmware);
var result = _telescope.CanSetTracking; var result = _telescope.CanSetTracking;
Assert.That(result, Is.EqualTo(supported)); Assert.That(result, Is.EqualTo(expectedSupported));
} }
[Test] [Test]
@@ -1621,25 +1629,13 @@ namespace Meade.net.Telescope.UnitTests
} }
[Test] [Test]
public void Park_WhenLX200NotParked_ThenSendsParkCommand() public void Park_WhenLX200ClassicNotParked_ThenSendsParkCommand()
{ {
var alt = 77.55;
var altAsDM = "77*30";
_utilMock.Setup(x => x.DegreesToDM(alt, "*", "", 2)).Returns(altAsDM);
var az = 180;
var azAsDM = "180*00";
_utilMock.Setup(x => x.DegreesToDM(az, "*", "", 2)).Returns(azAsDM);
_sharedResourcesWrapperMock.Setup(x => x.SendBool(_traceLoggerMock.Object, "Sa+77*30", false)).Returns(true);
_sharedResourcesWrapperMock.Setup(x => x.SendBool(_traceLoggerMock.Object, "Sz180*00", false)).Returns(true);
ConnectTelescope(TelescopeList.LX200CLASSIC); ConnectTelescope(TelescopeList.LX200CLASSIC);
Assert.That(_telescope.AtPark, Is.False); Assert.That(_telescope.AtPark, Is.False);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "hP", false), Times.Never);
_telescope.Park(); Assert.Throws<ASCOM.NotImplementedException>(() => { _telescope.Park(); });
Assert.That(_telescope.AtPark, Is.True);
} }
[Test] [Test]
@@ -1819,7 +1815,7 @@ namespace Meade.net.Telescope.UnitTests
var telescopeDecResult = "s12*3456"; var telescopeDecResult = "s12*3456";
var dmsResult = 1.2; var dmsResult = 1.2;
_testProperties.rightAscension = 1.3; _testProperties.RightAscension = 1.3;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult);
_utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(dmsResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(dmsResult);
@@ -1973,7 +1969,7 @@ namespace Meade.net.Telescope.UnitTests
var result = _telescope.RightAscension; var result = _telescope.RightAscension;
Assert.That(result, Is.EqualTo(_testProperties.rightAscension)); Assert.That(result, Is.EqualTo(_testProperties.RightAscension));
} }
[Test] [Test]
@@ -2027,9 +2023,9 @@ namespace Meade.net.Telescope.UnitTests
Assert.DoesNotThrow(() => { var result = _telescope.SideOfPier; }); Assert.DoesNotThrow(() => { var result = _telescope.SideOfPier; });
} }
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, AlignmentModes.algAltAz, 'A')] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, 'A')]
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, AlignmentModes.algPolar, 'P')] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, 'P')]
public void SideOfPier_Get_WhenMeridianFlipNotSupportedByAlignementMode_ThenThrowsException(string model, string firmware, AlignmentModes alignmode, char alignmentStatus) public void SideOfPier_Get_WhenMeridianFlipNotSupportedByAlignementMode_ThenThrowsException(string model, string firmware, char alignmentStatus)
{ {
ConnectTelescope(model, firmware); ConnectTelescope(model, firmware);
_testProperties.AlignmentStatus = new[] { alignmentStatus, 'T', '1' }; _testProperties.AlignmentStatus = new[] { alignmentStatus, 'T', '1' };
@@ -2044,8 +2040,8 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(excpetion.AccessorSet, Is.False); Assert.That(excpetion.AccessorSet, Is.False);
} }
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, AlignmentModes.algGermanPolar, 'G')] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, 'G')]
public void SideOfPier_Get_WhenMeridianFlipSupportedByAlignementMode_ThenDoesNotThrow(string model, string firmware, AlignmentModes alignmode, char alignmentStatus) public void SideOfPier_Get_WhenMeridianFlipSupportedByAlignementMode_ThenDoesNotThrow(string model, string firmware, char alignmentStatus)
{ {
ConnectTelescope(model, firmware); ConnectTelescope(model, firmware);
_testProperties.AlignmentStatus = new[] { alignmentStatus, 'T', '1' }; _testProperties.AlignmentStatus = new[] { alignmentStatus, 'T', '1' };
@@ -2250,11 +2246,11 @@ namespace Meade.net.Telescope.UnitTests
} }
[TestCase("5", 5, -5)] [TestCase(5, -5)]
[TestCase("-5", -5, 5)] [TestCase(-5, 5)]
[TestCase("185", 185, 175)] [TestCase(185, 175)]
[TestCase("350", 350, 10)] [TestCase(350, 10)]
public void SiteLongitude_Get_WhenConnected_ThenRetrivesAndReturnsExpectedValue(string telescopelongitudeString, double telescopeLongitudeValue, double expectedResult) public void SiteLongitude_Get_WhenConnected_ThenRetrivesAndReturnsExpectedValue(double telescopeLongitudeValue, double expectedResult)
{ {
var telescopeLongitude = "testLongitude"; var telescopeLongitude = "testLongitude";
@@ -2388,6 +2384,9 @@ namespace Meade.net.Telescope.UnitTests
public void TargetDeclination_Set_WhenTelescopeReportsInvalidDec_ThenThrowsException() public void TargetDeclination_Set_WhenTelescopeReportsInvalidDec_ThenThrowsException()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0");
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("50*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("50*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ".", "", It.IsAny<int>())).Returns("50*00");
ConnectTelescope(); ConnectTelescope();
@@ -2515,6 +2514,8 @@ namespace Meade.net.Telescope.UnitTests
public void TargetRightAscension_Set_WhenTelescopeReportsInvalidRA_ThenThrowsException() public void TargetRightAscension_Set_WhenTelescopeReportsInvalidRA_ThenThrowsException()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ".", "", 0)).Returns("00:00.00");
ConnectTelescope(); ConnectTelescope();
@@ -2667,9 +2668,8 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Exception of type 'System.ArgumentOutOfRangeException' was thrown.\r\nParameter name: value\r\nActual value was driveKing.")); Assert.That(exception.Message, Is.EqualTo("Exception of type 'System.ArgumentOutOfRangeException' was thrown.\r\nParameter name: value\r\nActual value was driveKing."));
} }
[TestCase("60.1")] [Test]
[TestCase("+60.1")] public void TrackingRage_Get_WhenReadingDefaultValue_ThenAssumesSidereal()
public void TrackingRage_Get_WhenReadingDefaultValue_ThenAssumesSidereal(string trackingRate)
{ {
ConnectTelescope(); ConnectTelescope();
@@ -2678,22 +2678,28 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.EqualTo(DriveRates.driveSidereal)); Assert.That(result, Is.EqualTo(DriveRates.driveSidereal));
} }
[TestCase(DriveRates.driveSidereal, "60.1")] [TestCase(DriveRates.driveSidereal, "60.1", "Autostar", "43Eg")]
[TestCase(DriveRates.driveSidereal, "60.0")] [TestCase(DriveRates.driveSidereal, "60.0", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "57.9")] [TestCase(DriveRates.driveLunar, "57.9", "Autostar", "43Eg")]
[TestCase(DriveRates.driveSidereal, "+60.1")] [TestCase(DriveRates.driveSidereal, "+60.1", "Autostar", "43Eg")]
[TestCase(DriveRates.driveSidereal, "+60.0")] [TestCase(DriveRates.driveSidereal, "+60.0", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "+57.9")] [TestCase(DriveRates.driveLunar, "+57.9", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "57.3")] [TestCase(DriveRates.driveLunar, "57.3", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "58.9")] [TestCase(DriveRates.driveLunar, "58.9", "Autostar", "43Eg")]
public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate) [TestCase(DriveRates.driveSidereal, "60.1", "Autostar", "A4S4")]
[TestCase(DriveRates.driveSidereal, "60.0", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "57.9", "Autostar", "A4S4")]
[TestCase(DriveRates.driveSidereal, "+60.1", "Autostar", "A4S4")]
[TestCase(DriveRates.driveSidereal, "+60.0", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "+57.9", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "57.3", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "58.9", "Autostar", "A4S4")]
public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate, string productName, string firmware)
{ {
CultureInfo.CurrentCulture = new CultureInfo("en-GB");
_siderealTrackingRate = trackingRate; _siderealTrackingRate = trackingRate;
string productName = TelescopeList.Autostar497; ConnectTelescope(productName, firmware);
string firmwareVersion = TelescopeList.Autostar497_43Eg;
ConnectTelescope(productName, firmwareVersion);
_telescope.TrackingRate = rate; _telescope.TrackingRate = rate;
@@ -2702,11 +2708,40 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.EqualTo(rate)); Assert.That(result, Is.EqualTo(rate));
} }
[TestCase(DriveRates.driveSidereal, "60.1")] [TestCase(DriveRates.driveSidereal, "60.1", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "60.1")] [TestCase(DriveRates.driveSidereal, "60.0", "Autostar", "43Eg")]
[TestCase(DriveRates.driveSidereal, "+60.1")] [TestCase(DriveRates.driveLunar, "57.9", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "+60.1")] [TestCase(DriveRates.driveSidereal, "+60.1", "Autostar", "43Eg")]
public void TrackingRate_Set_WhenConnectedToLX200_ThenThrowsException(DriveRates rate, string trackingRate) [TestCase(DriveRates.driveSidereal, "+60.0", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "+57.9", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "57.3", "Autostar", "43Eg")]
[TestCase(DriveRates.driveLunar, "58.9", "Autostar", "43Eg")]
[TestCase(DriveRates.driveSidereal, "60.1", "Autostar", "A4S4")]
[TestCase(DriveRates.driveSidereal, "60.0", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "57.9", "Autostar", "A4S4")]
[TestCase(DriveRates.driveSidereal, "+60.1", "Autostar", "A4S4")]
[TestCase(DriveRates.driveSidereal, "+60.0", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "+57.9", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "57.3", "Autostar", "A4S4")]
[TestCase(DriveRates.driveLunar, "58.9", "Autostar", "A4S4")]
public void TrackingRate_Get_WhenConnectedAndCurrentCultureIsSpanish_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate, string productName, string firmware)
{
CultureInfo.CurrentCulture = new CultureInfo("es-ES");
_siderealTrackingRate = trackingRate;
ConnectTelescope(productName, firmware);
_telescope.TrackingRate = rate;
var result = _telescope.TrackingRate;
Assert.That(result, Is.EqualTo(rate));
}
[TestCase(DriveRates.driveSidereal)]
[TestCase(DriveRates.driveLunar)]
public void TrackingRate_Set_WhenConnectedToLX200_ThenThrowsException(DriveRates rate)
{ {
string productName = TelescopeList.LX200CLASSIC; string productName = TelescopeList.LX200CLASSIC;
string firmwareVersion = string.Empty; string firmwareVersion = string.Empty;
@@ -2755,9 +2790,9 @@ namespace Meade.net.Telescope.UnitTests
public void UTCDate_Get_WhenConnected_ThenReturnsUTCDateTime(string telescopeDate, string telescopeTime, public void UTCDate_Get_WhenConnected_ThenReturnsUTCDateTime(string telescopeDate, string telescopeTime,
string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second)
{ {
_testProperties.telescopeDate = telescopeDate; _testProperties.TelescopeDate = telescopeDate;
_testProperties.telescopeTime = telescopeTime; _testProperties.TelescopeTime = telescopeTime;
_testProperties.telescopeUtcCorrection = telescopeUtcCorrection; _testProperties.TelescopeUtcCorrection = telescopeUtcCorrection;
ConnectTelescope(); ConnectTelescope();
@@ -2781,9 +2816,9 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: UTCDate Set")); Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: UTCDate Set"));
} }
[TestCase("10/15/20", "20:15:10", "-1.0", 2020, 10, 15, 19, 15, 10)] [TestCase("20:15:10", "-1.0", 2020, 10, 15, 19, 15, 10)]
[TestCase("12/03/15", "21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)] [TestCase("21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)]
public void UTCDate_Set_WhenFailsToSetTelescopeTime_ThenThrowsException(string telescopeDate, string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) public void UTCDate_Set_WhenFailsToSetTelescopeTime_ThenThrowsException(string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second)
{ {
double utcOffsetHours = double.Parse(telescopeUtcCorrection); double utcOffsetHours = double.Parse(telescopeUtcCorrection);
TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours); TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours);
@@ -2800,11 +2835,11 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Failed to set local time")); Assert.That(exception.Message, Is.EqualTo("Failed to set local time"));
} }
[TestCase("10/15/20", "20:15:10", "-1.0", 2020, 10, 15, 20, 15, 10)] [TestCase("20:15:10", "-1.0", 2020, 10, 15, 20, 15, 10)]
[TestCase("12/03/15", "21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)] [TestCase("21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)]
public void UTCDate_Set_WhenFailsToSetTelescopeDate_ThenThrowsException(string telescopeDate, string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) public void UTCDate_Set_WhenFailsToSetTelescopeDate_ThenThrowsException(string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second)
{ {
_testProperties.telescopeUtcCorrection = telescopeUtcCorrection; _testProperties.TelescopeUtcCorrection = telescopeUtcCorrection;
double utcOffsetHours = double.Parse(telescopeUtcCorrection); double utcOffsetHours = double.Parse(telescopeUtcCorrection);
TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours); TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours);
@@ -2829,7 +2864,7 @@ namespace Meade.net.Telescope.UnitTests
double utcOffsetHours = double.Parse(telescopeUtcCorrection); double utcOffsetHours = double.Parse(telescopeUtcCorrection);
TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours); TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours);
_testProperties.telescopeUtcCorrection = telescopeUtcCorrection; _testProperties.TelescopeUtcCorrection = telescopeUtcCorrection;
var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection; var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection;
@@ -2863,23 +2898,23 @@ namespace Meade.net.Telescope.UnitTests
var telescopeDecResult = "s12*3456"; var telescopeDecResult = "s12*3456";
string hms = "05:30:00"; string hms = "05:30:00";
_testProperties.rightAscension = 5.5; _testProperties.RightAscension = 5.5;
double declination = -30.5; double declination = -30.5;
string dec = "-30*30:00"; string dec = "-30*30:00";
var digitsRA = 2; var digitsRA = 2;
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.telescopeRaResult}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.TelescopeRaResult}", false)).Returns("1");
_utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.telescopeRaResult); _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.HMSToHours(hms)).Returns(_testProperties.rightAscension); _utilMock.Setup(x => x.HMSToHours(hms)).Returns(_testProperties.RightAscension);
_utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult);
_utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(declination); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(declination);
_utilMock.Setup(x => x.DMSToDegrees(dec)).Returns(declination); _utilMock.Setup(x => x.DMSToDegrees(dec)).Returns(declination);
_utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", 2)).Returns(hms); _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", 2)).Returns(hms);
_utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(dec); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(dec);
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{hms}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{hms}", false)).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sd{dec}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sd{dec}", false)).Returns("1");
@@ -2890,10 +2925,10 @@ namespace Meade.net.Telescope.UnitTests
ConnectTelescope(); ConnectTelescope();
_telescope.SyncToCoordinates(_testProperties.rightAscension, declination); _telescope.SyncToCoordinates(_testProperties.RightAscension, declination);
_sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "CM", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "CM", false), Times.Once);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
} }
@@ -2910,13 +2945,15 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void Slewing_WhenConnectedAndTelescopeFails_ThenReturnsFalse() public void Slewing_WhenConnectedAndTelescopeFails_ThenReturnsFalse()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns("");
ConnectTelescope(); ConnectTelescope();
var result = _telescope.Slewing; var result = _telescope.Slewing;
Assert.That(result, Is.False); Assert.That(result, Is.False);
_sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "D", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "D", false), Times.Exactly(1));
} }
[Test] [Test]
@@ -2997,12 +3034,30 @@ namespace Meade.net.Telescope.UnitTests
[TestCase(TelescopeList.LX200CLASSIC, "", "", false)] [TestCase(TelescopeList.LX200CLASSIC, "", "", false)]
[TestCase(TelescopeList.LX200CLASSIC, "", "[FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF] [FF][FF][FF][FF][FF][FF]", false)] //The test case below is this same string encoded to return exactly what the telescope will return. [TestCase(TelescopeList.LX200CLASSIC, "", "[FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF] [FF][FF][FF][FF][FF][FF]", false)] //The test case below is this same string encoded to return exactly what the telescope will return.
[TestCase(TelescopeList.LX200CLASSIC, "", "\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff \x00ff\x00ff\x00ff\x00ff\x00ff\x00ff", false)] [TestCase(TelescopeList.LX200CLASSIC, "", "\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff \x00ff\x00ff\x00ff\x00ff\x00ff\x00ff", false)]
[TestCase(TelescopeList.LX200CLASSIC, "", "[FF][FF][FF] [FF][FF][FF] ", true)] //The test case below is this same string encoded to return exactly what the telescope will return.
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "|", true)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "|", true)]
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "\x007f", true)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "\x007f", true)]
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "", false)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "", false)]
public void Slewing_WhenTelescopeNotSlewing_ThenReturnsFalse(string productName, string firmwareVersion, string response, bool isSlewing) public void Slewing_WhenTelescopeNotSlewing_ThenReturnsFalse(string productName, string firmwareVersion, string response, bool isSlewing)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(response); List<string> slewingResponses = new List<string>();
if (isSlewing)
slewingResponses.Add("|");
slewingResponses.Add(response);
var callCounter = 0;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns( () => {
var slewingResult = slewingResponses[callCounter];
callCounter++;
if (callCounter > slewingResponses.Count - 1)
{
callCounter = slewingResponses.Count - 1;
}
return slewingResult;
});
ConnectTelescope(productName, firmwareVersion); ConnectTelescope(productName, firmwareVersion);
@@ -3010,7 +3065,10 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.EqualTo(isSlewing)); Assert.That(result, Is.EqualTo(isSlewing));
_sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "D", false), Times.Once); if (isSlewing)
{
_sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "D", false), Times.Exactly(1));
}
} }
[TestCase(1, TelescopeAxes.axisPrimary)] [TestCase(1, TelescopeAxes.axisPrimary)]
@@ -3106,6 +3164,8 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTargetDeclinationNotSet_ThenThrowsException() public void SlewToTargetAsync_WhenTargetDeclinationNotSet_ThenThrowsException()
{ {
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope(); ConnectTelescope();
_telescope.TargetRightAscension = 1; _telescope.TargetRightAscension = 1;
@@ -3117,6 +3177,9 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTargetRightAscensionNotSet_ThenThrowsException() public void SlewToTargetAsync_WhenTargetRightAscensionNotSet_ThenThrowsException()
{ {
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
ConnectTelescope(); ConnectTelescope();
_telescope.TargetDeclination = 1; _telescope.TargetDeclination = 1;
@@ -3128,6 +3191,10 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTargetSet_ThenAttemptsSlew() public void SlewToTargetAsync_WhenTargetSet_ThenAttemptsSlew()
{ {
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
ConnectTelescope(); ConnectTelescope();
_telescope.TargetRightAscension = 2; _telescope.TargetRightAscension = 2;
@@ -3142,6 +3209,10 @@ namespace Meade.net.Telescope.UnitTests
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
ConnectTelescope(); ConnectTelescope();
_telescope.TargetRightAscension = 2; _telescope.TargetRightAscension = 2;
@@ -3159,6 +3230,10 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
ConnectTelescope(); ConnectTelescope();
_telescope.TargetRightAscension = 2; _telescope.TargetRightAscension = 2;
@@ -3171,9 +3246,14 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTargetBelowElevation_ThenThrowsException() public void SlewToTargetAsync_WhenTargetBelowElevation_ThenThrowsException()
{ {
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("2"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("2");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope(); ConnectTelescope();
_telescope.TargetRightAscension = 2; _telescope.TargetRightAscension = 2;
@@ -3188,6 +3268,10 @@ namespace Meade.net.Telescope.UnitTests
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("3"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("3");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod");
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope(); ConnectTelescope();
@@ -3210,9 +3294,16 @@ namespace Meade.net.Telescope.UnitTests
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0");
var preTestItterations = 1; var preTestItterations = 2;
var slewCounter = 0; var slewCounter = 0;
var iterations = 10; var iterations = 10;
_utilMock.Setup(x => x.DegreesToDM(It.IsAny<double>(), "*", "", 0)).Returns("00*00");
_utilMock.Setup(x => x.DegreesToDMS(It.IsAny<double>(), "*", ":", ":", It.IsAny<int>())).Returns("00*00");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() =>
{ {
slewCounter++; slewCounter++;
@@ -3229,8 +3320,6 @@ namespace Meade.net.Telescope.UnitTests
_telescope.TargetDeclination = 1; _telescope.TargetDeclination = 1;
_telescope.SlewToTarget(); _telescope.SlewToTarget();
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations - preTestItterations));
} }
[Test] [Test]
@@ -3245,7 +3334,7 @@ namespace Meade.net.Telescope.UnitTests
{ {
var digitsRA = 2; var digitsRA = 2;
_testProperties.rightAscension = 1; _testProperties.RightAscension = 1;
var declination = 2; var declination = 2;
@@ -3253,18 +3342,18 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0");
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.telescopeRaResult}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.TelescopeRaResult}", false)).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult);
_utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.telescopeRaResult); _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(declination); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(declination);
_utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult);
ConnectTelescope(); ConnectTelescope();
_telescope.SlewToCoordinatesAsync(_testProperties.rightAscension, declination); _telescope.SlewToCoordinatesAsync(_testProperties.RightAscension, declination);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
_sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once);
} }
@@ -3279,7 +3368,7 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToCoordinates_WhenCalled_ThenSetsTargetAndSlews() public void SlewToCoordinates_WhenCalled_ThenSetsTargetAndSlews()
{ {
_testProperties.rightAscension = 1; _testProperties.RightAscension = 1;
var declination = 2; var declination = 2;
var telescopeDecResult = "s12*3456"; var telescopeDecResult = "s12*3456";
@@ -3287,15 +3376,15 @@ namespace Meade.net.Telescope.UnitTests
var digitsRA = 2; var digitsRA = 2;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult);
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.telescopeRaResult}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.TelescopeRaResult}", false)).Returns("1");
_utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.telescopeRaResult); _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(dmsResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(dmsResult);
_utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult);
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0");
var preTestItterations = 1; var preTestItterations = 2;
var slewCounter = 0; var slewCounter = 0;
var iterations = 10; var iterations = 10;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() =>
@@ -3310,12 +3399,10 @@ namespace Meade.net.Telescope.UnitTests
ConnectTelescope(); ConnectTelescope();
_telescope.SlewToCoordinates(_testProperties.rightAscension, declination); _telescope.SlewToCoordinates(_testProperties.RightAscension, declination);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(dmsResult)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(dmsResult));
_sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations - preTestItterations));
} }
[Test] [Test]
@@ -3364,8 +3451,8 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToAltAzAsync_WhenAltAndAzValid_ThenConvertsToRADec() public void SlewToAltAzAsync_WhenAltAndAzValid_ThenConvertsToRADec()
{ {
_testProperties.rightAscension = 20; _testProperties.RightAscension = 20;
_testProperties.declination = 10; _testProperties.Declination = 10;
var altitude = 30; var altitude = 30;
var azimuth = 45; var azimuth = 45;
@@ -3380,17 +3467,17 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{telescopeRaResult}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{telescopeRaResult}", false)).Returns("1");
_utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(telescopeRaResult); _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(telescopeRaResult);
_utilMock.Setup(x => x.HMSToHours(telescopeRaResult)).Returns(_testProperties.rightAscension); _utilMock.Setup(x => x.HMSToHours(telescopeRaResult)).Returns(_testProperties.RightAscension);
_utilMock.Setup(x => x.DegreesToDMS(_testProperties.declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); _utilMock.Setup(x => x.DegreesToDMS(_testProperties.Declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult);
_utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(_testProperties.declination); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(_testProperties.Declination);
ConnectTelescope(); ConnectTelescope();
_telescope.SlewToAltAzAsync(azimuth, altitude); _telescope.SlewToAltAzAsync(azimuth, altitude);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.Declination));
_sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once);
} }
@@ -3404,21 +3491,21 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToAltAz_WhenCalled_ThenSetsTargetAndSlews() public void SlewToAltAz_WhenCalled_ThenSetsTargetAndSlews()
{ {
_testProperties.rightAscension = 10.0; _testProperties.RightAscension = 10.0;
_testProperties.declination = 20; _testProperties.Declination = 20;
var azimuth = 30; var azimuth = 30;
var altitude = 40; var altitude = 40;
_utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", 2)).Returns(_testProperties.telescopeRaResult); _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", 2)).Returns(_testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.DegreesToDMS(_testProperties.declination, "*", ":", ":", 2)).Returns(_testProperties.telescopeRaResult); _utilMock.Setup(x => x.DegreesToDMS(_testProperties.Declination, "*", ":", ":", 2)).Returns(_testProperties.TelescopeRaResult);
_utilMock.Setup(x => x.DMSToDegrees(_testProperties.telescopeRaResult)).Returns(_testProperties.declination); _utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination);
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns("-1.0");
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "Sd+HH:MM:SS", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "Sd+HH:MM:SS", false)).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0");
var preTestItterations = 1; var preTestItterations = 2;
var slewCounter = 0; var slewCounter = 0;
var iterations = 10; var iterations = 10;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() =>
@@ -3435,10 +3522,9 @@ namespace Meade.net.Telescope.UnitTests
_telescope.SlewToAltAz(azimuth, altitude); _telescope.SlewToAltAz(azimuth, altitude);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.Declination));
_sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations - preTestItterations));
} }
[Test] [Test]
@@ -3458,9 +3544,9 @@ namespace Meade.net.Telescope.UnitTests
var telescopeLongitude = "350"; var telescopeLongitude = "350";
var telescopeLongitudeValue = 350; var telescopeLongitudeValue = 350;
_testProperties.telescopeAltitude = 45; _testProperties.TelescopeAltitude = 45;
_testProperties.telescopeAzimuth = 200; _testProperties.TelescopeAzimuth = 200;
_testProperties.hourAngle = 3; _testProperties.HourAngle = 3;
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns("-1.0");
@@ -3472,7 +3558,7 @@ namespace Meade.net.Telescope.UnitTests
var result = _telescope.Azimuth; var result = _telescope.Azimuth;
Assert.That(result, Is.EqualTo(_testProperties.telescopeAzimuth)); Assert.That(result, Is.EqualTo(_testProperties.TelescopeAzimuth));
} }
[Test] [Test]
@@ -3498,9 +3584,9 @@ namespace Meade.net.Telescope.UnitTests
_utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue); _utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue);
_astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(_testProperties.hourAngle); _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(_testProperties.HourAngle);
_astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.hourAngle, It.IsAny<double>(), It.IsAny<EquatorialCoordinates>())).Returns(new HorizonCoordinates { Altitude = expectedAltitude, Azimuth = 200 }); _astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.HourAngle, It.IsAny<double>(), It.IsAny<EquatorialCoordinates>())).Returns(new HorizonCoordinates { Altitude = expectedAltitude, Azimuth = 200 });
ConnectTelescope(); ConnectTelescope();
@@ -3519,16 +3605,17 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void AbortSlew_WhenConnected_ThenSendsStopSlewingToTelescope() public void AbortSlew_WhenConnected_ThenSendsStopSlewingToTelescope()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns("");
ConnectTelescope(); ConnectTelescope();
_telescope.AbortSlew(); _telescope.AbortSlew();
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "Q", false), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "Q", false), Times.Once);
var isSloSlewing = _telescope.Slewing; var isSlewing = _telescope.Slewing;
Assert.That(isSloSlewing, Is.False); Assert.That(isSlewing, Is.False);
_sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "D", false), Times.Once);
} }
[Test] [Test]
@@ -3732,7 +3819,7 @@ namespace Meade.net.Telescope.UnitTests
_profileProperties.ParkedAz = 180; _profileProperties.ParkedAz = 180;
DateTime testNow = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); DateTime testNow = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture);
_testProperties.declination = 45; _testProperties.Declination = 45;
_clockMock.Setup(x => x.UtcNow).Returns(() => testNow); _clockMock.Setup(x => x.UtcNow).Returns(() => testNow);
@@ -3747,7 +3834,7 @@ namespace Meade.net.Telescope.UnitTests
break; break;
case ParkedBehaviour.ReportCoordinates: case ParkedBehaviour.ReportCoordinates:
var dec = _telescope.Declination; var dec = _telescope.Declination;
Assert.That(dec, Is.EqualTo(_testProperties.declination)); Assert.That(dec, Is.EqualTo(_testProperties.Declination));
break; break;
default: default:
Assert.Throws<ParkedException>(() => { var d = _telescope.Declination; }); Assert.Throws<ParkedException>(() => { var d = _telescope.Declination; });
@@ -3771,7 +3858,7 @@ namespace Meade.net.Telescope.UnitTests
_astroMathsMock _astroMathsMock
.Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(), .Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(),
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = _testProperties.rightAscension }); It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = _testProperties.RightAscension });
ConnectTelescope(); ConnectTelescope();
_telescope.Park(); _telescope.Park();
@@ -3784,7 +3871,7 @@ namespace Meade.net.Telescope.UnitTests
break; break;
case ParkedBehaviour.ReportCoordinates: case ParkedBehaviour.ReportCoordinates:
var reportRa = _telescope.RightAscension; var reportRa = _telescope.RightAscension;
Assert.That(reportRa, Is.EqualTo(_testProperties.rightAscension)); Assert.That(reportRa, Is.EqualTo(_testProperties.RightAscension));
break; break;
default: default:
Assert.Throws<ParkedException>(() => { var ra = _telescope.RightAscension; }); Assert.Throws<ParkedException>(() => { var ra = _telescope.RightAscension; });
+1 -1
View File
@@ -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-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.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" />
+21 -6
View File
@@ -1,10 +1,25 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ASCOM.Platform" version="6.5.1" targetFramework="net472" /> <package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
<package id="Castle.Core" version="4.4.1" targetFramework="net472" /> <package id="Castle.Core" version="5.1.0" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
<package id="Moq" version="4.15.2" targetFramework="net472" /> <package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
<package id="NUnit" version="3.13.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.TrxReport.Abstractions" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Extensions.VSTestBridge" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform.MSBuild" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.TestPlatform.AdapterUtilities" version="17.13.0" targetFramework="net472" />
<package id="Microsoft.TestPlatform.ObjectModel" version="17.13.0" targetFramework="net472" />
<package id="Moq" version="4.18.2" targetFramework="net472" />
<package id="NUnit" version="3.13.3" targetFramework="net472" />
<package id="NUnit3TestAdapter" version="5.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="5.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="7.0.0-preview.2.22152.2" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>
+13 -14
View File
@@ -71,40 +71,40 @@
</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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
</Reference> </Reference>
<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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.configuration" /> <Reference Include="System.configuration" />
@@ -156,7 +156,6 @@
<None Include="app.config" /> <None Include="app.config" />
<None Include="ASCOM.png" /> <None Include="ASCOM.png" />
<None Include="ASCOMDriverTemplate.snk" /> <None Include="ASCOMDriverTemplate.snk" />
<None Include="BootstrapAscomProfileStore.ps1" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
+288 -157
View File
@@ -1,5 +1,4 @@
#define Telescope #define Telescope
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
@@ -24,7 +23,7 @@ namespace ASCOM.Meade.net
// Your driver's DeviceID is ASCOM.Meade.net.Telescope // Your driver's DeviceID is ASCOM.Meade.net.Telescope
// //
// The Guid attribute sets the CLSID for ASCOM.Meade.net.Telescope // The Guid attribute sets the CLSID for ASCOM.Meade.net.Telescope
// The ClassInterface/None addribute prevents an empty interface called // The ClassInterface/None attribute prevents an empty interface called
// _Meade.net from being created and used as the [default] interface // _Meade.net from being created and used as the [default] interface
// //
// Replace the not implemented exceptions with code to implement the function or // Replace the not implemented exceptions with code to implement the function or
@@ -79,6 +78,11 @@ namespace ASCOM.Meade.net
/// </summary> /// </summary>
private int _digitsDe = 2; private int _digitsDe = 2;
/// <summary>
/// Used to make sure that the slewing property returns true when in the middle of an ascom slew command, anything above 0 means that we are inside slewing commands.
/// </summary>
private int _forceSlewingCount = 0;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Meade.net"/> class. /// Initializes a new instance of the <see cref="Meade.net"/> class.
/// Must be public for COM registration. /// Must be public for COM registration.
@@ -429,7 +433,15 @@ namespace ASCOM.Meade.net
// https://bitbucket.org/cjdskunkworks/meadeautostar497/issues/24/get-set-tracking#comment-60586901 // https://bitbucket.org/cjdskunkworks/meadeautostar497/issues/24/get-set-tracking#comment-60586901
if (command == (raw ? ":GW#" : "GW")) if (command == (raw ? ":GW#" : "GW"))
{ {
result = SharedResourcesWrapper.SendChars(Tl, command, raw, count: 3); switch (SharedResourcesWrapper.ProductName)
{
case TelescopeList.LX800:
result = SharedResourcesWrapper.SendString(Tl, command, raw);
break;
default:
result = SharedResourcesWrapper.SendChars(Tl, command, raw, count: 3);
break;
}
} }
else else
{ {
@@ -583,6 +595,7 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.RCX400: case TelescopeList.RCX400:
case TelescopeList.LX800:
{ {
LogMessage("SendTimeTimeToHandbox", LogMessage("SendTimeTimeToHandbox",
$"{SharedResourcesWrapper.ProductName} Detecting if daylight savings message on screen: {_profileProperties.SendDateTime}"); $"{SharedResourcesWrapper.ProductName} Detecting if daylight savings message on screen: {_profileProperties.SendDateTime}");
@@ -619,22 +632,26 @@ namespace ASCOM.Meade.net
{ {
var isStarPatch = false; var isStarPatch = false;
var firmwareVersionArray = SharedResourcesWrapper.FirmwareVersion.ToCharArray(); //LXD600 is based on LX-200 classic Meade and does not support StarPatch
if (firmwareVersionArray.Length > 1) if (SharedResourcesWrapper.ProductName != TelescopeList.LXD600)
{ {
//If last character is a number var firmwareVersionArray = SharedResourcesWrapper.FirmwareVersion.ToCharArray();
var lastChr = firmwareVersionArray[firmwareVersionArray.Length - 1]; if (firmwareVersionArray.Length > 1)
if (char.IsNumber(lastChr))
{ {
// Get case of second to last character //If last character is a number
var secondLastChar = firmwareVersionArray[firmwareVersionArray.Length - 2]; var lastChr = firmwareVersionArray[firmwareVersionArray.Length - 1];
// lower case = StarPatch, upper case = Meade if (char.IsNumber(lastChr))
isStarPatch = char.IsLower(secondLastChar); {
} // Get case of second to last character
else var secondLastChar = firmwareVersionArray[firmwareVersionArray.Length - 2];
{ // lower case = StarPatch, upper case = Meade
// lower case = Meade, upper case = StarPatch isStarPatch = char.IsLower(secondLastChar);
isStarPatch = char.IsUpper(lastChr); }
else
{
// lower case = Meade, upper case = StarPatch
isStarPatch = char.IsUpper(lastChr);
}
} }
} }
@@ -656,7 +673,8 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.RCX400: case TelescopeList.RCX400:
{ case TelescopeList.LX800:
{
var displayText = Action("Handbox", "readdisplay"); var displayText = Action("Handbox", "readdisplay");
if (displayText.Contains("Daylight")) if (displayText.Contains("Daylight"))
@@ -672,19 +690,26 @@ namespace ASCOM.Meade.net
} }
default: default:
{ {
var i = 10; try
while (i > 0)
{ {
var displayText = Action("Handbox", "readdisplay"); var i = 10;
if (displayText.Contains("Align:")) while (i > 0)
{ {
i = 0; var displayText = Action("Handbox", "readdisplay");
continue; if (displayText.Contains("Align:"))
} {
i = 0;
continue;
}
Action("Handbox", "mode"); Action("Handbox", "mode");
_utilities.WaitForMilliseconds(500); _utilities.WaitForMilliseconds(500);
i--; i--;
}
}
catch (TimeoutException)
{
LogMessage("ApplySkipAutoStarPrompts","Timed out bypassing the date time prompts. Skipping.");
} }
break; break;
@@ -726,6 +751,7 @@ namespace ASCOM.Meade.net
case TelescopeList.Autostar497: case TelescopeList.Autostar497:
return FirmwareIsGreaterThan(TelescopeList.Autostar497_31Ee); return FirmwareIsGreaterThan(TelescopeList.Autostar497_31Ee);
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.LX800:
return true; return true;
case TelescopeList.RCX400: case TelescopeList.RCX400:
return FirmwareIsGreaterThan(TelescopeList.RCX400_22I); return FirmwareIsGreaterThan(TelescopeList.RCX400_22I);
@@ -743,7 +769,8 @@ namespace ASCOM.Meade.net
private bool IsLongFormatSupported() private bool IsLongFormatSupported()
{ {
if (SharedResourcesWrapper.ProductName == TelescopeList.LX200CLASSIC) if ((SharedResourcesWrapper.ProductName == TelescopeList.LX200CLASSIC) ||
(SharedResourcesWrapper.ProductName == TelescopeList.LXD600))
{ {
return false; return false;
} }
@@ -757,6 +784,7 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.RCX400: case TelescopeList.RCX400:
case TelescopeList.LX800:
return true; return true;
default: default:
return false; return false;
@@ -769,9 +797,16 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.LX200CLASSIC: case TelescopeList.LX200CLASSIC:
return false; return false;
case TelescopeList.Audiostar:
case TelescopeList.Autostar497: case TelescopeList.Autostar497:
return FirmwareIsGreaterThan(TelescopeList.Autostar497_43Eg); return FirmwareIsGreaterThan(TelescopeList.Autostar497_43Eg);
case TelescopeList.LX800:
return FirmwareIsGreaterThan(TelescopeList.LX800_11i);
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
if (SharedResourcesWrapper.FirmwareVersion.Equals(TelescopeList.LX200GPS_4G0M,
StringComparison.InvariantCultureIgnoreCase))
return false;
return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G); return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G);
case TelescopeList.RCX400: case TelescopeList.RCX400:
return FirmwareIsGreaterThan(TelescopeList.RCX400_22I); return FirmwareIsGreaterThan(TelescopeList.RCX400_22I);
@@ -1092,7 +1127,7 @@ namespace ASCOM.Meade.net
LogMessage("AlignmentMode Get", $"Sending Ack code."); LogMessage("AlignmentMode Get", $"Sending Ack code.");
var alignmentString = GetAlignmentString(); var alignmentString = GetAlignmentString();
AlignmentModes alignmentMode; AlignmentModes alignmentMode;
switch (alignmentString) switch (alignmentString.ToUpperInvariant())
{ {
case "A": case "A":
LogMessage("AlignmentMode Get", $"Telescope is in AltAz"); LogMessage("AlignmentMode Get", $"Telescope is in AltAz");
@@ -1106,9 +1141,10 @@ namespace ASCOM.Meade.net
LogMessage("AlignmentMode Get", $"Telescope is in Land mode"); LogMessage("AlignmentMode Get", $"Telescope is in Land mode");
alignmentMode = AlignmentModes.algAltAz; alignmentMode = AlignmentModes.algAltAz;
break; break;
//case "G": case "G":
//alignmentMode = AlignmentModes.algGermanPolar; LogMessage("AlignmentMode Get", $"Telescope is in German Polar mode");
//break; alignmentMode = AlignmentModes.algGermanPolar;
break;
default: default:
var msg = $"unknown alignment returned from telescope: {alignmentString}"; var msg = $"unknown alignment returned from telescope: {alignmentString}";
LogMessage("AlignmentMode Get", msg); LogMessage("AlignmentMode Get", msg);
@@ -1225,6 +1261,12 @@ namespace ASCOM.Meade.net
case 'P': case 'P':
alignmentStatus.Status = Alignment.ScopeWasParked; alignmentStatus.Status = Alignment.ScopeWasParked;
break; break;
case '4': // 4 - Aligned on Home *** Starlock mounts
alignmentStatus.Status = Alignment.AlignedOnHome;
break;
case '5':// 5 - Scope was parked *** Starlock mounts
alignmentStatus.Status = Alignment.ScopeWasParked;
break;
} }
LogMessage("GetScopeAlignmentStatus", $"Result {alignmentStatus}"); LogMessage("GetScopeAlignmentStatus", $"Result {alignmentStatus}");
@@ -1243,6 +1285,7 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.RCX400: case TelescopeList.RCX400:
case TelescopeList.LX800:
return GetRealTelescopeAltitude(); return GetRealTelescopeAltitude();
default: default:
var altAz = CalcAltAzFromTelescopeEqData(); var altAz = CalcAltAzFromTelescopeEqData();
@@ -1324,7 +1367,7 @@ namespace ASCOM.Meade.net
{ {
get get
{ {
var apertureArea = _profileProperties.ApertureArea / 1000; var apertureArea = _profileProperties.ApertureArea / (1000*1000);
LogMessage("ApertureArea Get", $"{apertureArea}"); LogMessage("ApertureArea Get", $"{apertureArea}");
return apertureArea; return apertureArea;
} }
@@ -1409,6 +1452,7 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.RCX400: case TelescopeList.RCX400:
case TelescopeList.LX800:
return GetRealTelescopeAzimuth(); return GetRealTelescopeAzimuth();
default: default:
var altAz = CalcAltAzFromTelescopeEqData(); var altAz = CalcAltAzFromTelescopeEqData();
@@ -1493,8 +1537,10 @@ namespace ASCOM.Meade.net
{ {
try try
{ {
LogMessage("CanPark", "Get - " + true); var canPark = ((SharedResourcesWrapper.ProductName != TelescopeList.LX200CLASSIC) &&
return true; (SharedResourcesWrapper.ProductName != TelescopeList.LXD600));
LogMessage("CanPark", "Get - " + canPark);
return canPark;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -1747,10 +1793,11 @@ namespace ASCOM.Meade.net
try try
{ {
CheckConnected("CanUnpark"); CheckConnected("CanUnpark");
var canUnPark = IsUnparkable;
LogMessage("CanUnpark", "Get - " + true); LogMessage("CanUnpark", "Get - " + canUnPark);
return IsUnparkable; return canUnPark;
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -1768,7 +1815,9 @@ namespace ASCOM.Meade.net
{ {
TelescopeList.LX200GPS, TelescopeList.LX200GPS,
TelescopeList.RCX400, TelescopeList.RCX400,
TelescopeList.LX200CLASSIC TelescopeList.LX200CLASSIC,
TelescopeList.LX800,
TelescopeList.LXD600
}; };
return unParkableScopes.Contains(SharedResourcesWrapper.ProductName); return unParkableScopes.Contains(SharedResourcesWrapper.ProductName);
@@ -1874,6 +1923,8 @@ namespace ASCOM.Meade.net
var destinationSOP = hourAngle > 0 var destinationSOP = hourAngle > 0
? PierSide.pierEast ? PierSide.pierEast
: PierSide.pierWest; : PierSide.pierWest;
LogMessage("CalculateSideOfPier", $"destination side of pier: {destinationSOP} ha: {hourAngle}");
return destinationSOP; return destinationSOP;
} }
@@ -2250,7 +2301,8 @@ namespace ASCOM.Meade.net
var isTracking = Tracking; var isTracking = Tracking;
if (SharedResourcesWrapper.ProductName != TelescopeList.LX200CLASSIC) if ((SharedResourcesWrapper.ProductName != TelescopeList.LX200CLASSIC) &&
(SharedResourcesWrapper.ProductName != TelescopeList.LXD600))
{ {
SharedResourcesWrapper.SendBlind(Tl, "hP"); SharedResourcesWrapper.SendBlind(Tl, "hP");
//:hP# Autostar, Autostar II and LX 16" Slew to Park Position //:hP# Autostar, Autostar II and LX 16" Slew to Park Position
@@ -2258,17 +2310,8 @@ namespace ASCOM.Meade.net
} }
else else
{ {
LogMessage("Park", $"Calculating Park Alt Az"); LogMessage("Park", $"LX200 Classic or LXD600 do not support parking");
var siteLatitude = SiteLatitude; throw new NotImplementedException("Park");
var parkAlt = AlignmentMode == AlignmentModes.algAltAz ? 0 : 90 - siteLatitude;
var parkAz = siteLatitude >= 0 ? 180 : 0;
LogMessage("Park", $"Parking LX200 Classic");
Tracking = false;
LogMessage("Park", $"Slewing to park position az:{parkAz} alt:{parkAlt}");
SlewToAltAz(parkAz, parkAlt, false);
LogMessage("Park", $"Arrived at park position");
} }
//Setting park to true before sending the park command as the Autostar and Audiostar stop serial communications once the park command has been issued. //Setting park to true before sending the park command as the Autostar and Audiostar stop serial communications once the park command has been issued.
@@ -2838,49 +2881,57 @@ namespace ASCOM.Meade.net
public void SlewToAltAzAsync(double azimuth, double altitude, bool polar) public void SlewToAltAzAsync(double azimuth, double altitude, bool polar)
{ {
_forceSlewingCount++;
try try
{ {
CheckConnected("SlewToAltAzAsync"); try
CheckParked();
if (altitude > 90)
throw new InvalidValueException("Altitude cannot be greater than 90.");
if (altitude < 0)
throw new InvalidValueException("Altitude cannot be less than 0.");
if (azimuth >= 360)
throw new InvalidValueException("Azimuth cannot be 360 or higher.");
if (azimuth < 0)
throw new InvalidValueException("Azimuth cannot be less than 0.");
LogMessage("SlewToAltAzAsync", $"Az={azimuth} Alt={altitude} polar={polar}");
if (polar)
{ {
HorizonCoordinates altAz = new HorizonCoordinates { Azimuth = azimuth, Altitude = altitude }; CheckConnected("SlewToAltAzAsync");
CheckParked();
var utcDateTime = UTCDate; if (altitude > 90)
var latitude = SiteLatitude; throw new InvalidValueException("Altitude cannot be greater than 90.");
var longitude = SiteLongitude;
var raDec = _astroMaths.ConvertHozToEq(utcDateTime, latitude, longitude, altAz);
TargetRightAscension = raDec.RightAscension; if (altitude < 0)
TargetDeclination = raDec.Declination; throw new InvalidValueException("Altitude cannot be less than 0.");
if (azimuth >= 360)
throw new InvalidValueException("Azimuth cannot be 360 or higher.");
if (azimuth < 0)
throw new InvalidValueException("Azimuth cannot be less than 0.");
LogMessage("SlewToAltAzAsync", $"Az={azimuth} Alt={altitude} polar={polar}");
if (polar)
{
HorizonCoordinates altAz = new HorizonCoordinates { Azimuth = azimuth, Altitude = altitude };
var utcDateTime = UTCDate;
var latitude = SiteLatitude;
var longitude = SiteLongitude;
var raDec = _astroMaths.ConvertHozToEq(utcDateTime, latitude, longitude, altAz);
TargetRightAscension = raDec.RightAscension;
TargetDeclination = raDec.Declination;
}
else
{
TargetAltitude = altitude;
TargetAzimuth = azimuth;
}
DoSlewAsync(polar);
} }
else catch (Exception ex)
{ {
TargetAltitude = altitude; LogMessage("SlewToAltAzAsync", $"Error: {ex.Message}");
TargetAzimuth = azimuth; throw;
} }
DoSlewAsync(polar);
} }
catch (Exception ex) finally
{ {
LogMessage("SlewToAltAzAsync", $"Error: {ex.Message}"); _forceSlewingCount--;
throw;
} }
} }
@@ -2910,7 +2961,7 @@ namespace ASCOM.Meade.net
LogMessage("TargetAltitude Set", $"{command}"); LogMessage("TargetAltitude Set", $"{command}");
var response = SharedResourcesWrapper.SendBool(Tl, command); var response = SharedResourcesWrapper.SendBool(Tl, command);
//:SasDD*MM# //:SasDD*MM#
// Set target object altitude to sDD*MM# or sDD*MMSS# [LX 16, Autostar, Autostar II] // Set target object altitude to sDD*MM# or sDD*MMSS# [LX 16, Autostar, Autostar II]
// Returns: // Returns:
// 1 Object within slew range // 1 Object within slew range
// 0 Object out of slew range // 0 Object out of slew range
@@ -2947,9 +2998,9 @@ namespace ASCOM.Meade.net
LogMessage("TargetAzimuth Set", $"{command}"); LogMessage("TargetAzimuth Set", $"{command}");
var response = SharedResourcesWrapper.SendBool(Tl, command); var response = SharedResourcesWrapper.SendBool(Tl, command);
//: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:
// 0 Invalid // 0 Invalid
// 1 - Valid // 1 - Valid
if (!response) if (!response)
throw new InvalidOperationException("Target Azimuth out of slew range."); throw new InvalidOperationException("Target Azimuth out of slew range.");
@@ -2969,7 +3020,7 @@ namespace ASCOM.Meade.net
LogMessage("DoSlewAsync", "Beginning slew sequence"); LogMessage("DoSlewAsync", "Beginning slew sequence");
CheckConnected("DoSlewAsync"); CheckConnected("DoSlewAsync");
CheckParked(); CheckParked();
if (Slewing) if (GetSlewing(true))
{ {
LogMessage("DoSlewAsync", "Cannot start a slew whilst slew is in progress."); LogMessage("DoSlewAsync", "Cannot start a slew whilst slew is in progress.");
throw new ASCOM.InvalidOperationException("Cannot start a slew whilst slew is in progress."); throw new ASCOM.InvalidOperationException("Cannot start a slew whilst slew is in progress.");
@@ -3108,22 +3159,30 @@ namespace ASCOM.Meade.net
public void SlewToCoordinatesAsync(double rightAscension, double declination) public void SlewToCoordinatesAsync(double rightAscension, double declination)
{ {
_forceSlewingCount++;
try try
{ {
LogMessage("SlewToCoordinatesAsync", $"Ra={rightAscension}, Dec={declination}"); try
CheckConnected("SlewToCoordinatesAsync"); {
CheckParked(); LogMessage("SlewToCoordinatesAsync", $"Ra={rightAscension}, Dec={declination}");
CheckConnected("SlewToCoordinatesAsync");
CheckParked();
TargetRightAscension = rightAscension; TargetRightAscension = rightAscension;
TargetDeclination = declination; TargetDeclination = declination;
DoSlewAsync(true); DoSlewAsync(true);
LogMessage("SlewToCoordinatesAsync", $"Completed Ra={rightAscension}, Dec={declination}"); LogMessage("SlewToCoordinatesAsync", $"Completed Ra={rightAscension}, Dec={declination}");
}
catch (Exception ex)
{
LogMessage("SlewToCoordinatesAsync", $"Error: {ex.Message}");
throw;
}
} }
catch (Exception ex) finally
{ {
LogMessage("SlewToCoordinatesAsync", $"Error: {ex.Message}"); _forceSlewingCount--;
throw;
} }
} }
@@ -3152,20 +3211,28 @@ namespace ASCOM.Meade.net
public void SlewToTargetAsync() public void SlewToTargetAsync()
{ {
_forceSlewingCount++;
try try
{ {
CheckConnected("SlewToTargetAsync"); try
CheckParked(); {
CheckConnected("SlewToTargetAsync");
CheckParked();
if (TargetDeclination.Equals(InvalidParameter) || TargetRightAscension.Equals(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);
}
catch (Exception ex)
{
LogMessage("SlewToTargetAsync", $"Error: {ex.Message}");
throw;
}
} }
catch (Exception ex) finally
{ {
LogMessage("SlewToTargetAsync", $"Error: {ex.Message}"); _forceSlewingCount--;
throw;
} }
} }
@@ -3189,12 +3256,7 @@ namespace ASCOM.Meade.net
{ {
try try
{ {
var isSlewing = GetSlewing(); var isSlewing = GetSlewing(false);
if (isSlewing)
SetSlewingMinEndTime();
else if (_clock.UtcNow < SharedResourcesWrapper.EarliestNonSlewingTime)
isSlewing = true;
LogMessage("Slewing", $"Result = {isSlewing}"); LogMessage("Slewing", $"Result = {isSlewing}");
return isSlewing; return isSlewing;
@@ -3217,17 +3279,32 @@ namespace ASCOM.Meade.net
return TimeSpan.FromSeconds( SlewSettleTime + _profileProperties.SettleTime ); return TimeSpan.FromSeconds( SlewSettleTime + _profileProperties.SettleTime );
} }
private bool GetSlewing() private bool GetSlewing(bool isInternalCall)
{ {
var result = false; var result = false;
try try
{ {
if (Connected) if (Connected)
{
result = MovingAxis() || IsSlewingToTarget(); result = MovingAxis() || IsSlewingToTarget();
if (!isInternalCall && !result)
{
result = _forceSlewingCount > 0;
}
}
} }
finally finally
{ {
LogMessage("GetSlewing", $"Result = {result}"); LogMessage("GetSlewing", $"Result = {result} (isInternalCall = {isInternalCall} _forceSlewingCount= {_forceSlewingCount})");
}
if (result)
SetSlewingMinEndTime();
else if (_clock.UtcNow < SharedResourcesWrapper.EarliestNonSlewingTime && !isInternalCall)
{
LogMessage("GetSlewing", $"Last slewing operation has not yet completed. You need to wait for another {(_clock.UtcNow - SharedResourcesWrapper.EarliestNonSlewingTime).TotalMilliseconds} Milliseconds");
result = true;
} }
return result; return result;
@@ -3275,6 +3352,12 @@ namespace ASCOM.Meade.net
isSlewing = true; isSlewing = true;
return isSlewing; return isSlewing;
} }
if (result.Equals("[FF][FF][FF] [FF][FF][FF] "))
{
isSlewing = true;
return isSlewing;
}
////classic LX200 return bar with 32 chars. FF is contained from left to right when slewing ////classic LX200 return bar with 32 chars. FF is contained from left to right when slewing
//byte[] ba = Encoding.Default.GetBytes(result); //byte[] ba = Encoding.Default.GetBytes(result);
@@ -3344,7 +3427,16 @@ namespace ASCOM.Meade.net
CheckConnected("SyncToTarget"); CheckConnected("SyncToTarget");
CheckParked(); CheckParked();
var result = SharedResourcesWrapper.SendString(Tl, "CM"); string result;
try
{
result = SharedResourcesWrapper.SendString(Tl, "CM");
}
catch (TimeoutException)
{
//Some old autostars timeout as the result isn't properly returned, until the next successful command is sent!
result = GetAlignmentString();
}
//: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.
@@ -3424,25 +3516,14 @@ namespace ASCOM.Meade.net
if (value < -90) if (value < -90)
throw new InvalidValueException("Declination cannot be less than -90."); throw new InvalidValueException("Declination cannot be less than -90.");
var dms = SharedResourcesWrapper.IsLongFormat string dms;
? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) try
: _utilities.DegreesToDM(value, "*", "", _digitsDe);
var s = value < 0 ? string.Empty : "+";
var command = $"Sd{s}{dms}";
LogMessage("TargetDeclination Set", $"{command}");
var result = SharedResourcesWrapper.SendChar(Tl, command);
//:SdsDD*MM#
//Set target object declination to sDD*MM or sDD*MM:SS depending on the current precision setting
//Returns:
//1 - Dec Accepted
//0 - Dec invalid
if (result == "0")
{ {
throw new InvalidOperationException("Target declination invalid"); dms = SetTargetDeclination(value, SharedResourcesWrapper.IsLongFormat);
}
catch (InvalidOperationException)
{
dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat);
} }
SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms); SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms);
@@ -3455,6 +3536,34 @@ namespace ASCOM.Meade.net
} }
} }
private string SetTargetDeclination(double value, bool useLongFormat)
{
var dms = useLongFormat
? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe)
: _utilities.DegreesToDMS(value, "*", ".", "", 0);
dms = dms.TrimEnd(':');
var s = value < 0 ? string.Empty : "+";
var command = $"Sd{s}{dms}";
LogMessage("TargetDeclination Set", $"{command}");
var result = SharedResourcesWrapper.SendChar(Tl, command);
//:SdsDD*MM#
//Set target object declination to sDD*MM or sDD*MM:SS depending on the current precision setting
//Returns:
//1 - Dec Accepted
//0 - Dec invalid
if (result == "0")
{
throw new InvalidOperationException("Target declination invalid");
}
return dms;
}
public double TargetRightAscension public double TargetRightAscension
{ {
get get
@@ -3496,22 +3605,15 @@ namespace ASCOM.Meade.net
if (value >= 24) if (value >= 24)
throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59"); throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59");
var hms = SharedResourcesWrapper.IsLongFormat string hms;
? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) try
: _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); {
hms = SetTargetRightAscension(value, SharedResourcesWrapper.IsLongFormat);
var command = $"Sr{hms}"; }
LogMessage("TargetRightAscension Set", $"{command}"); catch (InvalidOperationException)
var response = SharedResourcesWrapper.SendChar(Tl, command); {
//:SrHH:MM.T# hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat);
//:SrHH:MM:SS# }
//Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting.
// Returns:
//0 - Invalid
//1 - Valid
if (response == "0")
throw new InvalidOperationException("Failed to set TargetRightAscension.");
SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms); SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms);
} }
@@ -3523,6 +3625,30 @@ namespace ASCOM.Meade.net
} }
} }
private string SetTargetRightAscension(double value, bool useLongFormat)
{
var hms = useLongFormat
? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa)
//: _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.');
: _utilities.HoursToHMS(value, ":", ".", "", 0);
hms = hms.TrimEnd(':');
var command = $"Sr{hms}";
LogMessage("TargetRightAscension Set", $"{command}");
var response = SharedResourcesWrapper.SendChar(Tl, command);
//:SrHH:MM.T#
//:SrHH:MM:SS#
//Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting.
// Returns:
//0 - Invalid
//1 - Valid
if (response == "0")
throw new InvalidOperationException("Failed to set TargetRightAscension.");
return hms;
}
public bool Tracking public bool Tracking
{ {
get get
@@ -3594,7 +3720,7 @@ namespace ASCOM.Meade.net
rate = rate.Replace("+", string.Empty); rate = rate.Replace("+", string.Empty);
var rateDouble = double.Parse(rate); var rateDouble = double.Parse(rate, CultureInfo.InvariantCulture);
DriveRates result; DriveRates result;
@@ -3735,18 +3861,18 @@ namespace ASCOM.Meade.net
UtcCorrection = GetUtcCorrection() UtcCorrection = GetUtcCorrection()
}; };
int month = telescopeDateDetails.TelescopeDate.Substring(0, 2).ToInteger(); var month = telescopeDateDetails.TelescopeDate.Substring(0, 2).ToInteger();
int day = telescopeDateDetails.TelescopeDate.Substring(3, 2).ToInteger(); var day = telescopeDateDetails.TelescopeDate.Substring(3, 2).ToInteger();
int year = telescopeDateDetails.TelescopeDate.Substring(6, 2).ToInteger(); var year = telescopeDateDetails.TelescopeDate.Substring(6, 2).ToInteger();
if (year < 2000) //todo fix this hack that will create a Y2K100 bug if (year < 2000) //todo fix this hack that will create a Y2K100 bug
{ {
year = year + 2000; year += 2000;
} }
int hour = telescopeDateDetails.TelescopeTime.Substring(0, 2).ToInteger(); var hour = telescopeDateDetails.TelescopeTime.Substring(0, 2).ToInteger();
int minute = telescopeDateDetails.TelescopeTime.Substring(3, 2).ToInteger(); var minute = telescopeDateDetails.TelescopeTime.Substring(3, 2).ToInteger();
int second = telescopeDateDetails.TelescopeTime.Substring(6, 2).ToInteger(); var second = telescopeDateDetails.TelescopeTime.Substring(6, 2).ToInteger();
var utcDate = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc) + var utcDate = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc) +
telescopeDateDetails.UtcCorrection; telescopeDateDetails.UtcCorrection;
@@ -3834,6 +3960,7 @@ namespace ASCOM.Meade.net
{ {
case TelescopeList.RCX400: case TelescopeList.RCX400:
case TelescopeList.LX200GPS: case TelescopeList.LX200GPS:
case TelescopeList.LX800:
SharedResourcesWrapper.SendChar(Tl, "I"); SharedResourcesWrapper.SendChar(Tl, "I");
//:I# LX200 GPS Only - Causes the telescope to cease current operations and restart at its power on initialization. //:I# LX200 GPS Only - Causes the telescope to cease current operations and restart at its power on initialization.
//Returns: X once the handset restart has completed //Returns: X once the handset restart has completed
@@ -3931,7 +4058,9 @@ namespace ASCOM.Meade.net
/// This technique should mean that it is never necessary to manually register a driver with ASCOM. /// This technique should mean that it is never necessary to manually register a driver with ASCOM.
/// </remarks> /// </remarks>
[ComRegisterFunction] [ComRegisterFunction]
#pragma warning disable IDE0060 // Remove unused parameter
public static void RegisterAscom(Type t) public static void RegisterAscom(Type t)
#pragma warning restore IDE0060 // Remove unused parameter
{ {
RegUnregAscom(true); RegUnregAscom(true);
} }
@@ -3954,7 +4083,9 @@ namespace ASCOM.Meade.net
/// This technique should mean that it is never necessary to manually unregister a driver from ASCOM. /// This technique should mean that it is never necessary to manually unregister a driver from ASCOM.
/// </remarks> /// </remarks>
[ComUnregisterFunction] [ComUnregisterFunction]
#pragma warning disable IDE0060 // Remove unused parameter
public static void UnregisterAscom(Type t) public static void UnregisterAscom(Type t)
#pragma warning restore IDE0060 // Remove unused parameter
{ {
RegUnregAscom(false); RegUnregAscom(false);
} }
+2 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ASCOM.Platform" version="6.5.1" targetFramework="net472" /> <package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
</packages> </packages>
+88 -24
View File
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.13.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" /> <Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" />
<Import Project="..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props" Condition="Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" />
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" />
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -35,56 +39,107 @@
</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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
</Reference> </Reference>
<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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
</Reference> </Reference>
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll</HintPath> <HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="Moq, Version=4.15.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL"> <Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.15.2\lib\net45\Moq.dll</HintPath> <HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.13.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll</HintPath> <HintPath>..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.MSBuild.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.Telemetry, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.TrxReport.Abstractions, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.TrxReport.Abstractions.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.TrxReport.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Extensions.VSTestBridge, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Extensions.VSTestBridge.1.7.3\lib\netstandard2.0\Microsoft.Testing.Extensions.VSTestBridge.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Testing.Platform, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Testing.Platform.1.7.3\lib\netstandard2.0\Microsoft.Testing.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.AdapterUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.AdapterUtilities.17.13.0\lib\net462\Microsoft.TestPlatform.AdapterUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.CoreUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TestPlatform.PlatformAbstractions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.TestPlatform.PlatformAbstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.TestPlatform.ObjectModel.17.13.0\lib\net462\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.18.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.18.2\lib\net462\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll</HintPath>
</Reference>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<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.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference> </Reference>
@@ -111,7 +166,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="BootstrapAscomProfileStore.ps1" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -119,6 +173,16 @@
<PropertyGroup> <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> <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> </PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.13.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.0\build\NUnit.props'))" /> <Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Testing.Extensions.Telemetry.1.7.3\build\netstandard2.0\Microsoft.Testing.Extensions.Telemetry.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets'))" />
</Target> </Target>
<Import Project="..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.1.7.3\build\netstandard2.0\Microsoft.Testing.Platform.targets')" />
<Import Project="..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets" Condition="Exists('..\packages\Microsoft.Testing.Platform.MSBuild.1.7.3\build\Microsoft.Testing.Platform.MSBuild.targets')" />
<Import Project="..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets" Condition="Exists('..\packages\NUnit3TestAdapter.5.1.0\build\net462\NUnit3TestAdapter.targets')" />
</Project> </Project>
+145 -42
View File
@@ -151,21 +151,21 @@ namespace Meade.net.UnitTests
string TraceStateDefault = "false"; string TraceStateDefault = "false";
string ComPortDefault = "COM1"; string ComPortDefault = "COM1";
string SpeedDefault = "9600"; int SpeedDefault = 9600;
string DataBitsDefault = "8"; int DataBitsDefault = 8;
string StopBitsDefault = "One"; string StopBitsDefault = "One";
string HandshakeDefault = "None"; string HandshakeDefault = "None";
string ParityDefault = "None"; string ParityDefault = "None";
string RtsDtrEnabledDefault = "true"; bool RtsDtrEnabledDefault = true;
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate double GuideRateProfileNameDefault = 10.077939; //67% of sidereal rate
string PrecisionDefault = "Unchanged"; string PrecisionDefault = "Unchanged";
string GuidingStyleDefault = "Auto"; string GuidingStyleDefault = "Auto";
string BacklashCompensationDefault = "3000"; int BacklashCompensationDefault = 3000;
string ReverseFocuserDiectionDefault = "true"; bool ReverseFocuserDiectionDefault = true;
string SendDateTimeDefault = "true"; bool SendDateTimeDefault = true;
string SkipPromptsDefault = "true"; string SkipPromptsDefault = "true";
string ParkedBehaviourDefault = "No Coordinates"; string ParkedBehaviourDefault = "No Coordinates";
@@ -184,23 +184,23 @@ namespace Meade.net.UnitTests
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault)) profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
.Returns(ComPortDefault); .Returns(ComPortDefault);
profileWrapperMock profileWrapperMock
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty, .Setup(x => x.GetValueDouble(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault); GuideRateProfileNameDefault.ToString())).Returns(GuideRateProfileNameDefault);
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault)) profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault); .Returns(PrecisionDefault);
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Guiding Style", string.Empty, GuidingStyleDefault)) profileWrapperMock.Setup(x => x.GetValue(DriverId, "Guiding Style", string.Empty, GuidingStyleDefault))
.Returns(GuidingStyleDefault); .Returns(GuidingStyleDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Backlash Compensation", string.Empty, BacklashCompensationDefault)) x.GetValueInt(DriverId, "Backlash Compensation", string.Empty, BacklashCompensationDefault.ToString()))
.Returns(BacklashCompensationDefault); .Returns(BacklashCompensationDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Reverse Focuser Direction", string.Empty, "true")) x.GetValueBool(DriverId, "Reverse Focuser Direction", string.Empty, "true"))
.Returns(() => ReverseFocuserDiectionDefault); .Returns(() => ReverseFocuserDiectionDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault)) x.GetValueInt(DriverId, "Speed", string.Empty, SpeedDefault.ToString()))
.Returns(() => SpeedDefault); .Returns(() => SpeedDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault)) x.GetValueInt(DriverId, "Data Bits", string.Empty, DataBitsDefault.ToString()))
.Returns(() => DataBitsDefault); .Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault)) x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
@@ -212,7 +212,7 @@ namespace Meade.net.UnitTests
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault)) x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault); .Returns(() => ParityDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, "false")) x.GetValueBool(DriverId, "Rts / Dtr", string.Empty, "false"))
.Returns(() => RtsDtrEnabledDefault); .Returns(() => RtsDtrEnabledDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
@@ -239,7 +239,7 @@ namespace Meade.net.UnitTests
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Send Date and time on connect", string.Empty, "false")) x.GetValueBool(DriverId, "Send Date and time on connect", string.Empty, "false"))
.Returns(() => SendDateTimeDefault); .Returns(() => SendDateTimeDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
@@ -264,21 +264,21 @@ namespace Meade.net.UnitTests
Assert.That(profileProperties.ComPort, Is.EqualTo(ComPortDefault)); Assert.That(profileProperties.ComPort, Is.EqualTo(ComPortDefault));
Assert.That(profileProperties.GuideRateArcSecondsPerSecond, Assert.That(profileProperties.GuideRateArcSecondsPerSecond,
Is.EqualTo(double.Parse(GuideRateProfileNameDefault))); Is.EqualTo(GuideRateProfileNameDefault));
Assert.That(profileProperties.Precision, Is.EqualTo(PrecisionDefault)); Assert.That(profileProperties.Precision, Is.EqualTo(PrecisionDefault));
Assert.That(profileProperties.GuidingStyle, Is.EqualTo(GuidingStyleDefault)); Assert.That(profileProperties.GuidingStyle, Is.EqualTo(GuidingStyleDefault));
Assert.That(profileProperties.BacklashCompensation, Is.EqualTo(int.Parse(BacklashCompensationDefault))); Assert.That(profileProperties.BacklashCompensation, Is.EqualTo(BacklashCompensationDefault));
Assert.That(profileProperties.ReverseFocusDirection, Is.EqualTo(bool.Parse(ReverseFocuserDiectionDefault))); Assert.That(profileProperties.ReverseFocusDirection, Is.EqualTo(ReverseFocuserDiectionDefault));
Assert.That(profileProperties.Speed, Is.EqualTo(int.Parse(SpeedDefault))); Assert.That(profileProperties.Speed, Is.EqualTo(SpeedDefault));
Assert.That(profileProperties.DataBits, Is.EqualTo(int.Parse(DataBitsDefault))); Assert.That(profileProperties.DataBits, Is.EqualTo(DataBitsDefault));
Assert.That(profileProperties.StopBits, Is.EqualTo(StopBitsDefault)); Assert.That(profileProperties.StopBits, Is.EqualTo(StopBitsDefault));
Assert.That(profileProperties.Handshake, Is.EqualTo(HandshakeDefault)); Assert.That(profileProperties.Handshake, Is.EqualTo(HandshakeDefault));
Assert.That(profileProperties.Parity, Is.EqualTo(ParityDefault)); Assert.That(profileProperties.Parity, Is.EqualTo(ParityDefault));
Assert.That(profileProperties.RtsDtrEnabled, Is.EqualTo(bool.Parse(RtsDtrEnabledDefault))); Assert.That(profileProperties.RtsDtrEnabled, Is.EqualTo(RtsDtrEnabledDefault));
Assert.That(profileProperties.SendDateTime, Is.EqualTo(bool.Parse(SendDateTimeDefault))); Assert.That(profileProperties.SendDateTime, Is.EqualTo(SendDateTimeDefault));
} }
[TestCase("TCP")] [TestCase("TCP")]
@@ -488,6 +488,109 @@ namespace Meade.net.UnitTests
} }
} }
[Test]
public void Connect_WhenDeviceIdIsSerialGVPGVTPartiallySupported_ThenConnectsAndSetsProductToLXD600()
{
string deviceId = "Serial";
string DriverId = "ASCOM.MeadeGeneric.Telescope";
string TraceStateDefault = "false";
string ComPortDefault = "COM1";
string SpeedDefault = "9600";
string DataBitsDefault = "8";
string StopBitsDefault = "One";
string HandshakeDefault = "None";
string ParityDefault = "None";
string RtsDtrEnabledDefault = "false";
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string ParkedBehaviourDefault = "No Coordinates";
string ParkedAltDefault = "0";
string ParkedAzimuthDefault = "180";
string FocalLengthDefault = "2000";
string ApertureAreaDefault = "32685";
string ApertureDiameterDefault = "203";
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);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => SpeedDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
.Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
.Returns(() => StopBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
.Returns(() => HandshakeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
.Returns(() => RtsDtrEnabledDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
.Returns(() => ParkedAltDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
.Returns(() => ParkedAzimuthDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
.Returns(() => FocalLengthDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
.Returns(() => ApertureAreaDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
.Returns(() => ApertureDiameterDefault);
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
SharedResources.ProfileFactory = profileFactoryMock.Object;
string serialPortReturn = string.Empty;
string productNameAndFirmwareVersion = TelescopeList.LXD600_6_12S;
_serialMock.Setup(x => x.Transmit("#:GVP#")).Callback(() => { serialPortReturn = productNameAndFirmwareVersion; });
_serialMock.Setup(x => x.Transmit("#:GVN#")).Callback(() => { serialPortReturn = productNameAndFirmwareVersion; });
_serialMock.Setup(x => x.Transmit("#:GG#")).Callback(() => { serialPortReturn = "0"; });
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => serialPortReturn);
var connectionResult = SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object);
try
{
Assert.That(connectionResult.SameDevice, Is.EqualTo(1));
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.LXD600));
Assert.That(SharedResources.FirmwareVersion, Is.EqualTo(productNameAndFirmwareVersion));
}
finally
{
SharedResources.Disconnect(deviceId, String.Empty);
}
}
[Test] [Test]
public void Connect_WhenDeviceIdIsSerialButGVPIsAutostar_ThenConnectsAndSetsProductToAutostarAndFirmware() public void Connect_WhenDeviceIdIsSerialButGVPIsAutostar_ThenConnectsAndSetsProductToAutostarAndFirmware()
{ {
@@ -692,15 +795,15 @@ namespace Meade.net.UnitTests
} }
} }
[TestCase("57600")] [TestCase(57600)]
[TestCase("38400")] [TestCase(38400)]
[TestCase("28800")] [TestCase(28800)]
[TestCase("19200")] [TestCase(19200)]
[TestCase("14400")] [TestCase(14400)]
[TestCase("4800")] [TestCase(4800)]
[TestCase("2400")] [TestCase(2400)]
[TestCase("1200")] [TestCase(1200)]
public void Connect_WhenSpeedIsFastAndAutostarAtDefault_ThenConnectsAutoStarSpeedChanged(string WantedSpeed) public void Connect_WhenSpeedIsFastAndAutostarAtDefault_ThenConnectsAutoStarSpeedChanged(int WantedSpeed)
{ {
string deviceId = "Serial"; string deviceId = "Serial";
@@ -739,7 +842,7 @@ namespace Meade.net.UnitTests
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault)) profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault); .Returns(PrecisionDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault)) x.GetValueInt(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => WantedSpeed); .Returns(() => WantedSpeed);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault)) x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
@@ -812,15 +915,15 @@ namespace Meade.net.UnitTests
} }
} }
[TestCase("57600")] [TestCase(57600)]
[TestCase("38400")] [TestCase(38400)]
[TestCase("28800")] [TestCase(28800)]
[TestCase("19200")] [TestCase(19200)]
[TestCase("14400")] [TestCase(14400)]
[TestCase("4800")] [TestCase(4800)]
[TestCase("2400")] [TestCase(2400)]
[TestCase("1200")] [TestCase(1200)]
public void Connect_WhenAutostarReportsFailedToChangeSpeec_ThenConnectsAutoStarAtDefaultSpeed(string WantedSpeed) public void Connect_WhenAutostarReportsFailedToChangeSpeec_ThenConnectsAutoStarAtDefaultSpeed(int WantedSpeed)
{ {
string deviceId = "Serial"; string deviceId = "Serial";
@@ -859,7 +962,7 @@ namespace Meade.net.UnitTests
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault)) profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault); .Returns(PrecisionDefault);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault)) x.GetValueInt(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => WantedSpeed); .Returns(() => WantedSpeed);
profileWrapperMock.Setup(x => profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault)) x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
+1 -1
View File
@@ -8,7 +8,7 @@
</dependentAssembly> </dependentAssembly>
<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-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
+22 -7
View File
@@ -1,11 +1,26 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ASCOM.Platform" version="6.5.1" targetFramework="net472" /> <package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
<package id="Castle.Core" version="4.4.1" targetFramework="net472" /> <package id="Castle.Core" version="5.1.0" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
<package id="Moq" version="4.15.2" targetFramework="net472" /> <package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
<package id="NUnit" version="3.13.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" targetFramework="net472" />
<package id="NUnit.ConsoleRunner" version="3.12.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.TrxReport.Abstractions" version="1.7.3" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" /> <package id="Microsoft.Testing.Extensions.VSTestBridge" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.Testing.Platform.MSBuild" version="1.7.3" targetFramework="net472" />
<package id="Microsoft.TestPlatform.AdapterUtilities" version="17.13.0" targetFramework="net472" />
<package id="Microsoft.TestPlatform.ObjectModel" version="17.13.0" targetFramework="net472" />
<package id="Moq" version="4.18.2" targetFramework="net472" />
<package id="NUnit" version="3.13.3" targetFramework="net472" />
<package id="NUnit.ConsoleRunner" version="3.15.2" targetFramework="net472" />
<package id="NUnit3TestAdapter" version="5.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
<package id="System.Diagnostics.DiagnosticSource" version="5.0.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="7.0.0-preview.2.22152.2" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>
+2 -2
View File
@@ -260,7 +260,7 @@ namespace ASCOM.Meade.net
} }
} }
private readonly int _maxIncrement = 7000; private readonly int _maxIncrement = 30000;
public int MaxIncrement public int MaxIncrement
{ {
get get
@@ -270,7 +270,7 @@ namespace ASCOM.Meade.net
} }
} }
private readonly int _maxStep = 7000; private readonly int _maxStep = 30000;
public int MaxStep public int MaxStep
{ {
+13 -14
View File
@@ -83,40 +83,40 @@
</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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
</Reference> </Reference>
<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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.configuration" /> <Reference Include="System.configuration" />
@@ -154,7 +154,6 @@
<None Include="app.config" /> <None Include="app.config" />
<None Include="ASCOM.png" /> <None Include="ASCOM.png" />
<None Include="ASCOMDriverTemplate.snk" /> <None Include="ASCOMDriverTemplate.snk" />
<None Include="BootstrapAscomProfileStore.ps1" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
+2 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ASCOM.Platform" version="6.5.1" targetFramework="net472" /> <package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
</packages> </packages>
+2
View File
@@ -2,10 +2,12 @@
<Settings> <Settings>
<AllowParallelTestExecution>True</AllowParallelTestExecution> <AllowParallelTestExecution>True</AllowParallelTestExecution>
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace> <CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
<EnableRDI>True</EnableRDI>
<MetricsExclusionList> <MetricsExclusionList>
<Value>FocuserTestConsole\FocuserTestConsole.csproj</Value> <Value>FocuserTestConsole\FocuserTestConsole.csproj</Value>
<Value>TelescopeTestConsole\TelescopeTestConsole.csproj</Value> <Value>TelescopeTestConsole\TelescopeTestConsole.csproj</Value>
</MetricsExclusionList> </MetricsExclusionList>
<RdiConfigured>True</RdiConfigured>
<SolutionConfigured>True</SolutionConfigured> <SolutionConfigured>True</SolutionConfigured>
</Settings> </Settings>
</SolutionConfiguration> </SolutionConfiguration>
+14 -14
View File
@@ -86,40 +86,40 @@
</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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
</Reference> </Reference>
<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">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL"> <Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
<HintPath>..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll</HintPath> <HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
</Reference> </Reference>
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
@@ -148,6 +148,7 @@
<Compile Include="TelescopeList.cs" /> <Compile Include="TelescopeList.cs" />
<Compile Include="ThreadSafeValue.cs" /> <Compile Include="ThreadSafeValue.cs" />
<Compile Include="Win32Utilities.cs" /> <Compile Include="Win32Utilities.cs" />
<Compile Include="Wrapper\GetValueException.cs" />
<Compile Include="Wrapper\IProfileWrapper.cs" /> <Compile Include="Wrapper\IProfileWrapper.cs" />
<Compile Include="Wrapper\SharedResourcesWrapper.cs" /> <Compile Include="Wrapper\SharedResourcesWrapper.cs" />
<EmbeddedResource Include="frmMain.resx"> <EmbeddedResource Include="frmMain.resx">
@@ -179,7 +180,6 @@
<ItemGroup> <ItemGroup>
<Content Include="ASCOM.ico" /> <Content Include="ASCOM.ico" />
<Content Include="ASCOM.png" /> <Content Include="ASCOM.png" />
<None Include="BootstrapAscomProfileStore.ps1" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Resources\ASCOM.bmp" /> <None Include="Resources\ASCOM.bmp" />
</ItemGroup> </ItemGroup>
+1
View File
@@ -26,5 +26,6 @@ namespace ASCOM.Meade.net
public double FocalLength { get; set; } public double FocalLength { get; set; }
public double ApertureArea { get; set; } public double ApertureArea { get; set; }
public double ApertureDiameter { get; set; } public double ApertureDiameter { get; set; }
public int TimeoutMs { get; set; }
} }
} }
+27
View File
@@ -232,6 +232,15 @@ namespace ASCOM.Meade.net
txtApertureDiameter.Text = "203"; txtApertureDiameter.Text = "203";
} }
try
{
txtTimeout.Text = profileProperties.TimeoutMs.ToString(CultureInfo.CurrentCulture);
}
catch (Exception)
{
txtTimeout.Text = "5000";
}
UpdateParkedItemsEnabled(); UpdateParkedItemsEnabled();
} }
@@ -241,6 +250,7 @@ namespace ASCOM.Meade.net
{ {
TraceLogger = chkTrace.Checked, TraceLogger = chkTrace.Checked,
ComPort = comboBoxComPort.SelectedItem.ToString(), ComPort = comboBoxComPort.SelectedItem.ToString(),
TimeoutMs = Convert.ToInt32(txtTimeout.Text),
RtsDtrEnabled = cbxRtsDtr.Checked, RtsDtrEnabled = cbxRtsDtr.Checked,
DataBits = Convert.ToInt32(numDatabits.Value), DataBits = Convert.ToInt32(numDatabits.Value),
StopBits = cboStopBits.SelectedItem.ToString(), StopBits = cboStopBits.SelectedItem.ToString(),
@@ -376,6 +386,23 @@ namespace ASCOM.Meade.net
txtFocalLength.Text = txtFocalLength.Text.Remove(txtFocalLength.Text.Length - 1); txtFocalLength.Text = txtFocalLength.Text.Remove(txtFocalLength.Text.Length - 1);
} }
} }
private void button1_Click(object sender, EventArgs e)
{
string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
Process.Start(new ProcessStartInfo()
{
FileName = $"{myDocumentsPath}\\ASCOM",
UseShellExecute = true,
Verb = "open"
});
}
private void label29_Click(object sender, EventArgs e)
{
}
} }
} }
+37 -2
View File
@@ -91,6 +91,10 @@ namespace ASCOM.Meade.net
this.label29 = new System.Windows.Forms.Label(); this.label29 = new System.Windows.Forms.Label();
this.txtApertureArea = new System.Windows.Forms.TextBox(); this.txtApertureArea = new System.Windows.Forms.TextBox();
this.label30 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.txtTimeout = new System.Windows.Forms.TextBox();
this.label31 = new System.Windows.Forms.Label();
this.label32 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit();
@@ -419,7 +423,7 @@ namespace ASCOM.Meade.net
resources.ApplyResources(this.label27, "label27"); resources.ApplyResources(this.label27, "label27");
this.label27.Name = "label27"; this.label27.Name = "label27";
// //
// txtApetureDiameter // txtApertureDiameter
// //
resources.ApplyResources(this.txtApertureDiameter, "txtApertureDiameter"); resources.ApplyResources(this.txtApertureDiameter, "txtApertureDiameter");
this.txtApertureDiameter.Name = "txtApertureDiameter"; this.txtApertureDiameter.Name = "txtApertureDiameter";
@@ -433,8 +437,9 @@ namespace ASCOM.Meade.net
// //
resources.ApplyResources(this.label29, "label29"); resources.ApplyResources(this.label29, "label29");
this.label29.Name = "label29"; this.label29.Name = "label29";
this.label29.Click += new System.EventHandler(this.label29_Click);
// //
// txtApetureArea // txtApertureArea
// //
resources.ApplyResources(this.txtApertureArea, "txtApertureArea"); resources.ApplyResources(this.txtApertureArea, "txtApertureArea");
this.txtApertureArea.Name = "txtApertureArea"; this.txtApertureArea.Name = "txtApertureArea";
@@ -444,10 +449,36 @@ namespace ASCOM.Meade.net
resources.ApplyResources(this.label30, "label30"); resources.ApplyResources(this.label30, "label30");
this.label30.Name = "label30"; this.label30.Name = "label30";
// //
// button1
//
resources.ApplyResources(this.button1, "button1");
this.button1.Name = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// txtTimeout
//
resources.ApplyResources(this.txtTimeout, "txtTimeout");
this.txtTimeout.Name = "txtTimeout";
//
// label31
//
resources.ApplyResources(this.label31, "label31");
this.label31.Name = "label31";
//
// label32
//
resources.ApplyResources(this.label32, "label32");
this.label32.Name = "label32";
//
// SetupDialogForm // SetupDialogForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label32);
this.Controls.Add(this.label31);
this.Controls.Add(this.txtTimeout);
this.Controls.Add(this.button1);
this.Controls.Add(this.label29); this.Controls.Add(this.label29);
this.Controls.Add(this.txtApertureArea); this.Controls.Add(this.txtApertureArea);
this.Controls.Add(this.label30); this.Controls.Add(this.label30);
@@ -580,5 +611,9 @@ namespace ASCOM.Meade.net
private Label label29; private Label label29;
private TextBox txtApertureArea; private TextBox txtApertureArea;
private Label label30; private Label label30;
private Button button1;
private TextBox txtTimeout;
private Label label31;
private Label label32;
} }
} }
File diff suppressed because it is too large Load Diff
+35 -22
View File
@@ -8,7 +8,7 @@
// //
// NOTES: // NOTES:
// //
// * ALL DECLARATIONS MUST BE STATIC HERE!! INSTANCES OF THIS CLASS MUST NEVER BE CREATED! // * ALL DECLARATIONS MUST BE STATIC HERE!! INSTANCES OF THIS CLASS MUST NEVER BE CREATEDReceiveTimeout
// //
// Written by: Bob Denny 29-May-2007 // Written by: Bob Denny 29-May-2007
// Modified by Chris Rowland and Peter Simpson to hamdle multiple hardware devices March 2011 // Modified by Chris Rowland and Peter Simpson to hamdle multiple hardware devices March 2011
@@ -111,9 +111,9 @@ namespace ASCOM.Meade.net
try try
{ {
var result = SharedSerial.ReceiveTerminated("#").TrimEnd('#'); var result = SharedSerial.ReceiveTerminated("#");
traceLogger.LogMessage("SendString", $"Received {result}", false); traceLogger.LogMessage("SendString", $"Received {result}", false);
return result; return result.TrimEnd('#');
} }
catch (COMException ex) catch (COMException ex)
{ {
@@ -189,6 +189,7 @@ namespace ASCOM.Meade.net
// Constants used for Profile persistence // Constants used for Profile persistence
private const string ComPortProfileName = "COM Port"; private const string ComPortProfileName = "COM Port";
private const string TimeoutMsName = "Serial Timeout (MS)";
private const string RtsDtrProfileName = "Rts / Dtr"; private const string RtsDtrProfileName = "Rts / Dtr";
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";
@@ -210,7 +211,7 @@ namespace ASCOM.Meade.net
private const string ParkedAltName = "Parked Altitude"; private const string ParkedAltName = "Parked Altitude";
private const string ParkedAzimuthName = "Parked Azimuth"; private const string ParkedAzimuthName = "Parked Azimuth";
private const string FocalLengthName = "Focal Length (mm)"; private const string FocalLengthName = "Focal Length (mm)";
private const string ApertureAreaName = "Aperture Area (mm²)"; private const string ApertureAreaName = "Aperture Area (mm)";
private const string ApertureDiameterName = "Aperture Diameter (mm)"; private const string ApertureDiameterName = "Aperture Diameter (mm)";
public static void WriteProfile(ProfileProperties profileProperties) public static void WriteProfile(ProfileProperties profileProperties)
@@ -222,6 +223,7 @@ namespace ASCOM.Meade.net
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, TimeoutMsName, profileProperties.TimeoutMs.ToString());
driverProfile.WriteValue(DriverId, RtsDtrProfileName, profileProperties.RtsDtrEnabled.ToString()); driverProfile.WriteValue(DriverId, RtsDtrProfileName, profileProperties.RtsDtrEnabled.ToString());
driverProfile.WriteValue(DriverId, SpeedName, profileProperties.Speed.ToString(CultureInfo.InvariantCulture)); driverProfile.WriteValue(DriverId, SpeedName, profileProperties.Speed.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, DataBitsName, profileProperties.DataBits.ToString(CultureInfo.InvariantCulture)); driverProfile.WriteValue(DriverId, DataBitsName, profileProperties.DataBits.ToString(CultureInfo.InvariantCulture));
@@ -248,6 +250,7 @@ namespace ASCOM.Meade.net
} }
private const string ComPortDefault = "COM1"; private const string ComPortDefault = "COM1";
private const string TimeoutMsDefault = "5000";
private const string RtsDtrDefault = "false"; private const string RtsDtrDefault = "false";
private const string TraceStateDefault = "false"; private const string TraceStateDefault = "false";
private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
@@ -280,29 +283,30 @@ namespace ASCOM.Meade.net
{ {
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.RtsDtrEnabled = Convert.ToBoolean(driverProfile.GetValue(DriverId, RtsDtrProfileName, string.Empty, RtsDtrDefault)); profileProperties.TimeoutMs = driverProfile.GetValueInt(DriverId, TimeoutMsName, string.Empty, TimeoutMsDefault);
profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault)); profileProperties.RtsDtrEnabled = driverProfile.GetValueBool(DriverId, RtsDtrProfileName, string.Empty, RtsDtrDefault);
profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault), NumberFormatInfo.InvariantInfo); profileProperties.TraceLogger = driverProfile.GetValueBool(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault);
profileProperties.GuideRateArcSecondsPerSecond = driverProfile.GetValueDouble(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault);
profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault); profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault);
profileProperties.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault); profileProperties.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault);
profileProperties.BacklashCompensation = Convert.ToInt32(driverProfile.GetValue(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault)); profileProperties.BacklashCompensation = driverProfile.GetValueInt(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault);
profileProperties.ReverseFocusDirection = Convert.ToBoolean(driverProfile.GetValue(DriverId, ReverseFocusDirectionName, string.Empty, ReverseFocuserDiectionDefault)); profileProperties.ReverseFocusDirection = driverProfile.GetValueBool(DriverId, ReverseFocusDirectionName, string.Empty, ReverseFocuserDiectionDefault);
profileProperties.DynamicBreaking = Convert.ToBoolean(driverProfile.GetValue(DriverId, DynamicBreakingName, string.Empty, DynamicBreakingDefault)); profileProperties.DynamicBreaking = driverProfile.GetValueBool(DriverId, DynamicBreakingName, string.Empty, DynamicBreakingDefault);
profileProperties.SiteElevation = Convert.ToInt32(driverProfile.GetValue(DriverId, SiteElevationName, string.Empty, SiteElevationDefault)); profileProperties.SiteElevation = driverProfile.GetValueInt(DriverId, SiteElevationName, string.Empty, SiteElevationDefault);
profileProperties.SettleTime = Convert.ToInt16(driverProfile.GetValue(DriverId, SettleTimeName, string.Empty, SettleTimeDefault)); profileProperties.SettleTime = driverProfile.GetValueShort(DriverId, SettleTimeName, string.Empty, SettleTimeDefault);
profileProperties.StopBits = driverProfile.GetValue(DriverId, StopBitsName, string.Empty, StopBitsDefault); profileProperties.StopBits = driverProfile.GetValue(DriverId, StopBitsName, string.Empty, StopBitsDefault);
profileProperties.DataBits = Convert.ToInt32(driverProfile.GetValue(DriverId, DataBitsName, string.Empty, DataBitsDefault)); profileProperties.DataBits = driverProfile.GetValueInt(DriverId, DataBitsName, string.Empty, DataBitsDefault);
profileProperties.Handshake = driverProfile.GetValue(DriverId, HandShakeName, string.Empty, HandShakeDefault); profileProperties.Handshake = driverProfile.GetValue(DriverId, HandShakeName, string.Empty, HandShakeDefault);
profileProperties.Speed = Convert.ToInt32(driverProfile.GetValue(DriverId, SpeedName, string.Empty, SpeedDefault)); profileProperties.Speed = driverProfile.GetValueInt(DriverId, SpeedName, string.Empty, SpeedDefault);
profileProperties.Parity = driverProfile.GetValue(DriverId, ParityName, string.Empty, ParityDefault); profileProperties.Parity = driverProfile.GetValue(DriverId, ParityName, string.Empty, ParityDefault);
profileProperties.SendDateTime = Convert.ToBoolean(driverProfile.GetValue(DriverId, SendDateTimeName, string.Empty, SendDateTimeDefault)); profileProperties.SendDateTime = driverProfile.GetValueBool(DriverId, SendDateTimeName, string.Empty, SendDateTimeDefault);
profileProperties.ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(driverProfile.GetValue(DriverId, ParkedBehaviourName, string.Empty, ParkedBehaviourDefault)); profileProperties.ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(driverProfile.GetValue(DriverId, ParkedBehaviourName, string.Empty, ParkedBehaviourDefault));
profileProperties.ParkedAlt = double.Parse(driverProfile.GetValue(DriverId, ParkedAltName, string.Empty, ParkedAltDefault), NumberFormatInfo.InvariantInfo); profileProperties.ParkedAlt = driverProfile.GetValueDouble(DriverId, ParkedAltName, string.Empty, ParkedAltDefault);
profileProperties.ParkedAz = double.Parse(driverProfile.GetValue(DriverId, ParkedAzimuthName, string.Empty, ParkedAzimuthDefault), NumberFormatInfo.InvariantInfo); profileProperties.ParkedAz = driverProfile.GetValueDouble(DriverId, ParkedAzimuthName, string.Empty, ParkedAzimuthDefault);
profileProperties.FocalLength = double.Parse(driverProfile.GetValue(DriverId, FocalLengthName, string.Empty, FocalLengthDefault), NumberFormatInfo.InvariantInfo); profileProperties.FocalLength = driverProfile.GetValueDouble(DriverId, FocalLengthName, string.Empty, FocalLengthDefault);
profileProperties.ApertureArea = double.Parse(driverProfile.GetValue(DriverId, ApertureAreaName, string.Empty, ApertureAreaDefault), NumberFormatInfo.InvariantInfo); profileProperties.ApertureArea = driverProfile.GetValueDouble(DriverId, ApertureAreaName, string.Empty, ApertureAreaDefault);
profileProperties.ApertureDiameter = double.Parse(driverProfile.GetValue(DriverId, ApertureDiameterName, string.Empty, ApertureDiameterDefault), NumberFormatInfo.InvariantInfo); profileProperties.ApertureDiameter = driverProfile.GetValueDouble(DriverId, ApertureDiameterName, string.Empty, ApertureDiameterDefault);
} }
return profileProperties; return profileProperties;
@@ -401,7 +405,7 @@ namespace ASCOM.Meade.net
SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits); SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits);
SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity); SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity);
SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake); SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake);
SharedSerial.ReceiveTimeout = 5; //5 second timeout; SharedSerial.ReceiveTimeoutMs = profileProperties.TimeoutMs;
SharedSerial.Speed = SerialSpeed.ps9600; SharedSerial.Speed = SerialSpeed.ps9600;
var wantedSpeed = (SerialSpeed)profileProperties.Speed; var wantedSpeed = (SerialSpeed)profileProperties.Speed;
@@ -466,11 +470,20 @@ namespace ASCOM.Meade.net
} }
} }
SharedSerial.Connected = true; SharedSerial.Connected = true;
try try
{ {
ProductName = SendString(traceLogger, "GVP"); ProductName = SendString(traceLogger, "GVP");
FirmwareVersion = SendString(traceLogger, "GVN"); FirmwareVersion = SendString(traceLogger, "GVN");
//LXD600 mount uses LX-200 based firmware. When both above commands are sent to the scope,
//they both return the "6.12S" string.
//There may be other values of the string applicable to LXD600 mount or other values of the string
//may allow identify LXD650/LXD700 or other scopes. May require further adjustments.
if (String.Equals(ProductName, FirmwareVersion) && String.Equals(ProductName, TelescopeList.LXD600_6_12S))
{
ProductName = TelescopeList.LXD600;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
+19
View File
@@ -4,6 +4,7 @@
{ {
#region Autostar 497/Audiostar #region Autostar 497/Audiostar
public const string Audiostar = "Audiostar"; //This is a synonym for Autostar which can be returned by some of the Audiostar firmware revisions A1f7
public const string Autostar497 = "Autostar"; public const string Autostar497 = "Autostar";
//Autostar/Audiostar firmware revisions //Autostar/Audiostar firmware revisions
@@ -14,6 +15,8 @@
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public const string Autostar497_43Eg = "43Eg"; public const string Autostar497_43Eg = "43Eg";
// ReSharper disable once InconsistentNaming
public const string AudioStar_A1F7 = "A1F7";
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public const string AudioStar_A4S4 = "A4S4"; public const string AudioStar_A4S4 = "A4S4";
#endregion #endregion
@@ -26,6 +29,15 @@
public const string LX200GPS_42F = "4.2f"; public const string LX200GPS_42F = "4.2f";
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public const string LX200GPS_42G = "4.2g"; public const string LX200GPS_42G = "4.2g";
public const string LX200GPS_4G0M = "4G0m";
#endregion
#region LX800
public const string LX800 = "LX800";
public const string LX800_11i = "1.1i";
#endregion #endregion
#region LX200EMC #region LX200EMC
@@ -33,6 +45,13 @@
public const string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported! public const string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported!
#endregion #endregion
#region LXD600
public const string LXD600 = "LXD600";
public const string LXD600_6_12S = "6.12S";
#endregion
#region RCX400 #region RCX400
// ReSharper disable once InconsistentNaming // ReSharper disable once InconsistentNaming
public const string RCX400 = "RCX400"; public const string RCX400 = "RCX400";
+28
View File
@@ -0,0 +1,28 @@
using System;
namespace ASCOM.Meade.net.Wrapper
{
public class GetValueException : Exception
{
public GetValueException(
string driverId,
string name,
string subKey,
string defaultValue,
Exception innerException
) : base ( $"Error getting value {name} from driver {driverId} in {subKey} and default value {defaultValue} cannot be used.", innerException)
{
}
public GetValueException(
string driverId,
string name,
string subKey,
string defaultValue,
string value,
Exception innerException):
base($"Error converting value {name} from {value}", innerException)
{
}
}
}
+67 -1
View File
@@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Globalization;
using ASCOM.Utilities; using ASCOM.Utilities;
using ASCOM.Utilities.Interfaces; using ASCOM.Utilities.Interfaces;
@@ -7,7 +8,11 @@ namespace ASCOM.Meade.net.Wrapper
{ {
public interface IProfileWrapper : IProfile, IProfileExtra, IDisposable public interface IProfileWrapper : IProfile, IProfileExtra, IDisposable
{ {
int GetValueInt(string driverId, string name, string subKey, string defaultValue);
short GetValueShort(string driverId, string name, string subKey, string defaultValue);
bool GetValueBool(string driverId, string name, string subKey, string defaultValue);
double GetValueDouble(string driverId, string name, string subKey, string defaultValue);
} }
public class ProfileWrapper : IProfileWrapper public class ProfileWrapper : IProfileWrapper
@@ -36,7 +41,68 @@ namespace ASCOM.Meade.net.Wrapper
public string GetValue(string driverId, string name, string subKey, string defaultValue) public string GetValue(string driverId, string name, string subKey, string defaultValue)
{ {
return _profile.GetValue(driverId, name, subKey, defaultValue); try
{
return _profile.GetValue(driverId, name, subKey, defaultValue);
}
catch (Exception e)
{
throw new GetValueException(driverId, name, subKey, defaultValue, e);
}
}
public int GetValueInt(string driverId, string name, string subKey, string defaultValue)
{
var value = GetValue(driverId, name, subKey, defaultValue);
try
{
return int.Parse(value, CultureInfo.InvariantCulture);
}
catch (Exception e)
{
throw new GetValueException(driverId, name, subKey, defaultValue, value, e);
}
}
public short GetValueShort(string driverId, string name, string subKey, string defaultValue)
{
var value = GetValue(driverId, name, subKey, defaultValue);
try
{
return short.Parse(value, CultureInfo.InvariantCulture);
}
catch (Exception e)
{
throw new GetValueException(driverId, name, subKey, defaultValue, value, e);
}
}
public bool GetValueBool(string driverId, string name, string subKey, string defaultValue)
{
var value = GetValue(driverId, name, subKey, defaultValue);
try
{
return bool.Parse(value);
}
catch (Exception e)
{
throw new GetValueException(driverId, name, subKey, defaultValue, value, e);
}
}
public double GetValueDouble(string driverId, string name, string subKey, string defaultValue)
{
var value = GetValue(driverId, name, subKey, defaultValue);
try
{
return double.Parse(value, CultureInfo.InvariantCulture);
}
catch (Exception e)
{
throw new GetValueException(driverId, name, subKey, defaultValue, value, e);
}
} }
public void WriteValue(string driverId, string name, string value, string subKey) public void WriteValue(string driverId, string name, string value, string subKey)
+2 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ASCOM.Platform" version="6.5.1" targetFramework="net472" /> <package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
</packages> </packages>
@@ -59,8 +59,8 @@
<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" />
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" /> <Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
<Reference Include="JetBrains.Annotations, Version=2020.3.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL"> <Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll</HintPath> <HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net45" /> <package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net48" />
</packages> </packages>