Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
@@ -56,8 +56,8 @@
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.12.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.12.0\lib\net45\Moq.dll</HintPath>
|
||||
<Reference Include="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
@@ -65,8 +65,8 @@
|
||||
<Reference Include="System" />
|
||||
<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.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?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="Moq" version="4.13.0" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ASCOM.MeadeGeneric</RootNamespace>
|
||||
<AssemblyName>ASCOM.MeadeGeneric.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -54,6 +54,7 @@
|
||||
<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" />
|
||||
|
||||
@@ -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.5"/></startup></configuration>
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Meade.net.Focuser.UnitTests
|
||||
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(firmware);
|
||||
_focuser.Connected = true;
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect("Serial", It.IsAny<string>()), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect("Serial", It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
|
||||
}
|
||||
|
||||
|
||||
@@ -189,20 +189,20 @@ namespace Meade.net.Focuser.UnitTests
|
||||
public void Connected_Set_SettingTrueWhenTrue_ThenDoesNothing()
|
||||
{
|
||||
ConnectFocuser();
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect(It.IsAny<string>(), It.IsAny<string>()), Times.Once);
|
||||
_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>()), Times.Once);
|
||||
_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>()), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Connect(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
|
||||
|
||||
//act
|
||||
_focuser.Connected = false;
|
||||
@@ -401,13 +401,13 @@ namespace Meade.net.Focuser.UnitTests
|
||||
|
||||
if (position < 0)
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":F-#"), Times.AtLeastOnce);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never);
|
||||
_sharedResourcesWrapperMock.Verify( x => x.SendBlind("#:F-#"), Times.AtLeastOnce);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Never);
|
||||
}
|
||||
else
|
||||
{
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Never);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.AtLeastOnce);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F-#"), Times.Never);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.AtLeastOnce);
|
||||
}
|
||||
|
||||
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once);
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\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="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
@@ -80,8 +80,8 @@
|
||||
<Reference Include="System" />
|
||||
<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.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -2,8 +2,8 @@
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
||||
<package id="Moq" version="4.12.0" targetFramework="net472" />
|
||||
<package id="Moq" version="4.13.0" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -25,9 +25,9 @@
|
||||
<![CDATA[Installed OR ASCOMPLATFORMVERSION >= "6.4.1"]]>
|
||||
</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="NETFRAMEWORK45"/>
|
||||
<Condition Message="This application requires .NET Framework 4.5 or higher. Please install the .NET Framework then run this installer again.">
|
||||
<![CDATA[Installed OR NETFRAMEWORK45]]>
|
||||
</Condition>
|
||||
|
||||
<!-- <Condition Message="Please use the correct installer for your operating system - x86 for 32-bit, x64 for 64-bit.">
|
||||
|
||||
@@ -92,8 +92,8 @@
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\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="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
|
||||
@@ -101,8 +101,8 @@
|
||||
<Reference Include="System" />
|
||||
<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.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
<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" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
|
||||
@@ -2,8 +2,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="Moq" version="4.13.0" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net40" requireReinstallation="true" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net45" requireReinstallation="true" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -22,7 +22,7 @@ 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 lst = GsTtoLst( gst, longitude);
|
||||
|
||||
@@ -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 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
||||
@@ -62,10 +62,12 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
@@ -118,6 +120,7 @@
|
||||
<Compile Include="AstroMaths\EquatorialCoordinates.cs" />
|
||||
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
|
||||
<Compile Include="AstroMaths\IAstroMaths.cs" />
|
||||
<Compile Include="ComparisonResult.cs" />
|
||||
<Compile Include="DoubleExtensions.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="Telescope.cs" />
|
||||
|
||||
@@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// 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")]
|
||||
|
||||
+19
-25
@@ -8,16 +8,10 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ASCOM.Meade.net.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
@@ -25,27 +19,27 @@ namespace ASCOM.Meade.net.Properties {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[DebuggerNonUserCode()]
|
||||
[CompilerGenerated()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static ResourceManager resourceMan;
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static CultureInfo resourceCulture;
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static ResourceManager ResourceManager {
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (ReferenceEquals(resourceMan, null)) {
|
||||
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@@ -56,8 +50,8 @@ namespace ASCOM.Meade.net.Properties {
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static CultureInfo Culture {
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@@ -69,20 +63,20 @@ namespace ASCOM.Meade.net.Properties {
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static Bitmap ASCOM {
|
||||
internal static System.Drawing.Bitmap ASCOM {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
||||
return ((Bitmap)(obj));
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// </summary>
|
||||
internal static Icon DefaultIcon {
|
||||
internal static System.Drawing.Icon DefaultIcon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
|
||||
return ((Icon)(obj));
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-8
@@ -8,18 +8,14 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Configuration;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ASCOM.Meade.net.Properties {
|
||||
|
||||
|
||||
[CompilerGenerated()]
|
||||
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
internal sealed partial class Settings : ApplicationSettingsBase {
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
|
||||
@@ -82,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[] { 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[] { 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];
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
+320
-222
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.5"/></startup></configuration>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<#
|
||||
This script initializes a bare minimum set of registry entries required for ASCOM.Utilities.Profile to work
|
||||
without throwing any exceptions. When building on a build server, or on a computer without the ASCOM Platform installed,
|
||||
it may be useful to execute this script as a build step prior to running any unit tests, or calling any code that relies on
|
||||
ASCOM.Utilities.Profile. The alternative is to install the ASCOM Platform on the build agent.
|
||||
|
||||
NOTE: This script equires elevated permissions because it creates registry keys in the LocalMachine hive.
|
||||
#>
|
||||
|
||||
$wow = Test-Path HKLM:\SOFTWARE\Wow6432Node
|
||||
if ($wow)
|
||||
{
|
||||
$root = "HKLM:\SOFTWARE\Wow6432Node"
|
||||
}
|
||||
else
|
||||
{
|
||||
$root = "HKLM:\SOFTWARE"
|
||||
}
|
||||
$ascomRoot = $root + "\ASCOM"
|
||||
|
||||
if (Test-Path $ascomRoot)
|
||||
{
|
||||
<# Don't upset an already-existing ASCOM registry #>
|
||||
exit
|
||||
}
|
||||
|
||||
<# Create the ASCOM root key and set it's ACL to allow all users read/write access #>
|
||||
New-Item -Path $root -Name ASCOM –Force
|
||||
$ascomAcl = Get-Acl $ascomRoot
|
||||
$aclRule = New-Object System.Security.AccessControl.RegistryAccessRule ("Users","FullControl","Allow")
|
||||
$ascomAcl.SetAccessRule($aclRule)
|
||||
$ascomAcl | Set-Acl -Path $ascomRoot
|
||||
|
||||
<# Now create the bare minimum keys required so that ASCOM.Utilities.Profile doesn't crash and burn #>
|
||||
New-ItemProperty -Path $ascomRoot -Name PlatformVersion -Value "6.1" -PropertyType String –Force
|
||||
New-ItemProperty -Path $ascomRoot -Name SerTraceFile -Value "C:\SerialTraceAuto.txt" -PropertyType String –Force
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{21EF28B4-D574-4A2D-A61D-5DF96AF46AB2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Meade.net.UnitTests</RootNamespace>
|
||||
<AssemblyName>Meade.net.UnitTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Astrometry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Cache, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Cache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Controls, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DeviceInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.DriverAccess, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.DriverAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Exceptions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Exceptions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Internal.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Internal.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.SettingsProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.SettingsProvider.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ASCOM.Utilities.Video, Version=6.1.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ASCOM.Platform.6.4.2\lib\net40\ASCOM.Utilities.Video.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.13.0.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.13.0\lib\net45\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SharedResourcesUnitTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
|
||||
<Project>{3689a2cb-94c5-4012-a5cf-7e7d1dd27143}</Project>
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="BootstrapAscomProfileStore.ps1" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Meade.net.UnitTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Meade.net.UnitTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("21ef28b4-d574-4a2d-a61d-5df96af46ab2")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,320 @@
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using ASCOM.Meade.net;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class SharedResourcesUnitTests
|
||||
{
|
||||
private Mock<ISerial> _serialMock;
|
||||
private Mock<ITraceLogger> _traceLoggerMock;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
_serialMock = new Mock<ISerial>();
|
||||
_serialMock.SetupAllProperties();
|
||||
|
||||
_traceLoggerMock = new Mock<ITraceLogger>();
|
||||
|
||||
SharedResources.SharedSerial = _serialMock.Object;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CheckThatSerialPortIsSetToUseMock()
|
||||
{
|
||||
Assert.That(SharedResources.SharedSerial,Is.EqualTo(_serialMock.Object));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SendBlind_WhenCalled_Then_ClearsBuffersAndSendsMessage()
|
||||
{
|
||||
var expectedMessage = "Test";
|
||||
|
||||
SharedResources.SendBlind(expectedMessage);
|
||||
|
||||
_serialMock.Verify(x=> x.ClearBuffers(), Times.Once);
|
||||
_serialMock.Verify(x=>x.Transmit(expectedMessage), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SendChar_WhenCalled_ThenSendsMessageAndReadsExpectedNumberOfCharacters()
|
||||
{
|
||||
var expectedMessage = "Test";
|
||||
var expectedResult = "A";
|
||||
|
||||
_serialMock.Setup(x => x.ReceiveCounted(1)).Returns(expectedResult);
|
||||
|
||||
var result = SharedResources.SendChar(expectedMessage);
|
||||
|
||||
_serialMock.Verify(x => x.ClearBuffers(), Times.Once);
|
||||
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once);
|
||||
_serialMock.Verify(x => x.ReceiveCounted(1), Times.Once);
|
||||
Assert.That(result, Is.EqualTo(expectedResult));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SendString_WhenCalled_ThenSendsMessageAndReadsResultUntilTerminatorFound()
|
||||
{
|
||||
var expectedMessage = "Test";
|
||||
var expectedResult = "TestMessage#";
|
||||
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(expectedResult);
|
||||
|
||||
var result = SharedResources.SendString(expectedMessage);
|
||||
|
||||
_serialMock.Verify(x => x.ClearBuffers(), Times.Once);
|
||||
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once);
|
||||
_serialMock.Verify(x => x.ReceiveTerminated("#"), Times.Once);
|
||||
Assert.That(result, Is.EqualTo(expectedResult.TrimEnd('#')));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReadTerminated_WhenCalled_ThenReadsResultUntilTerminatorFound()
|
||||
{
|
||||
var expectedResult = "TestMessage#";
|
||||
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(expectedResult);
|
||||
|
||||
var result = SharedResources.ReadTerminated();
|
||||
|
||||
_serialMock.Verify(x => x.ReceiveTerminated("#"), Times.Once);
|
||||
Assert.That(result, Is.EqualTo(expectedResult));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReadCharacters_WhenCalled_ThenReadsSpecificNumberOfCharacters()
|
||||
{
|
||||
var numberOfCharacters = 5;
|
||||
|
||||
SharedResources.ReadCharacters(numberOfCharacters);
|
||||
|
||||
_serialMock.Verify(x => x.ReceiveCounted(numberOfCharacters), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void WriteProfile_WhenCalled_WritesExpectedProfileSettings()
|
||||
{
|
||||
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
IProfileWrapper profeWrapper = profileWrapperMock.Object;
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
var profileProperties = new ProfileProperties
|
||||
{
|
||||
TraceLogger = false,
|
||||
ComPort = "TestComPort"
|
||||
};
|
||||
|
||||
SharedResources.WriteProfile(profileProperties);
|
||||
|
||||
Assert.That(profeWrapper.DeviceType, Is.EqualTo("Telescope"));
|
||||
profileWrapperMock.Verify( x => x.WriteValue(DriverId, "Trace Level", profileProperties.TraceLogger.ToString()), Times.Once);
|
||||
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "COM Port", profileProperties.ComPort), Times.Once);
|
||||
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Guide Rate Arc Seconds Per Second", profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.CurrentCulture)), Times.Once);
|
||||
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Precision", profileProperties.Precision), Times.Once);
|
||||
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Guiding Style", profileProperties.GuidingStyle), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ReadProfile_WhenCalled_ReturnsExpectedDefaultValues()
|
||||
{
|
||||
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string TraceStateDefault = "false";
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
string GuidingStyleDefault = "Auto";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Guiding Style", string.Empty, GuidingStyleDefault))
|
||||
.Returns(GuidingStyleDefault);
|
||||
|
||||
IProfileWrapper profeWrapper = profileWrapperMock.Object;
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
var profileProperties = SharedResources.ReadProfile();
|
||||
|
||||
Assert.That(profeWrapper.DeviceType, Is.EqualTo("Telescope"));
|
||||
Assert.That(profileProperties.ComPort, Is.EqualTo(ComPortDefault));
|
||||
Assert.That(profileProperties.GuideRateArcSecondsPerSecond,
|
||||
Is.EqualTo(double.Parse(GuideRateProfileNameDefault)));
|
||||
Assert.That(profileProperties.TraceLogger, Is.EqualTo(bool.Parse(TraceStateDefault)));
|
||||
Assert.That(profileProperties.Precision, Is.EqualTo(PrecisionDefault));
|
||||
Assert.That(profileProperties.GuidingStyle, Is.EqualTo(GuidingStyleDefault));
|
||||
}
|
||||
|
||||
[TestCase("TCP")]
|
||||
[TestCase("Carrier Pigeon")]
|
||||
public void Connect_WhenDeviceIdIsNotSerial_ThenThrowsException( string deviceId)
|
||||
{
|
||||
var result = Assert.Throws<ArgumentException>( () => { SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object); } );
|
||||
|
||||
Assert.That( result.Message, Is.EqualTo($"deviceId {deviceId} not currently supported") );
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connect_WhenDeviceIdIsSerialButGVPEchos_ThenThrowsException()
|
||||
{
|
||||
string deviceId = "Serial";
|
||||
|
||||
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string TraceStateDefault = "false";
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
string serialPortReturn = string.Empty;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit(":GVP#")).Callback(() => { serialPortReturn = ":GVP#"; });
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns( () => serialPortReturn);
|
||||
|
||||
var result = Assert.Throws<Exception>(() => { SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object); });
|
||||
Assert.That(result.Message, Is.EqualTo("Serial port is looping back data, something is wrong with the hardware."));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connect_WhenDeviceIdIsSerialButGVPNotSupported_ThenConnectsAndSetsProductToLX200Classic()
|
||||
{
|
||||
string deviceId = "Serial";
|
||||
|
||||
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string TraceStateDefault = "false";
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit(":GVP#")).Callback(() => { });
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => throw new Exception("Testerror"));
|
||||
|
||||
var connectionResult = SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object);
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
Assert.That(connectionResult.SameDevice, Is.EqualTo(1));
|
||||
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.LX200CLASSIC));
|
||||
}
|
||||
finally
|
||||
{
|
||||
SharedResources.Disconnect(deviceId, String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connect_WhenDeviceIdIsSerialButGVPIsAutostar_ThenConnectsAndSetsProductToAutostarAndFirmware()
|
||||
{
|
||||
string deviceId = "Serial";
|
||||
|
||||
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string TraceStateDefault = "false";
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
string serialPortReturn = string.Empty;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit(":GVP#")).Callback(() => { serialPortReturn = TelescopeList.Autostar497; });
|
||||
_serialMock.Setup(x => x.Transmit(":GVN#")).Callback(() => { serialPortReturn = TelescopeList.Autostar497_43Eg; });
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => serialPortReturn);
|
||||
|
||||
var connectionResult = SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object);
|
||||
try
|
||||
{
|
||||
Assert.That(connectionResult.SameDevice, Is.EqualTo(1));
|
||||
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.Autostar497));
|
||||
Assert.That(SharedResources.FirmwareVersion, Is.EqualTo(TelescopeList.Autostar497_43Eg));
|
||||
}
|
||||
finally
|
||||
{
|
||||
SharedResources.Disconnect(deviceId, String.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ASCOM.Platform" version="6.4.2" targetFramework="net472" />
|
||||
<package id="Castle.Core" version="4.4.0" targetFramework="net472" />
|
||||
<package id="Moq" version="4.13.0" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.12.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -30,6 +30,7 @@ namespace ASCOM.Meade.net
|
||||
[ProgId("ASCOM.MeadeGeneric.focuser")]
|
||||
[ServedClassName("Meade Generic")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ComVisible(true)]
|
||||
public class Focuser : ReferenceCountedObjectBase, IFocuserV3
|
||||
{
|
||||
/// <summary>
|
||||
@@ -186,7 +187,7 @@ namespace ASCOM.Meade.net
|
||||
try
|
||||
{
|
||||
ReadProfile();
|
||||
_sharedResourcesWrapper.Connect("Serial", DriverId);
|
||||
_sharedResourcesWrapper.Connect("Serial", DriverId, _tl);
|
||||
try
|
||||
{
|
||||
IsConnected = true;
|
||||
@@ -365,7 +366,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
_sharedResourcesWrapper.Lock(() =>
|
||||
{
|
||||
//_sharedResourcesWrapper.SendBlind(":FF#");
|
||||
//_sharedResourcesWrapper.SendBlind("#:FF#");
|
||||
//:FF# Set Focus speed to fastest setting
|
||||
//Returns: Nothing
|
||||
|
||||
@@ -382,7 +383,7 @@ namespace ASCOM.Meade.net
|
||||
Stopwatch stopwatch = Stopwatch.StartNew();
|
||||
while (stopwatch.ElapsedMilliseconds < steps)
|
||||
{
|
||||
_sharedResourcesWrapper.SendBlind(directionOut ? ":F+#" : ":F-#");
|
||||
_sharedResourcesWrapper.SendBlind(directionOut ? "#:F+#" : "#:F-#");
|
||||
//:F+# Start Focuser moving inward (toward objective)
|
||||
//Returns: None
|
||||
|
||||
@@ -451,6 +452,13 @@ namespace ASCOM.Meade.net
|
||||
|
||||
#region ASCOM Registration
|
||||
|
||||
private static IProfileFactory _profileFactory;
|
||||
public static IProfileFactory ProfileFactory
|
||||
{
|
||||
get => _profileFactory ?? (_profileFactory = new ProfileFactory());
|
||||
set => _profileFactory = value;
|
||||
}
|
||||
|
||||
// Register or unregister driver for ASCOM. This is harmless if already
|
||||
// registered or unregistered.
|
||||
//
|
||||
@@ -461,7 +469,7 @@ namespace ASCOM.Meade.net
|
||||
/// <param name="bRegister">If <c>true</c>, registers the driver, otherwise unregisters it.</param>
|
||||
private static void RegUnregAscom(bool bRegister)
|
||||
{
|
||||
using (var p = new Profile())
|
||||
using (IProfileWrapper p = ProfileFactory.Create())
|
||||
{
|
||||
p.DeviceType = "Focuser";
|
||||
if (bRegister)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
|
||||
@@ -69,6 +69,7 @@
|
||||
<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,6 +79,7 @@
|
||||
<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">
|
||||
|
||||
@@ -18,7 +18,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")]
|
||||
|
||||
+19
-25
@@ -8,16 +8,10 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System.CodeDom.Compiler;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ASCOM.Meade.net.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
@@ -25,27 +19,27 @@ namespace ASCOM.Meade.net.Properties {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[DebuggerNonUserCode()]
|
||||
[CompilerGenerated()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static ResourceManager resourceMan;
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static CultureInfo resourceCulture;
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static ResourceManager ResourceManager {
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (ReferenceEquals(resourceMan, null)) {
|
||||
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@@ -56,8 +50,8 @@ namespace ASCOM.Meade.net.Properties {
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static CultureInfo Culture {
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@@ -69,20 +63,20 @@ namespace ASCOM.Meade.net.Properties {
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static Bitmap ASCOM {
|
||||
internal static System.Drawing.Bitmap ASCOM {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
||||
return ((Bitmap)(obj));
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// </summary>
|
||||
internal static Icon DefaultIcon {
|
||||
internal static System.Drawing.Icon DefaultIcon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
|
||||
return ((Icon)(obj));
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -8,18 +8,14 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Configuration;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ASCOM.Meade.net.Properties {
|
||||
|
||||
|
||||
[CompilerGenerated()]
|
||||
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
internal sealed partial class Settings : ApplicationSettingsBase {
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||
|
||||
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meade.net.Telescope.UnitTes
|
||||
EndProject
|
||||
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
|
||||
@@ -137,6 +139,18 @@ Global
|
||||
{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
|
||||
@@ -147,6 +161,7 @@ Global
|
||||
{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}
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
<Settings>
|
||||
<AllowParallelTestExecution>True</AllowParallelTestExecution>
|
||||
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
|
||||
<MetricsExclusionList>
|
||||
<Value>FocuserTestConsole\FocuserTestConsole.csproj</Value>
|
||||
<Value>TelescopeTestConsole\TelescopeTestConsole.csproj</Value>
|
||||
</MetricsExclusionList>
|
||||
<SolutionConfigured>True</SolutionConfigured>
|
||||
</Settings>
|
||||
</SolutionConfiguration>
|
||||
@@ -11,6 +11,6 @@
|
||||
<ShowUnexecutedTestsMenuOption>true</ShowUnexecutedTestsMenuOption>
|
||||
<ShowIgnoredTestsMenuOption>false</ShowIgnoredTestsMenuOption>
|
||||
</TestsWindowMenuOptions>
|
||||
<TestsWindowSplitterDistance>451</TestsWindowSplitterDistance>
|
||||
<TestsWindowSplitterDistance>544</TestsWindowSplitterDistance>
|
||||
</Settings>
|
||||
</SolutionConfiguration>
|
||||
@@ -2,7 +2,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
public class ConnectionInfo
|
||||
{
|
||||
public int Connections { get; set; }
|
||||
//public int Connections { get; set; }
|
||||
public int SameDevice { get; set; }
|
||||
}
|
||||
}
|
||||
+14
-12
@@ -173,8 +173,10 @@ namespace ASCOM.Meade.net
|
||||
_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"))
|
||||
@@ -295,9 +297,9 @@ 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
|
||||
@@ -305,7 +307,7 @@ namespace ASCOM.Meade.net
|
||||
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)
|
||||
@@ -333,20 +335,20 @@ namespace ASCOM.Meade.net
|
||||
|
||||
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);
|
||||
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"))
|
||||
{
|
||||
key2.CreateSubKey("{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
|
||||
key2?.CreateSubKey("{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
|
||||
}
|
||||
using (RegistryKey key2 = key.CreateSubKey("ProgId"))
|
||||
{
|
||||
key2.SetValue(null, progid);
|
||||
key2?.SetValue(null, progid);
|
||||
}
|
||||
key.CreateSubKey("Programmable");
|
||||
using (RegistryKey key2 = key.CreateSubKey("LocalServer32"))
|
||||
{
|
||||
key2.SetValue(null, Application.ExecutablePath);
|
||||
key2?.SetValue(null, Application.ExecutablePath);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -354,10 +356,10 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
using (RegistryKey key = Registry.ClassesRoot.CreateSubKey(progid))
|
||||
{
|
||||
key.SetValue(null, assyTitle);
|
||||
key?.SetValue(null, assyTitle);
|
||||
using (RegistryKey key2 = key.CreateSubKey("CLSID"))
|
||||
{
|
||||
key2.SetValue(null, clsid);
|
||||
key2?.SetValue(null, clsid);
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
||||
<AssemblyName>ASCOM.Meade.net.Server</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
@@ -82,6 +82,7 @@
|
||||
<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">
|
||||
@@ -133,10 +134,12 @@
|
||||
</Compile>
|
||||
<Compile Include="GarbageCollection.cs" />
|
||||
<Compile Include="LocalServer.cs" />
|
||||
<Compile Include="ProfileFactory.cs" />
|
||||
<Compile Include="ProfileProperties.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TelescopeList.cs" />
|
||||
<Compile Include="Win32Utilities.cs" />
|
||||
<Compile Include="Wrapper\IProfileWrapper.cs" />
|
||||
<Compile Include="Wrapper\SharedResourcesWrapper.cs" />
|
||||
<EmbeddedResource Include="frmMain.resx">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public interface IProfileFactory
|
||||
{
|
||||
IProfileWrapper Create();
|
||||
}
|
||||
|
||||
public class ProfileFactory : IProfileFactory
|
||||
{
|
||||
public IProfileWrapper Create()
|
||||
{
|
||||
return new ProfileWrapper();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,6 @@ namespace ASCOM.Meade.net
|
||||
public bool TraceLogger { get; set; }
|
||||
public double GuideRateArcSecondsPerSecond { get; set; }
|
||||
public string Precision { get; set; }
|
||||
public string GuidingStyle { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ 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;
|
||||
@@ -54,8 +55,7 @@ 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(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))
|
||||
{
|
||||
@@ -71,6 +71,16 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
cboPrecision.SelectedItem = "Unchanged";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
cboGuidingStyle.SelectedItem = profileProperties.GuidingStyle;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
cboGuidingStyle.SelectedItem = "Auto";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ProfileProperties GetProfile()
|
||||
@@ -80,7 +90,8 @@ namespace ASCOM.Meade.net
|
||||
TraceLogger = chkTrace.Checked,
|
||||
ComPort = comboBoxComPort.SelectedItem.ToString(),
|
||||
GuideRateArcSecondsPerSecond = double.Parse(txtGuideRate.Text.Trim()),
|
||||
Precision = cboPrecision.SelectedItem.ToString()
|
||||
Precision = cboPrecision.SelectedItem.ToString(),
|
||||
GuidingStyle = cboGuidingStyle.SelectedItem.ToString()
|
||||
};
|
||||
|
||||
return profileProperties;
|
||||
|
||||
Generated
+22
@@ -45,6 +45,8 @@ 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();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -133,10 +135,28 @@ 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";
|
||||
//
|
||||
// SetupDialogForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
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);
|
||||
@@ -178,5 +198,7 @@ namespace ASCOM.Meade.net
|
||||
private Label lblPercentOfSiderealRate;
|
||||
private Label label5;
|
||||
private ComboBox cboPrecision;
|
||||
private Label label6;
|
||||
private ComboBox cboGuidingStyle;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="cmdOK.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>281, 225</value>
|
||||
<value>281, 250</value>
|
||||
</data>
|
||||
<data name="cmdOK.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 24</value>
|
||||
@@ -145,13 +145,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cmdOK.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name="cmdCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Right</value>
|
||||
</data>
|
||||
<data name="cmdCancel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>281, 255</value>
|
||||
<value>281, 280</value>
|
||||
</data>
|
||||
<data name="cmdCancel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 25</value>
|
||||
@@ -172,7 +172,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cmdCancel.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 9</value>
|
||||
@@ -196,7 +196,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="picASCOM.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
@@ -223,7 +223,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>picASCOM.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -250,13 +250,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="chkTrace.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="chkTrace.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>77, 136</value>
|
||||
<value>86, 136</value>
|
||||
</data>
|
||||
<data name="chkTrace.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>69, 17</value>
|
||||
@@ -277,10 +277,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>chkTrace.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>77, 87</value>
|
||||
<value>86, 87</value>
|
||||
</data>
|
||||
<data name="comboBoxComPort.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 21</value>
|
||||
@@ -298,7 +298,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>comboBoxComPort.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -325,10 +325,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label3.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>77, 159</value>
|
||||
<value>86, 159</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>46, 20</value>
|
||||
@@ -349,13 +349,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtGuideRate.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>129, 162</value>
|
||||
<value>138, 162</value>
|
||||
</data>
|
||||
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>122, 13</value>
|
||||
@@ -376,13 +376,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label4.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>129, 175</value>
|
||||
<value>138, 175</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>105, 13</value>
|
||||
@@ -403,7 +403,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblPercentOfSiderealRate.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -430,7 +430,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label5.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="cboPrecision.Items" xml:space="preserve">
|
||||
<value>Unchanged</value>
|
||||
@@ -442,7 +442,7 @@
|
||||
<value>High</value>
|
||||
</data>
|
||||
<data name="cboPrecision.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>77, 191</value>
|
||||
<value>86, 191</value>
|
||||
</data>
|
||||
<data name="cboPrecision.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 21</value>
|
||||
@@ -460,6 +460,66 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboPrecision.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label6.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>13, 221</value>
|
||||
</data>
|
||||
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>67, 13</value>
|
||||
</data>
|
||||
<data name="label6.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name="label6.Text" xml:space="preserve">
|
||||
<value>Guiding style</value>
|
||||
</data>
|
||||
<data name=">>label6.Name" xml:space="preserve">
|
||||
<value>label6</value>
|
||||
</data>
|
||||
<data name=">>label6.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>label6.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label6.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Items" xml:space="preserve">
|
||||
<value>Auto</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Items1" xml:space="preserve">
|
||||
<value>Guide rate slew</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Items2" xml:space="preserve">
|
||||
<value>Pulse guiding</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>86, 218</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 21</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>15</value>
|
||||
</data>
|
||||
<data name=">>cboGuidingStyle.Name" xml:space="preserve">
|
||||
<value>cboGuidingStyle</value>
|
||||
</data>
|
||||
<data name=">>cboGuidingStyle.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cboGuidingStyle.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboGuidingStyle.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
@@ -469,7 +529,7 @@
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>350, 288</value>
|
||||
<value>350, 313</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterScreen</value>
|
||||
|
||||
@@ -18,7 +18,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
@@ -36,7 +38,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
|
||||
@@ -59,9 +61,19 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
|
||||
/// <summary>
|
||||
/// Shared serial port
|
||||
/// Shared serial port. Do not directly access this method.
|
||||
/// </summary>
|
||||
private static Serial SharedSerial => _sSharedSerial ?? (_sSharedSerial = new Serial());
|
||||
public static ISerial SharedSerial
|
||||
{
|
||||
get => _sSharedSerial ?? (_sSharedSerial = new Serial());
|
||||
set => _sSharedSerial = value;
|
||||
}
|
||||
|
||||
public static IProfileFactory ProfileFactory
|
||||
{
|
||||
get => _profileFactory ?? ( _profileFactory = new ProfileFactory());
|
||||
set => _profileFactory = value;
|
||||
}
|
||||
|
||||
public static void SendBlind(string message)
|
||||
{
|
||||
@@ -127,18 +139,20 @@ namespace ASCOM.Meade.net
|
||||
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";
|
||||
|
||||
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(CultureInfo.CurrentCulture));
|
||||
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision);
|
||||
driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,19 +161,22 @@ namespace ASCOM.Meade.net
|
||||
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";
|
||||
|
||||
|
||||
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.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault), NumberFormatInfo.InvariantInfo);
|
||||
profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault);
|
||||
profileProperties.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault);
|
||||
}
|
||||
|
||||
return profileProperties;
|
||||
@@ -217,6 +234,7 @@ namespace ASCOM.Meade.net
|
||||
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>
|
||||
@@ -225,21 +243,20 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
/// <param name="deviceId"></param>
|
||||
/// <param name="driverId"></param>
|
||||
public static ConnectionInfo Connect(string deviceId, string driverId)
|
||||
/// <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 (!ConnectedDeviceIds.ContainsKey(driverId))
|
||||
ConnectedDeviceIds.Add(driverId, new DeviceHardware());
|
||||
ConnectedDeviceIds[driverId].Count++; // increment the value
|
||||
|
||||
if (deviceId == "Serial")
|
||||
{
|
||||
if (ConnectedDevices[deviceId].Count == 1)
|
||||
if (ConnectedDevices[deviceId].Count == 0)
|
||||
{
|
||||
var profileProperties = ReadProfile();
|
||||
SharedSerial.PortName = profileProperties.ComPort;
|
||||
@@ -252,14 +269,37 @@ namespace ASCOM.Meade.net
|
||||
SharedSerial.Handshake = SerialHandshake.None;
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
ProductName = SendString(":GVP#");
|
||||
FirmwareVersion = SendString(":GVN#");
|
||||
try
|
||||
{
|
||||
ProductName = SendString(":GVP#");
|
||||
FirmwareVersion = SendString(":GVN#");
|
||||
}
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
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,
|
||||
//Connections = ConnectedDevices[deviceId].Count,
|
||||
SameDevice = ConnectedDeviceIds[driverId].Count
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#region LX200EMC
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static readonly string LX200CLASSIC = ":GVP"; //GVP command is not supported!
|
||||
public static readonly string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported!
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net.Wrapper
|
||||
{
|
||||
public interface IProfileWrapper : IProfile, IProfileExtra, IDisposable
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class ProfileWrapper : IProfileWrapper
|
||||
{
|
||||
private readonly Profile _profile = new Profile();
|
||||
|
||||
public ArrayList RegisteredDevices(string deviceType)
|
||||
{
|
||||
return _profile.RegisteredDevices(deviceType);
|
||||
}
|
||||
|
||||
public bool IsRegistered(string driverId)
|
||||
{
|
||||
return _profile.IsRegistered(driverId);
|
||||
}
|
||||
|
||||
public void Register(string driverId, string descriptiveName)
|
||||
{
|
||||
_profile.Register(driverId, descriptiveName);
|
||||
}
|
||||
|
||||
public void Unregister(string driverId)
|
||||
{
|
||||
_profile.Unregister(driverId);
|
||||
}
|
||||
|
||||
public string GetValue(string driverId, string name, string subKey, string defaultValue)
|
||||
{
|
||||
return _profile.GetValue(driverId, name, subKey, defaultValue);
|
||||
}
|
||||
|
||||
public void WriteValue(string driverId, string name, string value, string subKey)
|
||||
{
|
||||
_profile.WriteValue(driverId, name, value);
|
||||
}
|
||||
|
||||
public ArrayList Values(string driverId, string subKey)
|
||||
{
|
||||
return _profile.Values(driverId, subKey);
|
||||
}
|
||||
|
||||
public void DeleteValue(string driverId, string name, string subKey)
|
||||
{
|
||||
_profile.DeleteValue(driverId, name, subKey);
|
||||
}
|
||||
|
||||
public void CreateSubKey(string driverId, string subKey)
|
||||
{
|
||||
_profile.CreateSubKey(driverId, subKey);
|
||||
}
|
||||
|
||||
public ArrayList SubKeys(string driverId, string subKey)
|
||||
{
|
||||
return _profile.SubKeys(driverId, subKey);
|
||||
}
|
||||
|
||||
public void DeleteSubKey(string driverId, string subKey)
|
||||
{
|
||||
_profile.DeleteSubKey(driverId, subKey);
|
||||
}
|
||||
|
||||
public string GetProfileXML(string deviceId)
|
||||
{
|
||||
return _profile.GetProfileXML(deviceId);
|
||||
}
|
||||
|
||||
public void SetProfileXML(string deviceId, string xml)
|
||||
{
|
||||
_profile.SetProfileXML(deviceId, xml);
|
||||
}
|
||||
|
||||
public string DeviceType
|
||||
{
|
||||
get => _profile.DeviceType;
|
||||
set => _profile.DeviceType = value;
|
||||
}
|
||||
public ArrayList RegisteredDeviceTypes => _profile.RegisteredDeviceTypes;
|
||||
|
||||
public void MigrateProfile(string currentPlatformVersion)
|
||||
{
|
||||
_profile.MigrateProfile(currentPlatformVersion);
|
||||
}
|
||||
|
||||
public void DeleteValue(string driverId, string name)
|
||||
{
|
||||
_profile.DeleteValue(driverId, name);
|
||||
}
|
||||
|
||||
public string GetValue(string driverId, string name)
|
||||
{
|
||||
return _profile.GetValue(driverId, name);
|
||||
}
|
||||
|
||||
public string GetValue(string driverId, string name, string subKey)
|
||||
{
|
||||
return _profile.GetValue(driverId, name, subKey);
|
||||
}
|
||||
|
||||
public ArrayList SubKeys(string driverId)
|
||||
{
|
||||
return _profile.SubKeys(driverId);
|
||||
}
|
||||
|
||||
public ArrayList Values(string driverId)
|
||||
{
|
||||
return _profile.Values(driverId);
|
||||
}
|
||||
|
||||
public void WriteValue(string driverId, string name, string value)
|
||||
{
|
||||
_profile.WriteValue(driverId, name, value);
|
||||
}
|
||||
|
||||
public ASCOMProfile GetProfile(string driverId)
|
||||
{
|
||||
return _profile.GetProfile(driverId);
|
||||
}
|
||||
|
||||
public void SetProfile(string driverId, ASCOMProfile xmlProfileKey)
|
||||
{
|
||||
_profile.SetProfile(driverId, xmlProfileKey);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_profile.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net.Wrapper
|
||||
{
|
||||
public interface ISharedResourcesWrapper
|
||||
{
|
||||
ConnectionInfo Connect(string deviceId, string driverId);
|
||||
ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger);
|
||||
void Disconnect(string deviceId, string driverId);
|
||||
|
||||
string ProductName { get; }
|
||||
@@ -29,9 +30,9 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
|
||||
public class SharedResourcesWrapper : ISharedResourcesWrapper
|
||||
{
|
||||
public ConnectionInfo Connect(string deviceId, string driverId)
|
||||
public ConnectionInfo Connect(string deviceId, string driverId, ITraceLogger traceLogger)
|
||||
{
|
||||
return SharedResources.Connect(deviceId, driverId);
|
||||
return SharedResources.Connect(deviceId, driverId, traceLogger);
|
||||
}
|
||||
|
||||
public void Disconnect(string deviceId, string driverId)
|
||||
|
||||
@@ -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.5"/></startup></configuration>
|
||||
|
||||
@@ -9,26 +9,29 @@
|
||||
#define UseChooser
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.DriverAccess;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
class Program
|
||||
public static class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
public static void Main()
|
||||
{
|
||||
// Uncomment the code that's required
|
||||
#if UseChooser
|
||||
//#if UseChooser
|
||||
// choose the device
|
||||
string id = Telescope.Choose("ASCOM.MeadeGeneric.Telescope");
|
||||
string id = Telescope.Choose("ASCOM.Meade.net.Telescope");
|
||||
if (string.IsNullOrEmpty(id))
|
||||
return;
|
||||
// create this device
|
||||
Telescope device = new Telescope(id);
|
||||
#else
|
||||
//#else
|
||||
// this can be replaced by this code, it avoids the chooser and creates the driver class directly.
|
||||
ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
|
||||
#endif
|
||||
//ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
|
||||
//#endif
|
||||
// now run some tests, adding code to your driver so that the tests will pass.
|
||||
// these first tests are common to all drivers.
|
||||
|
||||
@@ -50,8 +53,45 @@ namespace ASCOM.Meade.net
|
||||
//Console.WriteLine($"Ra {device.RightAscension}");
|
||||
//Console.WriteLine($"Dec {device.Declination}");
|
||||
|
||||
Console.WriteLine($"Altitude {device.Altitude}");
|
||||
Console.WriteLine($"Azimuth {device.Azimuth}");
|
||||
//Console.WriteLine($"Altitude {device.Altitude}");
|
||||
//Console.WriteLine($"Azimuth {device.Azimuth}");
|
||||
|
||||
var seconds = 10;
|
||||
|
||||
Console.WriteLine("Slewing tests 10 second in each direction");
|
||||
Console.WriteLine("test 1");
|
||||
device.MoveAxis(TelescopeAxes.axisPrimary, 4);
|
||||
Thread.Sleep(seconds * 1000);
|
||||
device.MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||
Console.WriteLine("test 2");
|
||||
device.MoveAxis(TelescopeAxes.axisPrimary, -4);
|
||||
Thread.Sleep(seconds * 1000);
|
||||
device.MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||
|
||||
Console.WriteLine("test 3");
|
||||
device.MoveAxis(TelescopeAxes.axisSecondary, 4);
|
||||
Thread.Sleep(seconds * 1000);
|
||||
device.MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||
|
||||
Console.WriteLine("test 4");
|
||||
device.MoveAxis(TelescopeAxes.axisSecondary, -4);
|
||||
Thread.Sleep(seconds * 1000);
|
||||
device.MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||
Console.WriteLine("Slewing tests complete");
|
||||
|
||||
|
||||
seconds = 120;
|
||||
|
||||
Console.WriteLine($"Guiding for {seconds} seconds!");
|
||||
|
||||
foreach( var direction in Enum.GetValues(typeof(GuideDirections)).Cast<GuideDirections>())
|
||||
{
|
||||
Console.WriteLine($"{direction.ToString()}");
|
||||
device.PulseGuide(direction, seconds* 1000);
|
||||
}
|
||||
Console.WriteLine("Guiding Finished");
|
||||
|
||||
|
||||
|
||||
device.Connected = false;
|
||||
Console.WriteLine("Press Enter to finish");
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ASCOM.Meade.net</RootNamespace>
|
||||
<AssemblyName>ASCOM.Meade.net.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
@@ -54,6 +54,7 @@
|
||||
<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" />
|
||||
|
||||
@@ -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.5"/></startup></configuration>
|
||||
|
||||
Reference in New Issue
Block a user