Compare commits

...

38 Commits

Author SHA1 Message Date
ColinD 8d8b50957c Merged in develop (pull request #36)
Develop
2021-07-03 12:35:42 +00:00
Sebastian Godelet faa6ad757e Merged in feature/GWSupport-update (pull request #35)
Feature/GWSupport update
2021-07-03 11:23:32 +00:00
Sebastian Godelet 64df8282a0 Support Set Tracking when GW is supported 2021-06-29 15:31:57 +10:00
Sebastian Godelet 8478af26bf Implemented TrackingRate via GT 2021-06-28 16:06:15 +10:00
Sebastian Godelet 77c87a51fa Moved IsGuiding to SharedResourcesWrapper 2021-06-28 13:03:07 +10:00
Sebastian Godelet 631aa91d94 Moved IsTargetCoordinateInitRequired to SharedResourcesWrapper 2021-06-28 12:53:05 +10:00
Sebastian Godelet 90713de34b Moved parked SiteLat/Long to ParkedPosition data 2021-06-28 12:45:26 +10:00
Sebastian Godelet a3408a86c3 Update unit tests to support GW command
SideOfPier also supports German EQ
2021-06-27 19:16:39 +10:00
Sebastian Godelet 74440b6b3b Merge branch 'develop' into feature/GWSupport 2021-06-25 15:34:58 +10:00
ColinD f1d100892b Removed nunit3 Test adapter 2021-06-23 13:18:30 +01:00
ColinD c6baab2b12 Added tolerance in unit test to allow for rounding error. 2021-06-23 13:11:33 +01:00
Sebastian Godelet f47b205025 Merged in feature/preserve-sop-target-radec-across-connections (pull request #34)
Preserve SideOfPier, Target{RA,DEC}, SlewSettleTime, Move axis across connections

Approved-by: Colin Dawson
2021-06-23 08:53:31 +00:00
Sebastian Godelet 6c27499769 Create generic ThreadSafeValue 2021-06-23 16:21:08 +10:00
Sebastian Godelet 6dff32505e Clarify thread-safe value test intention 2021-06-23 11:09:22 +10:00
Sebastian Godelet 7afd364efa Add tests for SharedResources properties
Ensure that default values are correct and no error appears
2021-06-22 17:43:25 +10:00
Sebastian Godelet 6fc476b031 Make further properties multi-client and thread-safe
Move MovingPrimary, MovingSecondary, EarliestNonSlewingTime to
SharedResources, make all new properties thread-safe (atomic)
operations.
2021-06-22 17:21:21 +10:00
Sebastian Godelet af750549fe Test that low-precision digit values are preserved across connections 2021-06-13 17:36:42 +10:00
Sebastian Godelet 2e3572375f Test that SideralTime is preserved across connections 2021-06-13 17:24:09 +10:00
Sebastian Godelet b23da15022 Make Focuser.cs ASCII compatible 2021-06-13 16:30:55 +10:00
Sebastian Godelet 0b75b8d2cd Remove now unneeded Setup for DestinationSideOfPier
DestinationSideOfPier will not call Slewing anymore,
since it reads the property from SharedResourcesWrapper directly.
2021-06-13 09:59:17 +10:00
Sebastian Godelet 036a9d7116 Add multi-connection test for TargetRightAscension 2021-06-13 09:45:07 +10:00
Sebastian Godelet 6c769f3649 Add SlewSettleTime and IsLongFormat to SharedResources interface
Also ensure that digit precision is set during initialisation
2021-06-12 20:09:51 +10:00
Sebastian Godelet bdbd206a54 Avoid possible data race condition when calculating DSOP 2021-06-12 16:22:38 +10:00
Sebastian Godelet 1684bd60bd Move SideOfPier, TargetRA/DEC properties to SharedResourcesWrapper
This change allows several instances of the driver to be in sync
w.r.t. TargetRightAscension, TargetDeclination and SideOfPier
2021-06-12 15:47:34 +10:00
Sebastian Godelet 8c4b08d0c6 Merged in feature/side-of-pier-unit-tests (pull request #33)
Add unit test around meridian flip detection

Approved-by: Colin Dawson
2021-06-07 10:30:52 +00:00
Sebastian Godelet fe3c106954 Add unit test around meridian flip detection 2021-06-07 17:58:20 +10:00
ColinD 3d0464f379 Merged in develop (pull request #32)
Develop
2021-06-06 13:44:33 +00:00
Sebastian Godelet d1b5652228 Merged in feature/add-side-of-pier (pull request #31)
Implemented SideOfPier and DestinationSideOfPier

Approved-by: Colin Dawson
2021-06-06 13:23:49 +00:00
Sebastian Godelet 65e06f2d6c Implemented SideOfPier and DestinationSideOfPier
For telescopes that automatically perform a meridian flip we can
implement the SideOfPier property by updating the current side of pier
after a telescope slew (via DestinationSideOfPier)
2021-06-06 19:44:40 +10:00
ColinD b27e50275d Added extra logging for CommandBlind, CommandBool, and CommandString. 2021-05-09 15:20:45 +01:00
ColinD a101d3a2d7 Merged in develop (pull request #30)
Develop
2021-04-29 15:18:42 +00:00
ColinD d7637928b7 Made sure that the telescope doesn't think it's parked for the first Telescope to connect. 2021-04-27 22:14:22 +01:00
ColinD 486a9205ee Fixed the defect when one instance of the driver gets parked, the info is shared to the other instances. 2021-04-27 22:08:25 +01:00
ColinD 2c2c59290e Reinstated the Real Alt Az methods for the LX200GPS. Changes how the parked behaviour is implemented, so that it doesn't need to make as many calls. 2021-04-27 20:14:57 +01:00
ColinD 70e615bb4e Made sure that CommandString, CommandBool and CommandBlind work as expected, complete with Raw and non raw support. (Implementation is the same as one of the LX200 drivers.) 2021-04-26 20:51:41 +01:00
ColinD 8c94fd6b71 Merge branch 'develop' into feature/GWSupport 2021-04-25 20:28:48 +01:00
ColinD a2abbbb3d0 Working on a possible side of pier implementation 2021-04-21 17:24:40 +01:00
ColinD 21e7bcd530 Added support for the GW Command.
Removed the implementation of Tracking Set as this does not do anything in the code.
Set Can Set Tracking to false.
Get tracking always returns true is the GW command is not supported.
2021-03-10 19:25:27 +00:00
21 changed files with 2092 additions and 943 deletions
+2 -1
View File
@@ -123,7 +123,8 @@ namespace AstroMath.UnitTests
var altAz = _astroMath.ConvertEqToHoz(hourAngle, latitude, equatorialCoordinates); 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)); Assert.That(altAz.Azimuth, Is.EqualTo(281.2728706962269));
} }
+26 -22
View File
@@ -109,16 +109,17 @@ namespace Meade.net.Focuser.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBlind")); Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBlind"));
} }
[Test] [TestCase(false)]
public void CommandBlind_WhenConnected_ThenSendsExpectedMessage() [TestCase(true)]
public void CommandBlind_WhenConnected_ThenSendsExpectedMessage(bool raw)
{ {
string expectedMessage = "test blind Message"; string expectedMessage = "test blind Message";
ConnectFocuser(); ConnectFocuser();
_focuser.CommandBlind(expectedMessage, true); _focuser.CommandBlind(expectedMessage, raw);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(expectedMessage), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(expectedMessage, raw), Times.Once);
} }
[Test] [Test]
@@ -130,16 +131,19 @@ namespace Meade.net.Focuser.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBool")); Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBool"));
} }
[Test] [TestCase(false)]
public void CommandBool_WhenConnected_ThenSendsExpectedMessage() [TestCase(true)]
public void CommandBool_WhenConnected_ThenSendsExpectedMessage(bool raw)
{ {
string expectedMessage = "test blind Message"; string expectedMessage = "test blind Message";
_sharedResourcesWrapperMock.Setup(x => x.SendBool(expectedMessage, raw)).Returns(true);
ConnectFocuser(); ConnectFocuser();
var exception = Assert.Throws<MethodNotImplementedException>(() => { _focuser.CommandBool(expectedMessage, true); }); var result = _focuser.CommandBool(expectedMessage, raw);
Assert.That(exception.Message, Is.EqualTo("Method CommandBool is not implemented in this driver.")); _sharedResourcesWrapperMock.Verify(x => x.SendBool(expectedMessage, raw), Times.Once);
Assert.That(result, Is.True);
} }
[Test] [Test]
@@ -319,7 +323,7 @@ namespace Meade.net.Focuser.UnitTests
_focuser.Halt(); _focuser.Halt();
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":FQ#"), Times.AtLeastOnce); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("FQ", false), Times.AtLeastOnce);
} }
[Test] [Test]
@@ -334,13 +338,13 @@ namespace Meade.net.Focuser.UnitTests
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void Link_Get_ReturnsSameValueAsConnected( bool connected) public void Link_Get_ReturnsSameValueAsConnected(bool connected)
{ {
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497); _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee); _sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
_focuser.Connected = connected; _focuser.Connected = connected;
Assert.That( _focuser.Link, Is.EqualTo(connected)); Assert.That(_focuser.Link, Is.EqualTo(connected));
} }
[TestCase(false)] [TestCase(false)]
@@ -394,12 +398,12 @@ namespace Meade.net.Focuser.UnitTests
_focuser.Move(0); _focuser.Move(0);
_utilMock.Verify( x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Never); _utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Never);
} }
[TestCase(200)] [TestCase(200)]
[TestCase(-200)] [TestCase(-200)]
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuser( int position) public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuser(int position)
{ {
_profileProperties.BacklashCompensation = 0; _profileProperties.BacklashCompensation = 0;
@@ -409,16 +413,16 @@ namespace Meade.net.Focuser.UnitTests
if (position < 0) if (position < 0)
{ {
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":F-#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Never);
} }
else else
{ {
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Once);
} }
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), 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(position)), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never); _utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
@@ -437,16 +441,16 @@ namespace Meade.net.Focuser.UnitTests
if (position < 0) if (position < 0)
{ {
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Never);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), 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(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(1)); _utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(1));
} }
else else
{ {
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position) + _profileProperties.BacklashCompensation), Times.Once); _utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position) + _profileProperties.BacklashCompensation), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(_profileProperties.BacklashCompensation), Times.Once); _utilMock.Verify(x => x.WaitForMilliseconds(_profileProperties.BacklashCompensation), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(2)); _utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(2));
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
namespace ASCOM.Meade.net
{
public enum Alignment
{
NeedsAlignment,
OneStarAligned,
TwoStarAligned,
ThreeStarAligned,
AlignedOnHome,
ScopeWasParked,
}
}
+11
View File
@@ -0,0 +1,11 @@
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; }
}
}
@@ -62,7 +62,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\bin\Release\</OutputPath> <OutputPath>..\bin\Release\</OutputPath>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<OutputPath>..\bin\Debug\</OutputPath> <OutputPath>..\bin\Debug\</OutputPath>
@@ -118,6 +118,8 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Alignment.cs" />
<Compile Include="AlignmentStatus.cs" />
<Compile Include="AstroMaths\AltitudeData.cs" /> <Compile Include="AstroMaths\AltitudeData.cs" />
<Compile Include="AstroMaths\AstroMathExtensions.cs" /> <Compile Include="AstroMaths\AstroMathExtensions.cs" />
<Compile Include="AstroMaths\AstroMaths.cs" /> <Compile Include="AstroMaths\AstroMaths.cs" />
File diff suppressed because it is too large Load Diff
@@ -98,6 +98,10 @@
<ItemGroup> <ItemGroup>
<Compile Include="SharedResourcesUnitTests.cs" /> <Compile Include="SharedResourcesUnitTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ThreadSafeBoolTests.cs" />
<Compile Include="ThreadSafeDateTimeTests.cs" />
<Compile Include="ThreadSafeEnumTests.cs" />
<Compile Include="ThreadSafeNullableDoubleTests.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Meade.net\Meade.net.csproj"> <ProjectReference Include="..\Meade.net\Meade.net.csproj">
+51 -13
View File
@@ -1,6 +1,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
using ASCOM.DeviceInterface;
using ASCOM.Meade.net; using ASCOM.Meade.net;
using ASCOM.Meade.net.Wrapper; using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities.Interfaces; using ASCOM.Utilities.Interfaces;
@@ -29,38 +30,39 @@ namespace Meade.net.UnitTests
[Test] [Test]
public void CheckThatSerialPortIsSetToUseMock() public void CheckThatSerialPortIsSetToUseMock()
{ {
Assert.That(SharedResources.SharedSerial,Is.EqualTo(_serialMock.Object)); Assert.That(SharedResources.SharedSerial, Is.EqualTo(_serialMock.Object));
} }
[Test] [TestCase(true, "Test")]
public void SendBlind_WhenCalled_Then_ClearsBuffersAndSendsMessage() [TestCase(false, "#:Test#")]
public void SendBlind_WhenCalled_Then_ClearsBuffersAndSendsMessage(bool raw, string expectedMessage)
{ {
var expectedMessage = "Test"; var sendMessage = "Test";
SharedResources.SendBlind(sendMessage, raw);
SharedResources.SendBlind(expectedMessage);
_serialMock.Verify(x=> x.ClearBuffers(), Times.Once); _serialMock.Verify(x=> x.ClearBuffers(), Times.Once);
_serialMock.Verify(x=>x.Transmit(expectedMessage), Times.Once); _serialMock.Verify(x=>x.Transmit(expectedMessage), Times.Once);
} }
[Test] [TestCase(false, "#:Test#")]
public void SendChar_WhenCalled_ThenSendsMessageAndReadsExpectedNumberOfCharacters() [TestCase(true, "Test")]
public void SendChar_WhenCalled_ThenSendsMessageAndReadsExpectedNumberOfCharacters(bool raw, string expectedCommand)
{ {
var expectedMessage = "Test"; var command = "Test";
var expectedResult = "A"; var expectedResult = "A";
_serialMock.Setup(x => x.ReceiveCounted(1)).Returns(expectedResult); _serialMock.Setup(x => x.ReceiveCounted(1)).Returns(expectedResult);
var result = SharedResources.SendChar(expectedMessage); var result = SharedResources.SendChar(command, raw);
_serialMock.Verify(x => x.ClearBuffers(), Times.Once); _serialMock.Verify(x => x.ClearBuffers(), Times.Once);
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once); _serialMock.Verify(x => x.Transmit(expectedCommand), Times.Once);
_serialMock.Verify(x => x.ReceiveCounted(1), Times.Once); _serialMock.Verify(x => x.ReceiveCounted(1), Times.Once);
Assert.That(result, Is.EqualTo(expectedResult)); Assert.That(result, Is.EqualTo(expectedResult));
} }
[TestCase(false, "Test")] [TestCase(true, "Test")]
[TestCase(true, "#Test")] [TestCase(false, "#:Test#")]
public void SendString_WhenCalled_ThenSendsMessageAndReadsResultUntilTerminatorFound(bool includePrefix, string expectedMessage) public void SendString_WhenCalled_ThenSendsMessageAndReadsResultUntilTerminatorFound(bool includePrefix, string expectedMessage)
{ {
var transmitMessage = "Test"; var transmitMessage = "Test";
@@ -617,5 +619,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); _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));
}
}
}
+1
View File
@@ -5,6 +5,7 @@
<package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" /> <package id="JetBrains.Annotations" version="2020.3.0" targetFramework="net472" />
<package id="Moq" version="4.15.2" targetFramework="net472" /> <package id="Moq" version="4.15.2" targetFramework="net472" />
<package id="NUnit" version="3.13.0" 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.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>
+17 -10
View File
@@ -101,32 +101,39 @@ namespace ASCOM.Meade.net
public void CommandBlind(string command, bool raw) public void CommandBlind(string command, bool raw)
{ {
LogMessage("CommandBlind", "raw: {0} command {0}", raw, command);
CheckConnected("CommandBlind"); CheckConnected("CommandBlind");
// Call CommandString and return as soon as it finishes // Call CommandString and return as soon as it finishes
//this.CommandString(command, raw); //this.CommandString(command, raw);
SharedResourcesWrapper.SendBlind(command); SharedResourcesWrapper.SendBlind(command, raw);
// or // or
//throw new ASCOM.MethodNotImplementedException("CommandBlind"); //throw new ASCOM.MethodNotImplementedException("CommandBlind");
// DO NOT have both these sections! One or the other // DO NOT have both these sections! One or the other
LogMessage("CommandBlind", "Completed");
} }
public bool CommandBool(string command, bool raw) public bool CommandBool(string command, bool raw)
{ {
LogMessage("CommandBool", "raw: {0} command {0}", raw, command);
CheckConnected("CommandBool"); CheckConnected("CommandBool");
//string ret = CommandString(command, raw); var result = SharedResourcesWrapper.SendBool(command, raw);
// decode the return string and return true or false LogMessage("CommandBool", "Completed: {0}", result);
return result;
// or // or
throw new MethodNotImplementedException("CommandBool"); //throw new MethodNotImplementedException("CommandBool");
// DO NOT have both these sections! One or the other // DO NOT have both these sections! One or the other
} }
public string CommandString(string command, bool raw) public string CommandString(string command, bool raw)
{ {
LogMessage("CommandString", "raw: {0} command {0}", raw, command);
CheckConnected("CommandString"); CheckConnected("CommandString");
// it's a good idea to put all the low level communication with the device here, // it's a good idea to put all the low level communication with the device here,
// then all communication calls this function // then all communication calls this function
// you need something to ensure that only one command is in progress at a time // you need something to ensure that only one command is in progress at a time
return SharedResourcesWrapper.SendString(command); var result = SharedResourcesWrapper.SendString(command, raw);
LogMessage("CommandBool", "Completed: {0}", result);
return result;
//throw new ASCOM.MethodNotImplementedException("CommandString"); //throw new ASCOM.MethodNotImplementedException("CommandString");
} }
@@ -225,7 +232,7 @@ namespace ASCOM.Meade.net
//todo fix this issue: A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe. //todo fix this issue: A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe.
SharedResourcesWrapper.SendBlind(":FQ#"); SharedResourcesWrapper.SendBlind("FQ");
//:FQ# Halt Focuser Motion //:FQ# Halt Focuser Motion
//Returns: Nothing //Returns: Nothing
} }
@@ -329,16 +336,16 @@ namespace ASCOM.Meade.net
private void MoveFocuser(bool directionOut, int steps) private void MoveFocuser(bool directionOut, int steps)
{ {
//_sharedResourcesWrapper.SendBlind(":FF#"); //_sharedResourcesWrapper.SendBlind("FF");
//:FF# Set Focus speed to fastest setting //:FF# Set Focus speed to fastest setting
//Returns: Nothing //Returns: Nothing
//:FS# Set Focus speed to slowest setting //:FS# Set Focus speed to slowest setting
//Returns: Nothing //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 //Returns: Nothing
//All others Not Supported //All others - Not Supported
_utilities.WaitForMilliseconds(100); _utilities.WaitForMilliseconds(100);
PerformFocuserMove(directionOut); PerformFocuserMove(directionOut);
@@ -350,7 +357,7 @@ namespace ASCOM.Meade.net
private void PerformFocuserMove(bool directionOut) private void PerformFocuserMove(bool directionOut)
{ {
SharedResourcesWrapper.SendBlind(directionOut ? ":F+#" : ":F-#"); SharedResourcesWrapper.SendBlind(directionOut ? "F+" : "F-");
//:F+# Start Focuser moving inward (toward objective) //:F+# Start Focuser moving inward (toward objective)
//Returns: None //Returns: None
+2
View File
@@ -141,10 +141,12 @@
<Compile Include="LocalServer.cs" /> <Compile Include="LocalServer.cs" />
<Compile Include="MeadeTelescopeBase.cs" /> <Compile Include="MeadeTelescopeBase.cs" />
<Compile Include="ParkedBehaviour.cs" /> <Compile Include="ParkedBehaviour.cs" />
<Compile Include="ParkedPosition.cs" />
<Compile Include="ProfileFactory.cs" /> <Compile Include="ProfileFactory.cs" />
<Compile Include="ProfileProperties.cs" /> <Compile Include="ProfileProperties.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TelescopeList.cs" /> <Compile Include="TelescopeList.cs" />
<Compile Include="ThreadSafeValue.cs" />
<Compile Include="Win32Utilities.cs" /> <Compile Include="Win32Utilities.cs" />
<Compile Include="Wrapper\IProfileWrapper.cs" /> <Compile Include="Wrapper\IProfileWrapper.cs" />
<Compile Include="Wrapper\SharedResourcesWrapper.cs" /> <Compile Include="Wrapper\SharedResourcesWrapper.cs" />
+12
View File
@@ -0,0 +1,12 @@
namespace ASCOM.Meade.net
{
public class ParkedPosition
{
public double Altitude { get; set; }
public double Azimuth { get; set; }
public double RightAscension { get; set; }
public double Declination { get; set; }
public double SiteLongitude { get; set; }
public double SiteLatitude { get; set; }
}
}
+129 -18
View File
@@ -18,7 +18,10 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using ASCOM.DeviceInterface;
using ASCOM.Meade.net.Wrapper; using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities; using ASCOM.Utilities;
using ASCOM.Utilities.Interfaces; using ASCOM.Utilities.Interfaces;
@@ -72,17 +75,18 @@ namespace ASCOM.Meade.net
public static IProfileFactory ProfileFactory public static IProfileFactory ProfileFactory
{ {
get => _profileFactory ?? ( _profileFactory = new ProfileFactory()); get => _profileFactory ?? (_profileFactory = new ProfileFactory());
set => _profileFactory = value; set => _profileFactory = value;
} }
//todo add code to ensure that there is a minimum gap between commands. 5ms as default. //todo add code to ensure that there is a minimum gap between commands. 5ms as default.
public static void SendBlind(string message) public static void SendBlind(string message, bool raw = false)
{ {
lock (LockObject) lock (LockObject)
{ {
SharedSerial.ClearBuffers(); SharedSerial.ClearBuffers();
SharedSerial.Transmit(message); var encodedMessage = raw ? message : $"#:{message}#";
SharedSerial.Transmit(encodedMessage);
} }
} }
@@ -93,14 +97,16 @@ namespace ASCOM.Meade.net
/// and that the reply will always be terminated by a "#" character. /// and that the reply will always be terminated by a "#" character.
/// </summary> /// </summary>
/// <param name="message"></param> /// <param name="message"></param>
/// <param name="raw"></param>
/// <returns></returns> /// <returns></returns>
public static string SendString(string message, bool includePrefix = true) public static string SendString(string message, bool raw = false)
{ {
lock (LockObject) lock (LockObject)
{ {
SharedSerial.ClearBuffers(); SharedSerial.ClearBuffers();
SharedSerial.Transmit(includePrefix ? $"#{message}" : message); var encodedMessage = raw ? message : $"#:{message}#";
SharedSerial.Transmit(encodedMessage);
try try
{ {
@@ -116,23 +122,34 @@ namespace ASCOM.Meade.net
} }
} }
public static string SendChar(string message) 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) lock (LockObject)
{ {
SharedSerial.ClearBuffers(); SharedSerial.ClearBuffers();
SharedSerial.Transmit(message);
var encodedMessage = raw ? command : $"#:{command}#";
SharedSerial.Transmit(encodedMessage);
try 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 new TimeoutException(ex.Message, ex);
throw;
} }
} }
} }
@@ -230,7 +247,7 @@ namespace ASCOM.Meade.net
private const string HandShakeDefault = "None"; private const string HandShakeDefault = "None";
private const string ParityDefault = "None"; private const string ParityDefault = "None";
private const string SendDateTimeDefault = "false"; 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 ParkedAltDefault = "0";
private const string ParkedAzimuthDefault = "180"; private const string ParkedAzimuthDefault = "180";
@@ -320,7 +337,7 @@ namespace ASCOM.Meade.net
private static readonly Dictionary<string, DeviceHardware> ConnectedDevices = new Dictionary<string, DeviceHardware>(); private static readonly Dictionary<string, DeviceHardware> ConnectedDevices = new Dictionary<string, DeviceHardware>();
private static readonly Dictionary<string, DeviceHardware> ConnectedDeviceIds = new Dictionary<string, DeviceHardware>(); private static readonly Dictionary<string, DeviceHardware> ConnectedDeviceIds = new Dictionary<string, DeviceHardware>();
private static IProfileFactory _profileFactory ; private static IProfileFactory _profileFactory;
/// <summary> /// <summary>
@@ -349,7 +366,7 @@ namespace ASCOM.Meade.net
SharedSerial.DTREnable = profileProperties.RtsDtrEnabled; SharedSerial.DTREnable = profileProperties.RtsDtrEnabled;
SharedSerial.RTSEnable = profileProperties.RtsDtrEnabled; SharedSerial.RTSEnable = profileProperties.RtsDtrEnabled;
SharedSerial.DataBits = profileProperties.DataBits; SharedSerial.DataBits = profileProperties.DataBits;
SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits ); SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits);
SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity); SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity);
SharedSerial.Speed = (SerialSpeed)profileProperties.Speed; SharedSerial.Speed = (SerialSpeed)profileProperties.Speed;
SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake); SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake);
@@ -357,8 +374,8 @@ namespace ASCOM.Meade.net
try try
{ {
ProductName = SendString(":GVP#"); ProductName = SendString("GVP");
FirmwareVersion = SendString(":GVN#"); FirmwareVersion = SendString("GVN");
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -378,7 +395,7 @@ namespace ASCOM.Meade.net
try try
{ {
string utcOffSet = SendString(":GG#"); string utcOffSet = SendString("GG");
//:GG# Get UTC offset time //:GG# Get UTC offset time
//Returns: sHH# or sHH.H# //Returns: sHH# or sHH.H#
//The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the //The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the
@@ -479,5 +496,99 @@ namespace ASCOM.Meade.net
Count = 0; Count = 0;
} }
} }
public static void SetParked(bool atPark, ParkedPosition parkedPosition)
{
IsParked = atPark;
ParkedPosition = parkedPosition;
}
private static readonly ThreadSafeValue<bool> _isParked = false;
public static bool IsParked
{
get => _isParked;
private set => _isParked.Set(value);
}
private static ParkedPosition _parkedPosition;
public static ParkedPosition ParkedPosition
{
get => _parkedPosition;
private set => Interlocked.Exchange(ref _parkedPosition, 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);
}
} }
} }
+18
View File
@@ -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);
}
}
+113 -9
View File
@@ -1,4 +1,5 @@
using System; using System;
using ASCOM.DeviceInterface;
using ASCOM.Utilities.Interfaces; using ASCOM.Utilities.Interfaces;
namespace ASCOM.Meade.net.Wrapper namespace ASCOM.Meade.net.Wrapper
@@ -15,9 +16,11 @@ namespace ASCOM.Meade.net.Wrapper
void Lock(Action action); void Lock(Action action);
T Lock<T>(Func<T> func); T Lock<T>(Func<T> func);
string SendString(string message, bool includePrefix = true); string SendString(string message, bool raw = false);
void SendBlind(string message); void SendBlind(string message, bool raw = false);
string SendChar(string message); 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(); string ReadTerminated();
@@ -26,6 +29,28 @@ namespace ASCOM.Meade.net.Wrapper
void SetupDialog(); void SetupDialog();
void WriteProfile(ProfileProperties profileProperties); void WriteProfile(ProfileProperties profileProperties);
void ReadCharacters(int throwAwayCharacters); void ReadCharacters(int throwAwayCharacters);
void SetParked(bool atPark, ParkedPosition parkedPosition);
bool IsParked { get; }
ParkedPosition ParkedPosition { get; }
PierSide SideOfPier { get; set; }
double? TargetRightAscension { get; set; }
double? TargetDeclination { get; set; }
short SlewSettleTime { get; set; }
bool IsLongFormat { get; set; }
bool MovingPrimary { get; set; }
bool MovingSecondary { get; set; }
DateTime EarliestNonSlewingTime { get; set; }
bool IsTargetCoordinateInitRequired { get; set; }
bool IsGuiding { get; set; }
} }
public class SharedResourcesWrapper : ISharedResourcesWrapper public class SharedResourcesWrapper : ISharedResourcesWrapper
@@ -54,19 +79,29 @@ namespace ASCOM.Meade.net.Wrapper
return SharedResources.Lock(func); return SharedResources.Lock(func);
} }
public string SendString(string message, bool includePrefix = true) public string SendString(string message, bool raw = false)
{ {
return SharedResources.SendString(message, includePrefix); return SharedResources.SendString(message, raw);
} }
public void SendBlind(string message) public void SendBlind(string message, bool raw = false)
{ {
SharedResources.SendBlind(message); SharedResources.SendBlind(message, raw);
} }
public string SendChar(string message) public bool SendBool(string command, bool raw = false)
{ {
return SharedResources.SendChar(message); return SharedResources.SendBool(command, raw);
}
public string SendChar(string message, bool raw = false)
{
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() public string ReadTerminated()
@@ -93,5 +128,74 @@ namespace ASCOM.Meade.net.Wrapper
{ {
SharedResources.WriteProfile(profileProperties); SharedResources.WriteProfile(profileProperties);
} }
public void SetParked(bool atPark, ParkedPosition parkedPosition)
{
SharedResources.SetParked(atPark, parkedPosition);
}
public bool IsParked => SharedResources.IsParked;
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;
}
} }
} }