Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e0e105255 | |||
| 3fa8079a41 | |||
| 7dc96c650d | |||
| 650fc04bca | |||
| 5c2bd21f1e | |||
| 39a6bfca80 | |||
| f551081454 | |||
| 5c362a5a9a | |||
| abb985559e | |||
| ddd6178416 | |||
| 356377ce36 | |||
| 1b220334d6 | |||
| bb54356b58 | |||
| ebca231d9a | |||
| 2b5205d9c5 | |||
| 81d2b98bfe | |||
| 9ee6adf063 | |||
| 554b1af082 | |||
| 70f72e3df7 | |||
| 3af02920c4 | |||
| ede7c33302 | |||
| 9866578cab | |||
| d9093635de | |||
| 885edba1c5 | |||
| 1949c50764 | |||
| 2b7d12fac9 | |||
| f168acc90b | |||
| 8f6ea33139 | |||
| c6f938bd5c | |||
| c271f0c4d3 | |||
| 35a76fe52c | |||
| 64e42f961c | |||
| 8eb093c13a | |||
| a204f9c57f | |||
| 700802033b | |||
| 350dd23ed1 | |||
| 5e65ea7946 | |||
| 0c70688b60 | |||
| af3cca7611 | |||
| ef498fc5a0 | |||
| ceca3a15dc | |||
| a9b8a60e43 | |||
| 7a85f7ca9e | |||
| 57c5a34fe2 | |||
| a68e86d8cd | |||
| 503eec38a3 | |||
| ed54487a88 | |||
| f788320927 | |||
| dc68bb0b4c | |||
| 1a66f41d78 | |||
| 826f887bdf | |||
| 7ac3c95c8e | |||
| acb1533f21 | |||
| eda3a53d6f | |||
| 6786db65fe | |||
| df7dfb7c04 | |||
| 771e325067 | |||
| a5a3bd5bd4 | |||
| a605a3ed9d | |||
| ad9169a48d | |||
| 3b056ef7f8 | |||
| 710ae0420a | |||
| 2a6b74c6fd | |||
| 49c43358de | |||
| 27a0f54b07 | |||
| a562b848c0 | |||
| f4c26d777b | |||
| 8d8b50957c | |||
| faa6ad757e | |||
| 64df8282a0 | |||
| 8478af26bf | |||
| 77c87a51fa | |||
| 631aa91d94 | |||
| 90713de34b | |||
| a3408a86c3 | |||
| 74440b6b3b | |||
| f1d100892b | |||
| c6baab2b12 | |||
| f47b205025 | |||
| 6c27499769 | |||
| 6dff32505e | |||
| 7afd364efa | |||
| 6fc476b031 | |||
| af750549fe | |||
| 2e3572375f | |||
| b23da15022 | |||
| 0b75b8d2cd | |||
| 036a9d7116 | |||
| 6c769f3649 | |||
| bdbd206a54 | |||
| 1684bd60bd | |||
| 8c4b08d0c6 | |||
| fe3c106954 | |||
| 8c94fd6b71 | |||
| a2abbbb3d0 | |||
| 21e7bcd530 |
@@ -123,7 +123,8 @@ namespace AstroMath.UnitTests
|
||||
|
||||
var altAz = _astroMath.ConvertEqToHoz(hourAngle, latitude, equatorialCoordinates);
|
||||
|
||||
Assert.That(altAz.Altitude, Is.EqualTo(20.958562421092779));
|
||||
Assert.That(altAz.Altitude, Is.GreaterThan(20.958562421092770));
|
||||
Assert.That(altAz.Altitude, Is.LessThanOrEqualTo(20.958562421092779));
|
||||
Assert.That(altAz.Azimuth, Is.EqualTo(281.2728706962269));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,6 @@ namespace Meade.net.Focuser.UnitTests
|
||||
|
||||
_sharedResourcesWrapperMock = new Mock<ISharedResourcesWrapper>();
|
||||
|
||||
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Action>())).Callback<Action>(action => { action(); });
|
||||
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ReadProfile()).Returns(() => _profileProperties);
|
||||
|
||||
_focuser = new ASCOM.Meade.net.Focuser(_utilMock.Object, _sharedResourcesWrapperMock.Object);
|
||||
@@ -422,8 +420,6 @@ namespace Meade.net.Focuser.UnitTests
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Once);
|
||||
}
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Lock(It.IsAny<Action>()), Times.Once);
|
||||
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Once());
|
||||
@@ -455,8 +451,6 @@ namespace Meade.net.Focuser.UnitTests
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(_profileProperties.BacklashCompensation), Times.Once);
|
||||
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(2));
|
||||
}
|
||||
|
||||
_sharedResourcesWrapperMock.Verify(x => x.Lock(It.IsAny<Action>()), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public enum Alignment
|
||||
{
|
||||
NeedsAlignment,
|
||||
OneStarAligned,
|
||||
TwoStarAligned,
|
||||
ThreeStarAligned,
|
||||
AlignedOnHome,
|
||||
ScopeWasParked,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using ASCOM.DeviceInterface;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class AlignmentStatus
|
||||
{
|
||||
public AlignmentModes AlignmentMode { get; set; }
|
||||
public bool Tracking { get; set; }
|
||||
public Alignment Status { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"AlignmentStatus AlignmentMode={AlignmentMode};Tracking={Tracking};Status={Status}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace System
|
||||
{
|
||||
static class DoubelExtensions
|
||||
{
|
||||
public static bool Between(this double value, double lower, double higher)
|
||||
{
|
||||
return value >= lower & value <= higher;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>..\bin\Release\</OutputPath>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<OutputPath>..\bin\Debug\</OutputPath>
|
||||
@@ -118,6 +118,8 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Alignment.cs" />
|
||||
<Compile Include="AlignmentStatus.cs" />
|
||||
<Compile Include="AstroMaths\AltitudeData.cs" />
|
||||
<Compile Include="AstroMaths\AstroMathExtensions.cs" />
|
||||
<Compile Include="AstroMaths\AstroMaths.cs" />
|
||||
@@ -126,6 +128,7 @@
|
||||
<Compile Include="Clock.cs" />
|
||||
<Compile Include="ComparisonResult.cs" />
|
||||
<Compile Include="DoubleExtensions.cs" />
|
||||
<Compile Include="ExtensionMethods\DoubelExtensions.cs" />
|
||||
<Compile Include="IClock.cs" />
|
||||
<Compile Include="StringExtensions.cs" />
|
||||
<Compile Include="Telescope.cs" />
|
||||
@@ -185,11 +188,16 @@
|
||||
<Name>Meade.net</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -149,15 +149,19 @@ namespace ASCOM.Meade.net
|
||||
// Default constructor - Internal prevents public creation
|
||||
// of instances. Returned by Telescope.AxisRates.
|
||||
//
|
||||
internal TrackingRates()
|
||||
internal TrackingRates(bool supportsLunar)
|
||||
{
|
||||
//
|
||||
// This array must hold ONE or more DriveRates values, indicating
|
||||
// the tracking rates supported by your telescope. The one value
|
||||
// (tracking rate) that MUST be supported is driveSidereal!
|
||||
//
|
||||
if (supportsLunar)
|
||||
{
|
||||
_trackingRates = new[] {DriveRates.driveSidereal, DriveRates.driveLunar};
|
||||
// TODO Initialize this array with any additional tracking rates that your driver may provide
|
||||
}
|
||||
else
|
||||
_trackingRates = new[] { DriveRates.driveSidereal };
|
||||
}
|
||||
|
||||
#region ITrackingRates Members
|
||||
|
||||
+1445
-367
File diff suppressed because it is too large
Load Diff
@@ -98,6 +98,10 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="SharedResourcesUnitTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ThreadSafeBoolTests.cs" />
|
||||
<Compile Include="ThreadSafeDateTimeTests.cs" />
|
||||
<Compile Include="ThreadSafeEnumTests.cs" />
|
||||
<Compile Include="ThreadSafeNullableDoubleTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
@@ -170,6 +171,9 @@ namespace Meade.net.UnitTests
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
@@ -221,6 +225,19 @@ namespace Meade.net.UnitTests
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Send Date and time on connect", string.Empty, "false"))
|
||||
.Returns(() => SendDateTimeDefault);
|
||||
@@ -294,6 +311,9 @@ namespace Meade.net.UnitTests
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
@@ -336,6 +356,18 @@ namespace Meade.net.UnitTests
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
@@ -374,6 +406,9 @@ namespace Meade.net.UnitTests
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
@@ -415,6 +450,15 @@ namespace Meade.net.UnitTests
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
@@ -467,6 +511,9 @@ namespace Meade.net.UnitTests
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
@@ -508,6 +555,15 @@ namespace Meade.net.UnitTests
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
@@ -534,6 +590,349 @@ namespace Meade.net.UnitTests
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connect_WhenSpeedIsFastAndAutostarSetToFast_ThenConnectsDirectlyAtFastSpeed()
|
||||
{
|
||||
string deviceId = "Serial";
|
||||
|
||||
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string TraceStateDefault = "false";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string SpeedDefault = "57600";
|
||||
string DataBitsDefault = "8";
|
||||
string StopBitsDefault = "One";
|
||||
string HandshakeDefault = "None";
|
||||
string ParityDefault = "None";
|
||||
string RtsDtrEnabledDefault = "false";
|
||||
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
|
||||
.Returns(() => SpeedDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
|
||||
.Returns(() => DataBitsDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
|
||||
.Returns(() => StopBitsDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
|
||||
.Returns(() => HandshakeDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
|
||||
.Returns(() => ParityDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
|
||||
.Returns(() => RtsDtrEnabledDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
|
||||
.Returns(() => ParityDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
|
||||
.Returns(() => ParkedAltDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
string serialPortReturn = string.Empty;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit("#:GVP#")).Callback(() => { serialPortReturn = TelescopeList.LX200GPS; });
|
||||
_serialMock.Setup(x => x.Transmit("#:GVN#")).Callback(() => { serialPortReturn = TelescopeList.LX200GPS_42G; });
|
||||
_serialMock.Setup(x => x.Transmit("#:GG#")).Callback(() => { serialPortReturn = "0"; });
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => serialPortReturn);
|
||||
|
||||
var connectionResult = SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object);
|
||||
try
|
||||
{
|
||||
Assert.That(connectionResult.SameDevice, Is.EqualTo(1));
|
||||
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.LX200GPS));
|
||||
Assert.That(SharedResources.FirmwareVersion, Is.EqualTo(TelescopeList.LX200GPS_42G));
|
||||
}
|
||||
finally
|
||||
{
|
||||
SharedResources.Disconnect(deviceId, String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
[TestCase("57600")]
|
||||
[TestCase("38400")]
|
||||
[TestCase("28800")]
|
||||
[TestCase("19200")]
|
||||
[TestCase("14400")]
|
||||
[TestCase("4800")]
|
||||
[TestCase("2400")]
|
||||
[TestCase("1200")]
|
||||
public void Connect_WhenSpeedIsFastAndAutostarAtDefault_ThenConnectsAutoStarSpeedChanged(string WantedSpeed)
|
||||
{
|
||||
string deviceId = "Serial";
|
||||
|
||||
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string TraceStateDefault = "false";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string SpeedDefault = "9600";
|
||||
string DataBitsDefault = "8";
|
||||
string StopBitsDefault = "One";
|
||||
string HandshakeDefault = "None";
|
||||
string ParityDefault = "None";
|
||||
string RtsDtrEnabledDefault = "false";
|
||||
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
|
||||
.Returns(() => WantedSpeed);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
|
||||
.Returns(() => DataBitsDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
|
||||
.Returns(() => StopBitsDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
|
||||
.Returns(() => HandshakeDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
|
||||
.Returns(() => ParityDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
|
||||
.Returns(() => RtsDtrEnabledDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
|
||||
.Returns(() => ParityDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
|
||||
.Returns(() => ParkedAltDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
string serialPortReturn = string.Empty;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit("#:GVP#")).Callback(() => { serialPortReturn = TelescopeList.LX200GPS; });
|
||||
_serialMock.Setup(x => x.Transmit("#:GVN#")).Callback(() => { serialPortReturn = TelescopeList.LX200GPS_42G; });
|
||||
_serialMock.Setup(x => x.Transmit("#:SB1#")).Callback(() => { serialPortReturn = "1"; });
|
||||
|
||||
var ggCall = 0;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit("#:GG#")).Callback(() => {
|
||||
ggCall++;
|
||||
if (ggCall == 1)
|
||||
throw new Exception("Fake Timeout");
|
||||
else
|
||||
serialPortReturn = "0"; });
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => serialPortReturn);
|
||||
_serialMock.Setup(x => x.ReceiveCounted(1)).Returns(() => "1");
|
||||
|
||||
var connectionResult = SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object);
|
||||
try
|
||||
{
|
||||
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.LX200GPS));
|
||||
Assert.That(SharedResources.FirmwareVersion, Is.EqualTo(TelescopeList.LX200GPS_42G));
|
||||
|
||||
_traceLoggerMock.Verify(x => x.LogIssue("Connect", $"Telescope serial port speed change, connecting at ps{WantedSpeed}."), Times.Once);
|
||||
}
|
||||
finally
|
||||
{
|
||||
SharedResources.Disconnect(deviceId, String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
[TestCase("57600")]
|
||||
[TestCase("38400")]
|
||||
[TestCase("28800")]
|
||||
[TestCase("19200")]
|
||||
[TestCase("14400")]
|
||||
[TestCase("4800")]
|
||||
[TestCase("2400")]
|
||||
[TestCase("1200")]
|
||||
public void Connect_WhenAutostarReportsFailedToChangeSpeec_ThenConnectsAutoStarAtDefaultSpeed(string WantedSpeed)
|
||||
{
|
||||
string deviceId = "Serial";
|
||||
|
||||
string DriverId = "ASCOM.MeadeGeneric.Telescope";
|
||||
|
||||
string TraceStateDefault = "false";
|
||||
|
||||
string ComPortDefault = "COM1";
|
||||
string SpeedDefault = "9600";
|
||||
string DataBitsDefault = "8";
|
||||
string StopBitsDefault = "One";
|
||||
string HandshakeDefault = "None";
|
||||
string ParityDefault = "None";
|
||||
string RtsDtrEnabledDefault = "false";
|
||||
|
||||
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
string PrecisionDefault = "Unchanged";
|
||||
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
|
||||
.Returns(TraceStateDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
|
||||
.Returns(ComPortDefault);
|
||||
profileWrapperMock
|
||||
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
|
||||
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
|
||||
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
|
||||
.Returns(PrecisionDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
|
||||
.Returns(() => WantedSpeed);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
|
||||
.Returns(() => DataBitsDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
|
||||
.Returns(() => StopBitsDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
|
||||
.Returns(() => HandshakeDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
|
||||
.Returns(() => ParityDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
|
||||
.Returns(() => RtsDtrEnabledDefault);
|
||||
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
|
||||
.Returns(() => ParityDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
|
||||
.Returns(() => ParkedAltDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
|
||||
SharedResources.ProfileFactory = profileFactoryMock.Object;
|
||||
|
||||
string serialPortReturn = string.Empty;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit("#:GVP#")).Callback(() => { serialPortReturn = TelescopeList.LX200GPS; });
|
||||
_serialMock.Setup(x => x.Transmit("#:GVN#")).Callback(() => { serialPortReturn = TelescopeList.LX200GPS_42G; });
|
||||
_serialMock.Setup(x => x.Transmit("#:SB1#")).Callback(() => { serialPortReturn = "1"; });
|
||||
|
||||
var ggCall = 0;
|
||||
|
||||
_serialMock.Setup(x => x.Transmit("#:GG#")).Callback(() => {
|
||||
ggCall++;
|
||||
if (ggCall == 1)
|
||||
throw new Exception("Fake Timeout");
|
||||
else
|
||||
serialPortReturn = "0";
|
||||
});
|
||||
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(() => serialPortReturn);
|
||||
_serialMock.Setup(x => x.ReceiveCounted(1)).Returns(() => "0");
|
||||
|
||||
var connectionResult = SharedResources.Connect(deviceId, string.Empty, _traceLoggerMock.Object);
|
||||
try
|
||||
{
|
||||
Assert.That(SharedResources.ProductName, Is.EqualTo(TelescopeList.LX200GPS));
|
||||
Assert.That(SharedResources.FirmwareVersion, Is.EqualTo(TelescopeList.LX200GPS_42G));
|
||||
|
||||
_traceLoggerMock.Verify(x => x.LogIssue("Connect", $"Telescope not responding to speed change, connecting at ps{SpeedDefault}."), Times.Once);
|
||||
}
|
||||
finally
|
||||
{
|
||||
SharedResources.Disconnect(deviceId, String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Connect_WhenSerialPortIsNotRespondingCorrectly_ThenExceptionThrown()
|
||||
{
|
||||
@@ -557,6 +956,9 @@ namespace Meade.net.UnitTests
|
||||
string ParkedBehaviourDefault = "No Coordinates";
|
||||
string ParkedAltDefault = "0";
|
||||
string ParkedAzimuthDefault = "180";
|
||||
string FocalLengthDefault = "2000";
|
||||
string ApertureAreaDefault = "32685";
|
||||
string ApertureDiameterDefault = "203";
|
||||
|
||||
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
|
||||
profileWrapperMock.SetupAllProperties();
|
||||
@@ -597,6 +999,15 @@ namespace Meade.net.UnitTests
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
|
||||
.Returns(() => ParkedAzimuthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Focal Length (mm)", string.Empty, FocalLengthDefault))
|
||||
.Returns(() => FocalLengthDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Area (mm²)", string.Empty, ApertureAreaDefault))
|
||||
.Returns(() => ApertureAreaDefault);
|
||||
profileWrapperMock.Setup(x =>
|
||||
x.GetValue(DriverId, "Aperture Diameter (mm)", string.Empty, ApertureDiameterDefault))
|
||||
.Returns(() => ApertureDiameterDefault);
|
||||
|
||||
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
|
||||
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
|
||||
@@ -618,5 +1029,41 @@ namespace Meade.net.UnitTests
|
||||
|
||||
_traceLoggerMock.Verify( x => x.LogIssue("Connect", "Unable to decode response from the telescope, This is likely a hardware serial communications error."), Times.Once);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CheckIsParkedIsFalseByDefault() => Assert.That(SharedResources.IsParked, Is.False);
|
||||
|
||||
[Test]
|
||||
public void CheckParkedPositionIsNullByDefault() => Assert.That(SharedResources.ParkedPosition, Is.Null);
|
||||
|
||||
[Test]
|
||||
public void CheckIsLongFormatIsFalseByDefault() => Assert.That(SharedResources.IsLongFormat, Is.False);
|
||||
|
||||
[Test]
|
||||
public void CheckMovingPrimaryIsFalseBydefault() => Assert.That(SharedResources.MovingPrimary, Is.False);
|
||||
|
||||
[Test]
|
||||
public void CheckMovingSecondaryIsFalseBydefault() => Assert.That(SharedResources.MovingSecondary, Is.False);
|
||||
|
||||
[Test]
|
||||
public void CheckSideOfPierIsUnknownByDefault() => Assert.That(SharedResources.SideOfPier, Is.EqualTo(PierSide.pierUnknown));
|
||||
|
||||
[Test]
|
||||
public void CheckSlewSettleTimeIsZeroByDefault() => Assert.That(SharedResources.SlewSettleTime, Is.EqualTo((short)0));
|
||||
|
||||
[Test]
|
||||
public void CheckEarliestNonNonSlewingTimeIsMinValueByDefault() => Assert.That(SharedResources.EarliestNonSlewingTime, Is.EqualTo(DateTime.MinValue));
|
||||
|
||||
[Test]
|
||||
public void CheckTargetDeclinationIsNullByDefault() => Assert.That(SharedResources.TargetDeclination.HasValue, Is.False);
|
||||
|
||||
[Test]
|
||||
public void CheckTargetRightAscensionIsNullByDefault() => Assert.That(SharedResources.TargetRightAscension.HasValue, Is.False);
|
||||
|
||||
[Test]
|
||||
public void CheckIsTargetCoordinateInitRequired() => Assert.That(SharedResources.IsTargetCoordinateInitRequired, Is.True);
|
||||
|
||||
[Test]
|
||||
public void CheckIsGuiding() => Assert.That(SharedResources.IsGuiding, Is.False);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeBoolTests
|
||||
{
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void When_Assigned_ThenValueIsSame(bool value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<bool> sut = value;
|
||||
|
||||
// when
|
||||
bool actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCase(false, false)]
|
||||
[TestCase(false, true)]
|
||||
[TestCase(true, false)]
|
||||
[TestCase(true, true)]
|
||||
public void When_SetValue_ThenValueIsUpdated(bool initialValue, bool setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<bool> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
bool afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeDateTimeTests
|
||||
{
|
||||
[TestCaseSource(nameof(DateTimeSource))]
|
||||
public void When_Assigned_ThenValueIsSame(DateTime value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<DateTime> sut = value;
|
||||
|
||||
// when
|
||||
DateTime actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(DateTimeSetSource))]
|
||||
public void When_SetValue_ThenValueIsUpdated(DateTime initialValue, DateTime setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<DateTime> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
DateTime afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
|
||||
static readonly DateTime Example1 = DateTimeOffset.Parse("2012-05-09T02:10:31.296761Z", CultureInfo.InvariantCulture).UtcDateTime;
|
||||
static readonly DateTime Example2 = DateTimeOffset.Parse("2051-03-09T23:15:11.556081Z", CultureInfo.InvariantCulture).UtcDateTime;
|
||||
|
||||
static IEnumerable<DateTime> DateTimeSource => new[]
|
||||
{
|
||||
DateTime.MinValue,
|
||||
Example1,
|
||||
Example2
|
||||
};
|
||||
|
||||
static IEnumerable<TestCaseData> DateTimeSetSource => new[]
|
||||
{
|
||||
new TestCaseData(DateTime.MinValue, Example1),
|
||||
new TestCaseData(DateTime.MinValue, Example2),
|
||||
new TestCaseData(DateTime.MinValue, DateTime.MinValue),
|
||||
new TestCaseData(Example1, Example1),
|
||||
new TestCaseData(Example1, Example2),
|
||||
new TestCaseData(Example1, DateTime.MinValue),
|
||||
new TestCaseData(Example2, Example1),
|
||||
new TestCaseData(Example2, Example2),
|
||||
new TestCaseData(Example2, DateTime.MinValue)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeEnumTests
|
||||
{
|
||||
[TestCase(PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierWest)]
|
||||
public void When_Assigned_ThenValueIsSame(PierSide value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<PierSide> sut = value;
|
||||
|
||||
// when
|
||||
PierSide actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCase(PierSide.pierUnknown, PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierUnknown, PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierUnknown, PierSide.pierWest)]
|
||||
[TestCase(PierSide.pierEast, PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierEast, PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierEast, PierSide.pierWest)]
|
||||
[TestCase(PierSide.pierWest, PierSide.pierUnknown)]
|
||||
[TestCase(PierSide.pierWest, PierSide.pierEast)]
|
||||
[TestCase(PierSide.pierWest, PierSide.pierWest)]
|
||||
public void When_SetValue_ThenValueIsUpdated(PierSide initialValue, PierSide setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<PierSide> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
PierSide afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using ASCOM.Meade.net;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Meade.net.UnitTests
|
||||
{
|
||||
public class ThreadSafeNullableDoubleTests
|
||||
{
|
||||
[TestCase(0.1d)]
|
||||
[TestCase(-12.34d)]
|
||||
[TestCase(0d)]
|
||||
[TestCase(null)]
|
||||
public void When_Assigned_ThenValueIsSame(double? value)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<double?> sut = value;
|
||||
|
||||
// when
|
||||
double? actual = sut;
|
||||
|
||||
// then
|
||||
Assert.That(actual, Is.EqualTo(value));
|
||||
}
|
||||
|
||||
[TestCase(0.1d, 0.2d)]
|
||||
[TestCase(-12.34d, 5d)]
|
||||
[TestCase(0d, 1d)]
|
||||
[TestCase(null, 2d)]
|
||||
[TestCase(0.1d, null)]
|
||||
[TestCase(-12.34d, null)]
|
||||
[TestCase(0d, null)]
|
||||
[TestCase(null, null)]
|
||||
public void When_SetValue_ThenValueIsUpdated(double? initialValue, double? setValue)
|
||||
{
|
||||
// given
|
||||
ThreadSafeValue<double?> sut = initialValue;
|
||||
|
||||
// when
|
||||
sut.Set(setValue);
|
||||
double? afterset = sut;
|
||||
|
||||
// then
|
||||
Assert.That(afterset, Is.EqualTo(setValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" />
|
||||
<package id="Moq" version="4.15.2" targetFramework="net472" />
|
||||
<package id="NUnit" version="3.13.0" targetFramework="net472" />
|
||||
<package id="NUnit.ConsoleRunner" version="3.12.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -176,12 +176,12 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogMessage("Connected Set", "Error connecting to port {0} - {1}", ComPort, ex.Message);
|
||||
LogMessage("Connected Set", "Error connecting to port {0} - {1}", _profileProperties.ComPort, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage("Connected Set", "Disconnecting from port {0}", ComPort);
|
||||
LogMessage("Connected Set", "Disconnecting from port {0}", _profileProperties.ComPort);
|
||||
SharedResourcesWrapper.Disconnect("Serial", DriverId);
|
||||
IsConnected = false;
|
||||
}
|
||||
@@ -295,13 +295,11 @@ namespace ASCOM.Meade.net
|
||||
return;
|
||||
|
||||
var direction = position > 0;
|
||||
if (ReverseFocusDirection)
|
||||
if (_profileProperties.ReverseFocusDirection)
|
||||
direction = !direction;
|
||||
|
||||
SharedResourcesWrapper.Lock(() =>
|
||||
{
|
||||
//backlash compensation.
|
||||
var backlashCompensationSteps = direction ? Math.Abs(BacklashCompensation) : 0;
|
||||
var backlashCompensationSteps = direction ? Math.Abs(_profileProperties.BacklashCompensation) : 0;
|
||||
|
||||
var steps = Math.Abs(position) + backlashCompensationSteps;
|
||||
|
||||
@@ -320,12 +318,11 @@ namespace ASCOM.Meade.net
|
||||
DynamicBreaking(direction);
|
||||
//todo implement dynamic braking
|
||||
//dynamic breaking is sending the command to move in the opposite direction immediatly followed by the command to stop.
|
||||
});
|
||||
}
|
||||
|
||||
private void DynamicBreaking(bool directionOut)
|
||||
{
|
||||
if (!UseDynamicBreaking)
|
||||
if (!_profileProperties.DynamicBreaking)
|
||||
return;
|
||||
|
||||
Tl.LogMessage("Move", "Applying dynamic breaking");
|
||||
@@ -343,9 +340,9 @@ namespace ASCOM.Meade.net
|
||||
//:FS# Set Focus speed to slowest setting
|
||||
//Returns: Nothing
|
||||
|
||||
//:F<n># Autostar, Autostar II – set focuser speed to <n> where <n> is an ASCII digit 1..4
|
||||
//:F<n># Autostar, Autostar II - set focuser speed to <n> where <n> is an ASCII digit 1..4
|
||||
//Returns: Nothing
|
||||
//All others – Not Supported
|
||||
//All others - Not Supported
|
||||
_utilities.WaitForMilliseconds(100);
|
||||
|
||||
PerformFocuserMove(directionOut);
|
||||
|
||||
@@ -146,6 +146,7 @@
|
||||
<Compile Include="ProfileProperties.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TelescopeList.cs" />
|
||||
<Compile Include="ThreadSafeValue.cs" />
|
||||
<Compile Include="Win32Utilities.cs" />
|
||||
<Compile Include="Wrapper\IProfileWrapper.cs" />
|
||||
<Compile Include="Wrapper\SharedResourcesWrapper.cs" />
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using ASCOM.Meade.net.AstroMaths;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities;
|
||||
|
||||
@@ -20,20 +19,8 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
protected static readonly string DriverDescription = "Meade Generic";
|
||||
|
||||
protected static string ComPort; // Variables to hold the currrent device configuration
|
||||
protected static int BacklashCompensation;
|
||||
protected static bool ReverseFocusDirection;
|
||||
protected static bool UseDynamicBreaking;
|
||||
protected double GuideRate;
|
||||
protected string Precision;
|
||||
protected string GuidingStyle;
|
||||
protected double SiteElevation;
|
||||
protected short ProfileSettleTime;
|
||||
protected bool SendDateTime;
|
||||
protected ParkedBehaviour ParkedBehaviour;
|
||||
protected HorizonCoordinates ParkedAltAz;
|
||||
|
||||
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
|
||||
protected ProfileProperties _profileProperties;
|
||||
|
||||
public MeadeTelescopeBase()
|
||||
{
|
||||
@@ -62,39 +49,25 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
protected void ReadProfile()
|
||||
{
|
||||
var profileProperties = SharedResourcesWrapper.ReadProfile();
|
||||
Tl.Enabled = profileProperties.TraceLogger;
|
||||
ComPort = profileProperties.ComPort;
|
||||
BacklashCompensation = profileProperties.BacklashCompensation;
|
||||
ReverseFocusDirection = profileProperties.ReverseFocusDirection;
|
||||
UseDynamicBreaking = profileProperties.DynamicBreaking;
|
||||
GuideRate = profileProperties.GuideRateArcSecondsPerSecond;
|
||||
Precision = profileProperties.Precision;
|
||||
GuidingStyle = profileProperties.GuidingStyle.ToLower();
|
||||
SiteElevation = profileProperties.SiteElevation;
|
||||
ProfileSettleTime = profileProperties.SettleTime;
|
||||
SendDateTime = profileProperties.SendDateTime;
|
||||
ParkedBehaviour = profileProperties.ParkedBehaviour;
|
||||
|
||||
ParkedAltAz = new HorizonCoordinates
|
||||
{
|
||||
Altitude = profileProperties.ParkedAlt,
|
||||
Azimuth = profileProperties.ParkedAz
|
||||
};
|
||||
_profileProperties = SharedResourcesWrapper.ReadProfile();
|
||||
Tl.Enabled = _profileProperties.TraceLogger;
|
||||
|
||||
LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}");
|
||||
LogMessage("ReadProfile", $"Com Port: {ComPort}");
|
||||
LogMessage("ReadProfile", $"Backlash Steps: {BacklashCompensation}");
|
||||
LogMessage("ReadProfile", $"Dynamic breaking: {UseDynamicBreaking}");
|
||||
LogMessage("ReadProfile", $"Guide Rate: {GuideRate}");
|
||||
LogMessage("ReadProfile", $"Precision: {Precision}");
|
||||
LogMessage("ReadProfile", $"Guiding Style: {GuidingStyle}");
|
||||
LogMessage("ReadProfile", $"Site Elevation: {SiteElevation}");
|
||||
LogMessage("ReadProfile", $"Settle Time after slew: {ProfileSettleTime}");
|
||||
LogMessage("ReadProfile", $"Send date and time on connect: {SendDateTime}");
|
||||
LogMessage("ReadProfile", $"Parked Behaviour: {ParkedBehaviour}");
|
||||
LogMessage("ReadProfile", $"Parked Alt: {ParkedAltAz.Altitude}");
|
||||
LogMessage("ReadProfile", $"Parked Az: {ParkedAltAz.Azimuth}");
|
||||
LogMessage("ReadProfile", $"Com Port: {_profileProperties.ComPort}");
|
||||
LogMessage("ReadProfile", $"Backlash Steps: {_profileProperties.BacklashCompensation}");
|
||||
LogMessage("ReadProfile", $"Dynamic breaking: {_profileProperties.DynamicBreaking}");
|
||||
LogMessage("ReadProfile", $"Guide Rate: {_profileProperties.GuideRateArcSecondsPerSecond}");
|
||||
LogMessage("ReadProfile", $"Precision: {_profileProperties.Precision}");
|
||||
LogMessage("ReadProfile", $"Guiding Style: {_profileProperties.GuidingStyle}");
|
||||
LogMessage("ReadProfile", $"Site Elevation: {_profileProperties.SiteElevation}");
|
||||
LogMessage("ReadProfile", $"Settle Time after slew: {_profileProperties.SettleTime}");
|
||||
LogMessage("ReadProfile", $"Send date and time on connect: {_profileProperties.SendDateTime}");
|
||||
LogMessage("ReadProfile", $"Parked Behaviour: {_profileProperties.ParkedBehaviour}");
|
||||
LogMessage("ReadProfile", $"Parked Alt: {_profileProperties.ParkedAlt}");
|
||||
LogMessage("ReadProfile", $"Parked Az: {_profileProperties.ParkedAz}");
|
||||
LogMessage("ReadProfile", $"Focal Length: {_profileProperties.FocalLength}");
|
||||
LogMessage("ReadProfile", $"Aperture Area: {_profileProperties.ApertureArea}");
|
||||
LogMessage("ReadProfile", $"Aperture Area: {_profileProperties.ApertureDiameter}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -159,7 +132,7 @@ namespace ASCOM.Meade.net
|
||||
protected void UpdateSiteElevation()
|
||||
{
|
||||
var profileProperties = SharedResourcesWrapper.ReadProfile();
|
||||
profileProperties.SiteElevation = SiteElevation;
|
||||
profileProperties.SiteElevation = _profileProperties.SiteElevation;
|
||||
SharedResourcesWrapper.WriteProfile(profileProperties);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,5 +6,7 @@ namespace ASCOM.Meade.net
|
||||
public double Azimuth { get; set; }
|
||||
public double RightAscension { get; set; }
|
||||
public double Declination { get; set; }
|
||||
public double SiteLongitude { get; set; }
|
||||
public double SiteLatitude { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -23,5 +23,8 @@ namespace ASCOM.Meade.net
|
||||
public ParkedBehaviour ParkedBehaviour { get; set; }
|
||||
public double ParkedAlt { get; set; }
|
||||
public double ParkedAz { get; set; }
|
||||
public double FocalLength { get; set; }
|
||||
public double ApertureArea { get; set; }
|
||||
public double ApertureDiameter { get; set; }
|
||||
}
|
||||
}
|
||||
+9
@@ -144,5 +144,14 @@ namespace ASCOM.Meade.net.Properties {
|
||||
return ResourceManager.GetString("SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please enter only numbers..
|
||||
/// </summary>
|
||||
internal static string SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_ {
|
||||
get {
|
||||
return ResourceManager.GetString("SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,4 +147,7 @@ Valid are : -register, -unregister and -embedding</value>
|
||||
<data name="SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_" xml:space="preserve">
|
||||
<value>Please enter only numbers.</value>
|
||||
</data>
|
||||
<data name="SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_" xml:space="preserve">
|
||||
<value>Please enter only numbers.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -25,7 +25,7 @@ namespace ASCOM.Meade.net
|
||||
|
||||
SetItemsFromEnum(cboStopBits.Items, typeof(SerialStopBits));
|
||||
SetItemsFromEnum(cboParity.Items, typeof(SerialParity));
|
||||
SetItemsFromEnumValues(cboSpeed.Items, typeof(SerialSpeed));
|
||||
SetItemFromEnumValues(cboSpeed.Items, SerialSpeed.ps1200, SerialSpeed.ps57600);
|
||||
SetItemsFromEnum(cboHandShake.Items, typeof(SerialHandshake));
|
||||
SetItemsFromEnum(cboParkedBehaviour.Items, typeof(ParkedBehaviour));
|
||||
}
|
||||
@@ -41,12 +41,29 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
}
|
||||
|
||||
private void SetItemsFromEnumValues(IList items, Type enumItems)
|
||||
//private void SetItemsFromEnumValues(IList items, Type enumItems)
|
||||
//{
|
||||
// items.Clear();
|
||||
|
||||
// foreach (int item in Enum.GetValues(enumItems))
|
||||
// {
|
||||
// items.Add(item);
|
||||
// }
|
||||
//}
|
||||
|
||||
private void SetItemFromEnumValues<T>(IList items, T minValue, T maxValue)
|
||||
{
|
||||
items.Clear();
|
||||
|
||||
foreach (int item in Enum.GetValues(enumItems))
|
||||
var type = typeof(T);
|
||||
|
||||
var intMinValue = (int)Convert.ChangeType(minValue, typeof(int));
|
||||
|
||||
var intMaxValue = (int)Convert.ChangeType(maxValue, typeof(int));
|
||||
|
||||
foreach (int item in Enum.GetValues(type))
|
||||
{
|
||||
if ((item >= intMinValue) && (item <= intMaxValue))
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
@@ -188,6 +205,33 @@ namespace ASCOM.Meade.net
|
||||
txtParkedAz.Text = "180";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtFocalLength.Text = profileProperties.FocalLength.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtFocalLength.Text = "2000";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtApertureArea.Text = profileProperties.ApertureArea.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtApertureArea.Text = "32685";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
txtApertureDiameter.Text = profileProperties.ApertureDiameter.ToString(CultureInfo.CurrentCulture);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
txtApertureDiameter.Text = "203";
|
||||
}
|
||||
|
||||
UpdateParkedItemsEnabled();
|
||||
}
|
||||
|
||||
@@ -214,7 +258,10 @@ namespace ASCOM.Meade.net
|
||||
SendDateTime = cbxSendDateTime.Checked,
|
||||
ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(cboParkedBehaviour.SelectedItem.ToString()),
|
||||
ParkedAlt = double.Parse(txtParkedAlt.Text),
|
||||
ParkedAz = double.Parse(txtParkedAz.Text)
|
||||
ParkedAz = double.Parse(txtParkedAz.Text),
|
||||
FocalLength = double.Parse(txtFocalLength.Text),
|
||||
ApertureArea = double.Parse(txtApertureArea.Text),
|
||||
ApertureDiameter = double.Parse(txtApertureDiameter.Text)
|
||||
};
|
||||
|
||||
return profileProperties;
|
||||
@@ -320,6 +367,15 @@ namespace ASCOM.Meade.net
|
||||
txtParkedAz.Text = txtParkedAz.Text.Remove(txtParkedAz.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void txt_FocalLength_TextChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtFocalLength.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show(Resources.SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_);
|
||||
txtFocalLength.Text = txtFocalLength.Text.Remove(txtFocalLength.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Generated
+73
@@ -82,6 +82,15 @@ namespace ASCOM.Meade.net
|
||||
this.label24 = new System.Windows.Forms.Label();
|
||||
this.txtParkedAlt = new System.Windows.Forms.TextBox();
|
||||
this.txtParkedAz = new System.Windows.Forms.TextBox();
|
||||
this.label25 = new System.Windows.Forms.Label();
|
||||
this.txtFocalLength = new System.Windows.Forms.TextBox();
|
||||
this.label26 = new System.Windows.Forms.Label();
|
||||
this.label27 = new System.Windows.Forms.Label();
|
||||
this.txtApertureDiameter = new System.Windows.Forms.TextBox();
|
||||
this.label28 = new System.Windows.Forms.Label();
|
||||
this.label29 = new System.Windows.Forms.Label();
|
||||
this.txtApertureArea = new System.Windows.Forms.TextBox();
|
||||
this.label30 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit();
|
||||
@@ -389,10 +398,65 @@ namespace ASCOM.Meade.net
|
||||
this.txtParkedAz.Name = "txtParkedAz";
|
||||
this.txtParkedAz.TextChanged += new System.EventHandler(this.txtParkedAz_TextChanged);
|
||||
//
|
||||
// label25
|
||||
//
|
||||
resources.ApplyResources(this.label25, "label25");
|
||||
this.label25.Name = "label25";
|
||||
//
|
||||
// txtFocalLength
|
||||
//
|
||||
resources.ApplyResources(this.txtFocalLength, "txtFocalLength");
|
||||
this.txtFocalLength.Name = "txtFocalLength";
|
||||
this.txtFocalLength.TextChanged += new System.EventHandler(this.txt_FocalLength_TextChanged_1);
|
||||
//
|
||||
// label26
|
||||
//
|
||||
resources.ApplyResources(this.label26, "label26");
|
||||
this.label26.Name = "label26";
|
||||
//
|
||||
// label27
|
||||
//
|
||||
resources.ApplyResources(this.label27, "label27");
|
||||
this.label27.Name = "label27";
|
||||
//
|
||||
// txtApetureDiameter
|
||||
//
|
||||
resources.ApplyResources(this.txtApertureDiameter, "txtApertureDiameter");
|
||||
this.txtApertureDiameter.Name = "txtApertureDiameter";
|
||||
//
|
||||
// label28
|
||||
//
|
||||
resources.ApplyResources(this.label28, "label28");
|
||||
this.label28.Name = "label28";
|
||||
//
|
||||
// label29
|
||||
//
|
||||
resources.ApplyResources(this.label29, "label29");
|
||||
this.label29.Name = "label29";
|
||||
//
|
||||
// txtApetureArea
|
||||
//
|
||||
resources.ApplyResources(this.txtApertureArea, "txtApertureArea");
|
||||
this.txtApertureArea.Name = "txtApertureArea";
|
||||
//
|
||||
// label30
|
||||
//
|
||||
resources.ApplyResources(this.label30, "label30");
|
||||
this.label30.Name = "label30";
|
||||
//
|
||||
// SetupDialogForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label29);
|
||||
this.Controls.Add(this.txtApertureArea);
|
||||
this.Controls.Add(this.label30);
|
||||
this.Controls.Add(this.label27);
|
||||
this.Controls.Add(this.txtApertureDiameter);
|
||||
this.Controls.Add(this.label28);
|
||||
this.Controls.Add(this.label26);
|
||||
this.Controls.Add(this.txtFocalLength);
|
||||
this.Controls.Add(this.label25);
|
||||
this.Controls.Add(this.txtParkedAz);
|
||||
this.Controls.Add(this.txtParkedAlt);
|
||||
this.Controls.Add(this.label24);
|
||||
@@ -507,5 +571,14 @@ namespace ASCOM.Meade.net
|
||||
private Label label24;
|
||||
private TextBox txtParkedAlt;
|
||||
private TextBox txtParkedAz;
|
||||
private Label label25;
|
||||
private TextBox txtFocalLength;
|
||||
private Label label26;
|
||||
private Label label27;
|
||||
private TextBox txtApertureDiameter;
|
||||
private Label label28;
|
||||
private Label label29;
|
||||
private TextBox txtApertureArea;
|
||||
private Label label30;
|
||||
}
|
||||
}
|
||||
+315
-75
@@ -145,7 +145,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cmdOK.ZOrder" xml:space="preserve">
|
||||
<value>47</value>
|
||||
<value>56</value>
|
||||
</data>
|
||||
<data name="cmdCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Right</value>
|
||||
@@ -172,7 +172,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cmdCancel.ZOrder" xml:space="preserve">
|
||||
<value>46</value>
|
||||
<value>55</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>45</value>
|
||||
<value>54</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>44</value>
|
||||
<value>53</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>43</value>
|
||||
<value>52</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>97, 305</value>
|
||||
<value>97, 380</value>
|
||||
</data>
|
||||
<data name="chkTrace.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 17</value>
|
||||
@@ -277,7 +277,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>chkTrace.ZOrder" xml:space="preserve">
|
||||
<value>42</value>
|
||||
<value>51</value>
|
||||
</data>
|
||||
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 87</value>
|
||||
@@ -298,13 +298,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>comboBoxComPort.ZOrder" xml:space="preserve">
|
||||
<value>41</value>
|
||||
<value>50</value>
|
||||
</data>
|
||||
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 169</value>
|
||||
<value>290, 262</value>
|
||||
</data>
|
||||
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>61, 13</value>
|
||||
@@ -325,13 +325,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label3.ZOrder" xml:space="preserve">
|
||||
<value>40</value>
|
||||
<value>49</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 166</value>
|
||||
<value>388, 259</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>46, 20</value>
|
||||
@@ -342,6 +339,9 @@
|
||||
<data name="txtGuideRate.Text" xml:space="preserve">
|
||||
<value>10.0</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="txtGuideRate.ToolTip" xml:space="preserve">
|
||||
<value>LX-200GPS only</value>
|
||||
</data>
|
||||
@@ -355,13 +355,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtGuideRate.ZOrder" xml:space="preserve">
|
||||
<value>39</value>
|
||||
<value>48</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>427, 169</value>
|
||||
<value>440, 262</value>
|
||||
</data>
|
||||
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>122, 13</value>
|
||||
@@ -382,13 +382,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label4.ZOrder" xml:space="preserve">
|
||||
<value>38</value>
|
||||
<value>47</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>427, 182</value>
|
||||
<value>440, 275</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>105, 13</value>
|
||||
@@ -409,13 +409,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblPercentOfSiderealRate.ZOrder" xml:space="preserve">
|
||||
<value>37</value>
|
||||
<value>46</value>
|
||||
</data>
|
||||
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 201</value>
|
||||
<value>290, 294</value>
|
||||
</data>
|
||||
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>50, 13</value>
|
||||
@@ -436,7 +436,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label5.ZOrder" xml:space="preserve">
|
||||
<value>36</value>
|
||||
<value>45</value>
|
||||
</data>
|
||||
<data name="cboPrecision.Items" xml:space="preserve">
|
||||
<value>Unchanged</value>
|
||||
@@ -448,7 +448,7 @@
|
||||
<value>High</value>
|
||||
</data>
|
||||
<data name="cboPrecision.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 198</value>
|
||||
<value>388, 291</value>
|
||||
</data>
|
||||
<data name="cboPrecision.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 21</value>
|
||||
@@ -466,7 +466,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboPrecision.ZOrder" xml:space="preserve">
|
||||
<value>35</value>
|
||||
<value>44</value>
|
||||
</data>
|
||||
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -475,7 +475,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 228</value>
|
||||
<value>290, 321</value>
|
||||
</data>
|
||||
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>67, 13</value>
|
||||
@@ -496,7 +496,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label6.ZOrder" xml:space="preserve">
|
||||
<value>34</value>
|
||||
<value>43</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Items" xml:space="preserve">
|
||||
<value>Auto</value>
|
||||
@@ -508,7 +508,7 @@
|
||||
<value>Pulse guiding</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 225</value>
|
||||
<value>388, 318</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 21</value>
|
||||
@@ -526,7 +526,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboGuidingStyle.ZOrder" xml:space="preserve">
|
||||
<value>33</value>
|
||||
<value>42</value>
|
||||
</data>
|
||||
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -556,7 +556,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label7.ZOrder" xml:space="preserve">
|
||||
<value>32</value>
|
||||
<value>41</value>
|
||||
</data>
|
||||
<data name="label8.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -568,7 +568,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 284</value>
|
||||
<value>290, 359</value>
|
||||
</data>
|
||||
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>52, 13</value>
|
||||
@@ -589,10 +589,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label8.ZOrder" xml:space="preserve">
|
||||
<value>31</value>
|
||||
<value>40</value>
|
||||
</data>
|
||||
<data name="txtBacklashSteps.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 302</value>
|
||||
<value>388, 377</value>
|
||||
</data>
|
||||
<data name="txtBacklashSteps.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>46, 20</value>
|
||||
@@ -613,7 +613,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtBacklashSteps.ZOrder" xml:space="preserve">
|
||||
<value>29</value>
|
||||
<value>38</value>
|
||||
</data>
|
||||
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -622,7 +622,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 305</value>
|
||||
<value>290, 380</value>
|
||||
</data>
|
||||
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>79, 13</value>
|
||||
@@ -643,7 +643,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label9.ZOrder" xml:space="preserve">
|
||||
<value>30</value>
|
||||
<value>39</value>
|
||||
</data>
|
||||
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -652,7 +652,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>427, 305</value>
|
||||
<value>440, 380</value>
|
||||
</data>
|
||||
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>20, 13</value>
|
||||
@@ -673,7 +673,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label10.ZOrder" xml:space="preserve">
|
||||
<value>28</value>
|
||||
<value>37</value>
|
||||
</data>
|
||||
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -706,13 +706,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label11.ZOrder" xml:space="preserve">
|
||||
<value>27</value>
|
||||
<value>36</value>
|
||||
</data>
|
||||
<data name="cbxReverseDirection.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="cbxReverseDirection.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 328</value>
|
||||
<value>388, 403</value>
|
||||
</data>
|
||||
<data name="cbxReverseDirection.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>109, 17</value>
|
||||
@@ -733,13 +733,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxReverseDirection.ZOrder" xml:space="preserve">
|
||||
<value>26</value>
|
||||
<value>35</value>
|
||||
</data>
|
||||
<data name="cbxDynamicBreaking.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="cbxDynamicBreaking.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 351</value>
|
||||
<value>388, 426</value>
|
||||
</data>
|
||||
<data name="cbxDynamicBreaking.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 17</value>
|
||||
@@ -760,7 +760,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxDynamicBreaking.ZOrder" xml:space="preserve">
|
||||
<value>25</value>
|
||||
<value>34</value>
|
||||
</data>
|
||||
<data name="cbxRtsDtr.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -793,11 +793,8 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxRtsDtr.ZOrder" xml:space="preserve">
|
||||
<value>24</value>
|
||||
<value>33</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="cbxSendDateTime.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
@@ -829,13 +826,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxSendDateTime.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>15</value>
|
||||
</data>
|
||||
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 96</value>
|
||||
<value>290, 189</value>
|
||||
</data>
|
||||
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>72, 13</value>
|
||||
@@ -856,10 +853,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label12.ZOrder" xml:space="preserve">
|
||||
<value>23</value>
|
||||
<value>32</value>
|
||||
</data>
|
||||
<data name="txtElevation.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 93</value>
|
||||
<value>388, 186</value>
|
||||
</data>
|
||||
<data name="txtElevation.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 20</value>
|
||||
@@ -877,13 +874,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtElevation.ZOrder" xml:space="preserve">
|
||||
<value>22</value>
|
||||
<value>31</value>
|
||||
</data>
|
||||
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>481, 96</value>
|
||||
<value>494, 189</value>
|
||||
</data>
|
||||
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>38, 13</value>
|
||||
@@ -904,13 +901,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label13.ZOrder" xml:space="preserve">
|
||||
<value>21</value>
|
||||
<value>30</value>
|
||||
</data>
|
||||
<data name="label14.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label14.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 127</value>
|
||||
<value>290, 220</value>
|
||||
</data>
|
||||
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>56, 13</value>
|
||||
@@ -931,10 +928,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label14.ZOrder" xml:space="preserve">
|
||||
<value>20</value>
|
||||
<value>29</value>
|
||||
</data>
|
||||
<data name="nudSettleTime.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>375, 125</value>
|
||||
<value>388, 218</value>
|
||||
</data>
|
||||
<data name="nudSettleTime.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>120, 20</value>
|
||||
@@ -952,13 +949,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>nudSettleTime.ZOrder" xml:space="preserve">
|
||||
<value>19</value>
|
||||
<value>28</value>
|
||||
</data>
|
||||
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>501, 127</value>
|
||||
<value>514, 220</value>
|
||||
</data>
|
||||
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>47, 13</value>
|
||||
@@ -979,7 +976,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label15.ZOrder" xml:space="preserve">
|
||||
<value>18</value>
|
||||
<value>27</value>
|
||||
</data>
|
||||
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1006,7 +1003,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label16.ZOrder" xml:space="preserve">
|
||||
<value>17</value>
|
||||
<value>26</value>
|
||||
</data>
|
||||
<data name="cboStopBits.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 163</value>
|
||||
@@ -1027,7 +1024,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboStopBits.ZOrder" xml:space="preserve">
|
||||
<value>16</value>
|
||||
<value>25</value>
|
||||
</data>
|
||||
<data name="numDatabits.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 137</value>
|
||||
@@ -1048,7 +1045,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>numDatabits.ZOrder" xml:space="preserve">
|
||||
<value>15</value>
|
||||
<value>24</value>
|
||||
</data>
|
||||
<data name="cboParity.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 190</value>
|
||||
@@ -1069,7 +1066,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboParity.ZOrder" xml:space="preserve">
|
||||
<value>14</value>
|
||||
<value>23</value>
|
||||
</data>
|
||||
<data name="cboSpeed.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 217</value>
|
||||
@@ -1090,7 +1087,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboSpeed.ZOrder" xml:space="preserve">
|
||||
<value>13</value>
|
||||
<value>22</value>
|
||||
</data>
|
||||
<data name="cboHandShake.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 244</value>
|
||||
@@ -1111,7 +1108,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboHandShake.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
<value>21</value>
|
||||
</data>
|
||||
<data name="label17.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1138,7 +1135,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label17.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
<value>20</value>
|
||||
</data>
|
||||
<data name="label18.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1165,7 +1162,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label18.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
<value>19</value>
|
||||
</data>
|
||||
<data name="label19.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1192,7 +1189,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label19.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>18</value>
|
||||
</data>
|
||||
<data name="label20.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1219,7 +1216,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label20.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>17</value>
|
||||
</data>
|
||||
<data name="label21.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1231,7 +1228,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label21.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>15, 284</value>
|
||||
<value>15, 359</value>
|
||||
</data>
|
||||
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>73, 13</value>
|
||||
@@ -1252,7 +1249,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label21.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>16</value>
|
||||
</data>
|
||||
<data name="cboParkedBehaviour.Items" xml:space="preserve">
|
||||
<value>No Coordinates</value>
|
||||
@@ -1282,7 +1279,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboParkedBehaviour.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name="label22.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1309,7 +1306,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label22.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name="label23.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1336,7 +1333,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label23.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="label24.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1363,7 +1360,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label24.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="txtParkedAlt.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>697, 151</value>
|
||||
@@ -1384,7 +1381,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtParkedAlt.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="txtParkedAz.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>697, 177</value>
|
||||
@@ -1405,8 +1402,251 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtParkedAz.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="label25.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label25.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label25.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 90</value>
|
||||
</data>
|
||||
<data name="label25.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>69, 13</value>
|
||||
</data>
|
||||
<data name="label25.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>48</value>
|
||||
</data>
|
||||
<data name="label25.Text" xml:space="preserve">
|
||||
<value>Focal Length</value>
|
||||
</data>
|
||||
<data name=">>label25.Name" xml:space="preserve">
|
||||
<value>label25</value>
|
||||
</data>
|
||||
<data name=">>label25.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=">>label25.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label25.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="txtFocalLength.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>388, 87</value>
|
||||
</data>
|
||||
<data name="txtFocalLength.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 20</value>
|
||||
</data>
|
||||
<data name="txtFocalLength.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>49</value>
|
||||
</data>
|
||||
<data name=">>txtFocalLength.Name" xml:space="preserve">
|
||||
<value>txtFocalLength</value>
|
||||
</data>
|
||||
<data name=">>txtFocalLength.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>txtFocalLength.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtFocalLength.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="label26.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label26.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label26.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>494, 90</value>
|
||||
</data>
|
||||
<data name="label26.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>23, 13</value>
|
||||
</data>
|
||||
<data name="label26.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>50</value>
|
||||
</data>
|
||||
<data name="label26.Text" xml:space="preserve">
|
||||
<value>mm</value>
|
||||
</data>
|
||||
<data name=">>label26.Name" xml:space="preserve">
|
||||
<value>label26</value>
|
||||
</data>
|
||||
<data name=">>label26.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=">>label26.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label26.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="label27.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label27.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label27.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>494, 114</value>
|
||||
</data>
|
||||
<data name="label27.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>23, 13</value>
|
||||
</data>
|
||||
<data name="label27.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>53</value>
|
||||
</data>
|
||||
<data name="label27.Text" xml:space="preserve">
|
||||
<value>mm</value>
|
||||
</data>
|
||||
<data name=">>label27.Name" xml:space="preserve">
|
||||
<value>label27</value>
|
||||
</data>
|
||||
<data name=">>label27.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=">>label27.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label27.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="txtApertureDiameter.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>388, 111</value>
|
||||
</data>
|
||||
<data name="txtApertureDiameter.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 20</value>
|
||||
</data>
|
||||
<data name="txtApertureDiameter.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>52</value>
|
||||
</data>
|
||||
<data name=">>txtApertureDiameter.Name" xml:space="preserve">
|
||||
<value>txtApertureDiameter</value>
|
||||
</data>
|
||||
<data name=">>txtApertureDiameter.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>txtApertureDiameter.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtApertureDiameter.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="label28.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label28.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label28.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 114</value>
|
||||
</data>
|
||||
<data name="label28.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>92, 13</value>
|
||||
</data>
|
||||
<data name="label28.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>51</value>
|
||||
</data>
|
||||
<data name="label28.Text" xml:space="preserve">
|
||||
<value>Aperture Diameter</value>
|
||||
</data>
|
||||
<data name=">>label28.Name" xml:space="preserve">
|
||||
<value>label28</value>
|
||||
</data>
|
||||
<data name=">>label28.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=">>label28.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label28.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="label29.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label29.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label29.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>494, 139</value>
|
||||
</data>
|
||||
<data name="label29.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>23, 13</value>
|
||||
</data>
|
||||
<data name="label29.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>56</value>
|
||||
</data>
|
||||
<data name="label29.Text" xml:space="preserve">
|
||||
<value>mm</value>
|
||||
</data>
|
||||
<data name=">>label29.Name" xml:space="preserve">
|
||||
<value>label29</value>
|
||||
</data>
|
||||
<data name=">>label29.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=">>label29.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label29.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="txtApertureArea.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>388, 136</value>
|
||||
</data>
|
||||
<data name="txtApertureArea.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 20</value>
|
||||
</data>
|
||||
<data name="txtApertureArea.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>55</value>
|
||||
</data>
|
||||
<data name=">>txtApertureArea.Name" xml:space="preserve">
|
||||
<value>txtApertureArea</value>
|
||||
</data>
|
||||
<data name=">>txtApertureArea.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>txtApertureArea.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtApertureArea.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="label30.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label30.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label30.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>290, 139</value>
|
||||
</data>
|
||||
<data name="label30.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>72, 13</value>
|
||||
</data>
|
||||
<data name="label30.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>54</value>
|
||||
</data>
|
||||
<data name="label30.Text" xml:space="preserve">
|
||||
<value>Aperture Area</value>
|
||||
</data>
|
||||
<data name=">>label30.Name" xml:space="preserve">
|
||||
<value>label30</value>
|
||||
</data>
|
||||
<data name=">>label30.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=">>label30.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label30.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
+216
-29
@@ -18,8 +18,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Meade.net.Wrapper;
|
||||
using ASCOM.Utilities;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
@@ -122,13 +124,17 @@ namespace ASCOM.Meade.net
|
||||
|
||||
public static bool SendBool(string command, bool raw = false)
|
||||
{
|
||||
|
||||
var result = SendChar(command, raw);
|
||||
|
||||
return result == "1";
|
||||
}
|
||||
|
||||
public static string SendChar(string command, bool raw = false)
|
||||
{
|
||||
return SendChars(command, raw, count: 1);
|
||||
}
|
||||
|
||||
public static string SendChars(string command, bool raw = false, int count = 1)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
@@ -139,14 +145,11 @@ namespace ASCOM.Meade.net
|
||||
|
||||
try
|
||||
{
|
||||
return SharedSerial.ReceiveCounted(1);
|
||||
return SharedSerial.ReceiveCounted(count);
|
||||
}
|
||||
catch (COMException ex)
|
||||
catch (COMException ex) when (ex.Message.Contains("Timed out waiting for received data"))
|
||||
{
|
||||
if (ex.Message.Contains("Timed out waiting for received data"))
|
||||
throw new TimeoutException(ex.Message, ex);
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,6 +198,9 @@ namespace ASCOM.Meade.net
|
||||
private const string ParkedBehaviourName = "Parked Behaviour";
|
||||
private const string ParkedAltName = "Parked Altitude";
|
||||
private const string ParkedAzimuthName = "Parked Azimuth";
|
||||
private const string FocalLengthName = "Focal Length (mm)";
|
||||
private const string ApertureAreaName = "Aperture Area (mm²)";
|
||||
private const string ApertureDiameterName = "Aperture Diameter (mm)";
|
||||
|
||||
public static void WriteProfile(ProfileProperties profileProperties)
|
||||
{
|
||||
@@ -223,6 +229,9 @@ namespace ASCOM.Meade.net
|
||||
driverProfile.WriteValue(DriverId, ParkedBehaviourName, profileProperties.ParkedBehaviour.GetDescription());
|
||||
driverProfile.WriteValue(DriverId, ParkedAltName, profileProperties.ParkedAlt.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, ParkedAzimuthName, profileProperties.ParkedAz.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, FocalLengthName, profileProperties.FocalLength.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, ApertureAreaName, profileProperties.ApertureArea.ToString(CultureInfo.InvariantCulture));
|
||||
driverProfile.WriteValue(DriverId, ApertureDiameterName, profileProperties.ApertureDiameter.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,9 +253,12 @@ namespace ASCOM.Meade.net
|
||||
private const string HandShakeDefault = "None";
|
||||
private const string ParityDefault = "None";
|
||||
private const string SendDateTimeDefault = "false";
|
||||
private static string ParkedBehaviourDefault = "No Coordinates";
|
||||
private const string ParkedBehaviourDefault = "No Coordinates";
|
||||
private const string ParkedAltDefault = "0";
|
||||
private const string ParkedAzimuthDefault = "180";
|
||||
private const string FocalLengthDefault = "2000";
|
||||
private const string ApertureAreaDefault = "32685";
|
||||
private const string ApertureDiameterDefault = "203";
|
||||
|
||||
public static ProfileProperties ReadProfile()
|
||||
{
|
||||
@@ -277,6 +289,9 @@ namespace ASCOM.Meade.net
|
||||
profileProperties.ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(driverProfile.GetValue(DriverId, ParkedBehaviourName, string.Empty, ParkedBehaviourDefault));
|
||||
profileProperties.ParkedAlt = double.Parse(driverProfile.GetValue(DriverId, ParkedAltName, string.Empty, ParkedAltDefault), NumberFormatInfo.InvariantInfo);
|
||||
profileProperties.ParkedAz = double.Parse(driverProfile.GetValue(DriverId, ParkedAzimuthName, string.Empty, ParkedAzimuthDefault), NumberFormatInfo.InvariantInfo);
|
||||
profileProperties.FocalLength = double.Parse(driverProfile.GetValue(DriverId, FocalLengthName, string.Empty, FocalLengthDefault), NumberFormatInfo.InvariantInfo);
|
||||
profileProperties.ApertureArea = double.Parse(driverProfile.GetValue(DriverId, ApertureAreaName, string.Empty, ApertureAreaDefault), NumberFormatInfo.InvariantInfo);
|
||||
profileProperties.ApertureDiameter = double.Parse(driverProfile.GetValue(DriverId, ApertureDiameterName, string.Empty, ApertureDiameterDefault), NumberFormatInfo.InvariantInfo);
|
||||
}
|
||||
|
||||
return profileProperties;
|
||||
@@ -288,6 +303,8 @@ namespace ASCOM.Meade.net
|
||||
#region SetupDialog
|
||||
|
||||
public static void SetupDialog()
|
||||
{
|
||||
try
|
||||
{
|
||||
var profileProperties = ReadProfile();
|
||||
|
||||
@@ -305,10 +322,17 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
profileProperties = f.GetProfile();
|
||||
|
||||
WriteProfile(profileProperties); // Persist device configuration values to the ASCOM Profile store
|
||||
WriteProfile(
|
||||
profileProperties); // Persist device configuration values to the ASCOM Profile store
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -365,8 +389,71 @@ namespace ASCOM.Meade.net
|
||||
SharedSerial.DataBits = profileProperties.DataBits;
|
||||
SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits);
|
||||
SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity);
|
||||
SharedSerial.Speed = (SerialSpeed)profileProperties.Speed;
|
||||
SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake);
|
||||
SharedSerial.ReceiveTimeout = 5; //5 second timeout;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
|
||||
var wantedSpeed = (SerialSpeed)profileProperties.Speed;
|
||||
if (wantedSpeed != SerialSpeed.ps9600)
|
||||
{
|
||||
SharedSerial.Speed = wantedSpeed;
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
var speedRampNeeded = false;
|
||||
|
||||
//Test if communication is working.
|
||||
try
|
||||
{
|
||||
string utcOffSet = SendString("GG");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
speedRampNeeded = true;
|
||||
}
|
||||
|
||||
if (speedRampNeeded)
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
int newSpeedIndex = GetSpeedIndex(wantedSpeed);
|
||||
//:SBn# Set Baud Rate n, where n is an ASCII digit (1..9) with the following interpertation
|
||||
// 1 56.7K
|
||||
// 2 38.4K
|
||||
// 3 28.8K
|
||||
// 4 19.2K
|
||||
// 5 14.4K
|
||||
// 6 9600
|
||||
// 7 4800
|
||||
// 8 2400
|
||||
// 9 1200
|
||||
//Returns:
|
||||
// 1 At the current baud rate and then changes to the new rate for further communication
|
||||
//SendBlind($"SB{newSpeedIndex}");
|
||||
try
|
||||
{
|
||||
var speedChanged = SendChar($"SB{newSpeedIndex}");
|
||||
if (speedChanged == "1")
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
SharedSerial.Speed = wantedSpeed;
|
||||
traceLogger.LogIssue("Connect",
|
||||
$"Telescope serial port speed change, connecting at {SharedSerial.Speed}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Autostar not signalled speed change.");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
SharedSerial.Connected = false;
|
||||
SharedSerial.Speed = SerialSpeed.ps9600;
|
||||
traceLogger.LogIssue("Connect", $"Telescope not responding to speed change, connecting at {SharedSerial.Speed}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
SharedSerial.Connected = true;
|
||||
|
||||
try
|
||||
@@ -427,6 +514,23 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetSpeedIndex(SerialSpeed speed)
|
||||
{
|
||||
switch (speed)
|
||||
{
|
||||
case SerialSpeed.ps57600: return 1;
|
||||
case SerialSpeed.ps38400: return 2;
|
||||
case SerialSpeed.ps28800: return 3;
|
||||
case SerialSpeed.ps19200: return 4;
|
||||
case SerialSpeed.ps14400: return 5;
|
||||
case SerialSpeed.ps9600: return 6;
|
||||
case SerialSpeed.ps4800: return 7;
|
||||
case SerialSpeed.ps2400: return 8;
|
||||
case SerialSpeed.ps1200: return 9;
|
||||
default: throw new NotSupportedException($"{SpeedDefault} not supported");
|
||||
}
|
||||
}
|
||||
|
||||
public static void Disconnect(string deviceId, string driverId)
|
||||
{
|
||||
lock (LockObject)
|
||||
@@ -464,22 +568,6 @@ namespace ASCOM.Meade.net
|
||||
|
||||
#endregion
|
||||
|
||||
public static void Lock(Action action)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
public static T Lock<T>(Func<T> func)
|
||||
{
|
||||
lock (LockObject)
|
||||
{
|
||||
return func();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Skeleton of a hardware class, all this does is hold a count of the connections,
|
||||
/// in reality extra code will be needed to handle the hardware in some way
|
||||
@@ -494,14 +582,113 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetParked(bool atPark, ParkedPosition parkedPosition)
|
||||
public static void SetParked(bool atPark, ParkedPosition parkedPosition, bool restartTracking)
|
||||
{
|
||||
IsParked = atPark;
|
||||
ParkedPosition = parkedPosition;
|
||||
RestartTracking = restartTracking;
|
||||
}
|
||||
|
||||
public static bool IsParked { get; private set; }
|
||||
private static readonly ThreadSafeValue<bool> _restartTracking = false;
|
||||
public static bool RestartTracking
|
||||
{
|
||||
get => _restartTracking;
|
||||
private set => _restartTracking.Set(value);
|
||||
}
|
||||
|
||||
public static ParkedPosition ParkedPosition { get; private set; }
|
||||
private static ParkedPosition _parkedPosition;
|
||||
public static ParkedPosition ParkedPosition
|
||||
{
|
||||
get => _parkedPosition;
|
||||
private set => Interlocked.Exchange(ref _parkedPosition, value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isParked = false;
|
||||
public static bool IsParked
|
||||
{
|
||||
get => _isParked;
|
||||
private set => _isParked.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<AlignmentModes> _alignmentMode = AlignmentModes.algAltAz;
|
||||
public static AlignmentModes AlignmentMode
|
||||
{
|
||||
get => _alignmentMode;
|
||||
set => _alignmentMode.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<PierSide> _sideOfPier = PierSide.pierUnknown;
|
||||
/// <summary>
|
||||
/// Start with <see cref="PierSide.pierUnknown"/>.
|
||||
/// As we do not know the physical declination axis position, we have to keep track manually.
|
||||
/// </summary>
|
||||
public static PierSide SideOfPier
|
||||
{
|
||||
get => _sideOfPier;
|
||||
internal set => _sideOfPier.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<double?> _targetRightAscension = null as double?;
|
||||
public static double? TargetRightAscension
|
||||
{
|
||||
get => _targetRightAscension;
|
||||
internal set => _targetRightAscension.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<double?> _targetDeclination = null as double?;
|
||||
public static double? TargetDeclination
|
||||
{
|
||||
get => _targetDeclination;
|
||||
internal set => _targetDeclination.Set(value);
|
||||
}
|
||||
|
||||
private static int _slewSettleTime;
|
||||
public static short SlewSettleTime
|
||||
{
|
||||
get => Convert.ToInt16(_slewSettleTime);
|
||||
internal set => Interlocked.Exchange(ref _slewSettleTime, value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isLongFormat = false;
|
||||
public static bool IsLongFormat
|
||||
{
|
||||
get => _isLongFormat;
|
||||
internal set => _isLongFormat.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _movingPrimary = false;
|
||||
public static bool MovingPrimary
|
||||
{
|
||||
get => _movingPrimary;
|
||||
internal set => _movingPrimary.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _movingSecondary = false;
|
||||
public static bool MovingSecondary
|
||||
{
|
||||
get => _movingSecondary;
|
||||
internal set => _movingSecondary.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<DateTime> _earliestNonSlewingTime = DateTime.MinValue;
|
||||
public static DateTime EarliestNonSlewingTime
|
||||
{
|
||||
get => _earliestNonSlewingTime;
|
||||
internal set => _earliestNonSlewingTime.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isTargetCoordinateInitRequired = true;
|
||||
public static bool IsTargetCoordinateInitRequired
|
||||
{
|
||||
get => _isTargetCoordinateInitRequired;
|
||||
internal set => _isTargetCoordinateInitRequired.Set(value);
|
||||
}
|
||||
|
||||
private static readonly ThreadSafeValue<bool> _isGuiding = false;
|
||||
public static bool IsGuiding
|
||||
{
|
||||
get => _isGuiding;
|
||||
internal set => _isGuiding.Set(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string LX200GPS = "LX2001";
|
||||
|
||||
public const string LX200GPS_42F = "4.2F";
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string LX200GPS_42G = "4.2G";
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using JetBrains.Annotations;
|
||||
using System.Threading;
|
||||
|
||||
namespace ASCOM.Meade.net
|
||||
{
|
||||
public class ThreadSafeValue<T>
|
||||
{
|
||||
private object _value;
|
||||
|
||||
public ThreadSafeValue(in T value) => _value = value;
|
||||
|
||||
public void Set(in T value) => Interlocked.Exchange(ref _value, value);
|
||||
|
||||
public static implicit operator ThreadSafeValue<T>(in T value) => new ThreadSafeValue<T>(value);
|
||||
|
||||
public static implicit operator T([NotNull] ThreadSafeValue<T> @this) => (T)(@this?._value ?? default);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using ASCOM.DeviceInterface;
|
||||
using ASCOM.Utilities.Interfaces;
|
||||
|
||||
namespace ASCOM.Meade.net.Wrapper
|
||||
@@ -12,13 +13,11 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
|
||||
string FirmwareVersion { get; }
|
||||
|
||||
void Lock(Action action);
|
||||
T Lock<T>(Func<T> func);
|
||||
|
||||
string SendString(string message, bool raw = false);
|
||||
void SendBlind(string message, bool raw = false);
|
||||
bool SendBool(string command, bool raw = false);
|
||||
string SendChar(string message, bool raw = false);
|
||||
string SendChars(string message, bool raw = false, int count = 1);
|
||||
|
||||
string ReadTerminated();
|
||||
|
||||
@@ -28,9 +27,27 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
void WriteProfile(ProfileProperties profileProperties);
|
||||
void ReadCharacters(int throwAwayCharacters);
|
||||
|
||||
void SetParked(bool atPark, ParkedPosition parkedPosition);
|
||||
void SetParked(bool atPark, ParkedPosition parkedPosition, bool restartTracking);
|
||||
bool IsParked { get; }
|
||||
ParkedPosition ParkedPosition { get; }
|
||||
bool RestartTracking { get; }
|
||||
|
||||
double? TargetRightAscension { get; set; }
|
||||
double? TargetDeclination { get; set; }
|
||||
|
||||
short SlewSettleTime { get; set; }
|
||||
|
||||
bool IsLongFormat { get; set; }
|
||||
|
||||
bool MovingPrimary { get; set; }
|
||||
|
||||
bool MovingSecondary { get; set; }
|
||||
|
||||
DateTime EarliestNonSlewingTime { get; set; }
|
||||
|
||||
bool IsTargetCoordinateInitRequired { get; set; }
|
||||
|
||||
bool IsGuiding { get; set; }
|
||||
}
|
||||
|
||||
public class SharedResourcesWrapper : ISharedResourcesWrapper
|
||||
@@ -49,16 +66,6 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
|
||||
public string FirmwareVersion => SharedResources.FirmwareVersion;
|
||||
|
||||
public void Lock(Action action)
|
||||
{
|
||||
SharedResources.Lock(action);
|
||||
}
|
||||
|
||||
public T Lock<T>(Func<T> func)
|
||||
{
|
||||
return SharedResources.Lock(func);
|
||||
}
|
||||
|
||||
public string SendString(string message, bool raw = false)
|
||||
{
|
||||
return SharedResources.SendString(message, raw);
|
||||
@@ -79,6 +86,11 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
return SharedResources.SendChar(message, raw);
|
||||
}
|
||||
|
||||
public string SendChars(string message, bool raw = false, int count = 1)
|
||||
{
|
||||
return SharedResources.SendChars(message, raw, count);
|
||||
}
|
||||
|
||||
public string ReadTerminated()
|
||||
{
|
||||
return SharedResources.ReadTerminated();
|
||||
@@ -104,13 +116,75 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
SharedResources.WriteProfile(profileProperties);
|
||||
}
|
||||
|
||||
public void SetParked(bool atPark, ParkedPosition parkedPosition)
|
||||
public void SetParked(bool atPark, ParkedPosition parkedPosition, bool restartTracking)
|
||||
{
|
||||
SharedResources.SetParked(atPark, parkedPosition);
|
||||
SharedResources.SetParked(atPark, parkedPosition, restartTracking);
|
||||
}
|
||||
|
||||
public bool IsParked => SharedResources.IsParked;
|
||||
|
||||
public bool RestartTracking => SharedResources.RestartTracking;
|
||||
|
||||
public ParkedPosition ParkedPosition => SharedResources.ParkedPosition;
|
||||
|
||||
public PierSide SideOfPier
|
||||
{
|
||||
get => SharedResources.SideOfPier;
|
||||
set => SharedResources.SideOfPier = value;
|
||||
}
|
||||
|
||||
public double? TargetRightAscension
|
||||
{
|
||||
get => SharedResources.TargetRightAscension;
|
||||
set => SharedResources.TargetRightAscension = value;
|
||||
}
|
||||
|
||||
public double? TargetDeclination
|
||||
{
|
||||
get => SharedResources.TargetDeclination;
|
||||
set => SharedResources.TargetDeclination = value;
|
||||
}
|
||||
|
||||
public short SlewSettleTime
|
||||
{
|
||||
get => SharedResources.SlewSettleTime;
|
||||
set => SharedResources.SlewSettleTime = value;
|
||||
}
|
||||
|
||||
public bool IsLongFormat
|
||||
{
|
||||
get => SharedResources.IsLongFormat;
|
||||
set => SharedResources.IsLongFormat = value;
|
||||
}
|
||||
|
||||
public bool MovingPrimary
|
||||
{
|
||||
get => SharedResources.MovingPrimary;
|
||||
set => SharedResources.MovingPrimary = value;
|
||||
}
|
||||
|
||||
public bool MovingSecondary
|
||||
{
|
||||
get => SharedResources.MovingSecondary;
|
||||
set => SharedResources.MovingSecondary = value;
|
||||
}
|
||||
|
||||
public DateTime EarliestNonSlewingTime
|
||||
{
|
||||
get => SharedResources.EarliestNonSlewingTime;
|
||||
set => SharedResources.EarliestNonSlewingTime = value;
|
||||
}
|
||||
|
||||
public bool IsTargetCoordinateInitRequired
|
||||
{
|
||||
get => SharedResources.IsTargetCoordinateInitRequired;
|
||||
set => SharedResources.IsTargetCoordinateInitRequired = value;
|
||||
}
|
||||
|
||||
public bool IsGuiding
|
||||
{
|
||||
get => SharedResources.IsGuiding;
|
||||
set => SharedResources.IsGuiding = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user