Compare commits
401 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b63bbec629 | |||
| a0d5eec267 | |||
| c24b4c1161 | |||
| a89b1c8fa6 | |||
| d1ed5558b2 | |||
| ea07c7b625 | |||
| 56642267b0 | |||
| ddd67b330a | |||
| 0bc4980786 | |||
| 8521b3e2d2 | |||
| a81318f4b5 | |||
| e7e216597a | |||
| a04cc82a46 | |||
| 7a0ee85af6 | |||
| 056484bce9 | |||
| 6aa19b869b | |||
| 431776cfdf | |||
| 0afb80bd70 | |||
| 4ef80b448e | |||
| cd6e72eb0a | |||
| c2bc2cfc7e | |||
| 7554c1e213 | |||
| 372c98a22c | |||
| 04c2f5e1bb | |||
| 5b050c45c6 | |||
| 44c59d1a55 | |||
| bb9fca7e9a | |||
| a0878ce153 | |||
| 80899b8056 | |||
| 99b3bce71a | |||
| 4c7a40a8e4 | |||
| 003dbe059a | |||
| c673e0c7d6 | |||
| 34dfa9276e | |||
| 5678285e0e | |||
| b263d5f3e2 | |||
| 4be35eb5d7 | |||
| 4b78d8fb4f | |||
| 466d995873 | |||
| 1ce2afe9ce | |||
| d5108cf4db | |||
| 888ab1aa46 | |||
| 21d1d93235 | |||
| 005643a7c7 | |||
| 8539308cf3 | |||
| cd304f5955 | |||
| da1d1baa30 | |||
| a2b15f291d | |||
| c380016b71 | |||
| febf52738e | |||
| 7afa7458c7 | |||
| 3ffa9fbe8b | |||
| 6db59eaef1 | |||
| cfa7e1d1cf | |||
| 129fc23d83 | |||
| 5c3bb7d4ad | |||
| e93da73431 | |||
| 1e5bb04817 | |||
| afd1c96671 | |||
| e851fd0e01 | |||
| fa7106a1b4 | |||
| ef2ec06b0a | |||
| 89f5b6d546 | |||
| 349397b70f | |||
| 9666811eff | |||
| 7287990240 | |||
| 6428e6d31b | |||
| 0fbb2331cf | |||
| faf2692fae | |||
| d996d6f8d6 | |||
| 2a40807dc3 | |||
| adeab53bd3 | |||
| 57a76383bc | |||
| 5f3157a58d | |||
| 5f75916116 | |||
| aff44494bc | |||
| 78e686b3cb | |||
| 519005d892 | |||
| e0d51eae81 | |||
| 42f2f45866 | |||
| 0066a6ebed | |||
| 9b2818ddba | |||
| 0806696d30 | |||
| fd4c524264 | |||
| 4e0e105255 | |||
| 3fa8079a41 | |||
| 7dc96c650d | |||
| 650fc04bca | |||
| 5c2bd21f1e | |||
| 39a6bfca80 | |||
| f551081454 | |||
| 5c362a5a9a | |||
| abb985559e | |||
| ddd6178416 | |||
| 356377ce36 | |||
| 1b220334d6 | |||
| bb54356b58 | |||
| ebca231d9a | |||
| 2b5205d9c5 | |||
| 81d2b98bfe | |||
| 9ee6adf063 | |||
| 554b1af082 | |||
| 70f72e3df7 | |||
| 3af02920c4 | |||
| ede7c33302 | |||
| 9866578cab | |||
| d9093635de | |||
| 885edba1c5 | |||
| 1949c50764 | |||
| 2b7d12fac9 | |||
| f168acc90b | |||
| 8f6ea33139 | |||
| c6f938bd5c | |||
| c271f0c4d3 | |||
| 35a76fe52c | |||
| 64e42f961c | |||
| 8eb093c13a | |||
| a204f9c57f | |||
| 700802033b | |||
| 350dd23ed1 | |||
| 5e65ea7946 | |||
| 0c70688b60 | |||
| af3cca7611 | |||
| ef498fc5a0 | |||
| ceca3a15dc | |||
| a9b8a60e43 | |||
| 7a85f7ca9e | |||
| 57c5a34fe2 | |||
| a68e86d8cd | |||
| 503eec38a3 | |||
| ed54487a88 | |||
| f788320927 | |||
| dc68bb0b4c | |||
| 1a66f41d78 | |||
| 826f887bdf | |||
| 7ac3c95c8e | |||
| acb1533f21 | |||
| eda3a53d6f | |||
| 6786db65fe | |||
| df7dfb7c04 | |||
| 771e325067 | |||
| a5a3bd5bd4 | |||
| a605a3ed9d | |||
| ad9169a48d | |||
| 3b056ef7f8 | |||
| 710ae0420a | |||
| 2a6b74c6fd | |||
| 49c43358de | |||
| 27a0f54b07 | |||
| a562b848c0 | |||
| f4c26d777b | |||
| 8d8b50957c | |||
| faa6ad757e | |||
| 64df8282a0 | |||
| 8478af26bf | |||
| 77c87a51fa | |||
| 631aa91d94 | |||
| 90713de34b | |||
| a3408a86c3 | |||
| 74440b6b3b | |||
| f1d100892b | |||
| c6baab2b12 | |||
| f47b205025 | |||
| 6c27499769 | |||
| 6dff32505e | |||
| 7afd364efa | |||
| 6fc476b031 | |||
| af750549fe | |||
| 2e3572375f | |||
| b23da15022 | |||
| 0b75b8d2cd | |||
| 036a9d7116 | |||
| 6c769f3649 | |||
| bdbd206a54 | |||
| 1684bd60bd | |||
| 8c4b08d0c6 | |||
| fe3c106954 | |||
| 3d0464f379 | |||
| d1b5652228 | |||
| 65e06f2d6c | |||
| b27e50275d | |||
| a101d3a2d7 | |||
| d7637928b7 | |||
| 486a9205ee | |||
| 2c2c59290e | |||
| 70e615bb4e | |||
| 43ec63b0f5 | |||
| 8c94fd6b71 | |||
| f354bcdee1 | |||
| e32c2aa50a | |||
| 795dc0c741 | |||
| 22a8a794ba | |||
| c6b54e273d | |||
| 7eec6c0008 | |||
| f9bb2aa879 | |||
| 18ea52c972 | |||
| f4eafa668d | |||
| 53abdba374 | |||
| fdd008fcfb | |||
| eaeae4d66b | |||
| 6ac80c408c | |||
| 9c5620edee | |||
| ad40eb8b9a | |||
| aca01de4ee | |||
| 384deecc3f | |||
| b27adf2649 | |||
| 2776b469c8 | |||
| fc3c91b975 | |||
| e7c81aba24 | |||
| a15bf22785 | |||
| ed84313c2e | |||
| e4af93dd07 | |||
| 5538f51cf0 | |||
| a2abbbb3d0 | |||
| d0f12a604a | |||
| 178ef8b11d | |||
| 0835431e76 | |||
| bf6203d901 | |||
| 51bf99cb8c | |||
| 21e7bcd530 | |||
| 8713154e84 | |||
| 75b6f0b4b4 | |||
| 032fb2e8a8 | |||
| a5773aaaa9 | |||
| f88ad13f0d | |||
| 9dde0d9e81 | |||
| acc935248b | |||
| cdf1066e4e | |||
| f57a73843a | |||
| b0ef75ae66 | |||
| 136ccc8fa9 | |||
| e9491da707 | |||
| db06002ebf | |||
| ca1b7f8883 | |||
| 14b5651795 | |||
| 1186924761 | |||
| 1616ddbc21 | |||
| 79a404e78a | |||
| 9cd547c204 | |||
| f140e8aee1 | |||
| a9f57b7ad2 | |||
| c7fa7ab095 | |||
| 778b36b7f5 | |||
| 447ff3ace9 | |||
| c848ebd9be | |||
| d9acad1caa | |||
| f827a1ea3a | |||
| 26b94de48c | |||
| 779d314748 | |||
| 199b068e94 | |||
| e8f3b00912 | |||
| 579ea164f8 | |||
| 902d6bbc6e | |||
| 927d6bce47 | |||
| 65afa07125 | |||
| 58992c2947 | |||
| 1297b5eb78 | |||
| cd8330196e | |||
| 9042c76d48 | |||
| 4126b2ee44 | |||
| ca0028f08d | |||
| a59ecaf21d | |||
| 1b73bb62b6 | |||
| c34ed41ddf | |||
| d0406b32dd | |||
| b33d1741c4 | |||
| d728dbe272 | |||
| 47d0a047a5 | |||
| 83dd7d87f0 | |||
| 03f2022f2f | |||
| 89600c463b | |||
| 92ab807eae | |||
| a2fcaac2a9 | |||
| da4e4fd81a | |||
| 4266139429 | |||
| 1dc7d7142a | |||
| b9f1dd9d61 | |||
| 6c25373d7f | |||
| c19115f252 | |||
| 9c4329deed | |||
| a563a77554 | |||
| f9792b22bc | |||
| 8d097fefe1 | |||
| 71ed5cc58b | |||
| d6cec4d63e | |||
| 139191a1ce | |||
| 946fb4b141 | |||
| 3d47e03240 | |||
| 855a21122a | |||
| 2c7de157e8 | |||
| 1e59d5610e | |||
| bd8476e11a | |||
| 3e00398af0 | |||
| 2ab9cfb9c8 | |||
| 894b78d9f1 | |||
| b9522ae2a2 | |||
| 07665b7617 | |||
| 6130cb6d64 | |||
| d925312403 | |||
| 5a18577552 | |||
| c7f1a4272f | |||
| 6601fa6205 | |||
| e2abda2d14 | |||
| 97810b5575 | |||
| 1185770a94 | |||
| 25d88b0609 | |||
| 85c77787ce | |||
| 2181ff5602 | |||
| 9505468efc | |||
| 2cbb1fb68c | |||
| ba0ae056ea | |||
| dff7bce6b0 | |||
| a155e27eac | |||
| 438ec779b4 | |||
| 307517ded0 | |||
| 8efa8752df | |||
| 7f6f478dfc | |||
| 7a92581fa8 | |||
| 7f8c2cb559 | |||
| 3dc87e3724 | |||
| 670a5ccf81 | |||
| 9af0613183 | |||
| 5df0e21a58 | |||
| 149bad2d31 | |||
| 276f0352e3 | |||
| f22e9cdd02 | |||
| ee3862f949 | |||
| 2972ae31aa | |||
| 79cdd60d07 | |||
| f92f21ab72 | |||
| 2a56cfa700 | |||
| babb2a7492 | |||
| 23960d8c7c | |||
| cb97358100 | |||
| 28889bdb49 | |||
| 5efde9f6e0 | |||
| 12e46edc74 | |||
| 9969fce375 | |||
| 97e77c839a | |||
| 0ea195e073 | |||
| 4aa5cf233e | |||
| eb775bba18 | |||
| 4ff193fadf | |||
| a61915a3b5 | |||
| f33ca49592 | |||
| 1c4d65bec3 | |||
| 300e042340 | |||
| ec48f1f36e | |||
| 13176cb286 | |||
| 970b1f1571 | |||
| 7465260354 | |||
| 2a13fcd40a | |||
| 19f831695d | |||
| 07bf72a8c3 | |||
| 7905da9651 | |||
| ecd9813f8a | |||
| 0e0ea2d2b0 | |||
| 272fdb58d1 | |||
| 4489a91eb7 | |||
| 013c2fd672 | |||
| 6394e08c4c | |||
| 15bf977458 | |||
| b8faab13b3 | |||
| 0bbfa5f9c3 | |||
| 69fbb14410 | |||
| 101784adb3 | |||
| ca982edbf8 | |||
| e782ac36fb | |||
| b962420b94 | |||
| 0594355072 | |||
| aec6cc19ab | |||
| 58b0e1395c | |||
| 274ecbab6b | |||
| 544cdd826b | |||
| fc68a788ac | |||
| 9c689f1179 | |||
| 6e7ff70862 | |||
| 0a0072ce43 | |||
| 0e31149e31 | |||
| d332243772 | |||
| d9aa68f1e9 | |||
| 2cc27788c8 | |||
| 5a0b3bba25 | |||
| 7a80ad4662 | |||
| 3eddc52c6a | |||
| 64a72560bc | |||
| 0a6ba16c61 | |||
| b932bd8eb6 | |||
| 5aec81b45f | |||
| d68d51bd9c | |||
| badc519f37 | |||
| 77ca457646 | |||
| 7ed79d6954 | |||
| 43e630283c | |||
| 09df67c67f | |||
| 9a30e02a4b | |||
| 036fd48bcf | |||
| 5476331073 | |||
| c6cab848f9 | |||
| efa78ec8a0 | |||
| c311fb8cbe |
+1
-1
@@ -109,6 +109,7 @@ _TeamCity*
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
*ncrunchsolution.user
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
@@ -217,5 +218,4 @@ _Pvt_Extensions
|
||||
|
||||
# nCrunch items
|
||||
*.ncrunchsolution
|
||||
*.DotSettings
|
||||
*.ncrunchproject
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,6 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
|
||||
<Import Project="..\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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -39,7 +43,7 @@
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
@@ -53,23 +57,77 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.12.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.12.0\lib\net45\Moq.dll</HintPath>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<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 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.Core" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
<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">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -87,8 +145,13 @@
|
||||
<Project>{64308775-bd4a-469c-bcab-3ed830b811af}</Project>
|
||||
<Name>Meade.net.Telescope</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
|
||||
<Project>{3689a2cb-94c5-4012-a5cf-7e7d1dd27143}</Project>
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
@@ -96,6 +159,16 @@
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
|
||||
<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>
|
||||
<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>
|
||||
@@ -18,14 +18,14 @@ namespace AstroMath.UnitTests
|
||||
[Test]
|
||||
public void DegreesToRadians()
|
||||
{
|
||||
var radians = _astroMath.DegreesToRadians(90);
|
||||
var radians = 90.0.DegreesToRadians();
|
||||
Assert.That(radians, Is.EqualTo(1.5707963267948966));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RadiansToDegrees()
|
||||
{
|
||||
var degrees = _astroMath.RadiansToDegrees(1.5707963267948966);
|
||||
var degrees = 1.5707963267948966.RadiansToDegrees();
|
||||
Assert.That(degrees, Is.EqualTo(90));
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace AstroMath.UnitTests
|
||||
public void DateTimeToDecimalHours_book()
|
||||
{
|
||||
DateTime dateTime = new DateTime(2019, 05, 18, 18, 31, 27, DateTimeKind.Utc);
|
||||
var decimalHours = _astroMath.DateTimeToDecimalHours(dateTime);
|
||||
var decimalHours = dateTime.DateTimeToDecimalHours();
|
||||
|
||||
Assert.That(decimalHours, Is.EqualTo(18.524166666666666));
|
||||
}
|
||||
@@ -43,7 +43,7 @@ namespace AstroMath.UnitTests
|
||||
public void DateTimeToDecimalHours()
|
||||
{
|
||||
DateTime dateTime = new DateTime(2019, 05, 18, 22, 26, 15, DateTimeKind.Utc);
|
||||
var decimalHours = _astroMath.DateTimeToDecimalHours(dateTime);
|
||||
var decimalHours = dateTime.DateTimeToDecimalHours();
|
||||
|
||||
Assert.That(decimalHours, Is.EqualTo(22.4375));
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace AstroMath.UnitTests
|
||||
public void UTtoGST_book()
|
||||
{
|
||||
DateTime dateTime = new DateTime(1980, 04, 22, 14, 36, 51, 670, DateTimeKind.Utc);
|
||||
double gst = _astroMath.UTtoGst(dateTime);
|
||||
double gst = dateTime.UTtoGst();
|
||||
|
||||
Assert.That(gst, Is.EqualTo(4.667932706211154));
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace AstroMath.UnitTests
|
||||
public void UTtoGst()
|
||||
{
|
||||
DateTime dateTime = new DateTime(2019, 05, 18, 22, 26, 15, DateTimeKind.Utc);
|
||||
double gst = _astroMath.UTtoGst(dateTime);
|
||||
double gst = dateTime.UTtoGst();
|
||||
|
||||
Assert.That(gst, Is.EqualTo(14.191879687876451));
|
||||
}
|
||||
@@ -113,15 +113,18 @@ namespace AstroMath.UnitTests
|
||||
{
|
||||
var latitude = 52.0;
|
||||
|
||||
EquatorialCoordinates equatorialCoordinates = new EquatorialCoordinates();
|
||||
equatorialCoordinates.RightAscension = 5.862222222222222;//5 51' 44"
|
||||
equatorialCoordinates.Declination = 23.21944444444444;//23 13' 10"
|
||||
var equatorialCoordinates = new EquatorialCoordinates
|
||||
{
|
||||
RightAscension = 5.862222222222222, //5 51' 44"
|
||||
Declination = 23.21944444444444 //23 13' 10"
|
||||
};
|
||||
|
||||
var hourAngle = 5.682222;
|
||||
const double hourAngle = 5.682222;
|
||||
|
||||
var altAz = _astroMath.ConvertEqToHoz(hourAngle, latitude, equatorialCoordinates);
|
||||
|
||||
Assert.That(altAz.Altitude, Is.EqualTo(20.958562421092779));
|
||||
Assert.That(altAz.Altitude, Is.GreaterThan(20.958562421092770));
|
||||
Assert.That(altAz.Altitude, Is.LessThanOrEqualTo(20.958562421092779));
|
||||
Assert.That(altAz.Azimuth, Is.EqualTo(281.2728706962269));
|
||||
}
|
||||
|
||||
@@ -131,9 +134,11 @@ namespace AstroMath.UnitTests
|
||||
DateTime dateTime = new DateTime(2019, 05, 18, 22, 26, 15, DateTimeKind.Utc);
|
||||
var longitude = -1.7833333333333332;
|
||||
var latitude = 52.0;
|
||||
EquatorialCoordinates equatorialCoordinates = new EquatorialCoordinates();
|
||||
equatorialCoordinates.RightAscension = 4.15361111111111;
|
||||
equatorialCoordinates.Declination = 30.0019444444444;
|
||||
EquatorialCoordinates equatorialCoordinates = new EquatorialCoordinates
|
||||
{
|
||||
RightAscension = 4.15361111111111,
|
||||
Declination = 30.0019444444444
|
||||
};
|
||||
|
||||
var hourAngle = _astroMath.RightAscensionToHourAngle(dateTime, longitude, equatorialCoordinates.RightAscension);
|
||||
var altaz = _astroMath.ConvertEqToHoz(hourAngle, latitude, equatorialCoordinates);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,8 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
||||
<package id="Moq" version="4.12.0" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="5.1.0" targetFramework="net472" />
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
|
||||
<package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" 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" />
|
||||
</packages>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ASCOM.MeadeGeneric</RootNamespace>
|
||||
<AssemblyName>ASCOM.MeadeGeneric.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -36,9 +36,32 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<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="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@@ -52,6 +75,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
||||
@@ -14,9 +14,9 @@ using ASCOM.DriverAccess;
|
||||
|
||||
namespace ASCOM.MeadeGeneric
|
||||
{
|
||||
class Program
|
||||
public static class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
public static void Main()
|
||||
{
|
||||
// Uncomment the code that's required
|
||||
#if UseChooser
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net48" />
|
||||
</packages>
|
||||
@@ -0,0 +1,36 @@
|
||||
<#
|
||||
This script initializes a bare minimum set of registry entries required for ASCOM.Utilities.Profile to work
|
||||
without throwing any exceptions. When building on a build server, or on a computer without the ASCOM Platform installed,
|
||||
it may be useful to execute this script as a build step prior to running any unit tests, or calling any code that relies on
|
||||
ASCOM.Utilities.Profile. The alternative is to install the ASCOM Platform on the build agent.
|
||||
|
||||
NOTE: This script equires elevated permissions because it creates registry keys in the LocalMachine hive.
|
||||
#>
|
||||
|
||||
$wow = Test-Path HKLM:\SOFTWARE\Wow6432Node
|
||||
if ($wow)
|
||||
{
|
||||
$root = "HKLM:\SOFTWARE\Wow6432Node"
|
||||
}
|
||||
else
|
||||
{
|
||||
$root = "HKLM:\SOFTWARE"
|
||||
}
|
||||
$ascomRoot = $root + "\ASCOM"
|
||||
|
||||
if (Test-Path $ascomRoot)
|
||||
{
|
||||
<# Don't upset an already-existing ASCOM registry #>
|
||||
exit
|
||||
}
|
||||
|
||||
<# Create the ASCOM root key and set it's ACL to allow all users read/write access #>
|
||||
New-Item -Path $root -Name ASCOM –Force
|
||||
$ascomAcl = Get-Acl $ascomRoot
|
||||
$aclRule = New-Object System.Security.AccessControl.RegistryAccessRule ("Users","FullControl","Allow")
|
||||
$ascomAcl.SetAccessRule($aclRule)
|
||||
$ascomAcl | Set-Acl -Path $ascomRoot
|
||||
|
||||
<# Now create the bare minimum keys required so that ASCOM.Utilities.Profile doesn't crash and burn #>
|
||||
New-ItemProperty -Path $ascomRoot -Name PlatformVersion -Value "6.1" -PropertyType String –Force
|
||||
New-ItemProperty -Path $ascomRoot -Name SerTraceFile -Value "C:\SerialTraceAuto.txt" -PropertyType String –Force
|
||||
@@ -0,0 +1,513 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using ASCOM;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.Focuser.UnitTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class FocuserUnitTests
|
||||
{
|
||||
private Mock<IUtil> _utilMock;
|
||||
private Mock<ISharedResourcesWrapper> _sharedResourcesWrapperMock;
|
||||
private Mock<ITraceLogger> _traceLoggerMock;
|
||||
|
||||
private ProfileProperties _profileProperties;
|
||||
|
||||
private ASCOM.Meade.net.Focuser _focuser;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_profileProperties = new ProfileProperties
|
||||
{
|
||||
TraceLogger = false,
|
||||
ComPort = "TestCom1",
|
||||
Speed = 9600,
|
||||
Parity = "None",
|
||||
Handshake = "None",
|
||||
StopBits = "One",
|
||||
DataBits = 8,
|
||||
|
||||
GuideRateArcSecondsPerSecond = 1.23,
|
||||
Precision = "Unchanged",
|
||||
GuidingStyle = "Auto"
|
||||
};
|
||||
|
||||
_utilMock = new Mock<IUtil>();
|
||||
|
||||
_traceLoggerMock = new Mock<ITraceLogger>();
|
||||
|
||||
_sharedResourcesWrapperMock = new Mock<ISharedResourcesWrapper>();
|
||||
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ReadProfile()).Returns(() => _profileProperties);
|
||||
|
||||
_focuser = new ASCOM.Meade.net.Focuser(_utilMock.Object, _sharedResourcesWrapperMock.Object, _traceLoggerMock.Object);
|
||||
}
|
||||
|
||||
private void ConnectFocuser()
|
||||
{
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
|
||||
_focuser.Connected = true;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CheckThatClassCreatedProperly()
|
||||
{
|
||||
Assert.That(_focuser, Is.Not.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void NotConnectedByDefault()
|
||||
{
|
||||
Assert.That(_focuser.Connected, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SetupDialog()
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify(x => x.ReadProfile(), Times.Once);
|
||||
|
||||
_focuser.SetupDialog();
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SetupDialog(), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.ReadProfile(), Times.Exactly(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SupportedActions()
|
||||
{
|
||||
var supportedActions = _focuser.SupportedActions;
|
||||
|
||||
Assert.That(supportedActions, Is.Not.Null);
|
||||
Assert.That(supportedActions.Count, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Action_WhenNotConnected_ThrowsNotConnectedException()
|
||||
{
|
||||
var actionName = "Action";
|
||||
|
||||
Assert.Throws<ActionNotImplementedException>(() =>
|
||||
{
|
||||
var actualResult = _focuser.Action(actionName, string.Empty);
|
||||
Assert.Fail($"{actualResult} should not have a value");
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CommandBlind_WhenNotConnected_ThenThrowsNotConnectedException()
|
||||
{
|
||||
string expectedMessage = "test blind Message";
|
||||
var exception = Assert.Throws<NotConnectedException>(() => { _focuser.CommandBlind(expectedMessage, true); });
|
||||
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBlind"));
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void CommandBlind_WhenConnected_ThenSendsExpectedMessage(bool raw)
|
||||
{
|
||||
string expectedMessage = "test blind Message";
|
||||
|
||||
ConnectFocuser();
|
||||
|
||||
_focuser.CommandBlind(expectedMessage, raw);
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, expectedMessage, raw), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CommandBool_WhenNotConnected_ThenThrowsNotConnectedException()
|
||||
{
|
||||
string expectedMessage = "test blind Message";
|
||||
var exception = Assert.Throws<NotConnectedException>(() => { _focuser.CommandBool(expectedMessage, true); });
|
||||
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBool"));
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void CommandBool_WhenConnected_ThenSendsExpectedMessage(bool raw)
|
||||
{
|
||||
string expectedMessage = "test blind Message";
|
||||
_sharedResourcesWrapperMock.Setup(x => x.SendBool(_traceLoggerMock.Object, expectedMessage, raw)).Returns(true);
|
||||
|
||||
ConnectFocuser();
|
||||
|
||||
var result = _focuser.CommandBool(expectedMessage, raw);
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBool(_traceLoggerMock.Object, expectedMessage, raw), Times.Once);
|
||||
Assert.That(result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CommandString_WhenNotConnected_ThenThrowsNotConnectedException()
|
||||
{
|
||||
string expectedMessage = "test blind Message";
|
||||
var exception = Assert.Throws<NotConnectedException>(() => { _focuser.CommandString(expectedMessage, true); });
|
||||
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandString"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CommandString_WhenConnected_ThenSendsExpectedMessage()
|
||||
{
|
||||
string expectedMessage = "expected result message";
|
||||
string sendMessage = "test blind Message";
|
||||
|
||||
ConnectFocuser();
|
||||
|
||||
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, sendMessage, true)).Returns(() => expectedMessage);
|
||||
|
||||
var actualMessage = _focuser.CommandString(sendMessage, true);
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, sendMessage, true), Times.Once);
|
||||
Assert.That(actualMessage, Is.EqualTo(expectedMessage));
|
||||
}
|
||||
|
||||
[TestCase(true)]
|
||||
[TestCase(false)]
|
||||
public void Connected_Get_ReturnsExpectedValue(bool expectedConnected)
|
||||
{
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
|
||||
_focuser.Connected = expectedConnected;
|
||||
|
||||
Assert.That(_focuser.Connected, Is.EqualTo(expectedConnected));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connected_Set_WhenConnecting_Then_ConnectsToSerialDevice()
|
||||
{
|
||||
var productName = "LX2001";
|
||||
var firmware = string.Empty;
|
||||
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(productName);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(firmware);
|
||||
_focuser.Connected = true;
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect("Serial", It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void Connected_Set_SettingTrueWhenTrue_ThenDoesNothing()
|
||||
{
|
||||
ConnectFocuser();
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
|
||||
|
||||
//act
|
||||
_focuser.Connected = true;
|
||||
|
||||
//assert
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connected_Set_SettingFalseWhenTrue_ThenDisconnects()
|
||||
{
|
||||
ConnectFocuser();
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
|
||||
|
||||
//act
|
||||
_focuser.Connected = false;
|
||||
|
||||
//assert
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Disconnect(It.IsAny<string>(), It.IsAny<string>()), Times.Once());
|
||||
}
|
||||
|
||||
//Commented out for now as the catch after connect is currently unreachable code.
|
||||
//[Test]
|
||||
//public void Connected_Set_WhenFailsToConnect_ThenDisconnects()
|
||||
//{
|
||||
// _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
|
||||
// _sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
|
||||
|
||||
// _sharedResourcesWrapperMock.Setup(x => x.SendString(It.IsAny<string>())).Throws(new Exception("TestFailed"));
|
||||
|
||||
// //act
|
||||
// _focuser.Connected = true;
|
||||
|
||||
// //assert
|
||||
// _sharedResourcesWrapperMock.Verify(x => x.Disconnect(It.IsAny<string>(), It.IsAny<string>()), Times.Once());
|
||||
//}
|
||||
|
||||
[Test]
|
||||
public void Description_Get()
|
||||
{
|
||||
var expectedDescription = "Meade Generic";
|
||||
|
||||
var description = _focuser.Description;
|
||||
|
||||
Assert.That(description, Is.EqualTo(expectedDescription));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DriverVersion_Get()
|
||||
{
|
||||
Version version = Assembly.GetAssembly(typeof(ASCOM.Meade.net.Focuser)).GetName().Version;
|
||||
|
||||
string exptectedDriverInfo = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
|
||||
|
||||
var driverVersion = _focuser.DriverVersion;
|
||||
|
||||
Assert.That(driverVersion, Is.EqualTo(exptectedDriverInfo));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DriverInfo_Get()
|
||||
{
|
||||
string exptectedDriverInfo = $"{_focuser.Description} .net driver. Version: {_focuser.DriverVersion}";
|
||||
|
||||
var driverInfo = _focuser.DriverInfo;
|
||||
|
||||
Assert.That(driverInfo, Is.EqualTo(exptectedDriverInfo));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InterfaceVersion_Get()
|
||||
{
|
||||
var interfaceVersion = _focuser.InterfaceVersion;
|
||||
Assert.That(interfaceVersion, Is.EqualTo(3));
|
||||
|
||||
Assert.That(_focuser, Is.AssignableTo<IFocuserV3>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Name_Get()
|
||||
{
|
||||
string expectedName = "Meade Generic";
|
||||
|
||||
var name = _focuser.Name;
|
||||
|
||||
Assert.That(name, Is.EqualTo(expectedName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Absolute_Get_WhenNotConnected_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<NotConnectedException>(() =>
|
||||
{
|
||||
var result = _focuser.Absolute;
|
||||
Assert.Fail($"{result} should not have a value");
|
||||
});
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: Absolute Get"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Absolute_Get_WhenConnected_ThenReturnsFalse()
|
||||
{
|
||||
ConnectFocuser();
|
||||
var result = _focuser.Absolute;
|
||||
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Halt_WhenNotConnected_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<NotConnectedException>(() => { _focuser.Halt(); });
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: Halt"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Halt_WhenConnected_ThenSendsHaltCommand()
|
||||
{
|
||||
ConnectFocuser();
|
||||
|
||||
_focuser.Halt();
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "FQ", false), Times.AtLeastOnce);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsMoving_WhenCalled_ThenReturnsFalse()
|
||||
{
|
||||
ConnectFocuser();
|
||||
|
||||
var result = _focuser.IsMoving;
|
||||
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void Link_Get_ReturnsSameValueAsConnected(bool connected)
|
||||
{
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
|
||||
_focuser.Connected = connected;
|
||||
|
||||
Assert.That(_focuser.Link, Is.EqualTo(connected));
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void Link_Set_WhenSet_ThenSetsConnectedState(bool connected)
|
||||
{
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
|
||||
_focuser.Link = connected;
|
||||
|
||||
Assert.That(_focuser.Link, Is.EqualTo(connected));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MaxIncrement_WhenCalled_ThenReturnsExpectedValue()
|
||||
{
|
||||
var result = _focuser.MaxIncrement;
|
||||
|
||||
Assert.That(result, Is.EqualTo(30000));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MaxStep_WhenCalled_ThenReturnsExpectedValue()
|
||||
{
|
||||
var result = _focuser.MaxStep;
|
||||
|
||||
Assert.That(result, Is.EqualTo(30000));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Move_WhenNotConnected_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<NotConnectedException>(() => { _focuser.Move(0); });
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: Move"));
|
||||
}
|
||||
|
||||
[TestCase(-30001)]
|
||||
[TestCase(300001)]
|
||||
public void Move_WhenLargerThanMaxIncrement_ThenThrowsException(int position)
|
||||
{
|
||||
ConnectFocuser();
|
||||
|
||||
var exception = Assert.Throws<InvalidValueException>(() => { _focuser.Move(position); });
|
||||
Assert.That(exception.Message, Is.EqualTo($"position out of range -{_focuser.MaxIncrement} < {position} < {_focuser.MaxIncrement}"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Move_WhenIncrementIs0_ThenDoesNothing()
|
||||
{
|
||||
ConnectFocuser();
|
||||
|
||||
_focuser.Move(0);
|
||||
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Never);
|
||||
}
|
||||
|
||||
[TestCase(200)]
|
||||
[TestCase(-200)]
|
||||
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuser(int position)
|
||||
{
|
||||
_profileProperties.BacklashCompensation = 0;
|
||||
|
||||
ConnectFocuser();
|
||||
|
||||
_focuser.Move(position);
|
||||
|
||||
if (position < 0)
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F-", false), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F+", false), Times.Never);
|
||||
}
|
||||
else
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F-", false), Times.Never);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F+", false), Times.Once);
|
||||
}
|
||||
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Once());
|
||||
}
|
||||
|
||||
[TestCase(200)]
|
||||
[TestCase(-200)]
|
||||
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuserWithBacklashCompensation(int position)
|
||||
{
|
||||
_profileProperties.BacklashCompensation = 3000;
|
||||
|
||||
ConnectFocuser();
|
||||
|
||||
_focuser.Move(position);
|
||||
|
||||
if (position < 0)
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F-", false), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F+", false), Times.Never);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F-", false), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(_traceLoggerMock.Object, "F+", false), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position) + _profileProperties.BacklashCompensation), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(_profileProperties.BacklashCompensation), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(2));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Position_WhenCalled_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<PropertyNotImplementedException>(() =>
|
||||
{
|
||||
var result = _focuser.Position;
|
||||
Assert.Fail($"{result} should not have a value");
|
||||
});
|
||||
Assert.That(exception.Message, Is.EqualTo("Property read Position is not implemented in this driver."));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StepSize_WhenCalled_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<PropertyNotImplementedException>(() =>
|
||||
{
|
||||
var result = _focuser.StepSize;
|
||||
Assert.Fail($"{result} should not have a value");
|
||||
});
|
||||
Assert.That(exception.Message, Is.EqualTo("Property read StepSize is not implemented in this driver."));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TempComp_WhenRead_ThenReturnsFalse()
|
||||
{
|
||||
var result = _focuser.TempComp;
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TempComp_WhenWrite_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<PropertyNotImplementedException>(() => { _focuser.TempComp = false; });
|
||||
Assert.That(exception.Message, Is.EqualTo("Property read TempComp is not implemented in this driver."));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TempCompAvailable_WhenRead_ThenReturnsFalse()
|
||||
{
|
||||
var result = _focuser.TempCompAvailable;
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Temperature_WhenCalled_ThenThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<PropertyNotImplementedException>(() =>
|
||||
{
|
||||
var result = _focuser.Temperature;
|
||||
Assert.Fail($"{result} should not have a value");
|
||||
});
|
||||
Assert.That(exception.Message, Is.EqualTo("Property read Temperature is not implemented in this driver."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A3991FA7-23C3-405A-96F9-5AB03AC58F30}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Meade.net.Focuser.UnitTests</RootNamespace>
|
||||
<AssemblyName>Meade.net.Focuser.UnitTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<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 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.Core" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</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">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FocuserUnitTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Meade.net.focuser\Meade.net.focuser.csproj">
|
||||
<Project>{a97e3aec-f11d-49da-b259-de99da813a86}</Project>
|
||||
<Name>Meade.net.focuser</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
|
||||
<Project>{3689a2cb-94c5-4012-a5cf-7e7d1dd27143}</Project>
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.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>
|
||||
<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>
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Meade.net.Focuser.UnitTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Meade.net.Focuser.UnitTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a3991fa7-23c3-405a-96f9-5ab03ac58f30")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="5.1.0" targetFramework="net472" />
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
|
||||
<package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" 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" />
|
||||
</packages>
|
||||
@@ -18,41 +18,6 @@
|
||||
Vital="yes"
|
||||
Assembly=".net"
|
||||
AssemblyApplication="filFocuserDriverAssembly" />
|
||||
<!-- Registry entries suitable for a LocalServer served class -->
|
||||
<!-- HKCR\CLSID\{driver-guid} -->
|
||||
<RegistryKey Root="HKCR" Key="CLSID">
|
||||
<RegistryKey Key="$(var.FocuserDriverClassId)">
|
||||
<RegistryValue Value="$(var.FocuserDriverProgId)" Type="string"/>
|
||||
<RegistryValue Name="AppId" Value="$(var.LocalServerAppId)" Type="string"/>
|
||||
<RegistryKey Key="Implemented Categories">
|
||||
<RegistryKey Key="{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}"
|
||||
ForceCreateOnInstall="yes"
|
||||
ForceDeleteOnUninstall="yes"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Key="ProgId">
|
||||
<RegistryValue Value="$(var.FocuserDriverProgId)" Type="string"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Key="Programmable"
|
||||
ForceCreateOnInstall="yes"
|
||||
ForceDeleteOnUninstall="yes" />
|
||||
<RegistryKey Key="LocalServer32">
|
||||
<RegistryValue Value="[#filLocalServerAssembly]" Type="string"/>
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
|
||||
<!-- HKCR\{driver-prog-id} -->
|
||||
<RegistryKey Root="HKCR" Key="$(var.FocuserDriverProgId)">
|
||||
<RegistryValue Value="$(var.FocuserDriverDescription)" Type="string"/>
|
||||
<RegistryKey Key="CLSID">
|
||||
<RegistryValue Value="$(var.FocuserDriverClassId)" Type="string" />
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
|
||||
<!--Register the driver with the ASCOM Profile-->
|
||||
<RegistryKey Root="HKLM" Key="SOFTWARE\ASCOM\Focuser Drivers\$(var.FocuserDriverProgId)">
|
||||
<RegistryValue Value="$(var.FocuserDriverDescription)" Type="string"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
@@ -12,21 +12,31 @@
|
||||
Assembly=".net"
|
||||
AssemblyApplication="filLocalServerAssembly" />
|
||||
</Component>
|
||||
<Component Id="cmpLocalServerRegistry" Win64="no">
|
||||
<!-- LocalServer32 COM Registration -->
|
||||
<RegistryKey Root="HKCR" Key="AppID" >
|
||||
<!-- HKCR\AppID\{my-app-id} -->
|
||||
<RegistryKey Key="$(var.LocalServerAppId)">
|
||||
<RegistryValue Value="$(var.InstallName)" Type="string"/>
|
||||
<RegistryValue Name="AppID" Value="$(var.LocalServerAppId)" Type="string"/>
|
||||
<RegistryValue Name="AuthenticationLevel" Value="1" Type="integer"/>
|
||||
</RegistryKey>
|
||||
<!-- HKCR\AppID\{exe-name} -->
|
||||
<RegistryKey Key="$(var.Meade.net.TargetFileName)">
|
||||
<RegistryValue Name="AppID" Value="$(var.LocalServerAppId)" Type="string"/>
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<CustomAction Id="RegisterEXE"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[#filLocalServerAssembly]" /register"
|
||||
Execute="deferred"
|
||||
Return="ignore"
|
||||
Impersonate="no"
|
||||
/>
|
||||
|
||||
<CustomAction Id="UnRegisterEXE"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[#filLocalServerAssembly]" /unregister"
|
||||
Execute="deferred"
|
||||
Return="ignore"
|
||||
Impersonate="no"
|
||||
/>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action='RegisterEXE' Before="InstallFinalize">
|
||||
<![CDATA[(NOT Installed)]]>
|
||||
</Custom>
|
||||
<Custom Action="UnRegisterEXE" After="InstallInitialize">
|
||||
<![CDATA[(REMOVE ~= "ALL" AND NOT UPGRADINGPRODUCTCODE)]]>
|
||||
</Custom>
|
||||
</InstallExecuteSequence>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
@@ -18,41 +18,6 @@
|
||||
Vital="yes"
|
||||
Assembly=".net"
|
||||
AssemblyApplication="filTelescopeDriverAssembly" />
|
||||
<!-- Registry entries suitable for a LocalServer served class -->
|
||||
<!-- HKCR\CLSID\{driver-guid} -->
|
||||
<RegistryKey Root="HKCR" Key="CLSID">
|
||||
<RegistryKey Key="$(var.TelescopeDriverClassId)">
|
||||
<RegistryValue Value="$(var.TelescopeDriverProgId)" Type="string"/>
|
||||
<RegistryValue Name="AppId" Value="$(var.LocalServerAppId)" Type="string"/>
|
||||
<RegistryKey Key="Implemented Categories">
|
||||
<RegistryKey Key="{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}"
|
||||
ForceCreateOnInstall="yes"
|
||||
ForceDeleteOnUninstall="yes"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Key="ProgId">
|
||||
<RegistryValue Value="$(var.TelescopeDriverProgId)" Type="string"/>
|
||||
</RegistryKey>
|
||||
<RegistryKey Key="Programmable"
|
||||
ForceCreateOnInstall="yes"
|
||||
ForceDeleteOnUninstall="yes" />
|
||||
<RegistryKey Key="LocalServer32">
|
||||
<RegistryValue Value="[#filLocalServerAssembly]" Type="string"/>
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
|
||||
<!-- HKCR\{driver-prog-id} -->
|
||||
<RegistryKey Root="HKCR" Key="$(var.TelescopeDriverProgId)">
|
||||
<RegistryValue Value="$(var.TelescopeDriverDescription)" Type="string"/>
|
||||
<RegistryKey Key="CLSID">
|
||||
<RegistryValue Value="$(var.TelescopeDriverClassId)" Type="string" />
|
||||
</RegistryKey>
|
||||
</RegistryKey>
|
||||
|
||||
<!--Register the driver with the ASCOM Profile-->
|
||||
<RegistryKey Root="HKLM" Key="SOFTWARE\ASCOM\Telescope Drivers\$(var.TelescopeDriverProgId)">
|
||||
<RegistryValue Value="$(var.TelescopeDriverDescription)" Type="string"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
Binary file not shown.
@@ -48,6 +48,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Config.wxi" />
|
||||
<Content Include="License.rtf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Meade.net.focuser\Meade.net.focuser.csproj">
|
||||
|
||||
@@ -21,21 +21,16 @@
|
||||
Type="raw" />
|
||||
</Property>
|
||||
|
||||
<Condition Message="This application requires Ascom Platform 6.4 SP1 or higher. Please install this before installing the driver.">
|
||||
<![CDATA[Installed OR ASCOMPLATFORMVERSION >= "6.4.1"]]>
|
||||
<Condition Message="This application requires Ascom Platform 6.6.0 or higher. Please install this before installing the driver.">
|
||||
<![CDATA[Installed OR ASCOMPLATFORMVERSION >= "6.6.0"]]>
|
||||
</Condition>
|
||||
|
||||
<PropertyRef Id="NETFRAMEWORK40FULL"/>
|
||||
<Condition Message="This application requires .NET Framework 4.0 or higher. Please install the .NET Framework then run this installer again.">
|
||||
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
|
||||
<PropertyRef Id='WIXNETFX4RELEASEINSTALLED'/>
|
||||
<Condition Message="This application requires .NET Framework 4.8 or higher. Please install the .NET Framework then run this installer again.">
|
||||
<![CDATA[Installed OR (WIXNETFX4RELEASEINSTALLED >= "#528040")]]>
|
||||
</Condition>
|
||||
|
||||
<!--todo create a method to check if ASCOM is installed.-->
|
||||
<!--<Condition Message="This application requires ASCOM Platform 6.4 or later. Please install this and try again.">
|
||||
<![CDATA[Installed or WIX_IS_NETFRAMEWORK_471_OR_LATER_INSTALLED]]>
|
||||
</Condition>-->
|
||||
|
||||
<!-- <Condition Message="Please use the correct installer for your operating system - x86 for 32-bit, x64 for 64-bit.">
|
||||
<!-- <Condition Message="Please use the correct installer for your operating system - x86 for 32-bit, x64 for 64-bit.">
|
||||
<?if $(var.Win64) = "yes" ?>
|
||||
VersionNT64
|
||||
<?else?>
|
||||
@@ -46,6 +41,7 @@
|
||||
|
||||
<UIRef Id="InstallationUI"/>
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
|
||||
|
||||
<FeatureGroupRef Id="fgRoot"/>
|
||||
</Product>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
|
||||
<Import Project="..\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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -26,7 +30,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -57,55 +61,110 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.12.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.12.0\lib\net45\Moq.dll</HintPath>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<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 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.Core" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
<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">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
@@ -129,7 +188,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="BootstrapAscomProfileStore.ps1" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
@@ -137,6 +195,16 @@
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
|
||||
<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>
|
||||
<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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1"/>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="4.4.0" targetFramework="net45" />
|
||||
<package id="Moq" version="4.12.0" targetFramework="net45" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net40" requireReinstallation="true" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net45" requireReinstallation="true" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net45" requireReinstallation="true" />
|
||||
<package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="5.1.0" targetFramework="net472" />
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
|
||||
<package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" 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" />
|
||||
</packages>
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public enum Alignment
|
||||
{
|
||||
NeedsAlignment,
|
||||
OneStarAligned,
|
||||
TwoStarAligned,
|
||||
ThreeStarAligned,
|
||||
AlignedOnHome,
|
||||
ScopeWasParked,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using ASCOM.DeviceInterface;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class AlignmentStatus
|
||||
{
|
||||
public AlignmentModes AlignmentMode { get; set; }
|
||||
public bool Tracking { get; set; }
|
||||
public Alignment Status { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"AlignmentStatus AlignmentMode={AlignmentMode};Tracking={Tracking};Status={Status}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using ASCOM.Utilities;
|
||||
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
public static class AstroMathExtensions
|
||||
{
|
||||
public static double DegreesToRadians(this double degrees)
|
||||
{
|
||||
return (Math.PI / 180) * degrees;
|
||||
}
|
||||
|
||||
public static double RadiansToDegrees(this double radians)
|
||||
{
|
||||
double degrees = (180 / Math.PI) * radians;
|
||||
return degrees;
|
||||
}
|
||||
|
||||
public static double DateTimeToDecimalHours(this DateTime utcDateTime)
|
||||
{
|
||||
double sec = utcDateTime.Second;
|
||||
double min = utcDateTime.Minute;
|
||||
double hour = utcDateTime.Hour;
|
||||
|
||||
var a = Math.Abs(sec) / 60;
|
||||
var b = (Math.Abs(min) + a) / 60;
|
||||
var c = Math.Abs(hour) + b;
|
||||
|
||||
var d = c;
|
||||
|
||||
if ((hour < 0) || (min < 0) || (sec < 0))
|
||||
d = -c;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
public static double UTtoGst( this DateTime utcDateTime)
|
||||
{
|
||||
Util util = new Util();
|
||||
|
||||
var jd = util.DateUTCToJulian(utcDateTime) - 0.5;
|
||||
if ((jd % 1) <= 0.5)
|
||||
jd = Math.Floor(jd);
|
||||
else
|
||||
jd = Math.Floor(jd) + 0.5;
|
||||
|
||||
var s = jd - 2451545.0;
|
||||
var t = s / 36525.0;
|
||||
var t0 = 6.697374558 + (2400.051336 * t) + (0.000025862 * (t * t));
|
||||
|
||||
while (t0 < 0)
|
||||
{
|
||||
t0 += 24;
|
||||
}
|
||||
|
||||
while (t0 >= 24)
|
||||
{
|
||||
t0 -= 24;
|
||||
}
|
||||
|
||||
var ut = utcDateTime.DateTimeToDecimalHours();
|
||||
var a = ut * 1.002737909;
|
||||
|
||||
var t1 = t0 + a;
|
||||
|
||||
while (t1 < 0)
|
||||
{
|
||||
t1 += 24;
|
||||
}
|
||||
|
||||
while (t1 >= 24)
|
||||
{
|
||||
t1 -= 24;
|
||||
}
|
||||
|
||||
return t1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using ASCOM.Utilities;
|
||||
|
||||
namespace ASCOM.Meade.net.AstroMaths
|
||||
{
|
||||
@@ -9,8 +8,8 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
//returns the decimal hour angle for given right ascension on a given datetime for a given logitude.
|
||||
public double RightAscensionToHourAngle(DateTime utcDateTime, double longitude, double rightAscension)
|
||||
{
|
||||
var ut = DateTimeToDecimalHours( utcDateTime);
|
||||
var gst = UTtoGst( utcDateTime);
|
||||
//var ut = DateTimeToDecimalHours( utcDateTime);
|
||||
var gst = utcDateTime.UTtoGst();
|
||||
var lst = GsTtoLst( gst, longitude);
|
||||
var raHours = rightAscension;
|
||||
var h1 = lst - raHours;
|
||||
@@ -22,9 +21,9 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
return h;
|
||||
}
|
||||
|
||||
public double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle )
|
||||
private double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle )
|
||||
{
|
||||
var gst = UTtoGst(utcDateTime);
|
||||
var gst = utcDateTime.UTtoGst();
|
||||
var lst = GsTtoLst( gst, longitude);
|
||||
var raHours = hourAngle;
|
||||
var h1 = lst - raHours;
|
||||
@@ -39,17 +38,17 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
|
||||
public EquatorialCoordinates ConvertHozToEq( DateTime utcDateTime, double latitude, double longitude, HorizonCoordinates altAz)
|
||||
{
|
||||
var az = DegreesToRadians(altAz.Azimuth);
|
||||
var alt = DegreesToRadians(altAz.Altitude);
|
||||
var lat = DegreesToRadians(latitude);
|
||||
var az = altAz.Azimuth.DegreesToRadians();
|
||||
var alt = altAz.Altitude.DegreesToRadians();
|
||||
var lat = latitude.DegreesToRadians();
|
||||
|
||||
var sinDec = Math.Sin(alt) * Math.Sin(lat) + Math.Cos(alt) * Math.Cos(lat) * Math.Cos(az);
|
||||
var dec = RadiansToDegrees(Math.Asin(sinDec));
|
||||
var dec = Math.Asin(sinDec).RadiansToDegrees();
|
||||
|
||||
var y = -Math.Cos(alt) * Math.Cos(lat) * Math.Sin(az);
|
||||
var x = Math.Sin(alt) - Math.Sin(lat) * sinDec;
|
||||
var upperA = Math.Atan2(y,x);
|
||||
var upperB = RadiansToDegrees(upperA);
|
||||
var upperB = upperA.RadiansToDegrees();
|
||||
|
||||
var ha = upperB;
|
||||
|
||||
@@ -72,20 +71,22 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
public HorizonCoordinates ConvertEqToHoz(double hourAngle, double latitude, EquatorialCoordinates raDec)
|
||||
{
|
||||
var h = hourAngle * 15;
|
||||
var h1 = DegreesToRadians(h);
|
||||
var d = DegreesToRadians(raDec.Declination);
|
||||
var lat = DegreesToRadians(latitude);
|
||||
var h1 = h.DegreesToRadians();
|
||||
var d = raDec.Declination.DegreesToRadians();
|
||||
var lat = latitude.DegreesToRadians();
|
||||
var sinA = Math.Sin(d) * Math.Sin(lat) + Math.Cos(d) * Math.Cos(lat) * Math.Cos(h1);
|
||||
|
||||
var y = -Math.Cos(d) * Math.Cos(lat) * Math.Sin(h1);
|
||||
var x = Math.Sin(d) - Math.Sin(lat) * sinA;
|
||||
var upperA = Math.Atan2(y, x);
|
||||
var upperB = RadiansToDegrees(upperA);
|
||||
var upperB = upperA.RadiansToDegrees();
|
||||
|
||||
var horizonCoordinates = new HorizonCoordinates();
|
||||
horizonCoordinates.Altitude = RadiansToDegrees(Math.Asin(sinA));
|
||||
var horizonCoordinates = new HorizonCoordinates
|
||||
{
|
||||
Altitude = Math.Asin(sinA).RadiansToDegrees(),
|
||||
Azimuth = upperB
|
||||
};
|
||||
|
||||
horizonCoordinates.Azimuth = upperB;
|
||||
|
||||
if (upperB < 0)
|
||||
{
|
||||
@@ -95,82 +96,6 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
return horizonCoordinates;
|
||||
}
|
||||
|
||||
|
||||
//todo convert to extension method
|
||||
public double DegreesToRadians(double degrees)
|
||||
{
|
||||
return (Math.PI / 180) * degrees;
|
||||
}
|
||||
|
||||
//todo convert to extension method
|
||||
public double RadiansToDegrees(double radians)
|
||||
{
|
||||
double degrees = (180 / Math.PI) * radians;
|
||||
return (degrees);
|
||||
}
|
||||
|
||||
//todo convert to extension method
|
||||
public double DateTimeToDecimalHours( DateTime utcDateTime)
|
||||
{
|
||||
double sec = utcDateTime.Second;
|
||||
double min = utcDateTime.Minute;
|
||||
double hour = utcDateTime.Hour;
|
||||
|
||||
var a = Math.Abs(sec) / 60;
|
||||
var b = (Math.Abs(min) + a) / 60;
|
||||
var c = Math.Abs(hour) + b;
|
||||
|
||||
var d = c;
|
||||
|
||||
if ((hour < 0) || (min < 0) || (sec < 0))
|
||||
d = -c;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
//todo convert to extension method
|
||||
public double UTtoGst(DateTime utcDateTime)
|
||||
{
|
||||
Util util = new Util();
|
||||
|
||||
var jd = util.DateUTCToJulian(utcDateTime) - 0.5;
|
||||
if ((jd % 1) <= 0.5 )
|
||||
jd = Math.Floor( jd );
|
||||
else
|
||||
jd = Math.Floor( jd ) + 0.5;
|
||||
|
||||
var s = jd - 2451545.0;
|
||||
var t = s / 36525.0;
|
||||
var t0 = 6.697374558 + (2400.051336 * t ) +(0.000025862 * (t * t) );
|
||||
|
||||
while (t0 < 0)
|
||||
{
|
||||
t0 += 24;
|
||||
}
|
||||
|
||||
while (t0 >= 24)
|
||||
{
|
||||
t0 -= 24;
|
||||
}
|
||||
|
||||
var ut = DateTimeToDecimalHours(utcDateTime);
|
||||
var a = ut * 1.002737909;
|
||||
|
||||
var t1 = t0 + a;
|
||||
|
||||
while (t1 < 0)
|
||||
{
|
||||
t1 += 24;
|
||||
}
|
||||
|
||||
while (t1 >= 24)
|
||||
{
|
||||
t1 -= 24;
|
||||
}
|
||||
|
||||
return t1;
|
||||
}
|
||||
|
||||
public double GsTtoLst(double gst, double longitude)
|
||||
{
|
||||
var l = longitude/ 15;
|
||||
@@ -188,4 +113,4 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
return lst;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@ namespace ASCOM.Meade.net.AstroMaths
|
||||
public interface IAstroMaths
|
||||
{
|
||||
double RightAscensionToHourAngle(DateTime utcDateTime, double longitude, double rightAscension);
|
||||
double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle );
|
||||
//double HourAngleToRightAscension(DateTime utcDateTime, double longitude, double hourAngle );
|
||||
EquatorialCoordinates ConvertHozToEq( DateTime utcDateTime, double latitude, double longitude, HorizonCoordinates altAz);
|
||||
HorizonCoordinates ConvertEqToHoz(double hourAngle, double latitude, EquatorialCoordinates raDec);
|
||||
double DegreesToRadians(double degrees);
|
||||
double RadiansToDegrees(double radians);
|
||||
double DateTimeToDecimalHours( DateTime utcDateTime);
|
||||
double UTtoGst(DateTime utcDateTime);
|
||||
double GsTtoLst(double gst, double longitude);
|
||||
//double DegreesToRadians(double degrees);
|
||||
//double RadiansToDegrees(double radians);
|
||||
//double DateTimeToDecimalHours( DateTime utcDateTime);
|
||||
//double UTtoGst(DateTime utcDateTime);
|
||||
//double GsTtoLst(double gst, double longitude);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class Clock : IClock
|
||||
{
|
||||
public DateTime UtcNow => DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public enum ComparisonResult
|
||||
{
|
||||
Lower,
|
||||
Equals,
|
||||
Greater
|
||||
}
|
||||
}
|
||||
@@ -10,5 +10,18 @@ namespace ASCOM.Meade.net
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static ComparisonResult Compare(this double value, double comparison)
|
||||
{
|
||||
var result = value.CompareTo(comparison);
|
||||
|
||||
if (result < 0)
|
||||
return ComparisonResult.Lower;
|
||||
|
||||
if (result == 0)
|
||||
return ComparisonResult.Equals;
|
||||
|
||||
return ComparisonResult.Greater;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace System
|
||||
{
|
||||
static class DoubelExtensions
|
||||
{
|
||||
public static bool Between(this double value, double lower, double higher)
|
||||
{
|
||||
return value >= lower & value <= higher;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public interface IClock
|
||||
{
|
||||
DateTime UtcNow { get; }
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
||||
@@ -46,7 +46,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<RegisterForComInterop>true</RegisterForComInterop>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -62,44 +62,49 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
@@ -113,12 +118,18 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Alignment.cs" />
|
||||
<Compile Include="AlignmentStatus.cs" />
|
||||
<Compile Include="AstroMaths\AltitudeData.cs" />
|
||||
<Compile Include="AstroMaths\AstroMathExtensions.cs" />
|
||||
<Compile Include="AstroMaths\AstroMaths.cs" />
|
||||
<Compile Include="AstroMaths\EquatorialCoordinates.cs" />
|
||||
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
|
||||
<Compile Include="AstroMaths\IAstroMaths.cs" />
|
||||
<Compile Include="Clock.cs" />
|
||||
<Compile Include="ComparisonResult.cs" />
|
||||
<Compile Include="DoubleExtensions.cs" />
|
||||
<Compile Include="ExtensionMethods\DoubelExtensions.cs" />
|
||||
<Compile Include="IClock.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="Telescope.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -145,14 +156,12 @@
|
||||
<None Include="app.config" />
|
||||
<None Include="ASCOM.png" />
|
||||
<None Include="ASCOMDriverTemplate.snk" />
|
||||
<None Include="BootstrapAscomProfileStore.ps1" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="ASCOM.ico" />
|
||||
<Content Include="ReadMe.htm" />
|
||||
<None Include="Resources\ASCOM.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -178,12 +187,17 @@
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<ProjectConfiguration>
|
||||
<Settings>
|
||||
<HiddenComponentWarnings>
|
||||
<Value>CopyReferencedAssembliesToWorkspaceIsOn</Value>
|
||||
</HiddenComponentWarnings>
|
||||
<UseCPUArchitecture>x86</UseCPUArchitecture>
|
||||
</Settings>
|
||||
</ProjectConfiguration>
|
||||
@@ -5,7 +5,6 @@ using System.Runtime.InteropServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
// TODO - Add your authorship information here
|
||||
[assembly: AssemblyTitle("ASCOM.Meade.net.Telescope")]
|
||||
[assembly: AssemblyDescription("ASCOM Telescope driver for Meade.net")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
@@ -18,7 +17,7 @@ using System.Runtime.InteropServices;
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(true)]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8b9fccb9-87ae-42f7-90af-079e13de6efb")]
|
||||
@@ -33,6 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
//
|
||||
// TODO - Set your driver's version here
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
||||
|
||||
@@ -79,5 +79,32 @@ namespace ASCOM.Meade.net.Properties {
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Site out of range.
|
||||
/// </summary>
|
||||
internal static string Telescope_GetSiteName_Site_out_of_range {
|
||||
get {
|
||||
return ResourceManager.GetString("Telescope_GetSiteName_Site_out_of_range", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Site cannot be higher than 4.
|
||||
/// </summary>
|
||||
internal static string Telescope_SelectSite_Site_cannot_be_higher_than_4 {
|
||||
get {
|
||||
return ResourceManager.GetString("Telescope_SelectSite_Site_cannot_be_higher_than_4", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Site cannot be lower than 1.
|
||||
/// </summary>
|
||||
internal static string Telescope_SelectSite_Site_cannot_be_lower_than_1 {
|
||||
get {
|
||||
return ResourceManager.GetString("Telescope_SelectSite_Site_cannot_be_lower_than_1", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,4 +124,13 @@
|
||||
<data name="DefaultIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\ASCOM.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Telescope_SelectSite_Site_cannot_be_lower_than_1" xml:space="preserve">
|
||||
<value>Site cannot be lower than 1</value>
|
||||
</data>
|
||||
<data name="Telescope_SelectSite_Site_cannot_be_higher_than_4" xml:space="preserve">
|
||||
<value>Site cannot be higher than 4</value>
|
||||
</data>
|
||||
<data name="Telescope_GetSiteName_Site_out_of_range" xml:space="preserve">
|
||||
<value>Site out of range</value>
|
||||
</data>
|
||||
</root>
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace ASCOM.Meade.net.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ASCOM.DeviceInterface;
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using ASCOM.DeviceInterface;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
@@ -19,37 +19,26 @@ namespace ASCOM.Meade.net
|
||||
[ComVisible(true)]
|
||||
public class Rate : IRate
|
||||
{
|
||||
private double _maximum = 0;
|
||||
private double _minimum = 0;
|
||||
|
||||
//
|
||||
// Default constructor - Internal prevents public creation
|
||||
// of instances. These are values for AxisRates.
|
||||
//
|
||||
internal Rate(double minimum, double maximum)
|
||||
{
|
||||
_maximum = maximum;
|
||||
_minimum = minimum;
|
||||
Maximum = maximum;
|
||||
Minimum = minimum;
|
||||
}
|
||||
|
||||
#region Implementation of IRate
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// TODO Add any required object cleanup here
|
||||
// Add any required object cleanup here
|
||||
}
|
||||
|
||||
public double Maximum
|
||||
{
|
||||
get => _maximum;
|
||||
set => _maximum = value;
|
||||
}
|
||||
public double Maximum { get; set; }
|
||||
|
||||
public double Minimum
|
||||
{
|
||||
get => _minimum;
|
||||
set => _minimum = value;
|
||||
}
|
||||
public double Minimum { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -93,16 +82,17 @@ namespace ASCOM.Meade.net
|
||||
switch (axis)
|
||||
{
|
||||
case TelescopeAxes.axisPrimary:
|
||||
case TelescopeAxes.axisSecondary:
|
||||
// TODO Initialize this array with any Primary axis rates that your driver may provide
|
||||
// Example: m_Rates = new Rate[] { new Rate(10.5, 30.2), new Rate(54.0, 43.6) }
|
||||
//this.rates = new Rate[0];
|
||||
_rates = new Rate[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
||||
break;
|
||||
case TelescopeAxes.axisSecondary:
|
||||
// TODO Initialize this array with any Secondary axis rates that your driver may provide
|
||||
//this.rates = new Rate[0];
|
||||
_rates = new Rate[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
||||
_rates = new[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
||||
break;
|
||||
|
||||
//// TODO Initialize this array with any Secondary axis rates that your driver may provide
|
||||
////this.rates = new Rate[0];
|
||||
//_rates = new[] { new Rate(1, 1), new Rate(2, 2), new Rate(3, 3), new Rate(4, 4) };
|
||||
//break;
|
||||
case TelescopeAxes.axisTertiary:
|
||||
// TODO Initialize this array with any Tertiary axis rates that your driver may provide
|
||||
_rates = new Rate[0];
|
||||
@@ -116,7 +106,7 @@ namespace ASCOM.Meade.net
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// TODO Add any required object cleanup here
|
||||
// Add any required object cleanup here
|
||||
}
|
||||
|
||||
public IEnumerator GetEnumerator()
|
||||
@@ -152,22 +142,26 @@ namespace ASCOM.Meade.net
|
||||
private readonly DriveRates[] _trackingRates;
|
||||
|
||||
// this is used to make the index thread safe
|
||||
private readonly ThreadLocal<int> _pos = new ThreadLocal<int>(() => { return -1; });
|
||||
private readonly ThreadLocal<int> _pos = new ThreadLocal<int>(() => -1);
|
||||
private static readonly object LockObj = new object();
|
||||
|
||||
//
|
||||
// Default constructor - Internal prevents public creation
|
||||
// of instances. Returned by Telescope.AxisRates.
|
||||
//
|
||||
internal TrackingRates()
|
||||
internal TrackingRates(bool supportsLunar)
|
||||
{
|
||||
//
|
||||
// This array must hold ONE or more DriveRates values, indicating
|
||||
// the tracking rates supported by your telescope. The one value
|
||||
// (tracking rate) that MUST be supported is driveSidereal!
|
||||
//
|
||||
_trackingRates = new[] { DriveRates.driveSidereal, DriveRates.driveLunar };
|
||||
// TODO Initialize this array with any additional tracking rates that your driver may provide
|
||||
if (supportsLunar)
|
||||
{
|
||||
_trackingRates = new[] {DriveRates.driveSidereal, DriveRates.driveLunar};
|
||||
}
|
||||
else
|
||||
_trackingRates = new[] { DriveRates.driveSidereal };
|
||||
}
|
||||
|
||||
#region ITrackingRates Members
|
||||
@@ -176,13 +170,17 @@ namespace ASCOM.Meade.net
|
||||
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
_pos.Value = -1;
|
||||
return this as IEnumerator;
|
||||
lock (LockObj)
|
||||
{
|
||||
_pos.Value = -1;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// TODO Add any required object cleanup here
|
||||
// Add any required object cleanup here
|
||||
}
|
||||
|
||||
public DriveRates this[int index] => _trackingRates[index - 1];
|
||||
@@ -220,7 +218,10 @@ namespace ASCOM.Meade.net
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_pos.Value = -1;
|
||||
lock (LockObj)
|
||||
{
|
||||
_pos.Value = -1;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
|
||||
<TITLE>Untitled Document</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Win32)">
|
||||
<META NAME="CREATED" CONTENT="0;0">
|
||||
<META NAME="CHANGEDBY" CONTENT="Chris Rowland">
|
||||
<META NAME="CHANGED" CONTENT="20110918;14150500">
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
@page { margin: 2cm }
|
||||
P { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
TD P { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
H3 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
H2 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
H4 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
TD P.note { background: #33ffff; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
TD P.underline { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal; text-decoration: underline }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" DIR="LTR">
|
||||
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD>
|
||||
<H2>ASCOM Telescope Driver (C#)</H2>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P><BR><BR>
|
||||
</P>
|
||||
<H4>You have just created the skeleton of an ASCOM
|
||||
Telescope driver in C#. It produces an in-process
|
||||
(assembly) based driver.</H4>
|
||||
<HR>
|
||||
<P CLASS="note">Prior to developing your first driver, please
|
||||
familiarize yourself with the <A HREF="http://ascom-standards.org/developer.html">developer
|
||||
information we've provided</A> at the ASCOM Initiative web site
|
||||
(internet required).
|
||||
</P>
|
||||
<P CLASS="underline">You must do the following in order to complete
|
||||
your implementation:</P>
|
||||
<OL>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Switch to the Debug configuration
|
||||
and build the template now. It should build without errors.
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Add a test project to the
|
||||
solution. There are templates that can be used to add either a
|
||||
console or a Windows Forms application:</P>
|
||||
</OL>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Select the <FONT FACE="Consolas, monospace">ASCOM
|
||||
Test Forms App (CS)</FONT> or <FONT FACE="Consolas, monospace">ASCOM
|
||||
Test Console App (CS)</FONT> template.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Set a name for the test
|
||||
application and click on OK.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">In the Wizard: set the same device
|
||||
type and model name as for the driver and select Create to build the
|
||||
test project.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Set the Test Application to Run at
|
||||
Startup.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Click on Debug and the test
|
||||
application should run. You should be able to select your
|
||||
application in the chooser. Selecting Properties should show the
|
||||
default setup dialog for your driver.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Trying to continue will generate
|
||||
errors because the additional properties have not been implemented.</P>
|
||||
</UL>
|
||||
<OL START=4>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Go through the Driver.cs file and
|
||||
replace the System.NotImplemented exceptions with code to implement
|
||||
your driver's functionality. See the ASCOM ITelescopeV3
|
||||
spec. If a property or method is not implemented in your driver the
|
||||
System.NotImplemented exception must be replaced by an
|
||||
ASCOM.PropertyNotImplemented or ASCOM.MethodNotImplemented
|
||||
exception.</P>
|
||||
<LI><P>Customize the Setup Dialog (SetupDialogForm) to provide the
|
||||
settings and other controls for your driver. You can bind settings
|
||||
directly to controls on your dialog form, there's no need to manage
|
||||
settings manually. A custom Settings class takes care of managing
|
||||
your settings behind the scenes.
|
||||
</P>
|
||||
</OL>
|
||||
<H3>Notes:</H3>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Successfully building the driver,
|
||||
as well as using <FONT FACE="Lucida Console, Courier New, Courier, monospace">regasm</FONT>
|
||||
on the assembly, registers it for both COM and ASCOM (the Chooser).
|
||||
See the code in the ASCOM Registration region of Driver.vb.
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Doing a Clean for the project, as
|
||||
well doing a <FONT FACE="Lucida Console, Courier New, Courier, monospace">regasm
|
||||
-u</FONT> on the assembly, unregisters it for both COM and ASCOM
|
||||
(the Chooser).
|
||||
</P>
|
||||
<LI><P>Place a breakpoint in your driver class constructor, then
|
||||
start debugging (go, F5). Your breakpoint will be hit when the test
|
||||
application creates an instance of your driver (after selecting it
|
||||
in the Chooser). You can now single step, examine variables, etc.
|
||||
Please review the test application and make changes and additions to
|
||||
activate various parts of your driver during debugging.</P>
|
||||
<LI><P>The project's Debug configuration is already configured (The
|
||||
test application creates an instance of your driver (after selecting
|
||||
it in the Chooser). You can now single step, examine variables, etc.
|
||||
Please review the test application and feel free to make changes and
|
||||
additions to activate various parts of your driver during debugging.
|
||||
</P>
|
||||
</UL>
|
||||
<DIV ALIGN=RIGHT>
|
||||
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD>
|
||||
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD>
|
||||
<H3>ASCOM Initiative</H3>
|
||||
</TD>
|
||||
<TD>
|
||||
<IMG SRC="ASCOM.png" NAME="graphics1" ALIGN=RIGHT WIDTH=48 HEIGHT=56 BORDER=0></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P><BR><BR>
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>
|
||||
<P>The ASCOM Initiative consists of a group of astronomy software
|
||||
developers and instrument vendors whose goals are to promote the
|
||||
driver/client model and scripting automation.
|
||||
</P>
|
||||
<P>See the <A HREF="http://ascom-standards.org/" TARGET="browser">ASCOM
|
||||
web site</A> for more information. Please participate in the
|
||||
<A HREF="http://tech.groups.yahoo.com/group/ASCOM-Talk" TARGET="browser">ASCOM-Talk
|
||||
Yahoo Group</A>.
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<P><BR><BR>
|
||||
</P><P>
|
||||
<BR><BR>
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -7,10 +7,10 @@ namespace ASCOM.Meade.net
|
||||
return int.Parse(str);
|
||||
}
|
||||
|
||||
public static double ToDouble(this string str)
|
||||
{
|
||||
return double.Parse(str);
|
||||
}
|
||||
//public static double ToDouble(this string str)
|
||||
//{
|
||||
// return double.Parse(str);
|
||||
//}
|
||||
|
||||
public static int Position(this string str, char find, int instance)
|
||||
{
|
||||
|
||||
+3031
-1250
File diff suppressed because it is too large
Load Diff
@@ -5,4 +5,4 @@
|
||||
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net40" />
|
||||
<package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -0,0 +1,36 @@
|
||||
<#
|
||||
This script initializes a bare minimum set of registry entries required for ASCOM.Utilities.Profile to work
|
||||
without throwing any exceptions. When building on a build server, or on a computer without the ASCOM Platform installed,
|
||||
it may be useful to execute this script as a build step prior to running any unit tests, or calling any code that relies on
|
||||
ASCOM.Utilities.Profile. The alternative is to install the ASCOM Platform on the build agent.
|
||||
|
||||
NOTE: This script equires elevated permissions because it creates registry keys in the LocalMachine hive.
|
||||
#>
|
||||
|
||||
$wow = Test-Path HKLM:\SOFTWARE\Wow6432Node
|
||||
if ($wow)
|
||||
{
|
||||
$root = "HKLM:\SOFTWARE\Wow6432Node"
|
||||
}
|
||||
else
|
||||
{
|
||||
$root = "HKLM:\SOFTWARE"
|
||||
}
|
||||
$ascomRoot = $root + "\ASCOM"
|
||||
|
||||
if (Test-Path $ascomRoot)
|
||||
{
|
||||
<# Don't upset an already-existing ASCOM registry #>
|
||||
exit
|
||||
}
|
||||
|
||||
<# Create the ASCOM root key and set it's ACL to allow all users read/write access #>
|
||||
New-Item -Path $root -Name ASCOM –Force
|
||||
$ascomAcl = Get-Acl $ascomRoot
|
||||
$aclRule = New-Object System.Security.AccessControl.RegistryAccessRule ("Users","FullControl","Allow")
|
||||
$ascomAcl.SetAccessRule($aclRule)
|
||||
$ascomAcl | Set-Acl -Path $ascomRoot
|
||||
|
||||
<# Now create the bare minimum keys required so that ASCOM.Utilities.Profile doesn't crash and burn #>
|
||||
New-ItemProperty -Path $ascomRoot -Name PlatformVersion -Value "6.1" -PropertyType String –Force
|
||||
New-ItemProperty -Path $ascomRoot -Name SerTraceFile -Value "C:\SerialTraceAuto.txt" -PropertyType String –Force
|
||||
@@ -0,0 +1,188 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Meade.net.UnitTests</RootNamespace>
|
||||
<AssemblyName>Meade.net.UnitTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.23.0.29, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.2.23.0\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Testing.Extensions.MSBuild, Version=1.7.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<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 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.Core" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</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">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SharedResourcesUnitTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ThreadSafeBoolTests.cs" />
|
||||
<Compile Include="ThreadSafeDateTimeTests.cs" />
|
||||
<Compile Include="ThreadSafeEnumTests.cs" />
|
||||
<Compile Include="ThreadSafeNullableDoubleTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
|
||||
<Project>{3689a2cb-94c5-4012-a5cf-7e7d1dd27143}</Project>
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.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>
|
||||
<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>
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Meade.net.UnitTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Meade.net.UnitTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("21ef28b4-d574-4a2d-a61d-5df96af46ab2")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeBoolTests
|
||||
{
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void When_Assigned_ThenValueIsSame(bool value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<bool> sut = value;
|
||||
|
||||
// when
|
||||
bool actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCase(false, false)]
|
||||
[TestCase(false, true)]
|
||||
[TestCase(true, false)]
|
||||
[TestCase(true, true)]
|
||||
public void When_SetValue_ThenValueIsUpdated(bool initialValue, bool setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<bool> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
bool afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeDateTimeTests
|
||||
{
|
||||
[TestCaseSource(nameof(DateTimeSource))]
|
||||
public void When_Assigned_ThenValueIsSame(DateTime value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<DateTime> sut = value;
|
||||
|
||||
// when
|
||||
DateTime actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(DateTimeSetSource))]
|
||||
public void When_SetValue_ThenValueIsUpdated(DateTime initialValue, DateTime setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<DateTime> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
DateTime afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
|
||||
static readonly DateTime Example1 = DateTimeOffset.Parse("2012-05-09T02:10:31.296761Z", CultureInfo.InvariantCulture).UtcDateTime;
|
||||
static readonly DateTime Example2 = DateTimeOffset.Parse("2051-03-09T23:15:11.556081Z", CultureInfo.InvariantCulture).UtcDateTime;
|
||||
|
||||
static IEnumerable<DateTime> DateTimeSource => new[]
|
||||
{
|
||||
DateTime.MinValue,
|
||||
Example1,
|
||||
Example2
|
||||
};
|
||||
|
||||
static IEnumerable<TestCaseData> DateTimeSetSource => new[]
|
||||
{
|
||||
new TestCaseData(DateTime.MinValue, Example1),
|
||||
new TestCaseData(DateTime.MinValue, Example2),
|
||||
new TestCaseData(DateTime.MinValue, DateTime.MinValue),
|
||||
new TestCaseData(Example1, Example1),
|
||||
new TestCaseData(Example1, Example2),
|
||||
new TestCaseData(Example1, DateTime.MinValue),
|
||||
new TestCaseData(Example2, Example1),
|
||||
new TestCaseData(Example2, Example2),
|
||||
new TestCaseData(Example2, DateTime.MinValue)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeEnumTests
|
||||
{
|
||||
[TestCase(PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierWest)]
|
||||
public void When_Assigned_ThenValueIsSame(PierSide value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<PierSide> sut = value;
|
||||
|
||||
// when
|
||||
PierSide actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCase(PierSide.pierUnknown, PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierUnknown, PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierUnknown, PierSide.pierWest)]
|
||||
[TestCase(PierSide.pierEast, PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierEast, PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierEast, PierSide.pierWest)]
|
||||
[TestCase(PierSide.pierWest, PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierWest, PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierWest, PierSide.pierWest)]
|
||||
public void When_SetValue_ThenValueIsUpdated(PierSide initialValue, PierSide setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<PierSide> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
PierSide afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeNullableDoubleTests
|
||||
{
|
||||
[TestCase(0.1d)]
|
||||
[TestCase(-12.34d)]
|
||||
[TestCase(0d)]
|
||||
[TestCase(null)]
|
||||
public void When_Assigned_ThenValueIsSame(double? value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<double?> sut = value;
|
||||
|
||||
// when
|
||||
double? actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCase(0.1d, 0.2d)]
|
||||
[TestCase(-12.34d, 5d)]
|
||||
[TestCase(0d, 1d)]
|
||||
[TestCase(null, 2d)]
|
||||
[TestCase(0.1d, null)]
|
||||
[TestCase(-12.34d, null)]
|
||||
[TestCase(0d, null)]
|
||||
[TestCase(null, null)]
|
||||
public void When_SetValue_ThenValueIsUpdated(double? initialValue, double? setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<double?> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
double? afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="5.1.0" targetFramework="net472" />
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
|
||||
<package id="Microsoft.ApplicationInsights" version="2.23.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Testing.Extensions.Telemetry" version="1.7.3" 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="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" />
|
||||
</packages>
|
||||
+120
-219
@@ -1,14 +1,12 @@
|
||||
#define Focuser
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.DeviceInterface;
|
||||
using System.Globalization;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
@@ -20,7 +18,7 @@ namespace ASCOM.Meade.net
|
||||
// The ClassInterface/None addribute prevents an empty interface called
|
||||
// _Meade.net from being created and used as the [default] interface
|
||||
//
|
||||
// TODO Replace the not implemented exceptions with code to implement the function or
|
||||
// Replace the not implemented exceptions with code to implement the function or
|
||||
// throw the appropriate ASCOM exception.
|
||||
//
|
||||
|
||||
@@ -29,36 +27,23 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
[Guid("a32ac647-bf0f-42f9-8ab0-d166fa5884ad")]
|
||||
[ProgId("ASCOM.MeadeGeneric.focuser")]
|
||||
[ServedClassName("Meade.net Focuser")]
|
||||
[ServedClassName("Meade Generic")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public class Focuser : ReferenceCountedObjectBase, IFocuserV3
|
||||
[ComVisible(true)]
|
||||
public class Focuser : MeadeTelescopeBase, IFocuserV3
|
||||
{
|
||||
/// <summary>
|
||||
/// ASCOM DeviceID (COM ProgID) for this driver.
|
||||
/// The DeviceID is used by ASCOM applications to load the driver at runtime.
|
||||
/// </summary>
|
||||
//internal static string driverID = "ASCOM.Meade.net.Focuser";
|
||||
private static readonly string DriverId = Marshal.GenerateProgIdForType(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// TODO Change the descriptive string for your driver then remove this line
|
||||
/// <summary>
|
||||
/// Driver description that displays in the ASCOM Chooser.
|
||||
/// </summary>
|
||||
private static readonly string DriverDescription = "Meade Generic";
|
||||
|
||||
private static string _comPort; // Variables to hold the currrent device configuration
|
||||
private static readonly string DriverId = Marshal.GenerateProgIdForType(MethodBase.GetCurrentMethod().DeclaringType ?? throw new System.InvalidOperationException());
|
||||
|
||||
/// <summary>
|
||||
/// Private variable to hold an ASCOM Utilities object
|
||||
/// </summary>
|
||||
private readonly IUtil _utilities;
|
||||
|
||||
/// <summary>
|
||||
/// Variable to hold the trace logger object (creates a diagnostic log file with information that you specify)
|
||||
/// </summary>
|
||||
internal static TraceLogger Tl;
|
||||
|
||||
private readonly ISharedResourcesWrapper _sharedResourcesWrapper;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Meade.net"/> class.
|
||||
/// Must be public for COM registration.
|
||||
@@ -66,26 +51,19 @@ namespace ASCOM.Meade.net
|
||||
public Focuser()
|
||||
{
|
||||
//todo move this out to IOC
|
||||
_utilities = new Util(); //Initialise util object
|
||||
_sharedResourcesWrapper = new SharedResourcesWrapper();
|
||||
var util = new Util(); //Initialise util object
|
||||
_utilities = util;
|
||||
|
||||
Initialise();
|
||||
Initialise(nameof(Focuser));
|
||||
}
|
||||
|
||||
private void Initialise()
|
||||
public Focuser(IUtil util, ISharedResourcesWrapper sharedResourcesWrapper, ITraceLogger traceLogger) : base(sharedResourcesWrapper)
|
||||
{
|
||||
//todo move the TraceLogger out to a factory class.
|
||||
Tl = new TraceLogger("", "Meade.Generic.focusser");
|
||||
_utilities = util;
|
||||
|
||||
ReadProfile(); // Read device configuration from the ASCOM Profile store
|
||||
|
||||
IsConnected = false; // Initialise connected to false
|
||||
|
||||
LogMessage("Focuser", "Completed initialisation");
|
||||
LogMessage("Focuser", $"Driver version: {DriverVersion}");
|
||||
Initialise(nameof(Focuser), traceLogger);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// PUBLIC COM INTERFACE IFocuserV3 IMPLEMENTATION
|
||||
//
|
||||
@@ -100,17 +78,17 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
public void SetupDialog()
|
||||
{
|
||||
Tl.LogMessage("SetupDialog", "Opening setup dialog");
|
||||
_sharedResourcesWrapper.SetupDialog();
|
||||
Tl.LogMessage("SetupDialog", "Opening setup dialog", false);
|
||||
SharedResourcesWrapper.SetupDialog();
|
||||
ReadProfile();
|
||||
Tl.LogMessage("SetupDialog", "complete");
|
||||
Tl.LogMessage("SetupDialog", "complete", false);
|
||||
}
|
||||
|
||||
public ArrayList SupportedActions
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("SupportedActions Get", "Returning empty arraylist");
|
||||
Tl.LogMessage("SupportedActions Get", "Returning empty arraylist", false);
|
||||
return new ArrayList();
|
||||
}
|
||||
}
|
||||
@@ -118,47 +96,53 @@ namespace ASCOM.Meade.net
|
||||
public string Action(string actionName, string actionParameters)
|
||||
{
|
||||
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
||||
throw new ActionNotImplementedException("Action " + actionName + " is not implemented by this driver");
|
||||
throw new ActionNotImplementedException();
|
||||
}
|
||||
|
||||
public void CommandBlind(string command, bool raw)
|
||||
{
|
||||
LogMessage("CommandBlind", "raw: {0} command {0}", raw, command);
|
||||
CheckConnected("CommandBlind");
|
||||
// Call CommandString and return as soon as it finishes
|
||||
//this.CommandString(command, raw);
|
||||
_sharedResourcesWrapper.SendBlind(command);
|
||||
SharedResourcesWrapper.SendBlind(Tl, command, raw);
|
||||
// or
|
||||
//throw new ASCOM.MethodNotImplementedException("CommandBlind");
|
||||
// DO NOT have both these sections! One or the other
|
||||
LogMessage("CommandBlind", "Completed");
|
||||
}
|
||||
|
||||
public bool CommandBool(string command, bool raw)
|
||||
{
|
||||
LogMessage("CommandBool", "raw: {0} command {0}", raw, command);
|
||||
CheckConnected("CommandBool");
|
||||
//string ret = CommandString(command, raw);
|
||||
// TODO decode the return string and return true or false
|
||||
var result = SharedResourcesWrapper.SendBool(Tl, command, raw);
|
||||
LogMessage("CommandBool", "Completed: {0}", result);
|
||||
return result;
|
||||
// or
|
||||
throw new MethodNotImplementedException("CommandBool");
|
||||
//throw new MethodNotImplementedException("CommandBool");
|
||||
// DO NOT have both these sections! One or the other
|
||||
}
|
||||
|
||||
public string CommandString(string command, bool raw)
|
||||
{
|
||||
LogMessage("CommandString", "raw: {0} command {0}", raw, command);
|
||||
CheckConnected("CommandString");
|
||||
// it's a good idea to put all the low level communication with the device here,
|
||||
// then all communication calls this function
|
||||
// you need something to ensure that only one command is in progress at a time
|
||||
return _sharedResourcesWrapper.SendString(command);
|
||||
|
||||
throw new MethodNotImplementedException("CommandString");
|
||||
var result = SharedResourcesWrapper.SendString(Tl, command, raw);
|
||||
LogMessage("CommandBool", "Completed: {0}", result);
|
||||
return result;
|
||||
//throw new ASCOM.MethodNotImplementedException("CommandString");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clean up the tracelogger and util objects
|
||||
Tl.Enabled = false;
|
||||
Tl.Dispose();
|
||||
Tl = null;
|
||||
//Tl.Dispose();
|
||||
//Tl = null;
|
||||
}
|
||||
|
||||
public bool Connected
|
||||
@@ -179,98 +163,31 @@ namespace ASCOM.Meade.net
|
||||
try
|
||||
{
|
||||
ReadProfile();
|
||||
_sharedResourcesWrapper.Connect("Serial");
|
||||
SharedResourcesWrapper.Connect("Serial", DriverId, Tl);
|
||||
try
|
||||
{
|
||||
SelectSite(1);
|
||||
SetLongFormat(true);
|
||||
|
||||
IsConnected = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_sharedResourcesWrapper.Disconnect("Serial");
|
||||
SharedResourcesWrapper.Disconnect("Serial", DriverId);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogMessage("Connected Set", "Error connecting to port {0} - {1}", _comPort, ex.Message);
|
||||
LogMessage("Connected Set", "Error connecting to port {0} - {1}", _profileProperties.ComPort, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage("Connected Set", "Disconnecting from port {0}", _comPort);
|
||||
_sharedResourcesWrapper.Disconnect("Serial");
|
||||
LogMessage("Connected Set", "Disconnecting from port {0}", _profileProperties.ComPort);
|
||||
SharedResourcesWrapper.Disconnect("Serial", DriverId);
|
||||
IsConnected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetLongFormat(bool setLongFormat)
|
||||
{
|
||||
_sharedResourcesWrapper.Lock(() =>
|
||||
{
|
||||
var result = _sharedResourcesWrapper.SendString(":GZ#");
|
||||
//:GZ# Get telescope azimuth
|
||||
//Returns: DDD*MM#T or DDD*MM’SS#
|
||||
//The current telescope Azimuth depending on the selected precision.
|
||||
|
||||
bool isLongFormat = result.Length > 6;
|
||||
|
||||
if (isLongFormat != setLongFormat)
|
||||
{
|
||||
_utilities.WaitForMilliseconds(500);
|
||||
_sharedResourcesWrapper.SendBlind(":U#");
|
||||
//:U# Toggle between low/hi precision positions
|
||||
//Low - RA displays and messages HH:MM.T sDD*MM
|
||||
//High - Dec / Az / El displays and messages HH:MM: SS sDD*MM:SS
|
||||
// Returns Nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SelectSite(int site)
|
||||
{
|
||||
_sharedResourcesWrapper.SendBlind($":W{site}#");
|
||||
//:W<n>#
|
||||
//Set current site to<n>, an ASCII digit in the range 1..4
|
||||
//Returns: Nothing
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
// TODO customise this device description
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("Description Get", DriverDescription);
|
||||
return DriverDescription;
|
||||
}
|
||||
}
|
||||
|
||||
public string DriverInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
Version version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
// TODO customise this driver description
|
||||
string driverInfo = "Information about the driver itself. Version: " + String.Format(CultureInfo.InvariantCulture, "{0}.{1}", version.Major, version.Minor);
|
||||
Tl.LogMessage("DriverInfo Get", driverInfo);
|
||||
return driverInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public string DriverVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
Version version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
string driverVersion = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", version.Major, version.Minor);
|
||||
Tl.LogMessage("DriverVersion Get", driverVersion);
|
||||
return driverVersion;
|
||||
}
|
||||
}
|
||||
|
||||
public short InterfaceVersion
|
||||
{
|
||||
// set by the driver wizard
|
||||
@@ -287,7 +204,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
//string name = "Short driver name - please customise";
|
||||
string name = DriverDescription;
|
||||
Tl.LogMessage("Name Get", name);
|
||||
Tl.LogMessage("Name Get", name, false);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -300,34 +217,31 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("Absolute Get", false.ToString());
|
||||
CheckConnected("Absolute Get");
|
||||
|
||||
Tl.LogMessage("Absolute Get", false.ToString(), false);
|
||||
return false; // This is a relative focuser
|
||||
}
|
||||
}
|
||||
|
||||
public void Halt()
|
||||
{
|
||||
Tl.LogMessage("Halt", "Halting");
|
||||
Tl.LogMessage("Halt", "Halting", false);
|
||||
|
||||
CheckConnected("Halt");
|
||||
|
||||
//A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe.
|
||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
||||
while (stopwatch.ElapsedMilliseconds < 1000)
|
||||
{
|
||||
_sharedResourcesWrapper.SendBlind(":FQ#");
|
||||
//:FQ# Halt Focuser Motion
|
||||
//Returns: Nothing
|
||||
//todo fix this issue: A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe.
|
||||
|
||||
_utilities.WaitForMilliseconds(250);
|
||||
}
|
||||
SharedResourcesWrapper.SendBlind(Tl, "FQ");
|
||||
//:FQ# Halt Focuser Motion
|
||||
//Returns: Nothing
|
||||
}
|
||||
|
||||
public bool IsMoving
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("IsMoving Get", false.ToString());
|
||||
Tl.LogMessage("IsMoving Get", false.ToString(), false);
|
||||
return false; // This focuser always moves instantaneously so no need for IsMoving ever to be True
|
||||
}
|
||||
}
|
||||
@@ -336,45 +250,42 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("Link Get", Connected.ToString());
|
||||
Tl.LogMessage("Link Get", Connected.ToString(), false);
|
||||
return Connected; // Direct function to the connected method, the Link method is just here for backwards compatibility
|
||||
}
|
||||
set
|
||||
{
|
||||
Tl.LogMessage("Link Set", value.ToString());
|
||||
Tl.LogMessage("Link Set", value.ToString(), false);
|
||||
Connected = value; // Direct function to the connected method, the Link method is just here for backwards compatibility
|
||||
}
|
||||
}
|
||||
|
||||
private readonly int _maxIncrement = 7000;
|
||||
private readonly int _maxIncrement = 30000;
|
||||
public int MaxIncrement
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("MaxIncrement Get", _maxIncrement.ToString());
|
||||
Tl.LogMessage("MaxIncrement Get", _maxIncrement.ToString(), false);
|
||||
return _maxIncrement; // Maximum change in one move
|
||||
}
|
||||
}
|
||||
|
||||
private readonly int _maxStep = 7000;
|
||||
private readonly int _maxStep = 30000;
|
||||
|
||||
public int MaxStep
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("MaxStep Get", _maxStep.ToString());
|
||||
Tl.LogMessage("MaxStep Get", _maxStep.ToString(), false);
|
||||
return _maxStep;
|
||||
}
|
||||
}
|
||||
|
||||
public void Move(int position)
|
||||
{
|
||||
Tl.LogMessage("Move", position.ToString());
|
||||
Tl.LogMessage("Move", position.ToString(), false);
|
||||
CheckConnected("Move");
|
||||
|
||||
//todo implement backlash compensation
|
||||
//todo implement direction reverse
|
||||
//todo implement dynamic braking
|
||||
|
||||
if (position < -MaxIncrement || position > MaxIncrement)
|
||||
{
|
||||
throw new InvalidValueException($"position out of range {-MaxIncrement} < {position} < {MaxIncrement}");
|
||||
@@ -383,53 +294,72 @@ namespace ASCOM.Meade.net
|
||||
if (position == 0)
|
||||
return;
|
||||
|
||||
if (position > 0)
|
||||
var direction = position > 0;
|
||||
if (_profileProperties.ReverseFocusDirection)
|
||||
direction = !direction;
|
||||
|
||||
//backlash compensation.
|
||||
var backlashCompensationSteps = direction ? Math.Abs(_profileProperties.BacklashCompensation) : 0;
|
||||
|
||||
var steps = Math.Abs(position) + backlashCompensationSteps;
|
||||
|
||||
|
||||
MoveFocuser(direction, steps);
|
||||
|
||||
|
||||
//todo refactor the backlash compensation to combine the commands into as few moves as practicle.
|
||||
//ApplyBacklashCompensation(direction);
|
||||
if (direction & backlashCompensationSteps != 0)
|
||||
{
|
||||
//desired move direction is out
|
||||
MoveFocuser(true, Math.Abs(position));
|
||||
}
|
||||
else
|
||||
{
|
||||
//desired move direction is in
|
||||
MoveFocuser(false, Math.Abs(position));
|
||||
Tl.LogMessage("Move", "Applying backlash compensation", false);
|
||||
MoveFocuser(!direction, backlashCompensationSteps);
|
||||
}
|
||||
|
||||
DynamicBreaking(direction);
|
||||
//todo implement dynamic braking
|
||||
//dynamic breaking is sending the command to move in the opposite direction immediatly followed by the command to stop.
|
||||
}
|
||||
|
||||
private void DynamicBreaking(bool directionOut)
|
||||
{
|
||||
if (!_profileProperties.DynamicBreaking)
|
||||
return;
|
||||
|
||||
Tl.LogMessage("Move", "Applying dynamic breaking", false);
|
||||
|
||||
PerformFocuserMove(directionOut);
|
||||
Halt();
|
||||
}
|
||||
|
||||
private void MoveFocuser(bool directionOut, int steps)
|
||||
{
|
||||
_sharedResourcesWrapper.Lock(() =>
|
||||
{
|
||||
//_sharedResourcesWrapper.SendBlind(":FF#");
|
||||
//:FF# Set Focus speed to fastest setting
|
||||
//Returns: Nothing
|
||||
//_sharedResourcesWrapper.SendBlind("FF");
|
||||
//:FF# Set Focus speed to fastest setting
|
||||
//Returns: Nothing
|
||||
|
||||
//:FS# Set Focus speed to slowest setting
|
||||
//Returns: Nothing
|
||||
//:FS# Set Focus speed to slowest setting
|
||||
//Returns: Nothing
|
||||
|
||||
//:F<n># Autostar, Autostar II – set focuser speed to <n> where <n> is an ASCII digit 1..4
|
||||
//Returns: Nothing
|
||||
//All others – Not Supported
|
||||
_utilities.WaitForMilliseconds(100);
|
||||
//:F<n># Autostar, Autostar II - set focuser speed to <n> where <n> is an ASCII digit 1..4
|
||||
//Returns: Nothing
|
||||
//All others - Not Supported
|
||||
_utilities.WaitForMilliseconds(100);
|
||||
|
||||
//A Single focus command sometimes gets lost on the #909, so sending lots of them solves the issue.
|
||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
||||
while (stopwatch.ElapsedMilliseconds < steps)
|
||||
{
|
||||
_sharedResourcesWrapper.SendBlind(directionOut ? ":F+#" : ":F-#");
|
||||
//:F+# Start Focuser moving inward (toward objective)
|
||||
//Returns: None
|
||||
PerformFocuserMove(directionOut);
|
||||
|
||||
//:F-# Start Focuser moving outward (away from objective)
|
||||
//Returns: None
|
||||
_utilities.WaitForMilliseconds(steps);
|
||||
|
||||
_utilities.WaitForMilliseconds(250);
|
||||
}
|
||||
Halt();
|
||||
}
|
||||
|
||||
Halt();
|
||||
private void PerformFocuserMove(bool directionOut)
|
||||
{
|
||||
SharedResourcesWrapper.SendBlind(Tl, directionOut ? "F+" : "F-");
|
||||
//:F+# Start Focuser moving inward (toward objective)
|
||||
//Returns: None
|
||||
|
||||
//This gives the focuser time to physically stop.
|
||||
_utilities.WaitForMilliseconds(1000);
|
||||
});
|
||||
//:F-# Start Focuser moving outward (away from objective)
|
||||
//Returns: None
|
||||
}
|
||||
|
||||
public int Position => throw new PropertyNotImplementedException("Position", false);
|
||||
@@ -438,7 +368,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("StepSize Get", "Not implemented");
|
||||
Tl.LogMessage("StepSize Get", "Not implemented", false);
|
||||
throw new PropertyNotImplementedException("StepSize", false);
|
||||
}
|
||||
}
|
||||
@@ -447,12 +377,13 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("TempComp Get", false.ToString());
|
||||
Tl.LogMessage("TempComp Get", false.ToString(), false);
|
||||
return false;
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
Tl.LogMessage("TempComp Set", "Not implemented");
|
||||
Tl.LogMessage("TempComp Set", "Not implemented", false);
|
||||
throw new PropertyNotImplementedException("TempComp", false);
|
||||
}
|
||||
}
|
||||
@@ -461,7 +392,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("TempCompAvailable Get", false.ToString());
|
||||
Tl.LogMessage("TempCompAvailable Get", false.ToString(), false);
|
||||
return false; // Temperature compensation is not available in this driver
|
||||
}
|
||||
}
|
||||
@@ -470,7 +401,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("Temperature Get", "Not implemented");
|
||||
Tl.LogMessage("Temperature Get", "Not implemented", false);
|
||||
throw new PropertyNotImplementedException("Temperature", false);
|
||||
}
|
||||
}
|
||||
@@ -484,7 +415,7 @@ namespace ASCOM.Meade.net
|
||||
#region ASCOM Registration
|
||||
|
||||
// Register or unregister driver for ASCOM. This is harmless if already
|
||||
// registered or unregistered.
|
||||
// registered or unregistered.
|
||||
//
|
||||
/// <summary>
|
||||
/// Register or unregister the driver with the ASCOM Platform.
|
||||
@@ -493,9 +424,9 @@ namespace ASCOM.Meade.net
|
||||
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
|
||||
private static void RegUnregAscom(bool bRegister)
|
||||
{
|
||||
using (var p = new Profile())
|
||||
using (IProfileWrapper p = ProfileFactory.Create())
|
||||
{
|
||||
p.DeviceType = "Focuser";
|
||||
p.DeviceType = nameof(Focuser);
|
||||
if (bRegister)
|
||||
{
|
||||
p.Register(DriverId, DriverDescription);
|
||||
@@ -555,11 +486,6 @@ namespace ASCOM.Meade.net
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if there is a valid connection to the driver hardware
|
||||
/// </summary>
|
||||
private bool IsConnected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Use this function to throw an exception if we aren't connected to the hardware
|
||||
/// </summary>
|
||||
@@ -568,34 +494,9 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
if (!IsConnected)
|
||||
{
|
||||
throw new NotConnectedException(message);
|
||||
throw new NotConnectedException($"Not connected to focuser when trying to execute: {message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read the device configuration from the ASCOM Profile store
|
||||
/// </summary>
|
||||
internal void ReadProfile()
|
||||
{
|
||||
var profileProperties = _sharedResourcesWrapper.ReadProfile();
|
||||
Tl.Enabled = profileProperties.TraceLogger;
|
||||
_comPort = profileProperties.ComPort;
|
||||
|
||||
LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}");
|
||||
LogMessage("ReadProfile", $"Com Port: {_comPort}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log helper function that takes formatted strings and arguments
|
||||
/// </summary>
|
||||
/// <param name="identifier"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="args"></param>
|
||||
internal static void LogMessage(string identifier, string message, params object[] args)
|
||||
{
|
||||
var msg = string.Format(message, args);
|
||||
Tl.LogMessage(identifier, msg);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
||||
@@ -66,9 +66,10 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<RegisterForComInterop>true</RegisterForComInterop>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
@@ -78,40 +79,44 @@
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
@@ -149,14 +154,12 @@
|
||||
<None Include="app.config" />
|
||||
<None Include="ASCOM.png" />
|
||||
<None Include="ASCOMDriverTemplate.snk" />
|
||||
<None Include="BootstrapAscomProfileStore.ps1" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Content Include="ASCOM.ico" />
|
||||
<Content Include="ReadMe.htm" />
|
||||
<None Include="Resources\ASCOM.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<ProjectConfiguration>
|
||||
<Settings>
|
||||
<HiddenComponentWarnings>
|
||||
<Value>CopyReferencedAssembliesToWorkspaceIsOn</Value>
|
||||
</HiddenComponentWarnings>
|
||||
<UseCPUArchitecture>x86</UseCPUArchitecture>
|
||||
</Settings>
|
||||
</ProjectConfiguration>
|
||||
@@ -5,7 +5,6 @@ using System.Runtime.InteropServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
// TODO - Add your authorship information here
|
||||
[assembly: AssemblyTitle("ASCOM.Meade.net.Focuser")]
|
||||
[assembly: AssemblyDescription("ASCOM Focuser driver for Meade.net")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
@@ -18,7 +17,7 @@ using System.Runtime.InteropServices;
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(true)]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("4ad7a6d4-6d54-4a9a-bbf3-895353e318f8")]
|
||||
@@ -33,6 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
//
|
||||
// TODO - Set your driver's version here
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace ASCOM.Meade.net.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
|
||||
<TITLE>Untitled Document</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Win32)">
|
||||
<META NAME="CREATED" CONTENT="0;0">
|
||||
<META NAME="CHANGEDBY" CONTENT="Chris Rowland">
|
||||
<META NAME="CHANGED" CONTENT="20110918;14150500">
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
@page { margin: 2cm }
|
||||
P { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
TD P { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
H3 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
H2 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
H4 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
TD P.note { background: #33ffff; font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
TD P.underline { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal; text-decoration: underline }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" DIR="LTR">
|
||||
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD>
|
||||
<H2>ASCOM Focuser Driver (C#)</H2>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P><BR><BR>
|
||||
</P>
|
||||
<H4>You have just created the skeleton of an ASCOM
|
||||
Focuser driver in C#. It produces an in-process
|
||||
(assembly) based driver.</H4>
|
||||
<HR>
|
||||
<P CLASS="note">Prior to developing your first driver, please
|
||||
familiarize yourself with the <A HREF="http://ascom-standards.org/developer.html">developer
|
||||
information we've provided</A> at the ASCOM Initiative web site
|
||||
(internet required).
|
||||
</P>
|
||||
<P CLASS="underline">You must do the following in order to complete
|
||||
your implementation:</P>
|
||||
<OL>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Switch to the Debug configuration
|
||||
and build the template now. It should build without errors.
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Add a test project to the
|
||||
solution. There are templates that can be used to add either a
|
||||
console or a Windows Forms application:</P>
|
||||
</OL>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Select the <FONT FACE="Consolas, monospace">ASCOM
|
||||
Test Forms App (CS)</FONT> or <FONT FACE="Consolas, monospace">ASCOM
|
||||
Test Console App (CS)</FONT> template.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Set a name for the test
|
||||
application and click on OK.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">In the Wizard: set the same device
|
||||
type and model name as for the driver and select Create to build the
|
||||
test project.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Set the Test Application to Run at
|
||||
Startup.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Click on Debug and the test
|
||||
application should run. You should be able to select your
|
||||
application in the chooser. Selecting Properties should show the
|
||||
default setup dialog for your driver.</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Trying to continue will generate
|
||||
errors because the additional properties have not been implemented.</P>
|
||||
</UL>
|
||||
<OL START=4>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Go through the Driver.cs file and
|
||||
replace the System.NotImplemented exceptions with code to implement
|
||||
your driver's functionality. See the ASCOM IFocuserV3
|
||||
spec. If a property or method is not implemented in your driver the
|
||||
System.NotImplemented exception must be replaced by an
|
||||
ASCOM.PropertyNotImplemented or ASCOM.MethodNotImplemented
|
||||
exception.</P>
|
||||
<LI><P>Customize the Setup Dialog (SetupDialogForm) to provide the
|
||||
settings and other controls for your driver. You can bind settings
|
||||
directly to controls on your dialog form, there's no need to manage
|
||||
settings manually. A custom Settings class takes care of managing
|
||||
your settings behind the scenes.
|
||||
</P>
|
||||
</OL>
|
||||
<H3>Notes:</H3>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Successfully building the driver,
|
||||
as well as using <FONT FACE="Lucida Console, Courier New, Courier, monospace">regasm</FONT>
|
||||
on the assembly, registers it for both COM and ASCOM (the Chooser).
|
||||
See the code in the ASCOM Registration region of Driver.vb.
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm">Doing a Clean for the project, as
|
||||
well doing a <FONT FACE="Lucida Console, Courier New, Courier, monospace">regasm
|
||||
-u</FONT> on the assembly, unregisters it for both COM and ASCOM
|
||||
(the Chooser).
|
||||
</P>
|
||||
<LI><P>Place a breakpoint in your driver class constructor, then
|
||||
start debugging (go, F5). Your breakpoint will be hit when the test
|
||||
application creates an instance of your driver (after selecting it
|
||||
in the Chooser). You can now single step, examine variables, etc.
|
||||
Please review the test application and make changes and additions to
|
||||
activate various parts of your driver during debugging.</P>
|
||||
<LI><P>The project's Debug configuration is already configured (The
|
||||
test application creates an instance of your driver (after selecting
|
||||
it in the Chooser). You can now single step, examine variables, etc.
|
||||
Please review the test application and feel free to make changes and
|
||||
additions to activate various parts of your driver during debugging.
|
||||
</P>
|
||||
</UL>
|
||||
<DIV ALIGN=RIGHT>
|
||||
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD>
|
||||
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
|
||||
<TR>
|
||||
<TD>
|
||||
<H3>ASCOM Initiative</H3>
|
||||
</TD>
|
||||
<TD>
|
||||
<IMG SRC="ASCOM.png" NAME="graphics1" ALIGN=RIGHT WIDTH=48 HEIGHT=56 BORDER=0></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P><BR><BR>
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>
|
||||
<P>The ASCOM Initiative consists of a group of astronomy software
|
||||
developers and instrument vendors whose goals are to promote the
|
||||
driver/client model and scripting automation.
|
||||
</P>
|
||||
<P>See the <A HREF="http://ascom-standards.org/" TARGET="browser">ASCOM
|
||||
web site</A> for more information. Please participate in the
|
||||
<A HREF="http://tech.groups.yahoo.com/group/ASCOM-Talk" TARGET="browser">ASCOM-Talk
|
||||
Yahoo Group</A>.
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<P><BR><BR>
|
||||
</P><P>
|
||||
<BR><BR>
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -5,4 +5,4 @@
|
||||
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net40" />
|
||||
<package id="ASCOM.Platform" version="6.5.2" targetFramework="net472" />
|
||||
<package id="JetBrains.Annotations" version="2022.3.1" targetFramework="net472" />
|
||||
</packages>
|
||||
+39
-6
@@ -23,6 +23,10 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Meade.net.Setup", "Meade.ne
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.Telescope.UnitTests", "Meade.net.Telescope.UnitTests\Meade.net.Telescope.UnitTests.csproj", "{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.Focuser.UnitTests", "Meade.net.Focuser.UnitTests\Meade.net.Focuser.UnitTests.csproj", "{A3991FA7-23C3-405A-96F9-5AB03AC58F30}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.UnitTests", "Meade.net.UnitTests\Meade.net.UnitTests.csproj", "{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -69,21 +73,23 @@ Global
|
||||
{A97E3AEC-F11D-49DA-B259-DE99DA813A86}.Release|x64.Build.0 = Release|Any CPU
|
||||
{A97E3AEC-F11D-49DA-B259-DE99DA813A86}.Release|x86.ActiveCfg = Release|x86
|
||||
{A97E3AEC-F11D-49DA-B259-DE99DA813A86}.Release|x86.Build.0 = Release|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|x64.ActiveCfg = Debug|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|x64.Build.0 = Debug|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Debug|x86.Build.0 = Debug|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|x64.ActiveCfg = Release|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|x86.ActiveCfg = Release|x86
|
||||
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|x86.Build.0 = Release|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|x64.ActiveCfg = Debug|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|x64.Build.0 = Debug|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Debug|x86.Build.0 = Debug|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Release|x64.ActiveCfg = Release|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Release|x86.ActiveCfg = Release|x86
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49}.Release|x86.Build.0 = Release|x86
|
||||
@@ -99,12 +105,13 @@ Global
|
||||
{AD4959DD-33D7-4C3F-8DB0-7361D8E74A95}.Release|x64.Build.0 = Release|Any CPU
|
||||
{AD4959DD-33D7-4C3F-8DB0-7361D8E74A95}.Release|x86.ActiveCfg = Release|x86
|
||||
{AD4959DD-33D7-4C3F-8DB0-7361D8E74A95}.Release|x86.Build.0 = Release|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Debug|x86.Build.0 = Debug|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Release|Any CPU.Build.0 = Release|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Release|x64.ActiveCfg = Release|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Release|x86.ActiveCfg = Release|x86
|
||||
{8EEB5C25-8394-4257-8E57-CDED47CB6F1B}.Release|x86.Build.0 = Release|x86
|
||||
@@ -120,6 +127,30 @@ Global
|
||||
{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33}.Release|x64.Build.0 = Release|Any CPU
|
||||
{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33}.Release|x86.ActiveCfg = Release|x86
|
||||
{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33}.Release|x86.Build.0 = Release|x86
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x64.Build.0 = Release|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30}.Release|x86.Build.0 = Release|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x64.Build.0 = Release|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -129,6 +160,8 @@ Global
|
||||
{AABC96B8-C462-4B3A-9B5F-2929E3CB7A49} = {BF650D97-AF98-4638-9C55-21311C6D88DA}
|
||||
{AD4959DD-33D7-4C3F-8DB0-7361D8E74A95} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||
{B7EEEEFD-5BFF-443D-981C-7B8AB5DFDE33} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||
{A3991FA7-23C3-405A-96F9-5AB03AC58F30} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||
{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2} = {0958D817-269C-44BE-BEFB-F3E6A409DE91}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3C0509DC-C7F5-48DC-920D-DCFD9C879BD2}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/Housekeeping/ExcludedProjects/ProjectMasksToIgnore/=_002A_002A_005C_002A_002EUnitTests/@EntryIndexedValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Housekeeping/ExcludedProjects/ProjectMasksToIgnore/=_002A_002A_005C_002A_002EUnitTests/@EntryIndexRemoved">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Housekeeping/ExcludedProjects/ProjectMasksToIgnore/=_002A_002EUnitTests_002E_002A/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ASCOM/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Autostar/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -2,6 +2,12 @@
|
||||
<Settings>
|
||||
<AllowParallelTestExecution>True</AllowParallelTestExecution>
|
||||
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
|
||||
<EnableRDI>True</EnableRDI>
|
||||
<MetricsExclusionList>
|
||||
<Value>FocuserTestConsole\FocuserTestConsole.csproj</Value>
|
||||
<Value>TelescopeTestConsole\TelescopeTestConsole.csproj</Value>
|
||||
</MetricsExclusionList>
|
||||
<RdiConfigured>True</RdiConfigured>
|
||||
<SolutionConfigured>True</SolutionConfigured>
|
||||
</Settings>
|
||||
</SolutionConfiguration>
|
||||
@@ -1,16 +0,0 @@
|
||||
<SolutionConfiguration>
|
||||
<Settings>
|
||||
<AutoEnable>True</AutoEnable>
|
||||
<CurrentEngineMode>Run all tests automatically [Global]</CurrentEngineMode>
|
||||
<MetricsTreeShowTestProjects>False</MetricsTreeShowTestProjects>
|
||||
<StatusIndicatorSplitterDistance>25</StatusIndicatorSplitterDistance>
|
||||
<TestsWindowMenuOptions>
|
||||
<VerticalSplitMenuOption>false</VerticalSplitMenuOption>
|
||||
<ShowPassingTestsMenuOption>false</ShowPassingTestsMenuOption>
|
||||
<ShowFailingTestsMenuOption>true</ShowFailingTestsMenuOption>
|
||||
<ShowUnexecutedTestsMenuOption>true</ShowUnexecutedTestsMenuOption>
|
||||
<ShowIgnoredTestsMenuOption>false</ShowIgnoredTestsMenuOption>
|
||||
</TestsWindowMenuOptions>
|
||||
<TestsWindowSplitterDistance>451</TestsWindowSplitterDistance>
|
||||
</Settings>
|
||||
</SolutionConfiguration>
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class AssemblyInfo
|
||||
{
|
||||
// The assembly information values.
|
||||
//public readonly string Title = string.Empty;
|
||||
//public readonly string Description = string.Empty;
|
||||
//public readonly string Company = string.Empty;
|
||||
public readonly string Product = string.Empty;
|
||||
//public readonly string Copyright = string.Empty;
|
||||
//public readonly string Trademark = string.Empty;
|
||||
public readonly string AssemblyVersion;
|
||||
//public readonly string FileVersion = string.Empty;
|
||||
//public readonly string Guid = string.Empty;
|
||||
//public readonly string NeutralLanguage = string.Empty;
|
||||
//public readonly bool IsComVisible;
|
||||
|
||||
// Return a particular assembly attribute value.
|
||||
private T GetAssemblyAttribute<T>(Assembly assembly)
|
||||
where T : Attribute
|
||||
{
|
||||
// Get attributes of this type.
|
||||
object[] attributes = assembly.GetCustomAttributes(typeof(T), true);
|
||||
|
||||
// If we didn't get anything, return null.
|
||||
if (attributes.Length == 0)
|
||||
return null;
|
||||
|
||||
// Convert the first attribute value into
|
||||
// the desired type and return it.
|
||||
return (T)attributes[0];
|
||||
}
|
||||
|
||||
// Constructors.
|
||||
public AssemblyInfo()
|
||||
: this(Assembly.GetExecutingAssembly())
|
||||
{
|
||||
}
|
||||
|
||||
private AssemblyInfo(Assembly assembly)
|
||||
{
|
||||
// Get values from the assembly.
|
||||
//var titleAttr = GetAssemblyAttribute<AssemblyTitleAttribute>(assembly);
|
||||
//if (titleAttr != null)
|
||||
// Title = titleAttr.Title;
|
||||
|
||||
//var assemblyAttr = GetAssemblyAttribute<AssemblyDescriptionAttribute>(assembly);
|
||||
//if (assemblyAttr != null)
|
||||
// Description = assemblyAttr.Description;
|
||||
|
||||
//var companyAttr =GetAssemblyAttribute<AssemblyCompanyAttribute>(assembly);
|
||||
//if (companyAttr != null)
|
||||
// Company = companyAttr.Company;
|
||||
|
||||
var productAttr = GetAssemblyAttribute<AssemblyProductAttribute>(assembly);
|
||||
if (productAttr != null)
|
||||
Product = productAttr.Product;
|
||||
|
||||
//var copyrightAttr = GetAssemblyAttribute<AssemblyCopyrightAttribute>(assembly);
|
||||
//if (copyrightAttr != null)
|
||||
// Copyright = copyrightAttr.Copyright;
|
||||
|
||||
//var trademarkAttr = GetAssemblyAttribute<AssemblyTrademarkAttribute>(assembly);
|
||||
//if (trademarkAttr != null)
|
||||
// Trademark = trademarkAttr.Trademark;
|
||||
|
||||
var version = assembly.GetName().Version;
|
||||
AssemblyVersion = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
|
||||
|
||||
|
||||
//var fileVersionAttr = GetAssemblyAttribute<AssemblyFileVersionAttribute>(assembly);
|
||||
//if (fileVersionAttr != null) FileVersion =
|
||||
// fileVersionAttr.Version;
|
||||
|
||||
//var guidAttr = GetAssemblyAttribute<GuidAttribute>(assembly);
|
||||
//if (guidAttr != null)
|
||||
// Guid = guidAttr.Value;
|
||||
|
||||
//var languageAttr = GetAssemblyAttribute<NeutralResourcesLanguageAttribute>(assembly);
|
||||
//if (languageAttr != null)
|
||||
// NeutralLanguage = languageAttr.CultureName;
|
||||
|
||||
//var comAttr = GetAssemblyAttribute<ComVisibleAttribute>(assembly);
|
||||
//if (comAttr != null)
|
||||
// IsComVisible = comAttr.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
-21
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
// ReSharper disable UnusedMember.Local
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
@@ -33,8 +35,8 @@ namespace ASCOM.Meade.net
|
||||
#region Access to ole32.dll functions for class factories
|
||||
|
||||
// Define two common GUID objects for public usage.
|
||||
private static readonly Guid _iidIUnknown = new Guid("{00000000-0000-0000-C000-000000000046}");
|
||||
private static readonly Guid _iidIDispatch = new Guid("{00020400-0000-0000-C000-000000000046}");
|
||||
private static readonly Guid IidIUnknown = new Guid("{00000000-0000-0000-C000-000000000046}");
|
||||
private static readonly Guid IidIDispatch = new Guid("{00020400-0000-0000-C000-000000000046}");
|
||||
|
||||
[Flags]
|
||||
enum Clsctx : uint
|
||||
@@ -113,16 +115,16 @@ namespace ASCOM.Meade.net
|
||||
private Guid _mClassId;
|
||||
private readonly ArrayList _mInterfaceTypes;
|
||||
private uint _mCookie;
|
||||
private readonly string _mProgid;
|
||||
//private readonly string _mProgid;
|
||||
|
||||
public ClassFactory(Type type)
|
||||
{
|
||||
if (type == null)
|
||||
throw new ArgumentNullException("type");
|
||||
throw new ArgumentNullException(nameof(type));
|
||||
_mClassType = type;
|
||||
|
||||
//PWGS Get the ProgID from the MetaData
|
||||
_mProgid = Marshal.GenerateProgIdForType(type);
|
||||
//_mProgid = Marshal.GenerateProgIdForType(type);
|
||||
_mClassId = Marshal.GenerateGuidForType(type); // Should be nailed down by [Guid(...)]
|
||||
ClassContext = (uint)Clsctx.ClsctxLocalServer; // Default
|
||||
Flags = (uint)Regcls.RegclsMultipleuse | // Default
|
||||
@@ -135,7 +137,8 @@ namespace ASCOM.Meade.net
|
||||
#endregion
|
||||
|
||||
#region Common ClassFactory Methods
|
||||
public uint ClassContext { get; }
|
||||
|
||||
private uint ClassContext { get; }
|
||||
|
||||
public Guid ClassId
|
||||
{
|
||||
@@ -143,7 +146,7 @@ namespace ASCOM.Meade.net
|
||||
set => _mClassId = value;
|
||||
}
|
||||
|
||||
public uint Flags { get; }
|
||||
private uint Flags { get; }
|
||||
|
||||
public bool RegisterClassObject()
|
||||
{
|
||||
@@ -156,25 +159,22 @@ namespace ASCOM.Meade.net
|
||||
Flags,
|
||||
out _mCookie
|
||||
);
|
||||
return (i == 0);
|
||||
return i == 0;
|
||||
}
|
||||
|
||||
public bool RevokeClassObject()
|
||||
public void RevokeClassObject()
|
||||
{
|
||||
int i = CoRevokeClassObject(_mCookie);
|
||||
return (i == 0);
|
||||
CoRevokeClassObject(_mCookie);
|
||||
}
|
||||
|
||||
public static bool ResumeClassObjects()
|
||||
public static void ResumeClassObjects()
|
||||
{
|
||||
int i = CoResumeClassObjects();
|
||||
return (i == 0);
|
||||
CoResumeClassObjects();
|
||||
}
|
||||
|
||||
public static bool SuspendClassObjects()
|
||||
public static void SuspendClassObjects()
|
||||
{
|
||||
int i = CoSuspendClassObjects();
|
||||
return (i == 0);
|
||||
CoSuspendClassObjects();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -201,12 +201,11 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
// Handle requests for IDispatch or IUnknown on the class
|
||||
//
|
||||
if (riid == _iidIDispatch)
|
||||
if (riid == IidIDispatch)
|
||||
{
|
||||
ppvObject = Marshal.GetIDispatchForObject(Activator.CreateInstance(_mClassType));
|
||||
return;
|
||||
}
|
||||
else if (riid == _iidIUnknown)
|
||||
else if (riid == IidIUnknown)
|
||||
{
|
||||
ppvObject = Marshal.GetIUnknownForObject(Activator.CreateInstance(_mClassType));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class ConnectionInfo
|
||||
{
|
||||
//public int Connections { get; set; }
|
||||
public int SameDevice { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public static class EnumExtensionMethods
|
||||
{
|
||||
public static string GetDescription(this Enum GenericEnum)
|
||||
{
|
||||
var genericEnumType = GenericEnum.GetType();
|
||||
var memberInfo = genericEnumType.GetMember(GenericEnum.ToString());
|
||||
if (memberInfo.Length > 0)
|
||||
{
|
||||
var _Attribs = memberInfo[0]
|
||||
.GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false);
|
||||
if (_Attribs.Any())
|
||||
{
|
||||
return ((System.ComponentModel.DescriptionAttribute) _Attribs.ElementAt(0)).Description;
|
||||
}
|
||||
}
|
||||
|
||||
return GenericEnum.ToString();
|
||||
}
|
||||
|
||||
public static T GetValueFromDescription<T>( string description) where T : Enum
|
||||
{
|
||||
foreach (T value in Enum.GetValues(typeof(T)))
|
||||
{
|
||||
if (value.GetDescription() == description)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace ASCOM.Meade.net
|
||||
_mEventThreadEnded.Set();
|
||||
}
|
||||
|
||||
protected bool ContinueThread()
|
||||
private bool ContinueThread()
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
|
||||
+111
-150
@@ -12,82 +12,38 @@
|
||||
// Modified by Chris Rowland and Peter Simpson to allow use with multiple devices of the same type March 2011
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ASCOM.Meade.net.Properties;
|
||||
using ASCOM.Utilities;
|
||||
using Microsoft.Win32;
|
||||
using System.Threading;
|
||||
using System.Security.Principal;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public static class Server
|
||||
{
|
||||
|
||||
private const string DriverName = "Meade Generic";
|
||||
|
||||
#region Access to kernel32.dll, user32.dll, and ole32.dll functions
|
||||
[Flags]
|
||||
enum Clsctx : uint
|
||||
{
|
||||
ClsctxInprocServer = 0x1,
|
||||
ClsctxInprocHandler = 0x2,
|
||||
ClsctxLocalServer = 0x4,
|
||||
ClsctxInprocServer16 = 0x8,
|
||||
ClsctxRemoteServer = 0x10,
|
||||
ClsctxInprocHandler16 = 0x20,
|
||||
ClsctxReserved1 = 0x40,
|
||||
ClsctxReserved2 = 0x80,
|
||||
ClsctxReserved3 = 0x100,
|
||||
ClsctxReserved4 = 0x200,
|
||||
ClsctxNoCodeDownload = 0x400,
|
||||
ClsctxReserved5 = 0x800,
|
||||
ClsctxNoCustomMarshal = 0x1000,
|
||||
ClsctxEnableCodeDownload = 0x2000,
|
||||
ClsctxNoFailureLog = 0x4000,
|
||||
ClsctxDisableAaa = 0x8000,
|
||||
ClsctxEnableAaa = 0x10000,
|
||||
ClsctxFromDefaultContext = 0x20000,
|
||||
ClsctxInproc = ClsctxInprocServer | ClsctxInprocHandler,
|
||||
ClsctxServer = ClsctxInprocServer | ClsctxLocalServer | ClsctxRemoteServer,
|
||||
ClsctxAll = ClsctxServer | ClsctxInprocHandler
|
||||
}
|
||||
|
||||
[Flags]
|
||||
enum Coinit : uint
|
||||
{
|
||||
/// Initializes the thread for multi-threaded object concurrency.
|
||||
CoinitMultithreaded = 0x0,
|
||||
/// Initializes the thread for apartment-threaded object concurrency.
|
||||
CoinitApartmentthreaded = 0x2,
|
||||
/// Disables DDE for Ole1 support.
|
||||
CoinitDisableOle1Dde = 0x4,
|
||||
/// Trades memory for speed.
|
||||
CoinitSpeedOverMemory = 0x8
|
||||
}
|
||||
//// CoInitializeEx() can be used to set the apartment model
|
||||
//// of individual threads.
|
||||
//[DllImport("ole32.dll")]
|
||||
//static extern int CoInitializeEx(IntPtr pvReserved, uint dwCoInit);
|
||||
|
||||
[Flags]
|
||||
enum Regcls : uint
|
||||
{
|
||||
RegclsSingleuse = 0,
|
||||
RegclsMultipleuse = 1,
|
||||
RegclsMultiSeparate = 2,
|
||||
RegclsSuspended = 4,
|
||||
RegclsSurrogate = 8
|
||||
}
|
||||
|
||||
|
||||
// CoInitializeEx() can be used to set the apartment model
|
||||
// of individual threads.
|
||||
[DllImport("ole32.dll")]
|
||||
static extern int CoInitializeEx(IntPtr pvReserved, uint dwCoInit);
|
||||
|
||||
// CoUninitialize() is used to uninitialize a COM thread.
|
||||
[DllImport("ole32.dll")]
|
||||
static extern void CoUninitialize();
|
||||
//// CoUninitialize() is used to uninitialize a COM thread.
|
||||
//[DllImport("ole32.dll")]
|
||||
//static extern void CoUninitialize();
|
||||
|
||||
// PostThreadMessage() allows us to post a Windows Message to
|
||||
// a specific thread (identified by its thread id).
|
||||
@@ -107,8 +63,8 @@ namespace ASCOM.Meade.net
|
||||
#region Private Data
|
||||
private static int _objsInUse; // Keeps a count on the total number of objects alive.
|
||||
private static int _serverLocks; // Keeps a lock count on this application.
|
||||
private static FrmMain _sMainForm = null; // Reference to our main form
|
||||
private static ArrayList _sComObjectAssys; // Dynamically loaded assemblies containing served COM objects
|
||||
private static FrmMain _sMainForm; // Reference to our main form
|
||||
//private static ArrayList _sComObjectAssys; // Dynamically loaded assemblies containing served COM objects
|
||||
private static ArrayList _sComObjectTypes; // Served COM object types
|
||||
private static ArrayList _sClassFactories; // Served COM object class factories
|
||||
private static string _sAppId = "{4e68ec46-5ffc-49e7-b298-38a548df0bfd}"; // Our AppId
|
||||
@@ -116,15 +72,15 @@ namespace ASCOM.Meade.net
|
||||
#endregion
|
||||
|
||||
// This property returns the main thread's id.
|
||||
public static uint MainThreadId { get; private set; } // Stores the main thread's thread id.
|
||||
private static uint MainThreadId { get; set; } // Stores the main thread's thread id.
|
||||
|
||||
// Used to tell if started by COM or manually
|
||||
public static bool StartedByCom { get; private set; } // True if server started by COM (-embedding)
|
||||
private static bool StartedByCom { get; set; } // True if server started by COM (-embedding)
|
||||
|
||||
|
||||
#region Server Lock, Object Counting, and AutoQuit on COM startup
|
||||
// Returns the total number of objects alive currently.
|
||||
public static int ObjectsCount
|
||||
private static int ObjectsCount
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -136,21 +92,21 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
|
||||
// This method performs a thread-safe incrementation of the objects count.
|
||||
public static int CountObject()
|
||||
public static void CountObject()
|
||||
{
|
||||
// Increment the global count of objects.
|
||||
return Interlocked.Increment(ref _objsInUse);
|
||||
Interlocked.Increment(ref _objsInUse);
|
||||
}
|
||||
|
||||
// This method performs a thread-safe decrementation the objects count.
|
||||
public static int UncountObject()
|
||||
public static void UncountObject()
|
||||
{
|
||||
// Decrement the global count of objects.
|
||||
return Interlocked.Decrement(ref _objsInUse);
|
||||
Interlocked.Decrement(ref _objsInUse);
|
||||
}
|
||||
|
||||
// Returns the current server lock count.
|
||||
public static int ServerLockCount
|
||||
private static int ServerLockCount
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -163,18 +119,18 @@ namespace ASCOM.Meade.net
|
||||
|
||||
// This method performs a thread-safe incrementation the
|
||||
// server lock count.
|
||||
public static int CountLock()
|
||||
public static void CountLock()
|
||||
{
|
||||
// Increment the global lock count of this server.
|
||||
return Interlocked.Increment(ref _serverLocks);
|
||||
Interlocked.Increment(ref _serverLocks);
|
||||
}
|
||||
|
||||
// This method performs a thread-safe decrementation the
|
||||
// server lock count.
|
||||
public static int UncountLock()
|
||||
public static void UncountLock()
|
||||
{
|
||||
// Decrement the global lock count of this server.
|
||||
return Interlocked.Decrement(ref _serverLocks);
|
||||
Interlocked.Decrement(ref _serverLocks);
|
||||
}
|
||||
|
||||
// AttemptToTerminateServer() will check to see if the objects count and the server
|
||||
@@ -213,12 +169,14 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
private static bool LoadComObjectAssemblies()
|
||||
{
|
||||
_sComObjectAssys = new ArrayList();
|
||||
//_sComObjectAssys = new ArrayList();
|
||||
_sComObjectTypes = new ArrayList();
|
||||
|
||||
// put everything into one folder, the same as the server.
|
||||
string assyPath = Assembly.GetEntryAssembly().Location;
|
||||
string assyPath = Assembly.GetEntryAssembly()?.Location;
|
||||
assyPath = Path.GetDirectoryName(assyPath);
|
||||
if (assyPath == null)
|
||||
throw new System.InvalidOperationException();
|
||||
|
||||
DirectoryInfo d = new DirectoryInfo(assyPath);
|
||||
foreach (FileInfo fi in d.GetFiles("*.dll"))
|
||||
@@ -244,7 +202,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
//MessageBox.Show("Adding Type: " + type.Name + " " + type.FullName);
|
||||
_sComObjectTypes.Add(type); //PWGS - much simpler
|
||||
_sComObjectAssys.Add(so);
|
||||
//_sComObjectAssys.Add(so);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,15 +210,13 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
// Probably an attempt to load a Win32 DLL (i.e. not a .net assembly)
|
||||
// Just swallow the exception and continue to the next item.
|
||||
continue;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Failed to load served COM class assembly " + fi.Name + " - " + e.Message,
|
||||
"Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
MessageBox.Show(string.Format(Resources.Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_, fi.Name, e.Message),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -285,22 +241,22 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
private static void ElevateSelf(string arg)
|
||||
{
|
||||
ProcessStartInfo si = new ProcessStartInfo();
|
||||
si.Arguments = arg;
|
||||
si.WorkingDirectory = Environment.CurrentDirectory;
|
||||
si.FileName = Application.ExecutablePath;
|
||||
si.Verb = "runas";
|
||||
try { Process.Start(si); }
|
||||
catch (System.ComponentModel.Win32Exception)
|
||||
var si = new ProcessStartInfo
|
||||
{
|
||||
MessageBox.Show("The Meade.net was not " + (arg == "/register" ? "registered" : "unregistered") +
|
||||
" because you did not allow it.", "Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
Arguments = arg,
|
||||
WorkingDirectory = Environment.CurrentDirectory,
|
||||
FileName = Application.ExecutablePath,
|
||||
Verb = "runas"
|
||||
};
|
||||
try { Process.Start(si); }
|
||||
catch (Win32Exception)
|
||||
{
|
||||
MessageBox.Show(string.Format(Resources.Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_, DriverName, (arg == "/register" ? "registered" : "unregistered")), DriverName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.ToString(), "Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
MessageBox.Show(ex.ToString(), DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -341,28 +297,25 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey("APPID\\" + _sAppId))
|
||||
{
|
||||
key.SetValue(null, assyDescription);
|
||||
key.SetValue("AppID", _sAppId);
|
||||
key.SetValue("AuthenticationLevel", 1, RegistryValueKind.DWord);
|
||||
key?.SetValue(null, assyDescription);
|
||||
key?.SetValue("AppID", _sAppId);
|
||||
key?.SetValue("AuthenticationLevel", 1, RegistryValueKind.DWord);
|
||||
}
|
||||
//
|
||||
// HKCR\APPID\exename.ext
|
||||
//
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(string.Format("APPID\\{0}",
|
||||
Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf('\\') + 1))))
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(
|
||||
$"APPID\\{Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf('\\') + 1)}"))
|
||||
{
|
||||
key.SetValue("AppID", _sAppId);
|
||||
key?.SetValue("AppID", _sAppId);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error while registering the server:\n" + ex.ToString(),
|
||||
"Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
MessageBox.Show(string.Format(Resources.Server_RegisterObjects_, ex),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return;
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// For each of the driver assemblies
|
||||
@@ -380,22 +333,27 @@ namespace ASCOM.Meade.net
|
||||
//PWGS Generate device type from the Class name
|
||||
string deviceType = type.Name;
|
||||
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(string.Format("CLSID\\{0}", clsid)))
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey($"CLSID\\{clsid}"))
|
||||
{
|
||||
key.SetValue(null, progid); // Could be assyTitle/Desc??, but .NET components show ProgId here
|
||||
key.SetValue("AppId", _sAppId);
|
||||
using (RegistryKey key2 = key.CreateSubKey("Implemented Categories"))
|
||||
key?.SetValue(null, progid); // Could be assyTitle/Desc??, but .NET components show ProgId here
|
||||
key?.SetValue("AppId", _sAppId);
|
||||
if (key != null)
|
||||
{
|
||||
key2.CreateSubKey("{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
|
||||
}
|
||||
using (RegistryKey key2 = key.CreateSubKey("ProgId"))
|
||||
{
|
||||
key2.SetValue(null, progid);
|
||||
}
|
||||
key.CreateSubKey("Programmable");
|
||||
using (RegistryKey key2 = key.CreateSubKey("LocalServer32"))
|
||||
{
|
||||
key2.SetValue(null, Application.ExecutablePath);
|
||||
using (RegistryKey key2 = key.CreateSubKey("Implemented Categories"))
|
||||
{
|
||||
key2?.CreateSubKey("{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
|
||||
}
|
||||
|
||||
using (RegistryKey key2 = key.CreateSubKey("ProgId"))
|
||||
{
|
||||
key2?.SetValue(null, progid);
|
||||
}
|
||||
|
||||
key.CreateSubKey("Programmable");
|
||||
using (RegistryKey key2 = key.CreateSubKey("LocalServer32"))
|
||||
{
|
||||
key2?.SetValue(null, Application.ExecutablePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -403,16 +361,16 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(progid))
|
||||
{
|
||||
key.SetValue(null, assyTitle);
|
||||
key?.SetValue(null, assyTitle);
|
||||
using (RegistryKey key2 = key.CreateSubKey("CLSID"))
|
||||
{
|
||||
key2.SetValue(null, clsid);
|
||||
key2?.SetValue(null, clsid);
|
||||
}
|
||||
}
|
||||
//
|
||||
// ASCOM
|
||||
//
|
||||
assy = type.Assembly;
|
||||
//assy = type.Assembly;
|
||||
|
||||
// Pull the display name from the ServedClassName attribute.
|
||||
attr = Attribute.GetCustomAttribute(type, typeof(ServedClassNameAttribute)); //PWGS Changed to search type for attribute rather than assembly
|
||||
@@ -425,13 +383,11 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error while registering the server:\n" + ex.ToString(),
|
||||
"Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
MessageBox.Show(string.Format(Resources.Server_RegisterObjects_, ex),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
bFail = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
|
||||
if (bFail) break;
|
||||
}
|
||||
}
|
||||
@@ -439,7 +395,7 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
// Remove all traces of this from the registry.
|
||||
//
|
||||
// **TODO** If the above does AppID/DCOM stuff, this would have
|
||||
// If the above does AppID/DCOM stuff, this would have
|
||||
// to remove that stuff too.
|
||||
//
|
||||
private static void UnregisterObjects()
|
||||
@@ -453,9 +409,9 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
// Local server's DCOM/AppID information
|
||||
//
|
||||
Registry.ClassesRoot.DeleteSubKey(string.Format("APPID\\{0}", _sAppId), false);
|
||||
Registry.ClassesRoot.DeleteSubKey(string.Format("APPID\\{0}",
|
||||
Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf('\\') + 1)), false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"APPID\\{_sAppId}", false);
|
||||
Registry.ClassesRoot.DeleteSubKey(
|
||||
$"APPID\\{Application.ExecutablePath.Substring(Application.ExecutablePath.LastIndexOf('\\') + 1)}", false);
|
||||
|
||||
//
|
||||
// For each of the driver assemblies
|
||||
@@ -471,17 +427,17 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
// HKCR\progid
|
||||
//
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("{0}\\CLSID", progid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"{progid}\\CLSID", false);
|
||||
Registry.ClassesRoot.DeleteSubKey(progid, false);
|
||||
//
|
||||
// HKCR\CLSID\clsid
|
||||
//
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("CLSID\\{0}\\Implemented Categories\\{{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}}", clsid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("CLSID\\{0}\\Implemented Categories", clsid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("CLSID\\{0}\\ProgId", clsid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("CLSID\\{0}\\LocalServer32", clsid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("CLSID\\{0}\\Programmable", clsid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey(String.Format("CLSID\\{0}", clsid), false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"CLSID\\{clsid}\\Implemented Categories\\{{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}}", false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"CLSID\\{clsid}\\Implemented Categories", false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"CLSID\\{clsid}\\ProgId", false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"CLSID\\{clsid}\\LocalServer32", false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"CLSID\\{clsid}\\Programmable", false);
|
||||
Registry.ClassesRoot.DeleteSubKey($"CLSID\\{clsid}", false);
|
||||
try
|
||||
{
|
||||
//
|
||||
@@ -493,7 +449,10 @@ namespace ASCOM.Meade.net
|
||||
p.Unregister(progid);
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -504,7 +463,7 @@ namespace ASCOM.Meade.net
|
||||
// that we serve. This requires the class facgtory name to be
|
||||
// equal to the served class name + "ClassFactory".
|
||||
//
|
||||
private static bool RegisterClassFactories()
|
||||
private static void RegisterClassFactories()
|
||||
{
|
||||
_sClassFactories = new ArrayList();
|
||||
foreach (Type type in _sComObjectTypes)
|
||||
@@ -513,13 +472,12 @@ namespace ASCOM.Meade.net
|
||||
_sClassFactories.Add(factory);
|
||||
if (!factory.RegisterClassObject())
|
||||
{
|
||||
MessageBox.Show("Failed to register class factory for " + type.Name,
|
||||
"Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return false;
|
||||
MessageBox.Show(string.Format(Resources.Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_, type.Name),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ClassFactory.ResumeClassObjects(); // Served objects now go live
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void RevokeClassFactories()
|
||||
@@ -541,7 +499,7 @@ namespace ASCOM.Meade.net
|
||||
bool bRet = true;
|
||||
|
||||
//
|
||||
//**TODO** -Embedding is "ActiveX start". Prohibit non_AX starting?
|
||||
// -Embedding is "ActiveX start". Prohibit non_AX starting?
|
||||
//
|
||||
if (args.Length > 0)
|
||||
{
|
||||
@@ -569,8 +527,9 @@ namespace ASCOM.Meade.net
|
||||
break;
|
||||
|
||||
default:
|
||||
MessageBox.Show("Unknown argument: " + args[0] + "\nValid are : -register, -unregister and -embedding",
|
||||
"Meade.net", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
MessageBox.Show(
|
||||
string.Format(Resources.Server_ProcessArguments_, args[0]),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -609,9 +568,11 @@ namespace ASCOM.Meade.net
|
||||
RegisterClassFactories();
|
||||
|
||||
// Start up the garbage collection thread.
|
||||
GarbageCollection garbageCollector = new GarbageCollection(1000);
|
||||
Thread gcThread = new Thread(new ThreadStart(garbageCollector.GcWatch));
|
||||
gcThread.Name = "Garbage Collection Thread";
|
||||
var garbageCollector = new GarbageCollection(1000);
|
||||
var gcThread = new Thread(garbageCollector.GcWatch)
|
||||
{
|
||||
Name = "Garbage Collection Thread"
|
||||
};
|
||||
gcThread.Start();
|
||||
|
||||
//
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ASCOM.Meade.net.Localization
|
||||
{
|
||||
internal class LocalisationHelper
|
||||
{
|
||||
private const string LocalizationNamespace = "LocalisationTest.Localization.Resources.Localization";
|
||||
private readonly ResourceManager _resourceManager;
|
||||
|
||||
public LocalisationHelper()
|
||||
{
|
||||
_resourceManager = new ResourceManager(LocalizationNamespace, Assembly.GetExecutingAssembly());
|
||||
|
||||
SetLocalisation(CultureInfo.CurrentCulture.Name);
|
||||
}
|
||||
|
||||
internal void SetLocalisation(string name)
|
||||
{
|
||||
var cultureInfo = new CultureInfo(name);
|
||||
|
||||
//CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
|
||||
//CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = cultureInfo;
|
||||
Thread.CurrentThread.CurrentUICulture = cultureInfo;
|
||||
}
|
||||
|
||||
internal string GetString(string key)
|
||||
{
|
||||
return _resourceManager.GetString(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
-16
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
||||
<AssemblyName>ASCOM.Meade.net.Server</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
@@ -43,6 +43,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -68,7 +69,7 @@
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
@@ -81,47 +82,54 @@
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
<HintPath>..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JetBrains.Annotations, Version=4242.42.42.42, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="ClassFactory.cs" />
|
||||
<Compile Include="ConnectionInfo.cs" />
|
||||
<Compile Include="EnumExtensionMethods.cs" />
|
||||
<Compile Include="frmMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -129,11 +137,19 @@
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GarbageCollection.cs" />
|
||||
<Compile Include="Localization\LocalisationHelper.cs" />
|
||||
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
|
||||
<Compile Include="LocalServer.cs" />
|
||||
<Compile Include="MeadeTelescopeBase.cs" />
|
||||
<Compile Include="ParkedBehaviour.cs" />
|
||||
<Compile Include="ParkedPosition.cs" />
|
||||
<Compile Include="ProfileFactory.cs" />
|
||||
<Compile Include="ProfileProperties.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TelescopeList.cs" />
|
||||
<Compile Include="ThreadSafeValue.cs" />
|
||||
<Compile Include="Win32Utilities.cs" />
|
||||
<Compile Include="Wrapper\GetValueException.cs" />
|
||||
<Compile Include="Wrapper\IProfileWrapper.cs" />
|
||||
<Compile Include="Wrapper\SharedResourcesWrapper.cs" />
|
||||
<EmbeddedResource Include="frmMain.resx">
|
||||
<SubType>Designer</SubType>
|
||||
@@ -164,8 +180,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="ASCOM.ico" />
|
||||
<Content Include="ASCOM.png" />
|
||||
<Content Include="ReadMe.htm" />
|
||||
<None Include="BootstrapAscomProfileStore.ps1" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\ASCOM.bmp" />
|
||||
</ItemGroup>
|
||||
@@ -190,6 +204,7 @@
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
[ComVisible(false)]
|
||||
public class MeadeTelescopeBase : ReferenceCountedObjectBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Variable to hold the trace logger object (creates a diagnostic log file with information that you specify)
|
||||
/// </summary>
|
||||
protected static ITraceLogger Tl;
|
||||
|
||||
/// <summary>
|
||||
/// Driver description that displays in the ASCOM Chooser.
|
||||
/// </summary>
|
||||
protected static readonly string DriverDescription = "Meade Generic";
|
||||
|
||||
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
|
||||
protected ProfileProperties _profileProperties;
|
||||
|
||||
public MeadeTelescopeBase()
|
||||
{
|
||||
SharedResourcesWrapper = new SharedResourcesWrapper();
|
||||
}
|
||||
|
||||
public MeadeTelescopeBase(ISharedResourcesWrapper sharedResourcesWrapper)
|
||||
{
|
||||
SharedResourcesWrapper = sharedResourcesWrapper;
|
||||
}
|
||||
|
||||
protected void Initialise(string className, ITraceLogger traceLogger = null)
|
||||
{
|
||||
Tl = traceLogger ?? new TraceLogger("", $"Meade.Generic.{className}");
|
||||
|
||||
ReadProfile(); // Read device configuration from the ASCOM Profile store
|
||||
|
||||
IsConnected = false; // Initialise connected to false
|
||||
|
||||
LogMessage(className, "Completed initialisation");
|
||||
LogMessage(className, $"Driver version: {DriverVersion}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read the device configuration from the ASCOM Profile store
|
||||
/// </summary>
|
||||
protected void ReadProfile()
|
||||
{
|
||||
_profileProperties = SharedResourcesWrapper.ReadProfile();
|
||||
Tl.Enabled = _profileProperties.TraceLogger;
|
||||
|
||||
LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}");
|
||||
LogMessage("ReadProfile", $"Com Port: {_profileProperties.ComPort}");
|
||||
LogMessage("ReadProfile", $"Backlash Steps: {_profileProperties.BacklashCompensation}");
|
||||
LogMessage("ReadProfile", $"Dynamic breaking: {_profileProperties.DynamicBreaking}");
|
||||
LogMessage("ReadProfile", $"Guide Rate: {_profileProperties.GuideRateArcSecondsPerSecond}");
|
||||
LogMessage("ReadProfile", $"Precision: {_profileProperties.Precision}");
|
||||
LogMessage("ReadProfile", $"Guiding Style: {_profileProperties.GuidingStyle}");
|
||||
LogMessage("ReadProfile", $"Site Elevation: {_profileProperties.SiteElevation}");
|
||||
LogMessage("ReadProfile", $"Settle Time after slew: {_profileProperties.SettleTime}");
|
||||
LogMessage("ReadProfile", $"Send date and time on connect: {_profileProperties.SendDateTime}");
|
||||
LogMessage("ReadProfile", $"Parked Behaviour: {_profileProperties.ParkedBehaviour}");
|
||||
LogMessage("ReadProfile", $"Parked Alt: {_profileProperties.ParkedAlt}");
|
||||
LogMessage("ReadProfile", $"Parked Az: {_profileProperties.ParkedAz}");
|
||||
LogMessage("ReadProfile", $"Focal Length: {_profileProperties.FocalLength}");
|
||||
LogMessage("ReadProfile", $"Aperture Area: {_profileProperties.ApertureArea}");
|
||||
LogMessage("ReadProfile", $"Aperture Area: {_profileProperties.ApertureDiameter}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log helper function that takes formatted strings and arguments
|
||||
/// </summary>
|
||||
/// <param name="identifier"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="args"></param>
|
||||
public static void LogMessage(string identifier, string message, params object[] args)
|
||||
{
|
||||
var msg = string.Format(message, args);
|
||||
Tl.LogMessage(identifier, msg, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if there is a valid connection to the driver hardware
|
||||
/// </summary>
|
||||
protected bool IsConnected { get; set; }
|
||||
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
Tl.LogMessage("Description Get", DriverDescription, false);
|
||||
return DriverDescription;
|
||||
}
|
||||
}
|
||||
|
||||
public string DriverInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
string driverInfo = $"{Description} .net driver. Version: {DriverVersion}";
|
||||
LogMessage("DriverInfo Get", driverInfo);
|
||||
return driverInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public string DriverVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
Version version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
string driverVersion = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
|
||||
LogMessage("DriverVersion Get", driverVersion);
|
||||
return driverVersion;
|
||||
}
|
||||
}
|
||||
|
||||
#region ASCOM Registration
|
||||
|
||||
private static IProfileFactory _profileFactory;
|
||||
|
||||
public static IProfileFactory ProfileFactory
|
||||
{
|
||||
get => _profileFactory ?? (_profileFactory = new ProfileFactory());
|
||||
set => _profileFactory = value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void UpdateSiteElevation()
|
||||
{
|
||||
var profileProperties = SharedResourcesWrapper.ReadProfile();
|
||||
profileProperties.SiteElevation = _profileProperties.SiteElevation;
|
||||
SharedResourcesWrapper.WriteProfile(profileProperties);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public enum ParkedBehaviour
|
||||
{
|
||||
[Description("No Coordinates")]
|
||||
NoCoordinates,
|
||||
[Description("Last Good Position")]
|
||||
LastGoodPosition,
|
||||
[Description("Report coordinates as")]
|
||||
ReportCoordinates
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class ParkedPosition
|
||||
{
|
||||
public double Altitude { get; set; }
|
||||
public double Azimuth { get; set; }
|
||||
public double RightAscension { get; set; }
|
||||
public double Declination { get; set; }
|
||||
public double SiteLongitude { get; set; }
|
||||
public double SiteLatitude { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public interface IProfileFactory
|
||||
{
|
||||
IProfileWrapper Create();
|
||||
}
|
||||
|
||||
public class ProfileFactory : IProfileFactory
|
||||
{
|
||||
public IProfileWrapper Create()
|
||||
{
|
||||
return new ProfileWrapper();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,25 @@ namespace ASCOM.Meade.net
|
||||
public bool TraceLogger { get; set; }
|
||||
public double GuideRateArcSecondsPerSecond { get; set; }
|
||||
public string Precision { get; set; }
|
||||
public string GuidingStyle { get; set; }
|
||||
public int BacklashCompensation { get; set; }
|
||||
public bool ReverseFocusDirection { get; set; }
|
||||
public bool DynamicBreaking { get; set; }
|
||||
public bool RtsDtrEnabled { get; set; }
|
||||
public double SiteElevation { get; set; }
|
||||
public short SettleTime { get; set; }
|
||||
public int DataBits { get; set; }
|
||||
public string StopBits { get; set; }
|
||||
public string Parity { get; set; }
|
||||
public int Speed { get; set; }
|
||||
public string Handshake { get; set; }
|
||||
public bool SendDateTime { get; set; }
|
||||
public ParkedBehaviour ParkedBehaviour { get; set; }
|
||||
public double ParkedAlt { get; set; }
|
||||
public double ParkedAz { get; set; }
|
||||
public double FocalLength { get; set; }
|
||||
public double ApertureArea { get; set; }
|
||||
public double ApertureDiameter { get; set; }
|
||||
public int TimeoutMs { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyDescription("ASCOM multi-interface server for Meade.net")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("cjdawson.com")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyProduct("ASCOM Meade Generic")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019 cjdawson.com")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@@ -23,4 +23,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
+84
@@ -69,5 +69,89 @@ namespace ASCOM.Meade.net.Properties {
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The {0} was not {1} because you did not allow it..
|
||||
/// </summary>
|
||||
internal static string Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed to load served COM class assembly {0} - {1}.
|
||||
/// </summary>
|
||||
internal static string Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_" +
|
||||
"", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unknown argument: {0}
|
||||
///Valid are : -register, -unregister and -embedding.
|
||||
/// </summary>
|
||||
internal static string Server_ProcessArguments_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_ProcessArguments_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed to register class factory for {0}.
|
||||
/// </summary>
|
||||
internal static string Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error while registering the server:
|
||||
///{0}.
|
||||
/// </summary>
|
||||
internal static string Server_RegisterObjects_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_RegisterObjects_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} Settings ({1}).
|
||||
/// </summary>
|
||||
internal static string SetupDialogForm_SetupDialogForm__0__Settings___1__ {
|
||||
get {
|
||||
return ResourceManager.GetString("SetupDialogForm_SetupDialogForm__0__Settings___1__", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ({0:00.0}% of sidereal rate).
|
||||
/// </summary>
|
||||
internal static string SetupDialogForm_TextBox1_TextChanged___0_00_0___of_sidereal_rate_ {
|
||||
get {
|
||||
return ResourceManager.GetString("SetupDialogForm_TextBox1_TextChanged___0_00_0___of_sidereal_rate_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please enter only numbers..
|
||||
/// </summary>
|
||||
internal static string SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_ {
|
||||
get {
|
||||
return ResourceManager.GetString("SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please enter only numbers..
|
||||
/// </summary>
|
||||
internal static string SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_ {
|
||||
get {
|
||||
return ResourceManager.GetString("SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,33 @@
|
||||
<data name="ASCOM" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\ASCOM.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Server_ProcessArguments_" xml:space="preserve">
|
||||
<value>Unknown argument: {0}
|
||||
Valid are : -register, -unregister and -embedding</value>
|
||||
</data>
|
||||
<data name="Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_" xml:space="preserve">
|
||||
<value>Failed to register class factory for {0}</value>
|
||||
</data>
|
||||
<data name="Server_RegisterObjects_" xml:space="preserve">
|
||||
<value>Error while registering the server:
|
||||
{0}</value>
|
||||
</data>
|
||||
<data name="Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_" xml:space="preserve">
|
||||
<value>The {0} was not {1} because you did not allow it.</value>
|
||||
</data>
|
||||
<data name="Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_" xml:space="preserve">
|
||||
<value>Failed to load served COM class assembly {0} - {1}</value>
|
||||
</data>
|
||||
<data name="SetupDialogForm_TextBox1_TextChanged___0_00_0___of_sidereal_rate_" xml:space="preserve">
|
||||
<value>({0:00.0}% of sidereal rate)</value>
|
||||
</data>
|
||||
<data name="SetupDialogForm_SetupDialogForm__0__Settings___1__" xml:space="preserve">
|
||||
<value>{0} Settings ({1})</value>
|
||||
</data>
|
||||
<data name="SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_" xml:space="preserve">
|
||||
<value>Please enter only numbers.</value>
|
||||
</data>
|
||||
<data name="SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_" xml:space="preserve">
|
||||
<value>Please enter only numbers.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,666 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252"/>
|
||||
<TITLE>Untitled Document</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Win32)"/>
|
||||
<META NAME="CREATED" CONTENT="0;0"/>
|
||||
<META NAME="CHANGEDBY" CONTENT="Chris Rowland"/>
|
||||
<META NAME="CHANGED" CONTENT="20110422;10442800"/>
|
||||
<META NAME="CHANGEDBY" CONTENT="Chris Rowland"/>
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
@page { margin: 2cm }
|
||||
P { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
TD P { font-family: "Verdana", "Arial", "Helvetica", sans-serif; font-weight: normal }
|
||||
H3 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
H2 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
H4 { font-family: "Arial", "Helvetica", sans-serif }
|
||||
PRE { margin-left: 0.18cm; margin-right: 0.18cm; margin-top: 0.18cm; margin-bottom: 0.18cm; background: #ccffff }
|
||||
PRE.western { font-weight: normal }
|
||||
PRE.cjk { font-family: "NSimSun", monospace; font-weight: normal }
|
||||
PRE.ctl { font-weight: normal }
|
||||
EM.underline { text-decoration: underline }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="en-GB" DIR="LTR">
|
||||
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="4" CELLSPACING="0" STYLE="page-break-before: always">
|
||||
<TR>
|
||||
<TD>
|
||||
<H2>
|
||||
ASCOM LocalServer (singleton) Host
|
||||
</H2>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P>
|
||||
<BR/>
|
||||
<BR/>
|
||||
|
||||
</P>
|
||||
<H4>
|
||||
You have just created a local server (singleton) host for one or
|
||||
more ASCOM driver classes.
|
||||
</H4>
|
||||
<HR/>
|
||||
<P>
|
||||
This project implements an ASCOM host server for one or more
|
||||
driver classes in a single-instance executable. It can be used to
|
||||
serve multiple instances of a single driver class (hub), provide
|
||||
driver services for multiple devices (e.g., Telescope and Focuser) to
|
||||
multiple applications and allow multiple devices of the same type to
|
||||
be connected. In the latter scenario, the multiple driver classes
|
||||
will often share one or more resources such as the serial connection
|
||||
and a microcontroller in the combined device. From the client's
|
||||
perspective, using the drivers served by the local server is exactly
|
||||
the same as if the drivers are loaded into the client's process space
|
||||
(in-proc servers).
|
||||
</P>
|
||||
<P STYLE="margin-left: 0.42cm; margin-right: 0.42cm; border: 1px solid #000000; padding: 0.21cm">
|
||||
<STRONG>
|
||||
<SPAN STYLE="background: #ffee88">NOTE:</SPAN>
|
||||
</STRONG>
|
||||
<SPAN STYLE="background: #ffee88">
|
||||
Unless you are prepared to handle all of the timing issues that arise
|
||||
when multiple clients are accessing the properties and methods of
|
||||
your driver(s), stop now. Just because the local server serializes
|
||||
the calls to your driver(s)' properties and methods does not mean
|
||||
that there will be no timing or concurrency issues.<BR/>
|
||||
<BR/>For
|
||||
example, suppose the hub serves instances of a Telescope driver. One
|
||||
client sets the TargetRightAscension property, then another sets
|
||||
TargetRightAscension to a different value, then the first client sets
|
||||
TargetDeclination, then the first client calls SlewToTarget()
|
||||
followed by the second client calling SlewToTarget(). Besides the
|
||||
first client's slew command sending the scope to the wrong (and
|
||||
possibly dangerous) coordinates, there is the problem of the second
|
||||
client trying to slew a slewing scope. Local server drivers are
|
||||
tricky to get right. There is no such thing as "ignorance is
|
||||
bliss" here.
|
||||
|
||||
</SPAN>
|
||||
</P>
|
||||
<P STYLE="margin-left: 0.42cm; margin-right: 0.42cm; border: 1px solid #000000; padding: 0.21cm">
|
||||
<SPAN STYLE="background: #ffee88">
|
||||
This implementation has changed
|
||||
from what was defined for Platform 5.5 as follows:
|
||||
</SPAN>
|
||||
</P>
|
||||
<P STYLE="margin-left: 0.42cm; margin-right: 0.42cm; border: 1px solid #000000; padding: 0.21cm">
|
||||
<SPAN STYLE="background: #ffee88">
|
||||
The drivers are now installed in
|
||||
the same folder as the local server executable. This makes deployment
|
||||
cleaner because the whole driver can exist in a single folder
|
||||
independently of other drivers.
|
||||
</SPAN>
|
||||
</P>
|
||||
<P STYLE="margin-left: 0.42cm; margin-right: 0.42cm; border: 1px solid #000000; padding: 0.21cm">
|
||||
<SPAN STYLE="background: #ffee88">
|
||||
The ProgId and friendly name as
|
||||
displayed by the Chooser are defined using attributes. This allows
|
||||
driver dlls to be identified clearly and so avoids confusion with
|
||||
other dlls that may be required such as interop dlls.
|
||||
</SPAN>
|
||||
</P>
|
||||
<P STYLE="margin-left: 0.42cm; margin-right: 0.42cm; border: 1px solid #000000; padding: 0.21cm">
|
||||
<SPAN STYLE="background: #ffee88">
|
||||
Some changes have been made that
|
||||
will facilitate generating multiple drivers of the same type.
|
||||
</SPAN>
|
||||
</P>
|
||||
<P STYLE="margin-left: 0.42cm; margin-right: 0.42cm; border: 1px solid #000000; padding: 0.21cm">
|
||||
<SPAN STYLE="background: #ffee88">
|
||||
I've put some additional advice and
|
||||
comments in the notes below <I>in italics.</I>
|
||||
</SPAN>
|
||||
</P>
|
||||
<P>
|
||||
You're probably anxious to get going, but you really should read
|
||||
through the <A HREF="#theory">Theory of Operation</A> and <A HREF="#details">
|
||||
Detailed
|
||||
Use and Deployment
|
||||
</A> below.
|
||||
</P>
|
||||
<P>You must do the following in order to complete your local server:</P>
|
||||
<OL>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
In the local server's project
|
||||
properties, Application tab, change BOTH the AssemblyName and the
|
||||
default assembly name to ASCOM.xxx (e.g., ASCOM.SuperScope). <I>
|
||||
This
|
||||
may be done by default now.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Add one or more driver skeleton
|
||||
projects using the in-proc templates. You may use either the C# or
|
||||
VB templates. Project name is not important (not used in ProgID)
|
||||
choose something like TelescopeDriver. You will be changing the
|
||||
substituted project name in these projects below. If you ensure that
|
||||
the LocalServer and all the driver projects have the same NameSpace
|
||||
e.g. ASCOM.SuperScope the renaming in section 6a will not be
|
||||
required.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Develop and debug these driver
|
||||
projects as normal in-process assemblies. This will be much simpler
|
||||
because the driver and test code can be debugged in the same
|
||||
process.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Build the LocalServer.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Set a reference to the local
|
||||
server <STRONG>project</STRONG> in each of the driver skeleton
|
||||
projects.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">In each skeleton driver project:</P>
|
||||
<OL TYPE="a">
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Do a Find In Files for the
|
||||
project name of the skeleton driver (e.g., TelescopeDriver) and
|
||||
change it to match the project name of your local server (e.g.
|
||||
SuperScope). You don't have to do this in the ReadMe.html file.
|
||||
Everywhere else, however, is IMPORTANT. This sets the correct
|
||||
namespace, progID, etc. If you're a bit more brave, you can use
|
||||
Replace in Files. <I>
|
||||
This may not be needed if the correct
|
||||
namespace and naming conventions have been followed when the
|
||||
drivers and local server were generated.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
In project properties,
|
||||
Application tab, change the assembly name to
|
||||
ASCOM.<EM CLASS="underline">localserverprojectname</EM>.<EM>drivertype</EM>,
|
||||
(e.g., ASCOM.SuperScope.Telescope).
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
In project properties,
|
||||
Application tab, click Assembly Information...
|
||||
</P>
|
||||
<UL>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Assure that Make assembly COM
|
||||
visible is <STRONG>on</STRONG> (it should already be on).
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Edit the Product Name to be the
|
||||
"friendly name" of your driver as will be shown in the
|
||||
Chooser. <I>
|
||||
Not used now, use the ServedClassName attribute
|
||||
instead.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
</UL>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
In project properties, Build tab,
|
||||
turn <STRONG>off</STRONG> Register for COM Interop.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P>
|
||||
Modify the driver class declaration to inherit from
|
||||
ReferenceCountedObjectBase. Examples:<BR/>C#:
|
||||
</P>
|
||||
<PRE CLASS="western">
|
||||
public class Telescope :
|
||||
ReferenceCountedObjectBase,
|
||||
ITelescope
|
||||
</PRE>
|
||||
<P>
|
||||
VB:
|
||||
</P>
|
||||
<PRE CLASS="western">
|
||||
Public Class Telescope
|
||||
'==================================
|
||||
Inherits ReferenceCountedObjectBase
|
||||
Implements ITelescope
|
||||
'==================================
|
||||
</PRE>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
In driver.cs/driver.vb, remove
|
||||
the entire ASCOM Registration region
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
In driver.cs/driver.vb, remove
|
||||
the private strings for driver ID and driver description. <I>
|
||||
They
|
||||
may be needed internally, and if so should be set from the
|
||||
associated attributes, ServedClassName for the description and
|
||||
ProgId for the driver Id.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Modify the class attributes by
|
||||
adding the ServedClassName and ProgID attributes. The
|
||||
ServedClassName attribute must be the friendly name shown as the
|
||||
device name in the Chooser and the ProgId the progid of the driver
|
||||
e.g. ASCOM.SuperScope.Telescope. The class header should look like
|
||||
this:
|
||||
</P>
|
||||
<P STYLE="margin-bottom: 0cm">C#:</P>
|
||||
<PRE CLASS="western" STYLE="margin-right: 0.16cm">
|
||||
<FONT FACE="Consolas" SIZE="2" STYLE="font-size: 9pt">
|
||||
[<FONT COLOR="#2b91af">Guid</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#a31515">"0AE8B38D-10A1-4A8D-A5B7-1B050F74B48B"</FONT><FONT COLOR="#000000">)] // set by the template</FONT>
|
||||
<FONT COLOR="#000000">[</FONT><FONT COLOR="#2b91af">ProgId</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#a31515">"ASCOM.SuperScope.Telescope"</FONT><FONT COLOR="#000000">)]</FONT>
|
||||
<FONT COLOR="#000000">[</FONT><FONT COLOR="#2b91af">ServedClassName</FONT><FONT COLOR="#000000"> (</FONT><FONT COLOR="#a31515">"Super Scope Telescope"</FONT><FONT COLOR="#000000">)]</FONT>
|
||||
<FONT COLOR="#000000">[</FONT><FONT COLOR="#2b91af">ClassInterface</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#2b91af">ClassInterfaceType</FONT><FONT COLOR="#000000">.None)]</FONT>
|
||||
<FONT COLOR="#0000ff">public </FONT><FONT COLOR="#0000ff">class </FONT><FONT COLOR="#2b91af">Telescope </FONT><FONT COLOR="#000000">: </FONT><FONT COLOR="#2b91af">ReferenceCountedObjectBase</FONT><FONT COLOR="#000000"> , </FONT><FONT COLOR="#2b91af">ITelescope</FONT>
|
||||
</FONT>
|
||||
</PRE>
|
||||
</LI>
|
||||
</OL>
|
||||
</LI>
|
||||
</OL>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
<BR/>
|
||||
</P>
|
||||
<OL>
|
||||
<OL TYPE="a">
|
||||
<P>VB:</P>
|
||||
<PRE CLASS="western">
|
||||
<FONT FACE="Consolas" SIZE="2" STYLE="font-size: 9pt">
|
||||
<Guid(“<FONT COLOR="#a31515">0AE8B38D-10A1-4A8D-A5B7-1B050F74B48B</FONT>”)>
|
||||
<ProgId(“ASCOM.SuperScope.Telescope”)>
|
||||
<ServedClassName(“Super Scope Telescope”)>
|
||||
Public Class Telescope
|
||||
'==================================
|
||||
Inherits ReferenceCountedObjectBase
|
||||
Implements ITelescope
|
||||
'==================================
|
||||
</FONT>
|
||||
</PRE>
|
||||
</OL>
|
||||
</OL>
|
||||
<P STYLE="margin-left: 2.5cm">
|
||||
Add the following line to the driver
|
||||
constructor, this sets the driver ID using the ProgId Attribute:
|
||||
</P>
|
||||
<OL>
|
||||
<OL TYPE="a">
|
||||
<P>C#</P>
|
||||
<PRE CLASS="western">
|
||||
<FONT FACE="Consolas" SIZE="2" STYLE="font-size: 9pt">
|
||||
s_csDriverID = <FONT COLOR="#2b91af">Marshal</FONT><FONT COLOR="#000000">.GenerateProgIdForType(</FONT><FONT COLOR="#0000ff">this</FONT><FONT COLOR="#000000">.GetType());</FONT>
|
||||
</FONT>
|
||||
</PRE>
|
||||
<P>VB:</P>
|
||||
<PRE CLASS="western">
|
||||
<FONT FACE="Consolas" SIZE="2" STYLE="font-size: 9pt">
|
||||
s_csDriverID = <FONT COLOR="#2b91af">Marshal</FONT><FONT COLOR="#000000">.GenerateProgIdForType(</FONT><FONT COLOR="#0000ff">Me</FONT><FONT COLOR="#000000">.GetType())</FONT>
|
||||
</FONT>
|
||||
</PRE>
|
||||
</OL>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Unless you're writing a
|
||||
single-driver hub, you will have two or more driver types (e.g.
|
||||
Telescope and Focuser) and thus two or more driver assembly projects
|
||||
added. Presumably, these drivers need to share some resources (e.g.
|
||||
a single COM port via Helper.Serial). <U>
|
||||
Put shared resources into
|
||||
the SharedResources class provided
|
||||
</U>. There are some examples that
|
||||
should give a clue, modify and delete these as required.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
A shared serial port is already
|
||||
provided (see SharedResources.cs) as <FONT FACE="Lucida Console, Courier New, Courier, monospace">SharedResources.SharedSerial</FONT>
|
||||
and it is an ASCOM Helper Serial object. You may wish to define
|
||||
additional shared resources in static member variables with public
|
||||
static accessor properties as is already done for SharedSerial.
|
||||
Unfortunately, if you are a Visual Basic programmer, you will have
|
||||
to make these additions in C#.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
If you are writing a hub and don't
|
||||
need the serial port, in SharedResources.cs you can remove the
|
||||
public static SharedSerial property, the m_SharedSerial member in
|
||||
the private data region, and the line in main that initializes it.
|
||||
If you don't need any other shared resources for your hub, then you
|
||||
can remove the SharedResources.cs file completely.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
If you modified the LocalServer,
|
||||
build it again now. This will refresh the stuff that's visible to
|
||||
the drivers.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
Build the driver skeletons to
|
||||
verify that you got all of the namespace and other variable changes.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P>
|
||||
The local server dynamically loads the driver assemblies from
|
||||
the same folder as the local server executable. <BR/>
|
||||
<BR/>During
|
||||
development, you'll need to add a post-build task to each of your
|
||||
driver assembly projects which puts a copy of the driver assembly
|
||||
into the local server executable folder. Here is an example:
|
||||
</P>
|
||||
<PRE CLASS="western"> copy "$(TargetPath)" "$(SolutionDir)\SuperScope\$(OutDir)\$(TargetFileName)"</PRE>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
This assumes that the server project is called “SuperScope”,
|
||||
and handles using the debug or release build.<BR/>
|
||||
Note the quotes for
|
||||
possible path elements with spaces in them. <I>
|
||||
An alternative is to
|
||||
set the build path to the required destination instead of the
|
||||
default path.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
<I>
|
||||
Make sure the drivers are
|
||||
registered through the local server by running it with the /register
|
||||
parameter, see below for details.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
<SPAN STYLE="background: #ffff00">IMPORTANT:</SPAN>
|
||||
With a local server based driver (or hub) it is possible for
|
||||
multiple clients to control the device(s). It is up to you to
|
||||
safeguard against abuse. <I>
|
||||
The sort of thing that's needed is to
|
||||
have a counter of the number of connections to a device, the
|
||||
connection is only fully broken when the number of connections is
|
||||
zero. You may also need code to prevent several drivers from talking
|
||||
to the hardware at the same time, the lock pattern is useful for
|
||||
that.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P>
|
||||
You may want to add controls and/or status information to the
|
||||
main form frmMain of the local server. Please resist the temptation
|
||||
to turn the local server's main form into a graphical device control
|
||||
panel. Instead, make a separate application that uses the served
|
||||
driver(s). <U>A driver is not a program!</U>
|
||||
</P>
|
||||
</LI>
|
||||
</OL>
|
||||
<H3>Notes</H3>
|
||||
<UL>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
The local server handles all of
|
||||
the registration and unregistration for each of its served driver
|
||||
classes, including the ASCOM Chooser info and the DCOM/AppID info
|
||||
needed for activation from TheSky. By running the server from a
|
||||
command line and giving /register or /unregister as the command line
|
||||
option, it will register or unregister all served classes
|
||||
(respectively). <SPAN STYLE="background: #ffff00">
|
||||
Never use REGASM
|
||||
on the local server executable!
|
||||
</SPAN> <I>
|
||||
This can be done in the
|
||||
Visual Studio IDE by setting the server project to run as startup
|
||||
and setting the command line argument to /register in Debug –
|
||||
Start Options.
|
||||
</I>
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
When you make the installer for
|
||||
your local server based driver/hub, do not let it register the
|
||||
executable for COM. Instead, have it activate the installed local
|
||||
server with the /register option.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P>
|
||||
The ASCOM registration uses the ServedClassName attribute as
|
||||
the friendly name that will show in the chooser and the ProgId
|
||||
attribute as the driver Id.
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P>
|
||||
The best deployment way is to install all the files in a
|
||||
folder that's a sub folder of the main driver, so the SuperScope
|
||||
driver files will be in the folder ...\ASCOM\Telescope\SuperScope.
|
||||
This can be done in the Inno script by changing the DefaultDirName
|
||||
like this:<BR/>
|
||||
DefaultDirName="{cf}\ASCOM\Telescope\SuperScope"<BR/>then
|
||||
the files can all be installed with DestDir: {app};
|
||||
</P>
|
||||
</LI>
|
||||
</UL>
|
||||
<H3>
|
||||
<A NAME="theory"></A>Theory of Operation
|
||||
</H3>
|
||||
<P>
|
||||
The local server is an executable which can provide multiple
|
||||
instances of multiple drivers to multiple clients. This capability is
|
||||
needed for two applications:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
A hub, which allows multiple
|
||||
clients to share a single device
|
||||
</P>
|
||||
</LI>
|
||||
<LI>
|
||||
<P>
|
||||
A device which provides multiple services, such as a
|
||||
telescope which has a focuser built-in where both the telescope and
|
||||
focuser are controlled by the same serial connection and different
|
||||
client programs need to control to the focuser and telescope.
|
||||
</P>
|
||||
</LI>
|
||||
</UL>
|
||||
<P>
|
||||
By simply dropping suitably developed driver assemblies into the
|
||||
same folder as the local server executable, the local server will
|
||||
find them and register them for COM and ASCOM and serve any number of
|
||||
instances of the drivers' interfaces to any number of client
|
||||
programs. It does this by locating and loading the driver assemblies,
|
||||
analysing them to detect their classes and interfaces, and
|
||||
implementing a class factory that can create instances of them for
|
||||
clients.
|
||||
</P>
|
||||
<P>
|
||||
A driver is an assembly which contains a class that <EM>implements</EM>
|
||||
one of the ASCOM standard driver interfaces and <EM>inherits</EM> the
|
||||
ReferenceCountedObjectBase class of the local server. Apart from
|
||||
that, driver assemblies are identical to those that are used
|
||||
in-process (DLL-type). The instructions above detail the steps needed
|
||||
to convert an in-process driver into one that can be served by the
|
||||
local server.
|
||||
</P>
|
||||
<P>
|
||||
The name of the local server is important, so we provide it as a
|
||||
<EM>template</EM> from which you can create a local server for your
|
||||
produce. To make this clear, let's assume that your company AlphaTech
|
||||
produces a telescope system which contains a microcontroller that is
|
||||
able to control not only the telescope mount, but also a focuser and
|
||||
a camera rotator. The mount, focuser, and rotator are all controlled
|
||||
via commands sent through a common serial line connecting the
|
||||
computer to the microcontroller, so you need a local server. In
|
||||
ASCOM, then, you probably want your system to appear as
|
||||
AlphaTech.Telescope, AlphaTech.Focuser, and AlphaTech.Rotator. Then
|
||||
you would name the local server AlphaTech. Be sure to give this due
|
||||
consideration before creating the template, the project name is the
|
||||
name of your local server. <I>
|
||||
Is this still correct? I get the
|
||||
impression that ASCOM.AlphaTech.Server would be OK.
|
||||
</I>
|
||||
</P>
|
||||
<P>
|
||||
The fact that driver classes inherit from the local server's
|
||||
ReferenceCountedObjectBase class allows the local server to maintain
|
||||
a reference count on the driver class. If a client creates an
|
||||
instance of a served driver, the local server automatically starts up
|
||||
and provides an instance of the class to the client. Once started the
|
||||
local server can provide additional instances of any of its served
|
||||
driver classes. If the reference count of all served classes drops to
|
||||
zero as a result of clients releasing their instances, the local
|
||||
server will automatically exit.
|
||||
</P>
|
||||
<P>
|
||||
Registration services provided include not only the basic COM
|
||||
class registration, but also DCOM/AppID info needed to use the served
|
||||
classes from outbound connections from Software Bisque's TheSky. It
|
||||
also registers the served classes for the ASCOM Chooser. The
|
||||
"friendly" name of each served driver that appears in the
|
||||
chooser comes from the driver's ServedClassName attribute. This also
|
||||
used to identify a driver so that non driver dlls, such as Interop
|
||||
dlls can be ignored. The COM ProgID for each served driver is
|
||||
specified in the ProgId attribute - ASCOM.<EM>localservername</EM>.<EM>drivertype</EM>,
|
||||
for example, ASCOM.AlphaTech.Telescope, where AlphaTech is the local
|
||||
server name and Telescope is the type of the driver. Unregistering
|
||||
removes all of this information from the system. Specifying the
|
||||
ProgId as an attribute allows multiple driver assemblies to be
|
||||
generated using the same source and namespace. This is used to
|
||||
provide multiple instances of the same driver, each with a different
|
||||
ProgId and so able to be registered separately.
|
||||
</P>
|
||||
<P>
|
||||
Driver DLLs are identified for registering/unregistering because
|
||||
they contain a type with the ServedClassName attribute. Only these
|
||||
will be registered for Com and ASCOM. This has changed; in Platform
|
||||
5 there was no attribute and the local server attempted to register
|
||||
all dlls. The new behaviour allows support dlls such as interop dlls
|
||||
to be included without them being registered incorrectly. There was
|
||||
also an interim version where the ServedClassName attribute was on
|
||||
the assembly, not the class. <I>
|
||||
All these previous versions, and the
|
||||
new drivers will operate together with Platform 6, the changes are
|
||||
local to the individual drivers.
|
||||
</I>
|
||||
</P>
|
||||
<H3>
|
||||
<A NAME="details"></A>Detailed Use and Deployment
|
||||
</H3>
|
||||
<P>
|
||||
Once you have built your local server and the served driver class
|
||||
assemblies, here's how to use it. To register the served classes,
|
||||
activate the local server from a shell command line with the option
|
||||
/register (or /regserver, for VB6 compatibility):
|
||||
</P>
|
||||
<PRE CLASS="western">
|
||||
C:\xxx> <EM>localserver</EM>.exe /register
|
||||
</PRE>
|
||||
<P>
|
||||
To unregister the local server and its drivers, activate the local
|
||||
server from a shell command line with the option /unregister (or
|
||||
/unregserver for VB6 compatibility):
|
||||
</P>
|
||||
<PRE CLASS="western">
|
||||
C:\xxx> <EM>localserver</EM>.exe /unregister
|
||||
</PRE>
|
||||
<P>
|
||||
When the operating system starts the local server in response to a
|
||||
client creating one of it's served driver classes, the command option
|
||||
/embedding is included. The local server's code detects this and sets
|
||||
a variable that you can use.
|
||||
</P>
|
||||
<P STYLE="margin-bottom: 0cm">
|
||||
When deploying a hub or set of drivers
|
||||
with the local server, you'll have to arrange for the local server
|
||||
and the driver assemblies to be placed together in a folder in the
|
||||
ASCOM driver folder. Any support files, such as Interop DLLs can be
|
||||
put in the same fiolder. That's all you need to do, the local server
|
||||
will find them in the same folder as it is located in.
|
||||
</P>
|
||||
<DIV ALIGN="RIGHT">
|
||||
<TABLE WIDTH="100"% BORDER="0" CELLPADDING="4" CELLSPACING="0">
|
||||
<TR>
|
||||
<TD>
|
||||
<TABLE WIDTH="100"% BORDER="0" CELLPADDING="4" CELLSPACING="0">
|
||||
<TR>
|
||||
<TD>
|
||||
<H3>ASCOM Initiative</H3>
|
||||
</TD>
|
||||
<TD>
|
||||
<IMG SRC="ASCOM.png" NAME="graphics1" ALIGN="RIGHT" WIDTH="48" HEIGHT="56" BORDER="0"/>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<P>
|
||||
<BR/>
|
||||
<BR/>
|
||||
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>
|
||||
<P>
|
||||
The ASCOM Initiative consists of a group of astronomy software
|
||||
developers and instrument vendors whose goals are to promote the
|
||||
driver/client model and scripting automation.
|
||||
</P>
|
||||
<P>
|
||||
See the <A HREF="http://ascom-standards.org/" TARGET="browser">
|
||||
ASCOM
|
||||
web site
|
||||
</A> for more information. Please participate in the
|
||||
<A HREF="http://tech.groups.yahoo.com/group/ASCOM-Talk" TARGET="browser">
|
||||
ASCOM-Talk
|
||||
Yahoo Group
|
||||
</A>.
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<P>
|
||||
<BR/>
|
||||
<BR/>
|
||||
|
||||
</P>
|
||||
<P>
|
||||
<BR/>
|
||||
<BR/>
|
||||
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
||||
+309
-14
@@ -1,7 +1,14 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using ASCOM.Meade.net.Properties;
|
||||
using ASCOM.Utilities;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
@@ -11,6 +18,60 @@ namespace ASCOM.Meade.net
|
||||
public SetupDialogForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var assemblyInfo = new AssemblyInfo();
|
||||
|
||||
Text = string.Format(Resources.SetupDialogForm_SetupDialogForm__0__Settings___1__, assemblyInfo.Product, assemblyInfo.AssemblyVersion);
|
||||
|
||||
SetItemsFromEnum(cboStopBits.Items, typeof(SerialStopBits));
|
||||
SetItemsFromEnum(cboParity.Items, typeof(SerialParity));
|
||||
SetItemFromEnumValues(cboSpeed.Items, SerialSpeed.ps1200, SerialSpeed.ps57600);
|
||||
SetItemsFromEnum(cboHandShake.Items, typeof(SerialHandshake));
|
||||
SetItemsFromEnum(cboParkedBehaviour.Items, typeof(ParkedBehaviour));
|
||||
}
|
||||
|
||||
private void SetItemsFromEnum(IList items, Type enumItems)
|
||||
{
|
||||
items.Clear();
|
||||
|
||||
foreach (var value in Enum.GetValues(enumItems) )
|
||||
{
|
||||
var val = value as Enum;
|
||||
items.Add(val.GetDescription());
|
||||
}
|
||||
}
|
||||
|
||||
//private void SetItemsFromEnumValues(IList items, Type enumItems)
|
||||
//{
|
||||
// items.Clear();
|
||||
|
||||
// foreach (int item in Enum.GetValues(enumItems))
|
||||
// {
|
||||
// items.Add(item);
|
||||
// }
|
||||
//}
|
||||
|
||||
private void SetItemFromEnumValues<T>(IList items, T minValue, T maxValue)
|
||||
{
|
||||
items.Clear();
|
||||
|
||||
var type = typeof(T);
|
||||
|
||||
var intMinValue = (int)Convert.ChangeType(minValue, typeof(int));
|
||||
|
||||
var intMaxValue = (int)Convert.ChangeType(maxValue, typeof(int));
|
||||
|
||||
foreach (int item in Enum.GetValues(type))
|
||||
{
|
||||
if ((item >= intMinValue) && (item <= intMaxValue))
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed override string Text
|
||||
{
|
||||
get => base.Text;
|
||||
set => base.Text = value;
|
||||
}
|
||||
|
||||
private void cmdCancel_Click(object sender, EventArgs e) // Cancel button event handler
|
||||
@@ -22,7 +83,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://ascom-standards.org/");
|
||||
Process.Start("http://ascom-standards.org/");
|
||||
}
|
||||
catch (Win32Exception noBrowser)
|
||||
{
|
||||
@@ -40,23 +101,147 @@ namespace ASCOM.Meade.net
|
||||
chkTrace.Checked = profileProperties.TraceLogger;
|
||||
// set the list of com ports to those that are currently available
|
||||
comboBoxComPort.Items.Clear();
|
||||
comboBoxComPort.Items.AddRange(System.IO.Ports.SerialPort
|
||||
.GetPortNames()); // use System.IO because it's static
|
||||
comboBoxComPort.Items.AddRange(SerialPort.GetPortNames().ToArray<object>()); // use System.IO because it's static
|
||||
// select the current port if possible
|
||||
if (comboBoxComPort.Items.Contains(profileProperties.ComPort))
|
||||
{
|
||||
comboBoxComPort.SelectedItem = profileProperties.ComPort;
|
||||
}
|
||||
|
||||
txtGuideRate.Text = profileProperties.GuideRateArcSecondsPerSecond.ToString();
|
||||
cbxRtsDtr.Checked = profileProperties.RtsDtrEnabled;
|
||||
|
||||
txtGuideRate.Text = profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.CurrentCulture);
|
||||
try
|
||||
{
|
||||
cboPrecision.SelectedItem = profileProperties.Precision;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
cboPrecision.SelectedItem = "Unchanged";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
cboGuidingStyle.SelectedItem = profileProperties.GuidingStyle;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboGuidingStyle.SelectedItem = "Auto";
|
||||
}
|
||||
|
||||
numDatabits.Value = profileProperties.DataBits;
|
||||
|
||||
try
|
||||
{
|
||||
cboStopBits.SelectedItem = profileProperties.StopBits;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboStopBits.SelectedItem = "One";
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
cboParity.SelectedItem = profileProperties.Parity;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboParity.SelectedItem = "None";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
cboSpeed.SelectedItem = profileProperties.Speed;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboParity.SelectedItem = "9600";
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
cboHandShake.SelectedItem = profileProperties.Handshake;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboHandShake.SelectedItem = "None";
|
||||
}
|
||||
|
||||
txtBacklashSteps.Text = profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture);
|
||||
txtElevation.Text = profileProperties.SiteElevation.ToString(CultureInfo.CurrentCulture);
|
||||
|
||||
cbxReverseDirection.Checked = profileProperties.ReverseFocusDirection;
|
||||
cbxDynamicBreaking.Checked = profileProperties.DynamicBreaking;
|
||||
nudSettleTime.Value = profileProperties.SettleTime;
|
||||
|
||||
cbxSendDateTime.Checked = profileProperties.SendDateTime;
|
||||
|
||||
try
|
||||
{
|
||||
cboParkedBehaviour.SelectedItem = profileProperties.ParkedBehaviour.GetDescription();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboParkedBehaviour.SelectedItem = ParkedBehaviour.NoCoordinates.GetDescription();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtParkedAlt.Text = profileProperties.ParkedAlt.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtParkedAlt.Text = "0";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtParkedAz.Text = profileProperties.ParkedAz.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtParkedAz.Text = "180";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtFocalLength.Text = profileProperties.FocalLength.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtFocalLength.Text = "2000";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtApertureArea.Text = profileProperties.ApertureArea.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtApertureArea.Text = "32685";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtApertureDiameter.Text = profileProperties.ApertureDiameter.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtApertureDiameter.Text = "203";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtTimeout.Text = profileProperties.TimeoutMs.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtTimeout.Text = "5000";
|
||||
}
|
||||
|
||||
UpdateParkedItemsEnabled();
|
||||
}
|
||||
|
||||
public ProfileProperties GetProfile()
|
||||
@@ -65,8 +250,28 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
TraceLogger = chkTrace.Checked,
|
||||
ComPort = comboBoxComPort.SelectedItem.ToString(),
|
||||
TimeoutMs = Convert.ToInt32(txtTimeout.Text),
|
||||
RtsDtrEnabled = cbxRtsDtr.Checked,
|
||||
DataBits = Convert.ToInt32(numDatabits.Value),
|
||||
StopBits = cboStopBits.SelectedItem.ToString(),
|
||||
Parity = cboParity.SelectedItem.ToString(),
|
||||
Speed = Convert.ToInt32(cboSpeed.SelectedItem),
|
||||
Handshake = cboHandShake.SelectedItem.ToString(),
|
||||
GuideRateArcSecondsPerSecond = double.Parse(txtGuideRate.Text.Trim()),
|
||||
Precision = cboPrecision.SelectedItem.ToString()
|
||||
Precision = cboPrecision.SelectedItem.ToString(),
|
||||
GuidingStyle = cboGuidingStyle.SelectedItem.ToString(),
|
||||
BacklashCompensation = int.Parse(txtBacklashSteps.Text),
|
||||
ReverseFocusDirection = cbxReverseDirection.Checked,
|
||||
DynamicBreaking = cbxDynamicBreaking.Checked,
|
||||
SiteElevation = double.Parse(txtElevation.Text),
|
||||
SettleTime = Convert.ToInt16(nudSettleTime.Value),
|
||||
SendDateTime = cbxSendDateTime.Checked,
|
||||
ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(cboParkedBehaviour.SelectedItem.ToString()),
|
||||
ParkedAlt = double.Parse(txtParkedAlt.Text),
|
||||
ParkedAz = double.Parse(txtParkedAz.Text),
|
||||
FocalLength = double.Parse(txtFocalLength.Text),
|
||||
ApertureArea = double.Parse(txtApertureArea.Text),
|
||||
ApertureDiameter = double.Parse(txtApertureDiameter.Text)
|
||||
};
|
||||
|
||||
return profileProperties;
|
||||
@@ -74,6 +279,7 @@ namespace ASCOM.Meade.net
|
||||
|
||||
private void SetupDialogForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
Win32Utilities.BringWindowToFront(Handle);
|
||||
Activate();
|
||||
}
|
||||
|
||||
@@ -81,34 +287,123 @@ namespace ASCOM.Meade.net
|
||||
|
||||
private void TextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//const double SIDRATE = 0.9972695677; //synodic/solar seconds per sidereal second
|
||||
try
|
||||
{
|
||||
double newGuideRate = double.Parse(txtGuideRate.Text.Trim());
|
||||
|
||||
const double siderealArcSecondsPerSecond = 15.041;
|
||||
var percentOfSideReal = (newGuideRate / siderealArcSecondsPerSecond * 100);
|
||||
var percentOfSideReal = newGuideRate / siderealArcSecondsPerSecond * 100;
|
||||
|
||||
lblPercentOfSiderealRate.Text = $"({percentOfSideReal:00.0}% of sidereal rate)";
|
||||
lblPercentOfSiderealRate.Text = string.Format(Resources.SetupDialogForm_TextBox1_TextChanged___0_00_0___of_sidereal_rate_, percentOfSideReal);
|
||||
_guideRateValid = true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
catch (Exception)
|
||||
{
|
||||
//Surpressing this exception as if the value is not valid then it's not useful.
|
||||
_guideRateValid = false;
|
||||
}
|
||||
|
||||
UpdateOKButton();
|
||||
UpdateOkButton();
|
||||
}
|
||||
|
||||
private void UpdateOKButton()
|
||||
private void UpdateOkButton()
|
||||
{
|
||||
cmdOK.Enabled = _guideRateValid && (comboBoxComPort.SelectedItem != null);
|
||||
}
|
||||
|
||||
private void ComboBoxComPort_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateOKButton();
|
||||
UpdateOkButton();
|
||||
}
|
||||
|
||||
public void SetReadOnlyMode()
|
||||
{
|
||||
foreach (Control control in Controls)
|
||||
{
|
||||
control.Enabled = false;
|
||||
}
|
||||
|
||||
cmdCancel.Enabled = true;
|
||||
//cmdOK.Enabled = false;
|
||||
//comboBoxComPort.Enabled = false;
|
||||
//chkTrace.Enabled = false;
|
||||
//txtGuideRate.Enabled = false;
|
||||
//cboPrecision.Enabled = false;
|
||||
}
|
||||
|
||||
private void txtElevation_TextChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtElevation.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show(Resources.SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_);
|
||||
txtElevation.Text = txtElevation.Text.Remove(txtElevation.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void txtBacklashSteps_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtBacklashSteps.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show(Resources.SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_);
|
||||
txtBacklashSteps.Text = txtElevation.Text.Remove(txtBacklashSteps.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void cboParkedBehaviour_SelectionChangeCommitted(object sender, EventArgs e)
|
||||
{
|
||||
UpdateParkedItemsEnabled();
|
||||
}
|
||||
|
||||
private void UpdateParkedItemsEnabled()
|
||||
{
|
||||
txtParkedAlt.Enabled = cboParkedBehaviour.SelectedItem?.ToString() == "Report coordinates as";
|
||||
txtParkedAz.Enabled = txtParkedAlt.Enabled;
|
||||
}
|
||||
|
||||
private void txtParkedAlt_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtParkedAlt.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show(Resources.SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_);
|
||||
txtParkedAlt.Text = txtParkedAlt.Text.Remove(txtParkedAlt.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void txtParkedAz_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtParkedAz.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show(Resources.SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_);
|
||||
txtParkedAz.Text = txtParkedAz.Text.Remove(txtParkedAz.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void txt_FocalLength_TextChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtFocalLength.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show(Resources.SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_);
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Generated
+455
-14
@@ -1,3 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
partial class SetupDialogForm
|
||||
@@ -5,7 +8,7 @@ namespace ASCOM.Meade.net
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
@@ -28,6 +31,7 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupDialogForm));
|
||||
this.cmdOK = new System.Windows.Forms.Button();
|
||||
this.cmdCancel = new System.Windows.Forms.Button();
|
||||
@@ -42,7 +46,58 @@ namespace ASCOM.Meade.net
|
||||
this.lblPercentOfSiderealRate = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.cboPrecision = new System.Windows.Forms.ComboBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.cboGuidingStyle = new System.Windows.Forms.ComboBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.txtBacklashSteps = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.cbxReverseDirection = new System.Windows.Forms.CheckBox();
|
||||
this.cbxDynamicBreaking = new System.Windows.Forms.CheckBox();
|
||||
this.cbxRtsDtr = new System.Windows.Forms.CheckBox();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.cbxSendDateTime = new System.Windows.Forms.CheckBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.txtElevation = new System.Windows.Forms.TextBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.nudSettleTime = new System.Windows.Forms.NumericUpDown();
|
||||
this.label15 = new System.Windows.Forms.Label();
|
||||
this.label16 = new System.Windows.Forms.Label();
|
||||
this.cboStopBits = new System.Windows.Forms.ComboBox();
|
||||
this.numDatabits = new System.Windows.Forms.NumericUpDown();
|
||||
this.cboParity = new System.Windows.Forms.ComboBox();
|
||||
this.cboSpeed = new System.Windows.Forms.ComboBox();
|
||||
this.cboHandShake = new System.Windows.Forms.ComboBox();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.label19 = new System.Windows.Forms.Label();
|
||||
this.label20 = new System.Windows.Forms.Label();
|
||||
this.label21 = new System.Windows.Forms.Label();
|
||||
this.cboParkedBehaviour = new System.Windows.Forms.ComboBox();
|
||||
this.label22 = new System.Windows.Forms.Label();
|
||||
this.label23 = new System.Windows.Forms.Label();
|
||||
this.label24 = new System.Windows.Forms.Label();
|
||||
this.txtParkedAlt = new System.Windows.Forms.TextBox();
|
||||
this.txtParkedAz = new System.Windows.Forms.TextBox();
|
||||
this.label25 = new System.Windows.Forms.Label();
|
||||
this.txtFocalLength = new System.Windows.Forms.TextBox();
|
||||
this.label26 = new System.Windows.Forms.Label();
|
||||
this.label27 = new System.Windows.Forms.Label();
|
||||
this.txtApertureDiameter = new System.Windows.Forms.TextBox();
|
||||
this.label28 = new System.Windows.Forms.Label();
|
||||
this.label29 = new System.Windows.Forms.Label();
|
||||
this.txtApertureArea = new System.Windows.Forms.TextBox();
|
||||
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.nudSettleTime)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// cmdOK
|
||||
@@ -102,6 +157,7 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
resources.ApplyResources(this.txtGuideRate, "txtGuideRate");
|
||||
this.txtGuideRate.Name = "txtGuideRate";
|
||||
this.toolTip1.SetToolTip(this.txtGuideRate, resources.GetString("txtGuideRate.ToolTip"));
|
||||
this.txtGuideRate.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
|
||||
//
|
||||
// label4
|
||||
@@ -130,10 +186,343 @@ namespace ASCOM.Meade.net
|
||||
resources.ApplyResources(this.cboPrecision, "cboPrecision");
|
||||
this.cboPrecision.Name = "cboPrecision";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
resources.ApplyResources(this.label6, "label6");
|
||||
this.label6.Name = "label6";
|
||||
//
|
||||
// cboGuidingStyle
|
||||
//
|
||||
this.cboGuidingStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboGuidingStyle.FormattingEnabled = true;
|
||||
this.cboGuidingStyle.Items.AddRange(new object[] {
|
||||
resources.GetString("cboGuidingStyle.Items"),
|
||||
resources.GetString("cboGuidingStyle.Items1"),
|
||||
resources.GetString("cboGuidingStyle.Items2")});
|
||||
resources.ApplyResources(this.cboGuidingStyle, "cboGuidingStyle");
|
||||
this.cboGuidingStyle.Name = "cboGuidingStyle";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
resources.ApplyResources(this.label7, "label7");
|
||||
this.label7.Name = "label7";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
resources.ApplyResources(this.label8, "label8");
|
||||
this.label8.Name = "label8";
|
||||
//
|
||||
// txtBacklashSteps
|
||||
//
|
||||
resources.ApplyResources(this.txtBacklashSteps, "txtBacklashSteps");
|
||||
this.txtBacklashSteps.Name = "txtBacklashSteps";
|
||||
this.txtBacklashSteps.TextChanged += new System.EventHandler(this.txtBacklashSteps_TextChanged);
|
||||
//
|
||||
// label9
|
||||
//
|
||||
resources.ApplyResources(this.label9, "label9");
|
||||
this.label9.Name = "label9";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
resources.ApplyResources(this.label10, "label10");
|
||||
this.label10.Name = "label10";
|
||||
//
|
||||
// label11
|
||||
//
|
||||
resources.ApplyResources(this.label11, "label11");
|
||||
this.label11.Name = "label11";
|
||||
//
|
||||
// cbxReverseDirection
|
||||
//
|
||||
resources.ApplyResources(this.cbxReverseDirection, "cbxReverseDirection");
|
||||
this.cbxReverseDirection.Name = "cbxReverseDirection";
|
||||
this.cbxReverseDirection.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbxDynamicBreaking
|
||||
//
|
||||
resources.ApplyResources(this.cbxDynamicBreaking, "cbxDynamicBreaking");
|
||||
this.cbxDynamicBreaking.Name = "cbxDynamicBreaking";
|
||||
this.cbxDynamicBreaking.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbxRtsDtr
|
||||
//
|
||||
resources.ApplyResources(this.cbxRtsDtr, "cbxRtsDtr");
|
||||
this.cbxRtsDtr.Name = "cbxRtsDtr";
|
||||
this.toolTip1.SetToolTip(this.cbxRtsDtr, resources.GetString("cbxRtsDtr.ToolTip"));
|
||||
this.cbxRtsDtr.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbxSendDateTime
|
||||
//
|
||||
resources.ApplyResources(this.cbxSendDateTime, "cbxSendDateTime");
|
||||
this.cbxSendDateTime.Name = "cbxSendDateTime";
|
||||
this.toolTip1.SetToolTip(this.cbxSendDateTime, resources.GetString("cbxSendDateTime.ToolTip"));
|
||||
this.cbxSendDateTime.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
resources.ApplyResources(this.label12, "label12");
|
||||
this.label12.Name = "label12";
|
||||
//
|
||||
// txtElevation
|
||||
//
|
||||
resources.ApplyResources(this.txtElevation, "txtElevation");
|
||||
this.txtElevation.Name = "txtElevation";
|
||||
this.txtElevation.TextChanged += new System.EventHandler(this.txtElevation_TextChanged_1);
|
||||
//
|
||||
// label13
|
||||
//
|
||||
resources.ApplyResources(this.label13, "label13");
|
||||
this.label13.Name = "label13";
|
||||
//
|
||||
// label14
|
||||
//
|
||||
resources.ApplyResources(this.label14, "label14");
|
||||
this.label14.Name = "label14";
|
||||
//
|
||||
// nudSettleTime
|
||||
//
|
||||
resources.ApplyResources(this.nudSettleTime, "nudSettleTime");
|
||||
this.nudSettleTime.Maximum = new decimal(new int[] {
|
||||
32767,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudSettleTime.Name = "nudSettleTime";
|
||||
//
|
||||
// label15
|
||||
//
|
||||
resources.ApplyResources(this.label15, "label15");
|
||||
this.label15.Name = "label15";
|
||||
//
|
||||
// label16
|
||||
//
|
||||
resources.ApplyResources(this.label16, "label16");
|
||||
this.label16.Name = "label16";
|
||||
//
|
||||
// cboStopBits
|
||||
//
|
||||
this.cboStopBits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboStopBits.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cboStopBits, "cboStopBits");
|
||||
this.cboStopBits.Name = "cboStopBits";
|
||||
//
|
||||
// numDatabits
|
||||
//
|
||||
resources.ApplyResources(this.numDatabits, "numDatabits");
|
||||
this.numDatabits.Maximum = new decimal(new int[] {
|
||||
32767,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numDatabits.Name = "numDatabits";
|
||||
//
|
||||
// cboParity
|
||||
//
|
||||
this.cboParity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboParity.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cboParity, "cboParity");
|
||||
this.cboParity.Name = "cboParity";
|
||||
//
|
||||
// cboSpeed
|
||||
//
|
||||
this.cboSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboSpeed.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cboSpeed, "cboSpeed");
|
||||
this.cboSpeed.Name = "cboSpeed";
|
||||
//
|
||||
// cboHandShake
|
||||
//
|
||||
this.cboHandShake.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboHandShake.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.cboHandShake, "cboHandShake");
|
||||
this.cboHandShake.Name = "cboHandShake";
|
||||
//
|
||||
// label17
|
||||
//
|
||||
resources.ApplyResources(this.label17, "label17");
|
||||
this.label17.Name = "label17";
|
||||
//
|
||||
// label18
|
||||
//
|
||||
resources.ApplyResources(this.label18, "label18");
|
||||
this.label18.Name = "label18";
|
||||
//
|
||||
// label19
|
||||
//
|
||||
resources.ApplyResources(this.label19, "label19");
|
||||
this.label19.Name = "label19";
|
||||
//
|
||||
// label20
|
||||
//
|
||||
resources.ApplyResources(this.label20, "label20");
|
||||
this.label20.Name = "label20";
|
||||
//
|
||||
// label21
|
||||
//
|
||||
resources.ApplyResources(this.label21, "label21");
|
||||
this.label21.Name = "label21";
|
||||
//
|
||||
// cboParkedBehaviour
|
||||
//
|
||||
this.cboParkedBehaviour.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cboParkedBehaviour.FormattingEnabled = true;
|
||||
this.cboParkedBehaviour.Items.AddRange(new object[] {
|
||||
resources.GetString("cboParkedBehaviour.Items"),
|
||||
resources.GetString("cboParkedBehaviour.Items1"),
|
||||
resources.GetString("cboParkedBehaviour.Items2")});
|
||||
resources.ApplyResources(this.cboParkedBehaviour, "cboParkedBehaviour");
|
||||
this.cboParkedBehaviour.Name = "cboParkedBehaviour";
|
||||
this.cboParkedBehaviour.SelectionChangeCommitted += new System.EventHandler(this.cboParkedBehaviour_SelectionChangeCommitted);
|
||||
//
|
||||
// label22
|
||||
//
|
||||
resources.ApplyResources(this.label22, "label22");
|
||||
this.label22.Name = "label22";
|
||||
//
|
||||
// label23
|
||||
//
|
||||
resources.ApplyResources(this.label23, "label23");
|
||||
this.label23.Name = "label23";
|
||||
//
|
||||
// label24
|
||||
//
|
||||
resources.ApplyResources(this.label24, "label24");
|
||||
this.label24.Name = "label24";
|
||||
//
|
||||
// txtParkedAlt
|
||||
//
|
||||
resources.ApplyResources(this.txtParkedAlt, "txtParkedAlt");
|
||||
this.txtParkedAlt.Name = "txtParkedAlt";
|
||||
this.txtParkedAlt.TextChanged += new System.EventHandler(this.txtParkedAlt_TextChanged);
|
||||
//
|
||||
// txtParkedAz
|
||||
//
|
||||
resources.ApplyResources(this.txtParkedAz, "txtParkedAz");
|
||||
this.txtParkedAz.Name = "txtParkedAz";
|
||||
this.txtParkedAz.TextChanged += new System.EventHandler(this.txtParkedAz_TextChanged);
|
||||
//
|
||||
// label25
|
||||
//
|
||||
resources.ApplyResources(this.label25, "label25");
|
||||
this.label25.Name = "label25";
|
||||
//
|
||||
// txtFocalLength
|
||||
//
|
||||
resources.ApplyResources(this.txtFocalLength, "txtFocalLength");
|
||||
this.txtFocalLength.Name = "txtFocalLength";
|
||||
this.txtFocalLength.TextChanged += new System.EventHandler(this.txt_FocalLength_TextChanged_1);
|
||||
//
|
||||
// label26
|
||||
//
|
||||
resources.ApplyResources(this.label26, "label26");
|
||||
this.label26.Name = "label26";
|
||||
//
|
||||
// label27
|
||||
//
|
||||
resources.ApplyResources(this.label27, "label27");
|
||||
this.label27.Name = "label27";
|
||||
//
|
||||
// txtApertureDiameter
|
||||
//
|
||||
resources.ApplyResources(this.txtApertureDiameter, "txtApertureDiameter");
|
||||
this.txtApertureDiameter.Name = "txtApertureDiameter";
|
||||
//
|
||||
// label28
|
||||
//
|
||||
resources.ApplyResources(this.label28, "label28");
|
||||
this.label28.Name = "label28";
|
||||
//
|
||||
// label29
|
||||
//
|
||||
resources.ApplyResources(this.label29, "label29");
|
||||
this.label29.Name = "label29";
|
||||
this.label29.Click += new System.EventHandler(this.label29_Click);
|
||||
//
|
||||
// txtApertureArea
|
||||
//
|
||||
resources.ApplyResources(this.txtApertureArea, "txtApertureArea");
|
||||
this.txtApertureArea.Name = "txtApertureArea";
|
||||
//
|
||||
// label30
|
||||
//
|
||||
resources.ApplyResources(this.label30, "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
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
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.txtApertureArea);
|
||||
this.Controls.Add(this.label30);
|
||||
this.Controls.Add(this.label27);
|
||||
this.Controls.Add(this.txtApertureDiameter);
|
||||
this.Controls.Add(this.label28);
|
||||
this.Controls.Add(this.label26);
|
||||
this.Controls.Add(this.txtFocalLength);
|
||||
this.Controls.Add(this.label25);
|
||||
this.Controls.Add(this.txtParkedAz);
|
||||
this.Controls.Add(this.txtParkedAlt);
|
||||
this.Controls.Add(this.label24);
|
||||
this.Controls.Add(this.label23);
|
||||
this.Controls.Add(this.label22);
|
||||
this.Controls.Add(this.cboParkedBehaviour);
|
||||
this.Controls.Add(this.cbxSendDateTime);
|
||||
this.Controls.Add(this.label21);
|
||||
this.Controls.Add(this.label20);
|
||||
this.Controls.Add(this.label19);
|
||||
this.Controls.Add(this.label18);
|
||||
this.Controls.Add(this.label17);
|
||||
this.Controls.Add(this.cboHandShake);
|
||||
this.Controls.Add(this.cboSpeed);
|
||||
this.Controls.Add(this.cboParity);
|
||||
this.Controls.Add(this.numDatabits);
|
||||
this.Controls.Add(this.cboStopBits);
|
||||
this.Controls.Add(this.label16);
|
||||
this.Controls.Add(this.label15);
|
||||
this.Controls.Add(this.nudSettleTime);
|
||||
this.Controls.Add(this.label14);
|
||||
this.Controls.Add(this.label13);
|
||||
this.Controls.Add(this.txtElevation);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.cbxRtsDtr);
|
||||
this.Controls.Add(this.cbxDynamicBreaking);
|
||||
this.Controls.Add(this.cbxReverseDirection);
|
||||
this.Controls.Add(this.label11);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.txtBacklashSteps);
|
||||
this.Controls.Add(this.label9);
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.cboGuidingStyle);
|
||||
this.Controls.Add(this.label6);
|
||||
this.Controls.Add(this.cboPrecision);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.lblPercentOfSiderealRate);
|
||||
@@ -152,8 +541,11 @@ namespace ASCOM.Meade.net
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "SetupDialogForm";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.TopMost = true;
|
||||
this.Shown += new System.EventHandler(this.SetupDialogForm_Shown);
|
||||
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numDatabits)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -161,18 +553,67 @@ namespace ASCOM.Meade.net
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button cmdOK;
|
||||
private System.Windows.Forms.Button cmdCancel;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.PictureBox picASCOM;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.CheckBox chkTrace;
|
||||
private System.Windows.Forms.ComboBox comboBoxComPort;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox txtGuideRate;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label lblPercentOfSiderealRate;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.ComboBox cboPrecision;
|
||||
private Button cmdOK;
|
||||
private Button cmdCancel;
|
||||
private Label label1;
|
||||
private PictureBox picASCOM;
|
||||
private Label label2;
|
||||
private CheckBox chkTrace;
|
||||
private ComboBox comboBoxComPort;
|
||||
private Label label3;
|
||||
private TextBox txtGuideRate;
|
||||
private Label label4;
|
||||
private Label lblPercentOfSiderealRate;
|
||||
private Label label5;
|
||||
private ComboBox cboPrecision;
|
||||
private Label label6;
|
||||
private ComboBox cboGuidingStyle;
|
||||
private Label label7;
|
||||
private Label label8;
|
||||
private TextBox txtBacklashSteps;
|
||||
private Label label9;
|
||||
private Label label10;
|
||||
private Label label11;
|
||||
private CheckBox cbxReverseDirection;
|
||||
private CheckBox cbxDynamicBreaking;
|
||||
private CheckBox cbxRtsDtr;
|
||||
private ToolTip toolTip1;
|
||||
private Label label12;
|
||||
private TextBox txtElevation;
|
||||
private Label label13;
|
||||
private Label label14;
|
||||
private NumericUpDown nudSettleTime;
|
||||
private Label label15;
|
||||
private Label label16;
|
||||
private ComboBox cboStopBits;
|
||||
private NumericUpDown numDatabits;
|
||||
private ComboBox cboParity;
|
||||
private ComboBox cboSpeed;
|
||||
private ComboBox cboHandShake;
|
||||
private Label label17;
|
||||
private Label label18;
|
||||
private Label label19;
|
||||
private Label label20;
|
||||
private Label label21;
|
||||
private CheckBox cbxSendDateTime;
|
||||
private ComboBox cboParkedBehaviour;
|
||||
private Label label22;
|
||||
private Label label23;
|
||||
private Label label24;
|
||||
private TextBox txtParkedAlt;
|
||||
private TextBox txtParkedAz;
|
||||
private Label label25;
|
||||
private TextBox txtFocalLength;
|
||||
private Label label26;
|
||||
private Label label27;
|
||||
private TextBox txtApertureDiameter;
|
||||
private Label label28;
|
||||
private Label label29;
|
||||
private TextBox txtApertureArea;
|
||||
private Label label30;
|
||||
private Button button1;
|
||||
private TextBox txtTimeout;
|
||||
private Label label31;
|
||||
private Label label32;
|
||||
}
|
||||
}
|
||||
+1530
-45
File diff suppressed because it is too large
Load Diff
+483
-154
@@ -4,18 +4,26 @@
|
||||
// ================
|
||||
//
|
||||
// This class is a container for all shared resources that may be needed
|
||||
// by the drivers served by the Local Server.
|
||||
// by the drivers served by the Local Server.
|
||||
//
|
||||
// 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
|
||||
// Modified by Chris Rowland and Peter Simpson to hamdle multiple hardware devices March 2011
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
@@ -33,7 +41,7 @@ namespace ASCOM.Meade.net
|
||||
private static readonly object LockObject = new object();
|
||||
|
||||
// Shared serial port. This will allow multiple drivers to use one single serial port.
|
||||
private static Serial _sSharedSerial; // Shared serial port
|
||||
private static ISerial _sSharedSerial; // Shared serial port
|
||||
|
||||
//
|
||||
// Public access to shared resources
|
||||
@@ -42,7 +50,7 @@ namespace ASCOM.Meade.net
|
||||
#region single serial port connector
|
||||
|
||||
//
|
||||
// this region shows a way that a single serial port could be connected to by multiple
|
||||
// this region shows a way that a single serial port could be connected to by multiple
|
||||
// drivers.
|
||||
//
|
||||
// Connected is used to handle the connections to the port.
|
||||
@@ -56,30 +64,32 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
|
||||
/// <summary>
|
||||
/// Shared serial port
|
||||
/// Shared serial port. Do not directly access this method.
|
||||
/// </summary>
|
||||
public static Serial SharedSerial => _sSharedSerial ?? (_sSharedSerial = new Serial());
|
||||
public static ISerial SharedSerial
|
||||
{
|
||||
get => _sSharedSerial ?? (_sSharedSerial = new Serial());
|
||||
set => _sSharedSerial = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// number of connections to the shared serial port
|
||||
/// </summary>
|
||||
public static int Connections { get; set; } = 0;
|
||||
public static IProfileFactory ProfileFactory
|
||||
{
|
||||
get => _profileFactory ?? (_profileFactory = new ProfileFactory());
|
||||
set => _profileFactory = value;
|
||||
}
|
||||
|
||||
public static void SendBlind(string message)
|
||||
//todo add code to ensure that there is a minimum gap between commands. 5ms as default.
|
||||
public static void SendBlind(ITraceLogger traceLogger, string message, bool raw = false)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
SharedSerial.ClearBuffers();
|
||||
SharedSerial.Transmit(message);
|
||||
var encodedMessage = raw ? message : $"#:{message}#";
|
||||
traceLogger.LogMessage("SendBlind", $"Transmitting {encodedMessage}", false);
|
||||
SharedSerial.Transmit(encodedMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SendBool(string message)
|
||||
{
|
||||
SharedSerial.ClearBuffers();
|
||||
return SendChar(message) == "1";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Example of a shared SendMessage method, the lock
|
||||
/// prevents different drivers tripping over one another.
|
||||
@@ -87,24 +97,71 @@ namespace ASCOM.Meade.net
|
||||
/// and that the reply will always be terminated by a "#" character.
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="raw"></param>
|
||||
/// <returns></returns>
|
||||
public static string SendString(string message)
|
||||
public static string SendString(ITraceLogger traceLogger, string message, bool raw = false)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
SharedSerial.ClearBuffers();
|
||||
SharedSerial.Transmit(message);
|
||||
return SharedSerial.ReceiveTerminated("#").TrimEnd('#');
|
||||
|
||||
var encodedMessage = raw ? message : $"#:{message}#";
|
||||
traceLogger.LogMessage("SendString", $"Transmitting {encodedMessage}", false);
|
||||
SharedSerial.Transmit(encodedMessage);
|
||||
|
||||
try
|
||||
{
|
||||
var result = SharedSerial.ReceiveTerminated("#");
|
||||
traceLogger.LogMessage("SendString", $"Received {result}", false);
|
||||
return result.TrimEnd('#');
|
||||
}
|
||||
catch (COMException ex)
|
||||
{
|
||||
traceLogger.LogIssue("SendString", ex.Message);
|
||||
if (ex.Message.Contains("Timed out waiting for received data"))
|
||||
throw new TimeoutException(ex.Message, ex);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string SendChar(string message)
|
||||
public static bool SendBool(ITraceLogger traceLogger, string command, bool raw = false)
|
||||
{
|
||||
var result = SendChar(traceLogger, command, raw);
|
||||
|
||||
return result == "1";
|
||||
}
|
||||
|
||||
public static string SendChar(ITraceLogger traceLogger, string command, bool raw = false)
|
||||
{
|
||||
return SendChars(traceLogger, command, raw, count: 1);
|
||||
}
|
||||
|
||||
public static string SendChars(ITraceLogger traceLogger, string command, bool raw = false, int count = 1)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
SharedSerial.ClearBuffers();
|
||||
SharedSerial.Transmit(message);
|
||||
return SharedSerial.ReceiveCounted(1);
|
||||
|
||||
var encodedMessage = raw ? command : $"#:{command}#";
|
||||
traceLogger.LogMessage("SendChars", $"Transmitting {encodedMessage}", false);
|
||||
SharedSerial.Transmit(encodedMessage);
|
||||
|
||||
try
|
||||
{
|
||||
var result = SharedSerial.ReceiveCounted(count);
|
||||
traceLogger.LogMessage("SendChars", $"Received {result}", false);
|
||||
return result;
|
||||
}
|
||||
catch (COMException ex)
|
||||
{
|
||||
traceLogger.LogIssue("SendString", ex.Message);
|
||||
if (ex.Message.Contains("Timed out waiting for received data"))
|
||||
throw new TimeoutException(ex.Message, ex);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,47 +173,14 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
}
|
||||
|
||||
public static string ReadCharacters(int throwAwayCharacters)
|
||||
public static void ReadCharacters(int throwAwayCharacters)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
return SharedSerial.ReceiveCounted(throwAwayCharacters);
|
||||
SharedSerial.ReceiveCounted(throwAwayCharacters);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Example of handling connecting to and disconnection from the
|
||||
/// shared serial port.
|
||||
/// Needs error handling
|
||||
/// the port name etc. needs to be set up first, this could be done by the driver
|
||||
/// checking Connected and if it's false setting up the port before setting connected to true.
|
||||
/// It could also be put here.
|
||||
/// </summary>
|
||||
public static bool Connected
|
||||
{
|
||||
set
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
if (Connections == 0)
|
||||
SharedSerial.Connected = true;
|
||||
Connections++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Connections--;
|
||||
if (Connections <= 0)
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get => SharedSerial.Connected;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Profile
|
||||
@@ -165,42 +189,124 @@ namespace ASCOM.Meade.net
|
||||
|
||||
// Constants used for Profile persistence
|
||||
private const string ComPortProfileName = "COM Port";
|
||||
private const string TimeoutMsName = "Serial Timeout (MS)";
|
||||
private const string RtsDtrProfileName = "Rts / Dtr";
|
||||
private const string TraceStateProfileName = "Trace Level";
|
||||
private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second";
|
||||
private const string PrecisionProfileName = "Precision";
|
||||
private const string GuidingStyleProfileName = "Guiding Style";
|
||||
private const string BacklashCompensationName = "Backlash Compensation";
|
||||
private const string ReverseFocusDirectionName = "Reverse Focuser Direction";
|
||||
private const string DynamicBreakingName = "Dynamic Breaking";
|
||||
private const string SiteElevationName = "Site Elevation";
|
||||
private const string SettleTimeName = "Settle Time";
|
||||
|
||||
private const string SpeedName = "Speed";
|
||||
private const string DataBitsName = "Data Bits";
|
||||
private const string StopBitsName = "Stop Bits";
|
||||
private const string HandShakeName = "Hand Shake";
|
||||
private const string ParityName = "Parity";
|
||||
private const string SendDateTimeName = "Send Date and time on connect";
|
||||
private const string ParkedBehaviourName = "Parked Behaviour";
|
||||
private const string ParkedAltName = "Parked Altitude";
|
||||
private const string ParkedAzimuthName = "Parked Azimuth";
|
||||
private const string FocalLengthName = "Focal Length (mm)";
|
||||
private const string ApertureAreaName = "Aperture Area (mm�)";
|
||||
private const string ApertureDiameterName = "Aperture Diameter (mm)";
|
||||
|
||||
public static void WriteProfile(ProfileProperties profileProperties)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
using (Profile driverProfile = new Profile())
|
||||
using (IProfileWrapper driverProfile = ProfileFactory.Create())
|
||||
{
|
||||
driverProfile.DeviceType = "Telescope";
|
||||
driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString());
|
||||
driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort);
|
||||
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString());
|
||||
driverProfile.WriteValue(DriverId, TimeoutMsName, profileProperties.TimeoutMs.ToString());
|
||||
driverProfile.WriteValue(DriverId, RtsDtrProfileName, profileProperties.RtsDtrEnabled.ToString());
|
||||
driverProfile.WriteValue(DriverId, SpeedName, profileProperties.Speed.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, DataBitsName, profileProperties.DataBits.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, StopBitsName, profileProperties.StopBits);
|
||||
driverProfile.WriteValue(DriverId, HandShakeName, profileProperties.Handshake);
|
||||
driverProfile.WriteValue(DriverId, ParityName, profileProperties.Parity);
|
||||
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision);
|
||||
driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle);
|
||||
driverProfile.WriteValue(DriverId, BacklashCompensationName, profileProperties.BacklashCompensation.ToString());
|
||||
driverProfile.WriteValue(DriverId, ReverseFocusDirectionName, profileProperties.ReverseFocusDirection.ToString());
|
||||
driverProfile.WriteValue(DriverId, DynamicBreakingName, profileProperties.DynamicBreaking.ToString());
|
||||
driverProfile.WriteValue(DriverId, SiteElevationName, profileProperties.SiteElevation.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, SettleTimeName, profileProperties.SettleTime.ToString());
|
||||
driverProfile.WriteValue(DriverId, SendDateTimeName, profileProperties.SendDateTime.ToString());
|
||||
driverProfile.WriteValue(DriverId, ParkedBehaviourName, profileProperties.ParkedBehaviour.GetDescription());
|
||||
driverProfile.WriteValue(DriverId, ParkedAltName, profileProperties.ParkedAlt.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, ParkedAzimuthName, profileProperties.ParkedAz.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, FocalLengthName, profileProperties.FocalLength.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, ApertureAreaName, profileProperties.ApertureArea.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, ApertureDiameterName, profileProperties.ApertureDiameter.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private const string ComPortDefault = "COM1";
|
||||
private const string TimeoutMsDefault = "5000";
|
||||
private const string RtsDtrDefault = "false";
|
||||
private const string TraceStateDefault = "false";
|
||||
private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
private const string PrecisionDefault = "Unchanged";
|
||||
private const string GuidingStyleDefault = "Auto";
|
||||
private const string BacklashCompensationDefault = "3000";
|
||||
private const string ReverseFocuserDiectionDefault = "true";
|
||||
private const string DynamicBreakingDefault = "true";
|
||||
private const string SiteElevationDefault = "0";
|
||||
private const string SettleTimeDefault = "2";
|
||||
private const string SpeedDefault = "9600";
|
||||
private const string DataBitsDefault = "8";
|
||||
private const string StopBitsDefault = "One";
|
||||
private const string HandShakeDefault = "None";
|
||||
private const string ParityDefault = "None";
|
||||
private const string SendDateTimeDefault = "false";
|
||||
private const string ParkedBehaviourDefault = "No Coordinates";
|
||||
private const string ParkedAltDefault = "0";
|
||||
private const string ParkedAzimuthDefault = "180";
|
||||
private const string FocalLengthDefault = "2000";
|
||||
private const string ApertureAreaDefault = "32685";
|
||||
private const string ApertureDiameterDefault = "203";
|
||||
|
||||
public static ProfileProperties ReadProfile()
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
ProfileProperties profileProperties = new ProfileProperties();
|
||||
using (Profile driverProfile = new Profile())
|
||||
using (IProfileWrapper driverProfile = ProfileFactory.Create())
|
||||
{
|
||||
driverProfile.DeviceType = "Telescope";
|
||||
profileProperties.ComPort = driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault);
|
||||
profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault));
|
||||
profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault));
|
||||
profileProperties.TimeoutMs = driverProfile.GetValueInt(DriverId, TimeoutMsName, string.Empty, TimeoutMsDefault);
|
||||
profileProperties.RtsDtrEnabled = driverProfile.GetValueBool(DriverId, RtsDtrProfileName, string.Empty, RtsDtrDefault);
|
||||
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.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault);
|
||||
profileProperties.BacklashCompensation = driverProfile.GetValueInt(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault);
|
||||
profileProperties.ReverseFocusDirection = driverProfile.GetValueBool(DriverId, ReverseFocusDirectionName, string.Empty, ReverseFocuserDiectionDefault);
|
||||
profileProperties.DynamicBreaking = driverProfile.GetValueBool(DriverId, DynamicBreakingName, string.Empty, DynamicBreakingDefault);
|
||||
profileProperties.SiteElevation = driverProfile.GetValueInt(DriverId, SiteElevationName, string.Empty, SiteElevationDefault);
|
||||
profileProperties.SettleTime = driverProfile.GetValueShort(DriverId, SettleTimeName, string.Empty, SettleTimeDefault);
|
||||
profileProperties.StopBits = driverProfile.GetValue(DriverId, StopBitsName, string.Empty, StopBitsDefault);
|
||||
profileProperties.DataBits = driverProfile.GetValueInt(DriverId, DataBitsName, string.Empty, DataBitsDefault);
|
||||
profileProperties.Handshake = driverProfile.GetValue(DriverId, HandShakeName, string.Empty, HandShakeDefault);
|
||||
profileProperties.Speed = driverProfile.GetValueInt(DriverId, SpeedName, string.Empty, SpeedDefault);
|
||||
profileProperties.Parity = driverProfile.GetValue(DriverId, ParityName, string.Empty, ParityDefault);
|
||||
profileProperties.SendDateTime = driverProfile.GetValueBool(DriverId, SendDateTimeName, string.Empty, SendDateTimeDefault);
|
||||
|
||||
profileProperties.ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(driverProfile.GetValue(DriverId, ParkedBehaviourName, string.Empty, ParkedBehaviourDefault));
|
||||
profileProperties.ParkedAlt = driverProfile.GetValueDouble(DriverId, ParkedAltName, string.Empty, ParkedAltDefault);
|
||||
profileProperties.ParkedAz = driverProfile.GetValueDouble(DriverId, ParkedAzimuthName, string.Empty, ParkedAzimuthDefault);
|
||||
profileProperties.FocalLength = driverProfile.GetValueDouble(DriverId, FocalLengthName, string.Empty, FocalLengthDefault);
|
||||
profileProperties.ApertureArea = driverProfile.GetValueDouble(DriverId, ApertureAreaName, string.Empty, ApertureAreaDefault);
|
||||
profileProperties.ApertureDiameter = driverProfile.GetValueDouble(DriverId, ApertureDiameterName, string.Empty, ApertureDiameterDefault);
|
||||
}
|
||||
|
||||
return profileProperties;
|
||||
@@ -213,32 +319,38 @@ namespace ASCOM.Meade.net
|
||||
|
||||
public static void SetupDialog()
|
||||
{
|
||||
// consider only showing the setup dialog if not connected
|
||||
// or call a different dialog if connected
|
||||
if (Connections > 0)
|
||||
try
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Already connected, please disconnect before altering settings");
|
||||
return;
|
||||
}
|
||||
var profileProperties = ReadProfile();
|
||||
|
||||
var profileProperties = ReadProfile();
|
||||
|
||||
using (SetupDialogForm f = new SetupDialogForm())
|
||||
{
|
||||
f.SetProfile(profileProperties);
|
||||
|
||||
var result = f.ShowDialog();
|
||||
if (result == System.Windows.Forms.DialogResult.OK)
|
||||
using (SetupDialogForm f = new SetupDialogForm())
|
||||
{
|
||||
profileProperties = f.GetProfile();
|
||||
f.SetProfile(profileProperties);
|
||||
|
||||
WriteProfile(profileProperties); // Persist device configuration values to the ASCOM Profile store
|
||||
if (IsConnected())
|
||||
{
|
||||
f.SetReadOnlyMode();
|
||||
}
|
||||
|
||||
var result = f.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
profileProperties = f.GetProfile();
|
||||
|
||||
WriteProfile(
|
||||
profileProperties); // Persist device configuration values to the ASCOM Profile store
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Multi Driver handling
|
||||
|
||||
public static string ProductName { get; private set; } = string.Empty;
|
||||
@@ -258,101 +370,235 @@ namespace ASCOM.Meade.net
|
||||
/// The Key is the connection number that identifies the device, it could be the COM port name,
|
||||
/// USB ID or IP Address, the Value is the DeviceHardware class
|
||||
/// </summary>
|
||||
private static readonly Dictionary<string, DeviceHardware> _connectedDevices = new Dictionary<string, DeviceHardware>();
|
||||
private static readonly Dictionary<string, DeviceHardware> ConnectedDevices = new Dictionary<string, DeviceHardware>();
|
||||
|
||||
private static readonly Dictionary<string, DeviceHardware> ConnectedDeviceIds = new Dictionary<string, DeviceHardware>();
|
||||
private static IProfileFactory _profileFactory;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This is called in the driver Connect(true) property,
|
||||
/// it add the device id to the list of devices if it's not there and increments the device count.
|
||||
/// </summary>
|
||||
/// <param name="deviceId"></param>
|
||||
public static void Connect(string deviceId)
|
||||
/// <param name="driverId"></param>
|
||||
/// <param name="traceLogger"></param>
|
||||
public static ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
if (!_connectedDevices.ContainsKey(deviceId))
|
||||
_connectedDevices.Add(deviceId, new DeviceHardware());
|
||||
_connectedDevices[deviceId].Count++; // increment the value
|
||||
if (!ConnectedDevices.ContainsKey(deviceId))
|
||||
ConnectedDevices.Add(deviceId, new DeviceHardware());
|
||||
|
||||
if (!ConnectedDeviceIds.ContainsKey(driverId))
|
||||
ConnectedDeviceIds.Add(driverId, new DeviceHardware());
|
||||
|
||||
if (deviceId == "Serial")
|
||||
{
|
||||
if (_connectedDevices[deviceId].Count == 1)
|
||||
if (ConnectedDevices[deviceId].Count == 0)
|
||||
{
|
||||
var profileProperties = ReadProfile();
|
||||
SharedSerial.PortName = profileProperties.ComPort;
|
||||
SharedSerial.DTREnable = false;
|
||||
SharedSerial.RTSEnable = false;
|
||||
SharedSerial.DataBits = 8;
|
||||
SharedSerial.StopBits = SerialStopBits.One;
|
||||
SharedSerial.Parity = SerialParity.None;
|
||||
SharedSerial.DTREnable = profileProperties.RtsDtrEnabled;
|
||||
SharedSerial.RTSEnable = profileProperties.RtsDtrEnabled;
|
||||
SharedSerial.DataBits = profileProperties.DataBits;
|
||||
SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits);
|
||||
SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity);
|
||||
SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake);
|
||||
SharedSerial.ReceiveTimeoutMs = profileProperties.TimeoutMs;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
SharedSerial.Handshake = SerialHandshake.None;
|
||||
|
||||
var wantedSpeed = (SerialSpeed)profileProperties.Speed;
|
||||
if (wantedSpeed != SerialSpeed.ps9600)
|
||||
{
|
||||
SharedSerial.Speed = wantedSpeed;
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
var speedRampNeeded = false;
|
||||
|
||||
//Test if communication is working.
|
||||
try
|
||||
{
|
||||
string utcOffSet = SendString( traceLogger, "GG");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
speedRampNeeded = true;
|
||||
}
|
||||
|
||||
if (speedRampNeeded)
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
int newSpeedIndex = GetSpeedIndex(wantedSpeed);
|
||||
//:SBn# Set Baud Rate n, where n is an ASCII digit (1..9) with the following interpertation
|
||||
// 1 56.7K
|
||||
// 2 38.4K
|
||||
// 3 28.8K
|
||||
// 4 19.2K
|
||||
// 5 14.4K
|
||||
// 6 9600
|
||||
// 7 4800
|
||||
// 8 2400
|
||||
// 9 1200
|
||||
//Returns:
|
||||
// 1 At the current baud rate and then changes to the new rate for further communication
|
||||
//SendBlind($"SB{newSpeedIndex}");
|
||||
try
|
||||
{
|
||||
var speedChanged = SendChar(traceLogger, $"SB{newSpeedIndex}");
|
||||
if (speedChanged == "1")
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
SharedSerial.Speed = wantedSpeed;
|
||||
traceLogger.LogIssue("Connect",
|
||||
$"Telescope serial port speed change, connecting at {SharedSerial.Speed}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Autostar not signalled speed change.");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
traceLogger.LogIssue("Connect", $"Telescope not responding to speed change, connecting at {SharedSerial.Speed}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
ProductName = SendString(":GVP#");
|
||||
FirmwareVersion = SendString(":GVN#");
|
||||
try
|
||||
{
|
||||
ProductName = SendString(traceLogger, "GVP");
|
||||
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)
|
||||
{
|
||||
traceLogger.LogIssue("Connect", $"Error getting telescope information \"{ex.Message}\" setting to LX200 Classic mode.");
|
||||
ProductName = TelescopeList.LX200CLASSIC;
|
||||
FirmwareVersion = "Unknown";
|
||||
}
|
||||
|
||||
if (ProductName == ":GVP")
|
||||
{
|
||||
traceLogger.LogIssue("Connect", "Serial port is looping back data, something is wrong with the hardware.");
|
||||
//This means that the serial port is looping back what's been sent, something is very wrong.
|
||||
SharedSerial.Connected = false;
|
||||
|
||||
throw new Exception("Serial port is looping back data, something is wrong with the hardware.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string utcOffSet = SendString(traceLogger, "GG");
|
||||
//:GG# Get UTC offset time
|
||||
//Returns: sHH# or sHH.H#
|
||||
//The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the
|
||||
//sHH# form is returned, otherwise the longer form is returned.
|
||||
if (!double.TryParse(utcOffSet, out var utcOffsetHours))
|
||||
{
|
||||
var message = "Unable to decode response from the telescope, This is likely a hardware serial communications error.";
|
||||
traceLogger.LogIssue("Connect", message);
|
||||
throw new Exception(message);
|
||||
}
|
||||
|
||||
traceLogger.LogMessage("Connect", $"Offset from UTC: {utcOffsetHours}", false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new ArgumentException($"deviceId {deviceId} not currently supported");
|
||||
|
||||
ConnectedDevices[deviceId].Count++; // increment the value
|
||||
ConnectedDeviceIds[driverId].Count++; // increment the value
|
||||
|
||||
return new ConnectionInfo
|
||||
{
|
||||
//Connections = ConnectedDevices[deviceId].Count,
|
||||
SameDevice = ConnectedDeviceIds[driverId].Count
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static void Disconnect(string deviceId)
|
||||
private static int GetSpeedIndex(SerialSpeed speed)
|
||||
{
|
||||
switch (speed)
|
||||
{
|
||||
case SerialSpeed.ps57600: return 1;
|
||||
case SerialSpeed.ps38400: return 2;
|
||||
case SerialSpeed.ps28800: return 3;
|
||||
case SerialSpeed.ps19200: return 4;
|
||||
case SerialSpeed.ps14400: return 5;
|
||||
case SerialSpeed.ps9600: return 6;
|
||||
case SerialSpeed.ps4800: return 7;
|
||||
case SerialSpeed.ps2400: return 8;
|
||||
case SerialSpeed.ps1200: return 9;
|
||||
default: throw new NotSupportedException($"{SpeedDefault} not supported");
|
||||
}
|
||||
}
|
||||
|
||||
public static void Disconnect(string deviceId, string driverId)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
if (_connectedDevices.ContainsKey(deviceId))
|
||||
if (ConnectedDevices.ContainsKey(deviceId))
|
||||
{
|
||||
_connectedDevices[deviceId].Count--;
|
||||
if (_connectedDevices[deviceId].Count <= 0)
|
||||
ConnectedDevices[deviceId].Count--;
|
||||
if (ConnectedDevices[deviceId].Count <= 0)
|
||||
{
|
||||
_connectedDevices.Remove(deviceId);
|
||||
ConnectedDevices.Remove(deviceId);
|
||||
if (deviceId == "Serial")
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ConnectedDeviceIds.ContainsKey(driverId))
|
||||
{
|
||||
ConnectedDeviceIds[driverId].Count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsConnected(string deviceId)
|
||||
private static bool IsConnected()
|
||||
{
|
||||
if (_connectedDevices.ContainsKey(deviceId))
|
||||
return (_connectedDevices[deviceId].Count > 0);
|
||||
else
|
||||
return false;
|
||||
foreach (var device in ConnectedDevices)
|
||||
{
|
||||
if (device.Value.Count > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static void Lock(Action action)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
public static T Lock<T>(Func<T> func)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
return func();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Skeleton of a hardware class, all this does is hold a count of the connections,
|
||||
/// in reality extra code will be needed to handle the hardware in some way
|
||||
/// </summary>
|
||||
public class DeviceHardware
|
||||
private class DeviceHardware
|
||||
{
|
||||
private int _count;
|
||||
|
||||
internal int Count
|
||||
{
|
||||
set => _count = value;
|
||||
get => _count;
|
||||
}
|
||||
internal int Count { set; get; }
|
||||
|
||||
internal DeviceHardware()
|
||||
{
|
||||
@@ -360,30 +606,113 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
}
|
||||
|
||||
//#region ServedClassName attribute
|
||||
///// <summary>
|
||||
///// This is only needed if the driver is targeted at platform 5.5, it is included with Platform 6
|
||||
///// </summary>
|
||||
//[global::System.AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
|
||||
//public sealed class ServedClassNameAttribute : Attribute
|
||||
//{
|
||||
// // See the attribute guidelines at
|
||||
// // http://go.microsoft.com/fwlink/?LinkId=85236
|
||||
public static void SetParked(bool atPark, ParkedPosition parkedPosition, bool restartTracking)
|
||||
{
|
||||
IsParked = atPark;
|
||||
ParkedPosition = parkedPosition;
|
||||
RestartTracking = restartTracking;
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// Gets or sets the 'friendly name' of the served class, as registered with the ASCOM Chooser.
|
||||
// /// </summary>
|
||||
// /// <value>The 'friendly name' of the served class.</value>
|
||||
// public string DisplayName { get; private set; }
|
||||
// /// <summary>
|
||||
// /// Initializes a new instance of the <see cref="ServedClassNameAttribute"/> class.
|
||||
// /// </summary>
|
||||
// /// <param name="servedClassName">The 'friendly name' of the served class.</param>
|
||||
// public ServedClassNameAttribute(string servedClassName)
|
||||
// {
|
||||
// DisplayName = servedClassName;
|
||||
// }
|
||||
//}
|
||||
//#endregion
|
||||
private static readonly ThreadSafeValue<bool> _restartTracking = false;
|
||||
public static bool RestartTracking
|
||||
{
|
||||
get => _restartTracking;
|
||||
private set => _restartTracking.Set(value);
|
||||
}
|
||||
|
||||
private static ParkedPosition _parkedPosition;
|
||||
public static ParkedPosition ParkedPosition
|
||||
{
|
||||
get => _parkedPosition;
|
||||
private set => Interlocked.Exchange(ref _parkedPosition, value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isParked = false;
|
||||
public static bool IsParked
|
||||
{
|
||||
get => _isParked;
|
||||
private set => _isParked.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<AlignmentModes> _alignmentMode = AlignmentModes.algAltAz;
|
||||
public static AlignmentModes AlignmentMode
|
||||
{
|
||||
get => _alignmentMode;
|
||||
set => _alignmentMode.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<PierSide> _sideOfPier = PierSide.pierUnknown;
|
||||
/// <summary>
|
||||
/// Start with <see cref="PierSide.pierUnknown"/>.
|
||||
/// As we do not know the physical declination axis position, we have to keep track manually.
|
||||
/// </summary>
|
||||
public static PierSide SideOfPier
|
||||
{
|
||||
get => _sideOfPier;
|
||||
internal set => _sideOfPier.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<double?> _targetRightAscension = null as double?;
|
||||
public static double? TargetRightAscension
|
||||
{
|
||||
get => _targetRightAscension;
|
||||
internal set => _targetRightAscension.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<double?> _targetDeclination = null as double?;
|
||||
public static double? TargetDeclination
|
||||
{
|
||||
get => _targetDeclination;
|
||||
internal set => _targetDeclination.Set(value);
|
||||
}
|
||||
|
||||
private static int _slewSettleTime;
|
||||
public static short SlewSettleTime
|
||||
{
|
||||
get => Convert.ToInt16(_slewSettleTime);
|
||||
internal set => Interlocked.Exchange(ref _slewSettleTime, value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isLongFormat = false;
|
||||
public static bool IsLongFormat
|
||||
{
|
||||
get => _isLongFormat;
|
||||
internal set => _isLongFormat.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _movingPrimary = false;
|
||||
public static bool MovingPrimary
|
||||
{
|
||||
get => _movingPrimary;
|
||||
internal set => _movingPrimary.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _movingSecondary = false;
|
||||
public static bool MovingSecondary
|
||||
{
|
||||
get => _movingSecondary;
|
||||
internal set => _movingSecondary.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<DateTime> _earliestNonSlewingTime = DateTime.MinValue;
|
||||
public static DateTime EarliestNonSlewingTime
|
||||
{
|
||||
get => _earliestNonSlewingTime;
|
||||
internal set => _earliestNonSlewingTime.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isTargetCoordinateInitRequired = true;
|
||||
public static bool IsTargetCoordinateInitRequired
|
||||
{
|
||||
get => _isTargetCoordinateInitRequired;
|
||||
internal set => _isTargetCoordinateInitRequired.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isGuiding = false;
|
||||
public static bool IsGuiding
|
||||
{
|
||||
get => _isGuiding;
|
||||
internal set => _isGuiding.Set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
-13
@@ -1,29 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public static class TelescopeList
|
||||
{
|
||||
#region Autostar 497/Audiostar
|
||||
|
||||
public readonly static string Autostar497 = "Autostar";
|
||||
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";
|
||||
|
||||
//Autostar/Audiostar firmware revisions
|
||||
public readonly static string Autostar497_30Ee = "30Ee";
|
||||
public readonly static string Autostar497_31Ee = "31Ee";
|
||||
public readonly static string Autostar497_43Eg = "43Eg";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string Autostar497_30Ee = "30Ee";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string Autostar497_31Ee = "31Ee";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string Autostar497_43Eg = "43Eg";
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string AudioStar_A1F7 = "A1F7";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string AudioStar_A4S4 = "A4S4";
|
||||
#endregion
|
||||
|
||||
#region LX200GPS
|
||||
|
||||
public readonly static string LX200GPS = "LX2001";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string LX200GPS = "LX2001";
|
||||
|
||||
public readonly static string LX200GPS_42G = "4.2G";
|
||||
public const string LX200GPS_42F = "4.2f";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
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
|
||||
|
||||
#region LX200EMC
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported!
|
||||
#endregion
|
||||
|
||||
#region LXD600
|
||||
public const string LXD600 = "LXD600";
|
||||
|
||||
public const string LXD600_6_12S = "6.12S";
|
||||
|
||||
#endregion
|
||||
|
||||
#region RCX400
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string RCX400 = "RCX400";
|
||||
|
||||
public const string RCX400_22I = "2.2i";
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using JetBrains.Annotations;
|
||||
using System.Threading;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class ThreadSafeValue<T>
|
||||
{
|
||||
private object _value;
|
||||
|
||||
public ThreadSafeValue(in T value) => _value = value;
|
||||
|
||||
public void Set(in T value) => Interlocked.Exchange(ref _value, value);
|
||||
|
||||
public static implicit operator ThreadSafeValue<T>(in T value) => new ThreadSafeValue<T>(value);
|
||||
|
||||
public static implicit operator T([NotNull] ThreadSafeValue<T> @this) => (T)(@this?._value ?? default);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
internal static class Win32Utilities
|
||||
{
|
||||
//Win32 API calls necesary to raise an unowned processs main window
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
|
||||
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool IsIconic(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
private static extern bool SystemParametersInfo(uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni);
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr lpdwProcessId);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetForegroundWindow();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
static extern bool BringWindowToTop(IntPtr hWnd);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, Int32 nMaxCount);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private static extern int GetWindowThreadProcessId(IntPtr hWnd, ref Int32 lpdwProcessId);
|
||||
|
||||
[DllImport("User32.dll")]
|
||||
public static extern IntPtr GetParent(IntPtr hWnd);
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const int SW_HIDE = 0;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWNORMAL = 1;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const int SW_NORMAL = 1;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWMINIMIZED = 2;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWMAXIMIZED = 3;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const int SW_MAXIMIZE = 3;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWNOACTIVATE = 4;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
private const int SW_SHOW = 5;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const int SW_MINIMIZE = 6;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWMINNOACTIVE = 7;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWNA = 8;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
private const int SW_RESTORE = 9;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SW_SHOWDEFAULT = 10;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once UnusedMember.Local
|
||||
private const int SW_MAX = 10;
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const uint SPI_GETFOREGROUNDLOCKTIMEOUT = 0x2000;
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const uint SPI_SETFOREGROUNDLOCKTIMEOUT = 0x2001;
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once IdentifierTypo
|
||||
private const int SPIF_SENDCHANGE = 0x2;
|
||||
|
||||
|
||||
public static void BringWindowToFront(IntPtr hWnd)
|
||||
{
|
||||
if (IsIconic(hWnd))
|
||||
ShowWindowAsync(hWnd, SW_RESTORE);
|
||||
|
||||
ShowWindowAsync(hWnd, SW_SHOW);
|
||||
|
||||
SetForegroundWindow(hWnd);
|
||||
|
||||
// Code from Karl E. Peterson, www.mvps.org/vb/sample.htm
|
||||
// Converted to Delphi by Ray Lischner
|
||||
// Published in The Delphi Magazine 55, page 16
|
||||
// Converted to C# by Kevin Gale
|
||||
IntPtr foregroundWindow = GetForegroundWindow();
|
||||
IntPtr dummy = IntPtr.Zero;
|
||||
|
||||
uint foregroundThreadId = GetWindowThreadProcessId(foregroundWindow, dummy);
|
||||
|
||||
uint thisThreadId = GetWindowThreadProcessId(hWnd, dummy);
|
||||
|
||||
if (AttachThreadInput(thisThreadId, foregroundThreadId, true))
|
||||
{
|
||||
BringWindowToTop(hWnd); // IE 5.5 related hack
|
||||
SetForegroundWindow(hWnd);
|
||||
AttachThreadInput(thisThreadId, foregroundThreadId, false);
|
||||
}
|
||||
|
||||
if (GetForegroundWindow() != hWnd)
|
||||
{
|
||||
// Code by Daniel P. Stasinski
|
||||
// Converted to C# by Kevin Gale
|
||||
IntPtr timeout = IntPtr.Zero;
|
||||
SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, timeout, 0);
|
||||
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, dummy, SPIF_SENDCHANGE);
|
||||
BringWindowToTop(hWnd); // IE 5.5 related hack
|
||||
SetForegroundWindow(hWnd);
|
||||
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, timeout, SPIF_SENDCHANGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net.Wrapper
|
||||
{
|
||||
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
|
||||
{
|
||||
private readonly Profile _profile = new Profile();
|
||||
|
||||
public ArrayList RegisteredDevices(string deviceType)
|
||||
{
|
||||
return _profile.RegisteredDevices(deviceType);
|
||||
}
|
||||
|
||||
public bool IsRegistered(string driverId)
|
||||
{
|
||||
return _profile.IsRegistered(driverId);
|
||||
}
|
||||
|
||||
public void Register(string driverId, string descriptiveName)
|
||||
{
|
||||
_profile.Register(driverId, descriptiveName);
|
||||
}
|
||||
|
||||
public void Unregister(string driverId)
|
||||
{
|
||||
_profile.Unregister(driverId);
|
||||
}
|
||||
|
||||
public string GetValue(string driverId, string name, string subKey, string defaultValue)
|
||||
{
|
||||
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)
|
||||
{
|
||||
_profile.WriteValue(driverId, name, value);
|
||||
}
|
||||
|
||||
public ArrayList Values(string driverId, string subKey)
|
||||
{
|
||||
return _profile.Values(driverId, subKey);
|
||||
}
|
||||
|
||||
public void DeleteValue(string driverId, string name, string subKey)
|
||||
{
|
||||
_profile.DeleteValue(driverId, name, subKey);
|
||||
}
|
||||
|
||||
public void CreateSubKey(string driverId, string subKey)
|
||||
{
|
||||
_profile.CreateSubKey(driverId, subKey);
|
||||
}
|
||||
|
||||
public ArrayList SubKeys(string driverId, string subKey)
|
||||
{
|
||||
return _profile.SubKeys(driverId, subKey);
|
||||
}
|
||||
|
||||
public void DeleteSubKey(string driverId, string subKey)
|
||||
{
|
||||
_profile.DeleteSubKey(driverId, subKey);
|
||||
}
|
||||
|
||||
public string GetProfileXML(string deviceId)
|
||||
{
|
||||
return _profile.GetProfileXML(deviceId);
|
||||
}
|
||||
|
||||
public void SetProfileXML(string deviceId, string xml)
|
||||
{
|
||||
_profile.SetProfileXML(deviceId, xml);
|
||||
}
|
||||
|
||||
public string DeviceType
|
||||
{
|
||||
get => _profile.DeviceType;
|
||||
set => _profile.DeviceType = value;
|
||||
}
|
||||
public ArrayList RegisteredDeviceTypes => _profile.RegisteredDeviceTypes;
|
||||
|
||||
public void MigrateProfile(string currentPlatformVersion)
|
||||
{
|
||||
_profile.MigrateProfile(currentPlatformVersion);
|
||||
}
|
||||
|
||||
public void DeleteValue(string driverId, string name)
|
||||
{
|
||||
_profile.DeleteValue(driverId, name);
|
||||
}
|
||||
|
||||
public string GetValue(string driverId, string name)
|
||||
{
|
||||
return _profile.GetValue(driverId, name);
|
||||
}
|
||||
|
||||
public string GetValue(string driverId, string name, string subKey)
|
||||
{
|
||||
return _profile.GetValue(driverId, name, subKey);
|
||||
}
|
||||
|
||||
public ArrayList SubKeys(string driverId)
|
||||
{
|
||||
return _profile.SubKeys(driverId);
|
||||
}
|
||||
|
||||
public ArrayList Values(string driverId)
|
||||
{
|
||||
return _profile.Values(driverId);
|
||||
}
|
||||
|
||||
public void WriteValue(string driverId, string name, string value)
|
||||
{
|
||||
_profile.WriteValue(driverId, name, value);
|
||||
}
|
||||
|
||||
public ASCOMProfile GetProfile(string driverId)
|
||||
{
|
||||
return _profile.GetProfile(driverId);
|
||||
}
|
||||
|
||||
public void SetProfile(string driverId, ASCOMProfile xmlProfileKey)
|
||||
{
|
||||
_profile.SetProfile(driverId, xmlProfileKey);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_profile.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,23 @@
|
||||
using System;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net.Wrapper
|
||||
{
|
||||
public interface ISharedResourcesWrapper
|
||||
{
|
||||
void Connect(string deviceId);
|
||||
void Disconnect(string deviceId);
|
||||
ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger);
|
||||
void Disconnect(string deviceId, string driverId);
|
||||
|
||||
string ProductName { get; }
|
||||
|
||||
string FirmwareVersion { get; }
|
||||
|
||||
void Lock(Action action);
|
||||
T Lock<T>(Func<T> func);
|
||||
|
||||
string SendString(string message);
|
||||
void SendBlind(string message);
|
||||
string SendChar(string message);
|
||||
|
||||
string SendString(ITraceLogger traceLogger, string message, bool raw = false);
|
||||
void SendBlind(ITraceLogger traceLogger, string message, bool raw = false);
|
||||
bool SendBool(ITraceLogger traceLogger, string command, bool raw = false);
|
||||
string SendChar(ITraceLogger traceLogger, string message, bool raw = false);
|
||||
string SendChars(ITraceLogger traceLogger, string message, bool raw = false, int count = 1);
|
||||
|
||||
string ReadTerminated();
|
||||
|
||||
@@ -24,48 +25,70 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
|
||||
void SetupDialog();
|
||||
void WriteProfile(ProfileProperties profileProperties);
|
||||
string ReadCharacters(int throwAwayCharacters);
|
||||
void ReadCharacters(int throwAwayCharacters);
|
||||
|
||||
void SetParked(bool atPark, ParkedPosition parkedPosition, bool restartTracking);
|
||||
bool IsParked { get; }
|
||||
ParkedPosition ParkedPosition { get; }
|
||||
bool RestartTracking { get; }
|
||||
|
||||
double? TargetRightAscension { get; set; }
|
||||
double? TargetDeclination { get; set; }
|
||||
|
||||
short SlewSettleTime { get; set; }
|
||||
|
||||
bool IsLongFormat { get; set; }
|
||||
|
||||
bool MovingPrimary { get; set; }
|
||||
|
||||
bool MovingSecondary { get; set; }
|
||||
|
||||
DateTime EarliestNonSlewingTime { get; set; }
|
||||
|
||||
bool IsTargetCoordinateInitRequired { get; set; }
|
||||
|
||||
bool IsGuiding { get; set; }
|
||||
}
|
||||
|
||||
public class SharedResourcesWrapper : ISharedResourcesWrapper
|
||||
{
|
||||
public void Connect(string deviceId)
|
||||
public ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger)
|
||||
{
|
||||
SharedResources.Connect( deviceId);
|
||||
return SharedResources.Connect(deviceId, driverId, traceLogger);
|
||||
}
|
||||
|
||||
public void Disconnect(string deviceId)
|
||||
public void Disconnect(string deviceId, string driverId)
|
||||
{
|
||||
SharedResources.Disconnect(deviceId);
|
||||
SharedResources.Disconnect(deviceId, driverId);
|
||||
}
|
||||
|
||||
public string ProductName => SharedResources.ProductName;
|
||||
|
||||
public string FirmwareVersion => SharedResources.FirmwareVersion;
|
||||
|
||||
public void Lock(Action action)
|
||||
public string SendString(ITraceLogger traceLogger, string message, bool raw = false)
|
||||
{
|
||||
SharedResources.Lock(action);
|
||||
return SharedResources.SendString(traceLogger, message, raw);
|
||||
}
|
||||
|
||||
public T Lock<T>(Func<T> func)
|
||||
public void SendBlind(ITraceLogger traceLogger, string message, bool raw = false)
|
||||
{
|
||||
return SharedResources.Lock(func);
|
||||
SharedResources.SendBlind(traceLogger, message, raw);
|
||||
}
|
||||
|
||||
public string SendString(string message)
|
||||
public bool SendBool(ITraceLogger traceLogger, string command, bool raw = false)
|
||||
{
|
||||
return SharedResources.SendString(message);
|
||||
return SharedResources.SendBool(traceLogger, command, raw);
|
||||
}
|
||||
|
||||
public void SendBlind(string message)
|
||||
public string SendChar(ITraceLogger traceLogger, string message, bool raw = false)
|
||||
{
|
||||
SharedResources.SendBlind(message);
|
||||
return SharedResources.SendChar(traceLogger, message, raw);
|
||||
}
|
||||
|
||||
public string SendChar(string message)
|
||||
public string SendChars(ITraceLogger traceLogger, string message, bool raw = false, int count = 1)
|
||||
{
|
||||
return SharedResources.SendChar(message);
|
||||
return SharedResources.SendChars(traceLogger, message, raw, count);
|
||||
}
|
||||
|
||||
public string ReadTerminated()
|
||||
@@ -73,9 +96,9 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
return SharedResources.ReadTerminated();
|
||||
}
|
||||
|
||||
public string ReadCharacters(int throwAwayCharacters)
|
||||
public void ReadCharacters(int throwAwayCharacters)
|
||||
{
|
||||
return SharedResources.ReadCharacters(throwAwayCharacters);
|
||||
SharedResources.ReadCharacters(throwAwayCharacters);
|
||||
}
|
||||
|
||||
public ProfileProperties ReadProfile()
|
||||
@@ -92,5 +115,76 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
{
|
||||
SharedResources.WriteProfile(profileProperties);
|
||||
}
|
||||
|
||||
public void SetParked(bool atPark, ParkedPosition parkedPosition, bool restartTracking)
|
||||
{
|
||||
SharedResources.SetParked(atPark, parkedPosition, restartTracking);
|
||||
}
|
||||
|
||||
public bool IsParked => SharedResources.IsParked;
|
||||
|
||||
public bool RestartTracking => SharedResources.RestartTracking;
|
||||
|
||||
public ParkedPosition ParkedPosition => SharedResources.ParkedPosition;
|
||||
|
||||
public PierSide SideOfPier
|
||||
{
|
||||
get => SharedResources.SideOfPier;
|
||||
set => SharedResources.SideOfPier = value;
|
||||
}
|
||||
|
||||
public double? TargetRightAscension
|
||||
{
|
||||
get => SharedResources.TargetRightAscension;
|
||||
set => SharedResources.TargetRightAscension = value;
|
||||
}
|
||||
|
||||
public double? TargetDeclination
|
||||
{
|
||||
get => SharedResources.TargetDeclination;
|
||||
set => SharedResources.TargetDeclination = value;
|
||||
}
|
||||
|
||||
public short SlewSettleTime
|
||||
{
|
||||
get => SharedResources.SlewSettleTime;
|
||||
set => SharedResources.SlewSettleTime = value;
|
||||
}
|
||||
|
||||
public bool IsLongFormat
|
||||
{
|
||||
get => SharedResources.IsLongFormat;
|
||||
set => SharedResources.IsLongFormat = value;
|
||||
}
|
||||
|
||||
public bool MovingPrimary
|
||||
{
|
||||
get => SharedResources.MovingPrimary;
|
||||
set => SharedResources.MovingPrimary = value;
|
||||
}
|
||||
|
||||
public bool MovingSecondary
|
||||
{
|
||||
get => SharedResources.MovingSecondary;
|
||||
set => SharedResources.MovingSecondary = value;
|
||||
}
|
||||
|
||||
public DateTime EarliestNonSlewingTime
|
||||
{
|
||||
get => SharedResources.EarliestNonSlewingTime;
|
||||
set => SharedResources.EarliestNonSlewingTime = value;
|
||||
}
|
||||
|
||||
public bool IsTargetCoordinateInitRequired
|
||||
{
|
||||
get => SharedResources.IsTargetCoordinateInitRequired;
|
||||
set => SharedResources.IsTargetCoordinateInitRequired = value;
|
||||
}
|
||||
|
||||
public bool IsGuiding
|
||||
{
|
||||
get => SharedResources.IsGuiding;
|
||||
set => SharedResources.IsGuiding = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
|
||||
|
||||
Generated
+4
-3
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
@@ -7,7 +8,7 @@ namespace ASCOM.Meade.net
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
private IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
@@ -56,7 +57,7 @@ namespace ASCOM.Meade.net
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private Label label1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user