Removed all # symbols from before the commands, as they're not really needed.

This commit is contained in:
2020-09-03 18:35:40 +01:00
parent 1dc7d7142a
commit 4266139429
10 changed files with 359 additions and 299 deletions
@@ -402,13 +402,13 @@ 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-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never);
} }
else else
{ {
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F-#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Once);
} }
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once);
@@ -430,16 +430,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-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), 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-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), 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));
@@ -43,7 +43,7 @@ namespace Meade.net.Telescope.UnitTests
_astroUtilsMock = new Mock<IAstroUtils>(); _astroUtilsMock = new Mock<IAstroUtils>();
_sharedResourcesWrapperMock = new Mock<ISharedResourcesWrapper>(); _sharedResourcesWrapperMock = new Mock<ISharedResourcesWrapper>();
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GZ#")).Returns("DDD*MMSS"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GZ#")).Returns("DDD*MMSS");
_sharedResourcesWrapperMock.Setup(x => x.ReadProfile()).Returns(() =>_profileProperties); _sharedResourcesWrapperMock.Setup(x => x.ReadProfile()).Returns(() =>_profileProperties);
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Action>())).Callback<Action>(action => { action(); }); _sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Action>())).Callback<Action>(action => { action(); });
@@ -122,36 +122,36 @@ namespace Meade.net.Telescope.UnitTests
public void Action_Handbox_ReadDisplay() public void Action_Handbox_ReadDisplay()
{ {
string expectedResult = "test result string"; string expectedResult = "test result string";
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:ED#")).Returns(expectedResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(":ED#")).Returns(expectedResult);
_telescope.Connected = true; _telescope.Connected = true;
var actualResult = _telescope.Action("handbox", "readdisplay"); var actualResult = _telescope.Action("handbox", "readdisplay");
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:ED#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":ED#"), Times.Once);
Assert.That(actualResult, Is.EqualTo(expectedResult)); Assert.That(actualResult, Is.EqualTo(expectedResult));
} }
[TestCase("enter", "#:EK13#")] [TestCase("enter", ":EK13#")]
[TestCase("mode", "#:EK9#")] [TestCase("mode", ":EK9#")]
[TestCase("longMode", "#:EK11#")] [TestCase("longMode", ":EK11#")]
[TestCase("goto", "#:EK24#")] [TestCase("goto", ":EK24#")]
[TestCase("0", "#:EK48#")] [TestCase("0", ":EK48#")]
[TestCase("1", "#:EK49#")] [TestCase("1", ":EK49#")]
[TestCase("2", "#:EK50#")] [TestCase("2", ":EK50#")]
[TestCase("3", "#:EK51#")] [TestCase("3", ":EK51#")]
[TestCase("4", "#:EK52#")] [TestCase("4", ":EK52#")]
[TestCase("5", "#:EK53#")] [TestCase("5", ":EK53#")]
[TestCase("6", "#:EK54#")] [TestCase("6", ":EK54#")]
[TestCase("7", "#:EK55#")] [TestCase("7", ":EK55#")]
[TestCase("8", "#:EK56#")] [TestCase("8", ":EK56#")]
[TestCase("9", "#:EK57#")] [TestCase("9", ":EK57#")]
[TestCase("up", "#:EK94#")] [TestCase("up", ":EK94#")]
[TestCase("down", "#:EK118#")] [TestCase("down", ":EK118#")]
[TestCase("back", "#:EK87#")] [TestCase("back", ":EK87#")]
[TestCase("forward", "#:EK69#")] [TestCase("forward", ":EK69#")]
[TestCase("?", "#:EK63#")] [TestCase("?", ":EK63#")]
public void Action_Handbox_WhenCalling_ThenSendsAppropriateBlindCommands(string action, string expectedString) public void Action_Handbox_WhenCalling_ThenSendsAppropriateBlindCommands(string action, string expectedString)
{ {
ConnectTelescope(); ConnectTelescope();
@@ -172,7 +172,7 @@ namespace Meade.net.Telescope.UnitTests
string parameters = $"select {site}"; string parameters = $"select {site}";
_telescope.Action("site", parameters); _telescope.Action("site", parameters);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:W{site}#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":W{site}#"), Times.Once);
} }
[TestCase("0")] [TestCase("0")]
@@ -187,10 +187,10 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo($"Site {parameters} not allowed, must be between 1 and 4")); Assert.That(exception.Message, Is.EqualTo($"Site {parameters} not allowed, must be between 1 and 4"));
} }
[TestCase("1", "#:GM#", "Home")] [TestCase("1", ":GM#", "Home")]
[TestCase("2", "#:GN#", "Club")] [TestCase("2", ":GN#", "Club")]
[TestCase("3", "#:GO#", "GPS")] [TestCase("3", ":GO#", "GPS")]
[TestCase("4", "#:GP#", "Parents")] [TestCase("4", ":GP#", "Parents")]
public void Action_Site_GetName_WhenCallingWithValidValues_ThenSelectsCorrectSite(string site, string telescopeCommand, string siteName) public void Action_Site_GetName_WhenCallingWithValidValues_ThenSelectsCorrectSite(string site, string telescopeCommand, string siteName)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString(telescopeCommand)).Returns(siteName); _sharedResourcesWrapperMock.Setup(x => x.SendString(telescopeCommand)).Returns(siteName);
@@ -227,10 +227,10 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.EqualTo("4")); Assert.That(result, Is.EqualTo("4"));
} }
[TestCase("1", "#:SMHome#", "Home")] [TestCase("1", ":SMHome#", "Home")]
[TestCase("2", "#:SNClub#", "Club")] [TestCase("2", ":SNClub#", "Club")]
[TestCase("3", "#:SOGPS Site#", "GPS Site")] [TestCase("3", ":SOGPS Site#", "GPS Site")]
[TestCase("4", "#:SPParents#", "Parents")] [TestCase("4", ":SPParents#", "Parents")]
public void Action_Site_SetName_WhenCallingWithValidValues_ThenSelectsCorrectSite(string site, string telescopeCommand, string siteName) public void Action_Site_SetName_WhenCallingWithValidValues_ThenSelectsCorrectSite(string site, string telescopeCommand, string siteName)
{ {
@@ -369,8 +369,8 @@ namespace Meade.net.Telescope.UnitTests
if (expectedConnected) if (expectedConnected)
{ {
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:GZ#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":GZ#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"), Times.Never);
} }
} }
@@ -385,9 +385,9 @@ namespace Meade.net.Telescope.UnitTests
_telescope.Connected = true; _telescope.Connected = true;
_sharedResourcesWrapperMock.Verify( x => x.Connect("Serial", It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.Connect("Serial", It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:GZ#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":GZ#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"),Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"),Times.Once);
} }
[Test] [Test]
@@ -401,8 +401,8 @@ namespace Meade.net.Telescope.UnitTests
_telescope.Connected = true; _telescope.Connected = true;
_sharedResourcesWrapperMock.Verify(x => x.Connect("Serial", It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.Connect("Serial", It.IsAny<string>(), It.IsAny<ITraceLogger>()), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:GZ#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendString(":GZ#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Rg{_profileProperties.GuideRateArcSecondsPerSecond:00.0}#"), Times.Never);
} }
@@ -473,37 +473,37 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SetLongFormatFalse_WhenTelescopeReturnsShortFormat_ThenDoesNothing() public void SetLongFormatFalse_WhenTelescopeReturnsShortFormat_ThenDoesNothing()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GZ#")).Returns("DDD*MM"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GZ#")).Returns("DDD*MM");
_telescope.SetLongFormat(false); _telescope.SetLongFormat(false);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:U#"),Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":U#"),Times.Never);
} }
[Test] [Test]
public void SetLongFormatFalse_WhenTelescopeReturnsLongFormat_ThenTogglesPrecision() public void SetLongFormatFalse_WhenTelescopeReturnsLongFormat_ThenTogglesPrecision()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GZ#")).Returns("DDD*MMSS"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GZ#")).Returns("DDD*MMSS");
_telescope.SetLongFormat(false); _telescope.SetLongFormat(false);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:U#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":U#"), Times.Once);
} }
[Test] [Test]
public void SetLongFormatTrue_WhenTelescopeReturnsLongFormat_ThenDoesNothing() public void SetLongFormatTrue_WhenTelescopeReturnsLongFormat_ThenDoesNothing()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GZ#")).Returns("DDD*MMSS"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GZ#")).Returns("DDD*MMSS");
_telescope.SetLongFormat(true); _telescope.SetLongFormat(true);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:U#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":U#"), Times.Never);
} }
[Test] [Test]
public void SetLongFormatTrue_WhenTelescopeReturnsShortFormat_ThenTogglesPrecision() public void SetLongFormatTrue_WhenTelescopeReturnsShortFormat_ThenTogglesPrecision()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GZ#")).Returns("DDD*MM"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GZ#")).Returns("DDD*MM");
_telescope.SetLongFormat(true); _telescope.SetLongFormat(true);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:U#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":U#"), Times.Once);
} }
[Test] [Test]
@@ -545,7 +545,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.SelectSite(site); _telescope.SelectSite(site);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:W{site}#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":W{site}#"), Times.Once);
} }
[Test] [Test]
@@ -645,9 +645,9 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Set")); Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Set"));
} }
[TestCase("AUTOSTAR", "43Eg", AlignmentModes.algAltAz, "#:AA#")] [TestCase("AUTOSTAR", "43Eg", AlignmentModes.algAltAz, ":AA#")]
[TestCase("AUTOSTAR", "43Eg", AlignmentModes.algPolar, "#:AP#")] [TestCase("AUTOSTAR", "43Eg", AlignmentModes.algPolar, ":AP#")]
[TestCase("AUTOSTAR", "43Eg", AlignmentModes.algGermanPolar, "#:AP#")] [TestCase("AUTOSTAR", "43Eg", AlignmentModes.algGermanPolar, ":AP#")]
public void AlignmentMode_Set_WhenConnected_ThenSendsExpectedCommand(string productName, string firmware, AlignmentModes alignmentMode, string expectedCommand) public void AlignmentMode_Set_WhenConnected_ThenSendsExpectedCommand(string productName, string firmware, AlignmentModes alignmentMode, string expectedCommand)
{ {
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(productName); _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(productName);
@@ -815,7 +815,7 @@ namespace Meade.net.Telescope.UnitTests
{ {
_telescope.Connected = true; _telescope.Connected = true;
_sharedResourcesWrapperMock.Verify( x => x.SendString("#:P#"), Times.Never); _sharedResourcesWrapperMock.Verify( x => x.SendString(":P#"), Times.Never);
} }
[TestCase("High", false, true)] [TestCase("High", false, true)]
@@ -827,7 +827,7 @@ namespace Meade.net.Telescope.UnitTests
_profileProperties.Precision = desiredPresision; _profileProperties.Precision = desiredPresision;
var currentPrecision = telescopePrecision; var currentPrecision = telescopePrecision;
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:P#")).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendChar(":P#")).Returns(() =>
{ {
currentPrecision = !currentPrecision; currentPrecision = !currentPrecision;
@@ -843,7 +843,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.Connected = true; _telescope.Connected = true;
Assert.That(currentPrecision, Is.EqualTo(finalPrecision)); Assert.That(currentPrecision, Is.EqualTo(finalPrecision));
_sharedResourcesWrapperMock.Verify(x => x.SendChar("#:P#"), Times.AtLeastOnce); _sharedResourcesWrapperMock.Verify(x => x.SendChar(":P#"), Times.AtLeastOnce);
} }
[TestCase("High", false, true)] [TestCase("High", false, true)]
@@ -859,7 +859,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.Connected = true; _telescope.Connected = true;
_sharedResourcesWrapperMock.Verify(x => x.SendChar("#:P#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendChar(":P#"), Times.Never);
} }
[Test] [Test]
@@ -966,7 +966,7 @@ namespace Meade.net.Telescope.UnitTests
public void Declination_Get_WhenConnected_ThenReadsValueFromScope(string declincationString) public void Declination_Get_WhenConnected_ThenReadsValueFromScope(string declincationString)
{ {
var expectedResult = 12.34; var expectedResult = 12.34;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GD#")).Returns(declincationString); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GD#")).Returns(declincationString);
_utilMock.Setup(x => x.DMSToDegrees(declincationString)).Returns(expectedResult); _utilMock.Setup(x => x.DMSToDegrees(declincationString)).Returns(expectedResult);
ConnectTelescope(); ConnectTelescope();
@@ -981,14 +981,14 @@ namespace Meade.net.Telescope.UnitTests
var telescopeRaResult = "s12*3456"; var telescopeRaResult = "s12*3456";
var dmsResult = 1.2; var dmsResult = 1.2;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GD#")).Returns(telescopeRaResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GD#")).Returns(telescopeRaResult);
_utilMock.Setup(x => x.DMSToDegrees(telescopeRaResult)).Returns(dmsResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeRaResult)).Returns(dmsResult);
ConnectTelescope(); ConnectTelescope();
var result = _telescope.Declination; var result = _telescope.Declination;
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:GD#"), Times.Exactly(2)); _sharedResourcesWrapperMock.Verify(x => x.SendString(":GD#"), Times.Exactly(2));
_utilMock.Verify(x => x.DMSToDegrees(telescopeRaResult), Times.Exactly(2)); _utilMock.Verify(x => x.DMSToDegrees(telescopeRaResult), Times.Exactly(2));
Assert.That(result, Is.EqualTo(dmsResult)); Assert.That(result, Is.EqualTo(dmsResult));
@@ -1102,7 +1102,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.GuideRateDeclination = newGuideRate; _telescope.GuideRateDeclination = newGuideRate;
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Rg01.2#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg01.2#"), Times.Once);
Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate)); Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate));
} }
@@ -1135,7 +1135,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.GuideRateRightAscension = newGuideRate; _telescope.GuideRateRightAscension = newGuideRate;
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Rg01.2#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg01.2#"), Times.Once);
Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate)); Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate));
} }
@@ -1157,23 +1157,23 @@ namespace Meade.net.Telescope.UnitTests
} }
[TestCase( 0, "", TelescopeAxes.axisPrimary)] [TestCase( 0, "", TelescopeAxes.axisPrimary)]
[TestCase( 1, "#:RG#", TelescopeAxes.axisPrimary)] [TestCase( 1, ":RG#", TelescopeAxes.axisPrimary)]
[TestCase(-1, "#:RG#", TelescopeAxes.axisPrimary)] [TestCase(-1, ":RG#", TelescopeAxes.axisPrimary)]
[TestCase( 2, "#:RC#", TelescopeAxes.axisPrimary)] [TestCase( 2, ":RC#", TelescopeAxes.axisPrimary)]
[TestCase(-2, "#:RC#", TelescopeAxes.axisPrimary)] [TestCase(-2, ":RC#", TelescopeAxes.axisPrimary)]
[TestCase( 3, "#:RM#", TelescopeAxes.axisPrimary)] [TestCase( 3, ":RM#", TelescopeAxes.axisPrimary)]
[TestCase(-3, "#:RM#", TelescopeAxes.axisPrimary)] [TestCase(-3, ":RM#", TelescopeAxes.axisPrimary)]
[TestCase( 4, "#:RS#", TelescopeAxes.axisPrimary)] [TestCase( 4, ":RS#", TelescopeAxes.axisPrimary)]
[TestCase(-4, "#:RS#", TelescopeAxes.axisPrimary)] [TestCase(-4, ":RS#", TelescopeAxes.axisPrimary)]
[TestCase(0, "", TelescopeAxes.axisSecondary)] [TestCase(0, "", TelescopeAxes.axisSecondary)]
[TestCase(1, "#:RG#", TelescopeAxes.axisSecondary)] [TestCase(1, ":RG#", TelescopeAxes.axisSecondary)]
[TestCase(-1, "#:RG#", TelescopeAxes.axisSecondary)] [TestCase(-1, ":RG#", TelescopeAxes.axisSecondary)]
[TestCase(2, "#:RC#", TelescopeAxes.axisSecondary)] [TestCase(2, ":RC#", TelescopeAxes.axisSecondary)]
[TestCase(-2, "#:RC#", TelescopeAxes.axisSecondary)] [TestCase(-2, ":RC#", TelescopeAxes.axisSecondary)]
[TestCase(3, "#:RM#", TelescopeAxes.axisSecondary)] [TestCase(3, ":RM#", TelescopeAxes.axisSecondary)]
[TestCase(-3, "#:RM#", TelescopeAxes.axisSecondary)] [TestCase(-3, ":RM#", TelescopeAxes.axisSecondary)]
[TestCase(4, "#:RS#", TelescopeAxes.axisSecondary)] [TestCase(4, ":RS#", TelescopeAxes.axisSecondary)]
[TestCase(-4, "#:RS#", TelescopeAxes.axisSecondary)] [TestCase(-4, ":RS#", TelescopeAxes.axisSecondary)]
public void MoveAxis_WhenConnected_ThenExecutesCorrectCommandSequence(double rate, string slewRateCommand, TelescopeAxes axis) public void MoveAxis_WhenConnected_ThenExecutesCorrectCommandSequence(double rate, string slewRateCommand, TelescopeAxes axis)
{ {
ConnectTelescope(); ConnectTelescope();
@@ -1184,10 +1184,10 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(slewRateCommand), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.SendBlind(slewRateCommand), Times.Once);
else else
{ {
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:RG#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":RG#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:RC#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":RC#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:RM#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":RM#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:RS#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":RS#"), Times.Never);
} }
switch (axis) switch (axis)
@@ -1196,14 +1196,14 @@ namespace Meade.net.Telescope.UnitTests
switch (rate.Compare(0)) switch (rate.Compare(0))
{ {
case ComparisonResult.Equals: case ComparisonResult.Equals:
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Qe#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Qe#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Qw#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Qw#"), Times.Once);
break; break;
case ComparisonResult.Greater: case ComparisonResult.Greater:
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Me#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Me#"), Times.Once);
break; break;
case ComparisonResult.Lower: case ComparisonResult.Lower:
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Mw#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Mw#"), Times.Once);
break; break;
} }
break; break;
@@ -1211,14 +1211,14 @@ namespace Meade.net.Telescope.UnitTests
switch (rate.Compare(0)) switch (rate.Compare(0))
{ {
case ComparisonResult.Equals: case ComparisonResult.Equals:
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Qn#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Qn#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Qs#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Qs#"), Times.Once);
break; break;
case ComparisonResult.Greater: case ComparisonResult.Greater:
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Mn#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Mn#"), Times.Once);
break; break;
case ComparisonResult.Lower: case ComparisonResult.Lower:
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:Ms#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Ms#"), Times.Once);
break; break;
} }
break; break;
@@ -1264,11 +1264,11 @@ namespace Meade.net.Telescope.UnitTests
{ {
ConnectTelescope(); ConnectTelescope();
Assert.That(_telescope.AtPark, Is.False); Assert.That(_telescope.AtPark, Is.False);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:hP#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":hP#"), Times.Never);
_telescope.Park(); _telescope.Park();
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:hP#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":hP#"), Times.Once);
Assert.That(_telescope.AtPark, Is.True); Assert.That(_telescope.AtPark, Is.True);
} }
@@ -1279,7 +1279,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.Park(); _telescope.Park();
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:hP#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":hP#"), Times.Once);
Assert.That(_telescope.AtPark, Is.True); Assert.That(_telescope.AtPark, Is.True);
@@ -1287,7 +1287,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.Park(); _telescope.Park();
//no change from previous state. //no change from previous state.
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:hP#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":hP#"), Times.Once);
Assert.That(_telescope.AtPark, Is.True); Assert.That(_telescope.AtPark, Is.True);
} }
@@ -1326,7 +1326,7 @@ namespace Meade.net.Telescope.UnitTests
break; break;
} }
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:Mg{d}{duration:0000}#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Mg{d}{duration:0000}#"));
_utilMock.Verify( x => x.WaitForMilliseconds(duration), Times.Once); _utilMock.Verify( x => x.WaitForMilliseconds(duration), Times.Once);
} }
@@ -1336,7 +1336,7 @@ namespace Meade.net.Telescope.UnitTests
[TestCase(GuideDirections.guideSouth)] [TestCase(GuideDirections.guideSouth)]
public void PulseGuide_WhenSlewingAndPulseGuideAttempted_ThenThrowsExpectedException(GuideDirections direction) public void PulseGuide_WhenSlewingAndPulseGuideAttempted_ThenThrowsExpectedException(GuideDirections direction)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns("|"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns("|");
var duration = 0; var duration = 0;
ConnectTelescope(); ConnectTelescope();
@@ -1352,7 +1352,7 @@ namespace Meade.net.Telescope.UnitTests
[TestCase(GuideDirections.guideSouth, TelescopeAxes.axisSecondary)] [TestCase(GuideDirections.guideSouth, TelescopeAxes.axisSecondary)]
public void PulseGuide_WhenMovingAxisAndPulseGuideAttempted_ThenThrowsExpectedException(GuideDirections direction, TelescopeAxes axes) public void PulseGuide_WhenMovingAxisAndPulseGuideAttempted_ThenThrowsExpectedException(GuideDirections direction, TelescopeAxes axes)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns(""); _sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns("");
var duration = 0; var duration = 0;
ConnectTelescope(); ConnectTelescope();
@@ -1417,10 +1417,10 @@ namespace Meade.net.Telescope.UnitTests
break; break;
} }
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:RG#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":RG#"));
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:M{d}#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":M{d}#"));
_utilMock.Verify(x => x.WaitForMilliseconds(duration), Times.Once); _utilMock.Verify(x => x.WaitForMilliseconds(duration), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:Q{d}#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Q{d}#"));
} }
[TestCase(GuideDirections.guideEast)] [TestCase(GuideDirections.guideEast)]
@@ -1453,10 +1453,10 @@ namespace Meade.net.Telescope.UnitTests
break; break;
} }
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:RG#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":RG#"));
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:M{d}#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":M{d}#"));
_utilMock.Verify(x => x.WaitForMilliseconds(duration), Times.Once); _utilMock.Verify(x => x.WaitForMilliseconds(duration), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind($"#:Q{d}#")); _sharedResourcesWrapperMock.Verify(x => x.SendBlind($":Q{d}#"));
} }
[Test] [Test]
@@ -1476,14 +1476,14 @@ namespace Meade.net.Telescope.UnitTests
var telescopeRaResult = "HH:MM:SS"; var telescopeRaResult = "HH:MM:SS";
var hmsResult = 1.2; var hmsResult = 1.2;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GR#")).Returns(telescopeRaResult); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GR#")).Returns(telescopeRaResult);
_utilMock.Setup(x => x.HMSToHours(telescopeRaResult)).Returns(hmsResult); _utilMock.Setup(x => x.HMSToHours(telescopeRaResult)).Returns(hmsResult);
ConnectTelescope(); ConnectTelescope();
var result = _telescope.RightAscension; var result = _telescope.RightAscension;
_sharedResourcesWrapperMock.Verify( x => x.SendString("#:GR#"), Times.Exactly(2)); _sharedResourcesWrapperMock.Verify( x => x.SendString(":GR#"), Times.Exactly(2));
_utilMock.Verify( x => x.HMSToHours(telescopeRaResult), Times.Exactly(2)); _utilMock.Verify( x => x.HMSToHours(telescopeRaResult), Times.Exactly(2));
Assert.That(result,Is.EqualTo(hmsResult)); Assert.That(result,Is.EqualTo(hmsResult));
@@ -1605,14 +1605,14 @@ namespace Meade.net.Telescope.UnitTests
var siteLatitudeString = "testLatString"; var siteLatitudeString = "testLatString";
var siteLatitudeValue = 123.45; var siteLatitudeValue = 123.45;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:Gt#")).Returns(siteLatitudeString); _sharedResourcesWrapperMock.Setup(x => x.SendString(":Gt#")).Returns(siteLatitudeString);
_utilMock.Setup(x => x.DMSToDegrees(siteLatitudeString)).Returns(siteLatitudeValue); _utilMock.Setup(x => x.DMSToDegrees(siteLatitudeString)).Returns(siteLatitudeValue);
ConnectTelescope(); ConnectTelescope();
var result = _telescope.SiteLatitude; var result = _telescope.SiteLatitude;
_sharedResourcesWrapperMock.Verify( x => x.SendString("#:Gt#"), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.SendString(":Gt#"), Times.Once);
Assert.That(result,Is.EqualTo(siteLatitudeValue)); Assert.That(result,Is.EqualTo(siteLatitudeValue));
} }
@@ -1655,8 +1655,8 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Failed to set site latitude.")); Assert.That(exception.Message, Is.EqualTo("Failed to set site latitude."));
} }
[TestCase(-10.5, "#:St-10*30#")] [TestCase(-10.5, ":St-10*30#")]
[TestCase(20.75, "#:St+20*45#")] [TestCase(20.75, ":St+20*45#")]
public void SiteLatitude_Set_WhenValidValues_ThenValueSentToTelescope(double siteLatitude, string expectedCommand) public void SiteLatitude_Set_WhenValidValues_ThenValueSentToTelescope(double siteLatitude, string expectedCommand)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(expectedCommand)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(expectedCommand)).Returns("1");
@@ -1688,7 +1688,7 @@ namespace Meade.net.Telescope.UnitTests
{ {
var telescopeLongitude = "testLongitude"; var telescopeLongitude = "testLongitude";
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:Gg#")).Returns(telescopeLongitude); _sharedResourcesWrapperMock.Setup(x => x.SendString(":Gg#")).Returns(telescopeLongitude);
_utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue); _utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue);
ConnectTelescope(); ConnectTelescope();
@@ -1735,7 +1735,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Failed to set site longitude.")); Assert.That(exception.Message, Is.EqualTo("Failed to set site longitude."));
} }
[TestCase(10, "#:Sg350*00#")] [TestCase(10, ":Sg350*00#")]
public void SiteLongitude_Set_WhenConnectedAndTelescopeFails_ThenThrowsException(double longitude, string expectedCommand) public void SiteLongitude_Set_WhenConnectedAndTelescopeFails_ThenThrowsException(double longitude, string expectedCommand)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar(expectedCommand)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(expectedCommand)).Returns("1");
@@ -1767,26 +1767,26 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SyncToTarget_WhenSyncToTargetFails_ThenThrowsException() public void SyncToTarget_WhenSyncToTargetFails_ThenThrowsException()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:CM#")).Returns(string.Empty); _sharedResourcesWrapperMock.Setup(x => x.SendString(":CM#")).Returns(string.Empty);
ConnectTelescope(); ConnectTelescope();
var exception = Assert.Throws<InvalidOperationException>(() => { _telescope.SyncToTarget(); } ); var exception = Assert.Throws<InvalidOperationException>(() => { _telescope.SyncToTarget(); } );
Assert.That(exception.Message, Is.EqualTo("Unable to perform sync")); Assert.That(exception.Message, Is.EqualTo("Unable to perform sync"));
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:CM#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":CM#"), Times.Once);
} }
[Test] [Test]
public void SyncToTarget_WhenSyncToTargetWorks_ThennoExceptionThrown() public void SyncToTarget_WhenSyncToTargetWorks_ThennoExceptionThrown()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:CM#")).Returns(" M31 EX GAL MAG 3.5 SZ178.0'#"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":CM#")).Returns(" M31 EX GAL MAG 3.5 SZ178.0'#");
ConnectTelescope(); ConnectTelescope();
Assert.DoesNotThrow(() => { _telescope.SyncToTarget(); }); Assert.DoesNotThrow(() => { _telescope.SyncToTarget(); });
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:CM#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":CM#"), Times.Once);
} }
[Test] [Test]
@@ -1825,10 +1825,10 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Target declination invalid")); Assert.That(exception.Message, Is.EqualTo("Target declination invalid"));
} }
[TestCase(-30.5, "-30*30:00", "#:Sd-30*30:00#")] [TestCase(-30.5, "-30*30:00", ":Sd-30*30:00#")]
[TestCase(30.5, "30*30:00", "#:Sd+30*30:00#")] [TestCase(30.5, "30*30:00", ":Sd+30*30:00#")]
[TestCase(-75.25, "-75*15:00", "#:Sd-75*15:00#")] [TestCase(-75.25, "-75*15:00", ":Sd-75*15:00#")]
[TestCase(50, "50*00:00", "#:Sd+50*00:00#")] [TestCase(50, "50*00:00", ":Sd+50*00:00#")]
public void TargetDeclination_Set_WhenValueOK_ThenSetsNewTargetDeclination( double declination,string decstring, string commandString) public void TargetDeclination_Set_WhenValueOK_ThenSetsNewTargetDeclination( double declination,string decstring, string commandString)
{ {
@@ -1855,7 +1855,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Target not set")); Assert.That(exception.Message, Is.EqualTo("Target not set"));
} }
[TestCase(50, "50*00:00", "#:Sd+50*00:00#")] [TestCase(50, "50*00:00", ":Sd+50*00:00#")]
public void TargetDeclination_Get_WhenValueOK_ThenSetsNewTargetDeclination(double declination, string decstring, string commandString) public void TargetDeclination_Get_WhenValueOK_ThenSetsNewTargetDeclination(double declination, string decstring, string commandString)
{ {
_utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", 2)).Returns(decstring); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", 2)).Returns(decstring);
@@ -1906,8 +1906,8 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Failed to set TargetRightAscension.")); Assert.That(exception.Message, Is.EqualTo("Failed to set TargetRightAscension."));
} }
[TestCase(5.5, "05:30:00", "#:Sr05:30:00#")] [TestCase(5.5, "05:30:00", ":Sr05:30:00#")]
[TestCase(10, "10:00:00", "#:Sr10:00:00#")] [TestCase(10, "10:00:00", ":Sr10:00:00#")]
public void TargetRightAscension_Set_WhenValueOK_ThenSetsNewTargetDeclination(double rightAscension, string hms, string commandString) public void TargetRightAscension_Set_WhenValueOK_ThenSetsNewTargetDeclination(double rightAscension, string hms, string commandString)
{ {
_utilMock.Setup(x => x.HoursToHMS(rightAscension, ":", ":", ":", 2)).Returns(hms); _utilMock.Setup(x => x.HoursToHMS(rightAscension, ":", ":", ":", 2)).Returns(hms);
@@ -1933,7 +1933,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Target not set")); Assert.That(exception.Message, Is.EqualTo("Target not set"));
} }
[TestCase(15, "15:00:00", "#:Sr15:00:00#")] [TestCase(15, "15:00:00", ":Sr15:00:00#")]
public void TargetRightAscension_Get_WhenValueOK_ThenSetsNewTargetDeclination(double rightAscension, string hms, string commandString) public void TargetRightAscension_Get_WhenValueOK_ThenSetsNewTargetDeclination(double rightAscension, string hms, string commandString)
{ {
_utilMock.Setup(x => x.HoursToHMS(rightAscension, ":", ":", ":", 2)).Returns(hms); _utilMock.Setup(x => x.HoursToHMS(rightAscension, ":", ":", ":", 2)).Returns(hms);
@@ -1970,8 +1970,8 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: TrackingRate Set")); Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: TrackingRate Set"));
} }
[TestCase(DriveRates.driveSidereal, "#:TQ#")] [TestCase(DriveRates.driveSidereal, ":TQ#")]
[TestCase(DriveRates.driveLunar, "#:TL#")] [TestCase(DriveRates.driveLunar, ":TL#")]
public void TrackingRate_Set_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string commandString) public void TrackingRate_Set_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string commandString)
{ {
ConnectTelescope(); ConnectTelescope();
@@ -2039,9 +2039,9 @@ namespace Meade.net.Telescope.UnitTests
public void UTCDate_Get_WhenConnected_ThenReturnsUTCDateTime(string telescopeDate, string telescopeTime, public void UTCDate_Get_WhenConnected_ThenReturnsUTCDateTime(string telescopeDate, string telescopeTime,
string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second)
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GC#")).Returns(telescopeDate); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GC#")).Returns(telescopeDate);
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GL#")).Returns(telescopeTime); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GL#")).Returns(telescopeTime);
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns(telescopeUtcCorrection); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns(telescopeUtcCorrection);
ConnectTelescope(); ConnectTelescope();
@@ -2074,8 +2074,8 @@ namespace Meade.net.Telescope.UnitTests
var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection; var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns(telescopeUtcCorrection); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns(telescopeUtcCorrection);
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:SL{telescopeTime}#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":SL{telescopeTime}#")).Returns("0");
ConnectTelescope(); ConnectTelescope();
@@ -2093,9 +2093,9 @@ namespace Meade.net.Telescope.UnitTests
var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection; var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns(telescopeUtcCorrection); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns(telescopeUtcCorrection);
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:SL{telescopeTime}#")).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":SL{telescopeTime}#")).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:SC{newDate:MM/dd/yy}#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":SC{newDate:MM/dd/yy}#")).Returns("0");
ConnectTelescope(); ConnectTelescope();
@@ -2115,9 +2115,9 @@ namespace Meade.net.Telescope.UnitTests
var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection; var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns(telescopeUtcCorrection); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns(telescopeUtcCorrection);
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:SL{telescopeTime}#")).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":SL{telescopeTime}#")).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:SC{telescopeDate}#")).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":SC{telescopeDate}#")).Returns("1");
ConnectTelescope(); ConnectTelescope();
@@ -2136,16 +2136,16 @@ namespace Meade.net.Telescope.UnitTests
string dec = "-30*30:00"; string dec = "-30*30:00";
_utilMock.Setup(x => x.HoursToHMS(rightAscension, ":", ":", ":", 2)).Returns(hms); _utilMock.Setup(x => x.HoursToHMS(rightAscension, ":", ":", ":", 2)).Returns(hms);
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:Sr{hms}#")).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":Sr{hms}#")).Returns("1");
_utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", 2)).Returns(dec); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", 2)).Returns(dec);
_sharedResourcesWrapperMock.Setup(x => x.SendChar($"#:Sd{dec}#")).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar($":Sd{dec}#")).Returns("1");
ConnectTelescope(); ConnectTelescope();
_telescope.SyncToCoordinates(rightAscension, declination); _telescope.SyncToCoordinates(rightAscension, declination);
_sharedResourcesWrapperMock.Verify( x => x.SendString("#:CM#"), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.SendString(":CM#"), Times.Once);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
} }
@@ -2157,7 +2157,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.False); Assert.That(result, Is.False);
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:D#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendString(":D#"), Times.Never);
} }
[Test] [Test]
@@ -2169,13 +2169,13 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.False); Assert.That(result, Is.False);
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:D#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":D#"), Times.Once);
} }
[Test] [Test]
public void Slewing_WhenTelescopeIsSlewing_ThenReturnsTrue() public void Slewing_WhenTelescopeIsSlewing_ThenReturnsTrue()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns("|"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns("|");
ConnectTelescope(); ConnectTelescope();
@@ -2183,7 +2183,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(result, Is.True); Assert.That(result, Is.True);
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:D#"),Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendString(":D#"),Times.Once);
} }
[TestCase(1, TelescopeAxes.axisPrimary)] [TestCase(1, TelescopeAxes.axisPrimary)]
@@ -2199,7 +2199,7 @@ namespace Meade.net.Telescope.UnitTests
var result = _telescope.Slewing; var result = _telescope.Slewing;
Assert.That(result, Is.True); Assert.That(result, Is.True);
_sharedResourcesWrapperMock.Verify(x => x.SendString("#:D#"), Times.Never); _sharedResourcesWrapperMock.Verify(x => x.SendString(":D#"), Times.Never);
} }
@@ -2247,7 +2247,7 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTargetSetAndSlewIsPossible_ThenAttemptsSlew() public void SlewToTargetAsync_WhenTargetSetAndSlewIsPossible_ThenAttemptsSlew()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
ConnectTelescope(); ConnectTelescope();
@@ -2257,13 +2257,13 @@ namespace Meade.net.Telescope.UnitTests
_telescope.SlewToTargetAsync(); _telescope.SlewToTargetAsync();
_sharedResourcesWrapperMock.Verify(x => x.SendChar("#:MS#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(":MS#"), Times.Once);
} }
[Test] [Test]
public void SlewToTargetAsync_WhenTargetBelowHorizon_ThenThrowsException() public void SlewToTargetAsync_WhenTargetBelowHorizon_ThenThrowsException()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon");
ConnectTelescope(); ConnectTelescope();
@@ -2278,7 +2278,7 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTargetBelowElevation_ThenThrowsException() public void SlewToTargetAsync_WhenTargetBelowElevation_ThenThrowsException()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("2"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("2");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation");
ConnectTelescope(); ConnectTelescope();
@@ -2293,7 +2293,7 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTargetAsync_WhenTelescopeCanHitTripod_ThenThrowsException() public void SlewToTargetAsync_WhenTelescopeCanHitTripod_ThenThrowsException()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("3"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("3");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod");
ConnectTelescope(); ConnectTelescope();
@@ -2315,11 +2315,11 @@ namespace Meade.net.Telescope.UnitTests
[Test] [Test]
public void SlewToTarget_WhenSlewing_ThenWaitsForTheSlewToComplete() public void SlewToTarget_WhenSlewing_ThenWaitsForTheSlewToComplete()
{ {
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
var slewCounter = 0; var slewCounter = 0;
var iterations = 10; var iterations = 10;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns(() =>
{ {
slewCounter++; slewCounter++;
if (slewCounter <= iterations) if (slewCounter <= iterations)
@@ -2350,11 +2350,11 @@ namespace Meade.net.Telescope.UnitTests
var rightAscension = 1; var rightAscension = 1;
var declination = 2; var declination = 2;
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
//var slewCounter = 0; //var slewCounter = 0;
//var iterations = 10; //var iterations = 10;
//_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns(() => //_sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns(() =>
//{ //{
// slewCounter++; // slewCounter++;
// if (slewCounter <= iterations) // if (slewCounter <= iterations)
@@ -2370,7 +2370,7 @@ namespace Meade.net.Telescope.UnitTests
//_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations)); //_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations));
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
_sharedResourcesWrapperMock.Verify( x => x.SendChar("#:MS#"), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.SendChar(":MS#"), Times.Once);
} }
[Test] [Test]
@@ -2386,11 +2386,11 @@ namespace Meade.net.Telescope.UnitTests
var rightAscension = 1; var rightAscension = 1;
var declination = 2; var declination = 2;
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
var slewCounter = 0; var slewCounter = 0;
var iterations = 10; var iterations = 10;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns(() =>
{ {
slewCounter++; slewCounter++;
if (slewCounter <= iterations) if (slewCounter <= iterations)
@@ -2403,7 +2403,7 @@ namespace Meade.net.Telescope.UnitTests
_telescope.SlewToCoordinates(rightAscension, declination); _telescope.SlewToCoordinates(rightAscension, declination);
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
_sharedResourcesWrapperMock.Verify(x => x.SendChar("#:MS#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(":MS#"), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations)); _utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations));
} }
@@ -2459,15 +2459,15 @@ namespace Meade.net.Telescope.UnitTests
var rightAscension = 20; var rightAscension = 20;
var declination = 10; var declination = 10;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GC#")).Returns("10/15/20"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GC#")).Returns("10/15/20");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GL#")).Returns("20:15:10"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GL#")).Returns("20:15:10");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns("-1.0");
_astroMathsMock _astroMathsMock
.Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(), .Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(),
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = rightAscension }); It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = rightAscension });
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
ConnectTelescope(); ConnectTelescope();
@@ -2475,7 +2475,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
_sharedResourcesWrapperMock.Verify(x => x.SendChar("#:MS#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(":MS#"), Times.Once);
} }
[Test] [Test]
@@ -2493,19 +2493,19 @@ namespace Meade.net.Telescope.UnitTests
var azimuth = 30; var azimuth = 30;
var altitude = 40; var altitude = 40;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GC#")).Returns("10/15/20"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GC#")).Returns("10/15/20");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GL#")).Returns("20:15:10"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GL#")).Returns("20:15:10");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns("-1.0");
_astroMathsMock _astroMathsMock
.Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(), .Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(),
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = rightAscension }); It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = rightAscension });
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
var slewCounter = 0; var slewCounter = 0;
var iterations = 10; var iterations = 10;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:D#")).Returns(() => _sharedResourcesWrapperMock.Setup(x => x.SendString(":D#")).Returns(() =>
{ {
slewCounter++; slewCounter++;
if (slewCounter <= iterations) if (slewCounter <= iterations)
@@ -2519,7 +2519,7 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension)); Assert.That(_telescope.TargetRightAscension, Is.EqualTo(rightAscension));
Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination));
_sharedResourcesWrapperMock.Verify(x => x.SendChar("#:MS#"), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(":MS#"), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations)); _utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Exactly(iterations));
} }
@@ -2547,14 +2547,14 @@ namespace Meade.net.Telescope.UnitTests
var mockHourAngle = 3; var mockHourAngle = 3;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GC#")).Returns("10/15/20"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GC#")).Returns("10/15/20");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GL#")).Returns("20:15:10"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GL#")).Returns("20:15:10");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns("-1.0");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:Gg#")).Returns(telescopeLongitude); _sharedResourcesWrapperMock.Setup(x => x.SendString(":Gg#")).Returns(telescopeLongitude);
_utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue); _utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue);
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GR#")).Returns(telescopeLatitude); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GR#")).Returns(telescopeLatitude);
_utilMock.Setup(x => x.HMSToHours(telescopeLatitude)).Returns(telescopeLatitudeValue); _utilMock.Setup(x => x.HMSToHours(telescopeLatitude)).Returns(telescopeLatitudeValue);
_astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(mockHourAngle); _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(mockHourAngle);
@@ -2592,14 +2592,14 @@ namespace Meade.net.Telescope.UnitTests
var mockHourAngle = 3; var mockHourAngle = 3;
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GC#")).Returns("10/15/20"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GC#")).Returns("10/15/20");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GL#")).Returns("20:15:10"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GL#")).Returns("20:15:10");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GG#")).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GG#")).Returns("-1.0");
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:Gg#")).Returns(telescopeLongitude); _sharedResourcesWrapperMock.Setup(x => x.SendString(":Gg#")).Returns(telescopeLongitude);
_utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue); _utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue);
_sharedResourcesWrapperMock.Setup(x => x.SendString("#:GR#")).Returns(telescopeLatitude); _sharedResourcesWrapperMock.Setup(x => x.SendString(":GR#")).Returns(telescopeLatitude);
_utilMock.Setup(x => x.HMSToHours(telescopeLatitude)).Returns(telescopeLatitudeValue); _utilMock.Setup(x => x.HMSToHours(telescopeLatitude)).Returns(telescopeLatitudeValue);
_astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(mockHourAngle); _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>())).Returns(mockHourAngle);
@@ -2627,12 +2627,12 @@ namespace Meade.net.Telescope.UnitTests
_telescope.AbortSlew(); _telescope.AbortSlew();
_sharedResourcesWrapperMock.Verify( x => x.SendBlind("#:Q#"),Times.Once); _sharedResourcesWrapperMock.Verify( x => x.SendBlind(":Q#"),Times.Once);
var isSloSlewing = _telescope.Slewing; var isSloSlewing = _telescope.Slewing;
Assert.That(isSloSlewing, Is.False); Assert.That(isSloSlewing, Is.False);
_sharedResourcesWrapperMock.Verify( x => x.SendString("#:D#"), Times.Once); _sharedResourcesWrapperMock.Verify( x => x.SendString(":D#"), Times.Once);
} }
} }
} }
+78 -78
View File
@@ -202,68 +202,68 @@ namespace ASCOM.Meade.net
{ {
//Read the screen //Read the screen
case "readdisplay": case "readdisplay":
var output = _sharedResourcesWrapper.SendString("#:ED#"); var output = _sharedResourcesWrapper.SendString(":ED#");
return output; return output;
//top row of buttons //top row of buttons
case "enter": case "enter":
_sharedResourcesWrapper.SendBlind("#:EK13#"); _sharedResourcesWrapper.SendBlind(":EK13#");
break; break;
case "mode": case "mode":
_sharedResourcesWrapper.SendBlind("#:EK9#"); _sharedResourcesWrapper.SendBlind(":EK9#");
break; break;
case "longmode": case "longmode":
_sharedResourcesWrapper.SendBlind("#:EK11#"); _sharedResourcesWrapper.SendBlind(":EK11#");
break; break;
case "goto": case "goto":
_sharedResourcesWrapper.SendBlind("#:EK24#"); _sharedResourcesWrapper.SendBlind(":EK24#");
break; break;
case "0": //light and 0 case "0": //light and 0
_sharedResourcesWrapper.SendBlind("#:EK48#"); _sharedResourcesWrapper.SendBlind(":EK48#");
break; break;
case "1": case "1":
_sharedResourcesWrapper.SendBlind("#:EK49#"); _sharedResourcesWrapper.SendBlind(":EK49#");
break; break;
case "2": case "2":
_sharedResourcesWrapper.SendBlind("#:EK50#"); _sharedResourcesWrapper.SendBlind(":EK50#");
break; break;
case "3": case "3":
_sharedResourcesWrapper.SendBlind("#:EK51#"); _sharedResourcesWrapper.SendBlind(":EK51#");
break; break;
case "4": case "4":
_sharedResourcesWrapper.SendBlind("#:EK52#"); _sharedResourcesWrapper.SendBlind(":EK52#");
break; break;
case "5": case "5":
_sharedResourcesWrapper.SendBlind("#:EK53#"); _sharedResourcesWrapper.SendBlind(":EK53#");
break; break;
case "6": case "6":
_sharedResourcesWrapper.SendBlind("#:EK54#"); _sharedResourcesWrapper.SendBlind(":EK54#");
break; break;
case "7": case "7":
_sharedResourcesWrapper.SendBlind("#:EK55#"); _sharedResourcesWrapper.SendBlind(":EK55#");
break; break;
case "8": case "8":
_sharedResourcesWrapper.SendBlind("#:EK56#"); _sharedResourcesWrapper.SendBlind(":EK56#");
break; break;
case "9": case "9":
_sharedResourcesWrapper.SendBlind("#:EK57#"); _sharedResourcesWrapper.SendBlind(":EK57#");
break; break;
case "up": case "up":
_sharedResourcesWrapper.SendBlind("#:EK94#"); _sharedResourcesWrapper.SendBlind(":EK94#");
break; break;
case "down": case "down":
_sharedResourcesWrapper.SendBlind("#:EK118#"); _sharedResourcesWrapper.SendBlind(":EK118#");
break; break;
case "back": case "back":
_sharedResourcesWrapper.SendBlind("#:EK87#"); _sharedResourcesWrapper.SendBlind(":EK87#");
break; break;
case "forward": case "forward":
_sharedResourcesWrapper.SendBlind("#:EK69#"); _sharedResourcesWrapper.SendBlind(":EK69#");
break; break;
case "?": case "?":
_sharedResourcesWrapper.SendBlind("#:EK63#"); _sharedResourcesWrapper.SendBlind(":EK63#");
break; break;
default: default:
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters); LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
@@ -541,7 +541,7 @@ namespace ASCOM.Meade.net
_sharedResourcesWrapper.Lock(() => _sharedResourcesWrapper.Lock(() =>
{ {
var result = _sharedResourcesWrapper.SendString("#:GZ#"); var result = _sharedResourcesWrapper.SendString(":GZ#");
//:GZ# Get telescope azimuth //:GZ# Get telescope azimuth
//Returns: DDD*MM# or DDD*MMSS# //Returns: DDD*MM# or DDD*MMSS#
//The current telescope Azimuth depending on the selected precision. //The current telescope Azimuth depending on the selected precision.
@@ -551,7 +551,7 @@ namespace ASCOM.Meade.net
if (IsLongFormat != setLongFormat) if (IsLongFormat != setLongFormat)
{ {
_utilities.WaitForMilliseconds(500); _utilities.WaitForMilliseconds(500);
_sharedResourcesWrapper.SendBlind("#:U#"); _sharedResourcesWrapper.SendBlind(":U#");
//:U# Toggle between low/hi precision positions //:U# Toggle between low/hi precision positions
//Low - RA displays and messages HH:MM.T sDD*MM //Low - RA displays and messages HH:MM.T sDD*MM
//High - Dec / Az / El displays and messages HH:MM: SS sDD*MM:SS //High - Dec / Az / El displays and messages HH:MM: SS sDD*MM:SS
@@ -565,7 +565,7 @@ namespace ASCOM.Meade.net
private bool TogglePrecision() private bool TogglePrecision()
{ {
LogMessage("TogglePrecision", "Toggling slewing precision"); LogMessage("TogglePrecision", "Toggling slewing precision");
var result = _sharedResourcesWrapper.SendChar("#:P#"); var result = _sharedResourcesWrapper.SendChar(":P#");
//:P# Toggles High Precsion Pointing. When High precision pointing is enabled scope will first allow the operator to center a nearby bright star before moving to the actual target. //:P# Toggles High Precsion Pointing. When High precision pointing is enabled scope will first allow the operator to center a nearby bright star before moving to the actual target.
//Returns: <string> //Returns: <string>
//“HIGH PRECISION” Current setting after this command. //“HIGH PRECISION” Current setting after this command.
@@ -605,7 +605,7 @@ namespace ASCOM.Meade.net
{ {
CheckConnectedAndValidateSite(site, "SelectSite"); CheckConnectedAndValidateSite(site, "SelectSite");
_sharedResourcesWrapper.SendBlind($"#:W{site}#"); _sharedResourcesWrapper.SendBlind($":W{site}#");
//:W<n># //:W<n>#
//Set current site to<n>, an ASCII digit in the range 1..4 //Set current site to<n>, an ASCII digit in the range 1..4
//Returns: Nothing //Returns: Nothing
@@ -631,7 +631,7 @@ namespace ASCOM.Meade.net
switch (site) switch (site)
{ {
case 1: case 1:
command = $"#:SM{sitename}#"; command = $":SM{sitename}#";
//:SM<string># //:SM<string>#
//Set site 1s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters. //Set site 1s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
// Returns: // Returns:
@@ -639,7 +639,7 @@ namespace ASCOM.Meade.net
//1 - Valid //1 - Valid
break; break;
case 2: case 2:
command = $"#:SN{sitename}#"; command = $":SN{sitename}#";
//:SN<string># //:SN<string>#
//Set site 2s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters. //Set site 2s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
// Returns: // Returns:
@@ -647,7 +647,7 @@ namespace ASCOM.Meade.net
//1 - Valid //1 - Valid
break; break;
case 3: case 3:
command = $"#:SO{sitename}#"; command = $":SO{sitename}#";
//:SO<string># //:SO<string>#
//Set site 3s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters. //Set site 3s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
// Returns: // Returns:
@@ -655,7 +655,7 @@ namespace ASCOM.Meade.net
//1 - Valid //1 - Valid
break; break;
case 4: case 4:
command = $"#:SP{sitename}#"; command = $":SP{sitename}#";
//:SP<string># //:SP<string>#
//Set site 4s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters. //Set site 4s name to be<string>.LX200s only accept 3 character strings. Other scopes accept up to 15 characters.
// Returns: // Returns:
@@ -680,22 +680,22 @@ namespace ASCOM.Meade.net
switch (site) switch (site)
{ {
case 1: case 1:
return _sharedResourcesWrapper.SendString("#:GM#"); return _sharedResourcesWrapper.SendString(":GM#");
//:GM# Get Site 1 Name //:GM# Get Site 1 Name
//Returns: <string># //Returns: <string>#
//A # terminated string with the name of the requested site. //A # terminated string with the name of the requested site.
case 2: case 2:
return _sharedResourcesWrapper.SendString("#:GN#"); return _sharedResourcesWrapper.SendString(":GN#");
//:GN# Get Site 2 Name //:GN# Get Site 2 Name
//Returns: <string># //Returns: <string>#
//A # terminated string with the name of the requested site. //A # terminated string with the name of the requested site.
case 3: case 3:
return _sharedResourcesWrapper.SendString("#:GO#"); return _sharedResourcesWrapper.SendString(":GO#");
//:GO# Get Site 3 Name //:GO# Get Site 3 Name
//Returns: <string># //Returns: <string>#
//A # terminated string with the name of the requested site. //A # terminated string with the name of the requested site.
case 4: case 4:
return _sharedResourcesWrapper.SendString("#:GP#"); return _sharedResourcesWrapper.SendString(":GP#");
//:GP# Get Site 4 Name //:GP# Get Site 4 Name
//Returns: <string># //Returns: <string>#
//A # terminated string with the name of the requested site. //A # terminated string with the name of the requested site.
@@ -750,11 +750,11 @@ namespace ASCOM.Meade.net
{ {
//string name = "Short driver name - please customise"; //string name = "Short driver name - please customise";
//var telescopeProduceName = _sharedResourcesWrapper.SendString("#:GVP#"); //var telescopeProduceName = _sharedResourcesWrapper.SendString(":GVP#");
////:GVP# Get Telescope Product Name ////:GVP# Get Telescope Product Name
////Returns: <string># ////Returns: <string>#
//var firmwareVersion = _sharedResourcesWrapper.SendString("#:GVN#"); //var firmwareVersion = _sharedResourcesWrapper.SendString(":GVN#");
////:GVN# Get Telescope Firmware Number ////:GVN# Get Telescope Firmware Number
////Returns: dd.d# ////Returns: dd.d#
@@ -774,7 +774,7 @@ namespace ASCOM.Meade.net
CheckConnected("AbortSlew"); CheckConnected("AbortSlew");
LogMessage("AbortSlew", "Aborting slew"); LogMessage("AbortSlew", "Aborting slew");
_sharedResourcesWrapper.SendBlind("#:Q#"); _sharedResourcesWrapper.SendBlind(":Q#");
//:Q# Halt all current slewing //:Q# Halt all current slewing
//Returns:Nothing //Returns:Nothing
@@ -803,7 +803,7 @@ namespace ASCOM.Meade.net
//todo implement GW Command - Supported in Autostar 43Eg and above //todo implement GW Command - Supported in Autostar 43Eg and above
//if FirmwareIsGreaterThan(TelescopeList.Autostar497_43EG) //if FirmwareIsGreaterThan(TelescopeList.Autostar497_43EG)
//{ //{
//var alignmentString = SerialPort.CommandTerminated("#:GW#", "#"); //var alignmentString = SerialPort.CommandTerminated(":GW#", "#");
//:GW# Get Scope Alignment Status //:GW# Get Scope Alignment Status
//Returns: <mount><tracking><alignment># //Returns: <mount><tracking><alignment>#
// where: // where:
@@ -843,13 +843,13 @@ namespace ASCOM.Meade.net
switch (value) switch (value)
{ {
case AlignmentModes.algAltAz: case AlignmentModes.algAltAz:
_sharedResourcesWrapper.SendBlind("#:AA#"); _sharedResourcesWrapper.SendBlind(":AA#");
//:AA# Sets telescope the AltAz alignment mode //:AA# Sets telescope the AltAz alignment mode
//Returns: nothing //Returns: nothing
break; break;
case AlignmentModes.algPolar: case AlignmentModes.algPolar:
case AlignmentModes.algGermanPolar: case AlignmentModes.algGermanPolar:
_sharedResourcesWrapper.SendBlind("#:AP#"); _sharedResourcesWrapper.SendBlind(":AP#");
//:AP# Sets telescope to Polar alignment mode //:AP# Sets telescope to Polar alignment mode
//Returns: nothing //Returns: nothing
break; break;
@@ -873,7 +873,7 @@ namespace ASCOM.Meade.net
return altAz.Altitude; return altAz.Altitude;
//firmware bug in 44Eg, :GA# is returning the dec, not the altitude! //firmware bug in 44Eg, :GA# is returning the dec, not the altitude!
//var result = _sharedResourcesWrapper.SendString("#:GA#"); //var result = _sharedResourcesWrapper.SendString(":GA#");
////:GA# Get Telescope Altitude ////:GA# Get Telescope Altitude
////Returns: sDD* MM# or sDD*MMSS# ////Returns: sDD* MM# or sDD*MMSS#
////The current scope altitude. The returned format depending on the current precision setting. ////The current scope altitude. The returned format depending on the current precision setting.
@@ -963,7 +963,7 @@ namespace ASCOM.Meade.net
{ {
CheckConnected("Azimuth Get"); CheckConnected("Azimuth Get");
//var result = _sharedResourcesWrapper.SendString("#:GZ#"); //var result = _sharedResourcesWrapper.SendString(":GZ#");
//:GZ# Get telescope azimuth //:GZ# Get telescope azimuth
//Returns: DDD*MM#T or DDD*MMSS# //Returns: DDD*MM#T or DDD*MMSS#
//The current telescope Azimuth depending on the selected precision. //The current telescope Azimuth depending on the selected precision.
@@ -1145,7 +1145,7 @@ namespace ASCOM.Meade.net
{ {
CheckConnected("Declination Get"); CheckConnected("Declination Get");
var result = _sharedResourcesWrapper.SendString("#:GD#"); var result = _sharedResourcesWrapper.SendString(":GD#");
//:GD# Get Telescope Declination. //:GD# Get Telescope Declination.
//Returns: sDD*MM# or sDD*MMSS# //Returns: sDD*MM# or sDD*MMSS#
//Depending upon the current precision setting for the telescope. //Depending upon the current precision setting for the telescope.
@@ -1233,7 +1233,7 @@ namespace ASCOM.Meade.net
} }
LogMessage($"{propertyName} Set", $"Setting new guiderate {value.ToString(CultureInfo.CurrentCulture)} arc seconds/second ({value.ToString(CultureInfo.CurrentCulture)} degrees/second)"); LogMessage($"{propertyName} Set", $"Setting new guiderate {value.ToString(CultureInfo.CurrentCulture)} arc seconds/second ({value.ToString(CultureInfo.CurrentCulture)} degrees/second)");
_sharedResourcesWrapper.SendBlind($"#:Rg{value:00.0}#"); _sharedResourcesWrapper.SendBlind($":Rg{value:00.0}#");
//:RgSS.S# //:RgSS.S#
//Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking //Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking
//Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed //Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed
@@ -1314,22 +1314,22 @@ namespace ASCOM.Meade.net
//do nothing, it's ok this time as we're halting the slew. //do nothing, it's ok this time as we're halting the slew.
break; break;
case 1: case 1:
_sharedResourcesWrapper.SendBlind("#:RG#"); _sharedResourcesWrapper.SendBlind(":RG#");
//:RG# Set Slew rate to Guiding Rate (slowest) //:RG# Set Slew rate to Guiding Rate (slowest)
//Returns: Nothing //Returns: Nothing
break; break;
case 2: case 2:
_sharedResourcesWrapper.SendBlind("#:RC#"); _sharedResourcesWrapper.SendBlind(":RC#");
//:RC# Set Slew rate to Centering rate (2nd slowest) //:RC# Set Slew rate to Centering rate (2nd slowest)
//Returns: Nothing //Returns: Nothing
break; break;
case 3: case 3:
_sharedResourcesWrapper.SendBlind("#:RM#"); _sharedResourcesWrapper.SendBlind(":RM#");
//:RM# Set Slew rate to Find Rate (2nd Fastest) //:RM# Set Slew rate to Find Rate (2nd Fastest)
//Returns: Nothing //Returns: Nothing
break; break;
case 4: case 4:
_sharedResourcesWrapper.SendBlind("#:RS#"); _sharedResourcesWrapper.SendBlind(":RS#");
//:RS# Set Slew rate to max (fastest) //:RS# Set Slew rate to max (fastest)
//Returns: Nothing //Returns: Nothing
break; break;
@@ -1344,22 +1344,22 @@ namespace ASCOM.Meade.net
{ {
case ComparisonResult.Equals: case ComparisonResult.Equals:
_movingPrimary = false; _movingPrimary = false;
_sharedResourcesWrapper.SendBlind("#:Qe#"); _sharedResourcesWrapper.SendBlind(":Qe#");
//:Qe# Halt eastward Slews //:Qe# Halt eastward Slews
//Returns: Nothing //Returns: Nothing
_sharedResourcesWrapper.SendBlind("#:Qw#"); _sharedResourcesWrapper.SendBlind(":Qw#");
//:Qw# Halt westward Slews //:Qw# Halt westward Slews
//Returns: Nothing //Returns: Nothing
break; break;
case ComparisonResult.Greater: case ComparisonResult.Greater:
_sharedResourcesWrapper.SendBlind("#:Me#"); _sharedResourcesWrapper.SendBlind(":Me#");
//:Me# Move Telescope East at current slew rate //:Me# Move Telescope East at current slew rate
//Returns: Nothing //Returns: Nothing
_movingPrimary = true; _movingPrimary = true;
break; break;
case ComparisonResult.Lower: case ComparisonResult.Lower:
_sharedResourcesWrapper.SendBlind("#:Mw#"); _sharedResourcesWrapper.SendBlind(":Mw#");
//:Mw# Move Telescope West at current slew rate //:Mw# Move Telescope West at current slew rate
//Returns: Nothing //Returns: Nothing
_movingPrimary = true; _movingPrimary = true;
@@ -1371,21 +1371,21 @@ namespace ASCOM.Meade.net
{ {
case ComparisonResult.Equals: case ComparisonResult.Equals:
_movingSecondary = false; _movingSecondary = false;
_sharedResourcesWrapper.SendBlind("#:Qn#"); _sharedResourcesWrapper.SendBlind(":Qn#");
//:Qn# Halt northward Slews //:Qn# Halt northward Slews
//Returns: Nothing //Returns: Nothing
_sharedResourcesWrapper.SendBlind("#:Qs#"); _sharedResourcesWrapper.SendBlind(":Qs#");
//:Qs# Halt southward Slews //:Qs# Halt southward Slews
//Returns: Nothing //Returns: Nothing
break; break;
case ComparisonResult.Greater: case ComparisonResult.Greater:
_sharedResourcesWrapper.SendBlind("#:Mn#"); _sharedResourcesWrapper.SendBlind(":Mn#");
//:Mn# Move Telescope North at current slew rate //:Mn# Move Telescope North at current slew rate
//Returns: Nothing //Returns: Nothing
_movingSecondary = true; _movingSecondary = true;
break; break;
case ComparisonResult.Lower: case ComparisonResult.Lower:
_sharedResourcesWrapper.SendBlind("#:Ms#"); _sharedResourcesWrapper.SendBlind(":Ms#");
//:Ms# Move Telescope South at current slew rate //:Ms# Move Telescope South at current slew rate
//Returns: Nothing //Returns: Nothing
_movingSecondary = true; _movingSecondary = true;
@@ -1407,7 +1407,7 @@ namespace ASCOM.Meade.net
if (AtPark) if (AtPark)
return; return;
_sharedResourcesWrapper.SendBlind("#:hP#"); _sharedResourcesWrapper.SendBlind(":hP#");
//:hP# Autostar, Autostar II and LX 16”Slew to Park Position //:hP# Autostar, Autostar II and LX 16”Slew to Park Position
//Returns: Nothing //Returns: Nothing
AtPark = true; AtPark = true;
@@ -1457,7 +1457,7 @@ namespace ASCOM.Meade.net
} }
LogMessage("PulseGuide", "Using new pulse guiding technique"); LogMessage("PulseGuide", "Using new pulse guiding technique");
_sharedResourcesWrapper.SendBlind($"#:Mg{d}{duration:0000}#"); _sharedResourcesWrapper.SendBlind($":Mg{d}{duration:0000}#");
//:MgnDDDD# //:MgnDDDD#
//:MgsDDDD# //:MgsDDDD#
//:MgeDDDD# //:MgeDDDD#
@@ -1522,7 +1522,7 @@ namespace ASCOM.Meade.net
get get
{ {
CheckConnected("RightAscension Get"); CheckConnected("RightAscension Get");
var result = _sharedResourcesWrapper.SendString("#:GR#"); var result = _sharedResourcesWrapper.SendString(":GR#");
//:GR# Get Telescope RA //:GR# Get Telescope RA
//Returns: HH:MM.T# or HH:MM:SS# //Returns: HH:MM.T# or HH:MM:SS#
//Depending which precision is set for the telescope //Depending which precision is set for the telescope
@@ -1618,7 +1618,7 @@ namespace ASCOM.Meade.net
{ {
CheckConnected("SiteLatitude Get"); CheckConnected("SiteLatitude Get");
var latitude = _sharedResourcesWrapper.SendString("#:Gt#"); var latitude = _sharedResourcesWrapper.SendString(":Gt#");
//:Gt# Get Current Site Latitude //:Gt# Get Current Site Latitude
//Returns: sDD* MM# //Returns: sDD* MM#
//The latitude of the current site. Positive inplies North latitude. //The latitude of the current site. Positive inplies North latitude.
@@ -1644,7 +1644,7 @@ namespace ASCOM.Meade.net
var absValue = Math.Abs(value); var absValue = Math.Abs(value);
int d = Convert.ToInt32(Math.Floor(absValue)); int d = Convert.ToInt32(Math.Floor(absValue));
int m = Convert.ToInt32(60 * (absValue - d)); int m = Convert.ToInt32(60 * (absValue - d));
var commandString = $"#:St{sign}{d:00}*{m:00}#"; var commandString = $":St{sign}{d:00}*{m:00}#";
var result = _sharedResourcesWrapper.SendChar(commandString); var result = _sharedResourcesWrapper.SendChar(commandString);
//:StsDD*MM# //:StsDD*MM#
@@ -1663,7 +1663,7 @@ namespace ASCOM.Meade.net
{ {
CheckConnected("SiteLongitude Get"); CheckConnected("SiteLongitude Get");
var longitude = _sharedResourcesWrapper.SendString("#:Gg#"); var longitude = _sharedResourcesWrapper.SendString(":Gg#");
//:Gg# Get Current Site Longitude //:Gg# Get Current Site Longitude
//Returns: sDDD*MM# //Returns: sDDD*MM#
//The current site Longitude. East Longitudes are expressed as negative //The current site Longitude. East Longitudes are expressed as negative
@@ -1699,7 +1699,7 @@ namespace ASCOM.Meade.net
int d = Convert.ToInt32(Math.Floor(newLongitude)); int d = Convert.ToInt32(Math.Floor(newLongitude));
int m = Convert.ToInt32(60 * (newLongitude - d)); int m = Convert.ToInt32(60 * (newLongitude - d));
var commandstring = $"#:Sg{d:000}*{m:00}#"; var commandstring = $":Sg{d:000}*{m:00}#";
var result = _sharedResourcesWrapper.SendChar(commandstring); var result = _sharedResourcesWrapper.SendChar(commandstring);
//:SgDDD*MM# //:SgDDD*MM#
@@ -1789,7 +1789,7 @@ namespace ASCOM.Meade.net
switch (polar) switch (polar)
{ {
case true: case true:
var response = _sharedResourcesWrapper.SendChar("#:MS#"); var response = _sharedResourcesWrapper.SendChar(":MS#");
//:MS# Slew to Target Object //:MS# Slew to Target Object
//Returns: //Returns:
//0 Slew is Possible //0 Slew is Possible
@@ -1825,7 +1825,7 @@ namespace ASCOM.Meade.net
break; break;
case false: case false:
var maResponse = _sharedResourcesWrapper.SendChar("#:MA#"); var maResponse = _sharedResourcesWrapper.SendChar(":MA#");
//:MA# Autostar, LX 16”, Autostar II Slew to target Alt and Az //:MA# Autostar, LX 16”, Autostar II Slew to target Alt and Az
//Returns: //Returns:
//0 - No fault //0 - No fault
@@ -1925,7 +1925,7 @@ namespace ASCOM.Meade.net
if (_isGuiding) if (_isGuiding)
return false; return false;
var result = _sharedResourcesWrapper.SendString("#:D#"); var result = _sharedResourcesWrapper.SendString(":D#");
//:D# Requests a string of bars indicating the distance to the current target location. //:D# Requests a string of bars indicating the distance to the current target location.
//Returns: //Returns:
//LX200's a string of bar characters indicating the distance. //LX200's a string of bar characters indicating the distance.
@@ -1967,7 +1967,7 @@ namespace ASCOM.Meade.net
LogMessage("SyncToTarget", "Executing"); LogMessage("SyncToTarget", "Executing");
CheckConnected("SyncToTarget"); CheckConnected("SyncToTarget");
var result = _sharedResourcesWrapper.SendString("#:CM#"); var result = _sharedResourcesWrapper.SendString(":CM#");
//:CM# Synchronizes the telescope's position with the currently selected database object's coordinates. //:CM# Synchronizes the telescope's position with the currently selected database object's coordinates.
//Returns: //Returns:
//LX200's - a "#" terminated string with the name of the object that was synced. //LX200's - a "#" terminated string with the name of the object that was synced.
@@ -1985,7 +1985,7 @@ namespace ASCOM.Meade.net
if (_targetDeclination.Equals(InvalidParameter)) if (_targetDeclination.Equals(InvalidParameter))
throw new InvalidOperationException("Target not set"); throw new InvalidOperationException("Target not set");
//var result = SerialPort.CommandTerminated("#:Gd#", "#"); //var result = SerialPort.CommandTerminated(":Gd#", "#");
////:Gd# Get Currently Selected Object/Target Declination ////:Gd# Get Currently Selected Object/Target Declination
////Returns: sDD* MM# or sDD*MMSS# ////Returns: sDD* MM# or sDD*MMSS#
////Depending upon the current precision setting for the telescope. ////Depending upon the current precision setting for the telescope.
@@ -2013,7 +2013,7 @@ namespace ASCOM.Meade.net
var dms = _utilities.DegreesToDMS(value, "*", ":", ":", 2); var dms = _utilities.DegreesToDMS(value, "*", ":", ":", 2);
var s = value < 0 ? string.Empty : "+"; var s = value < 0 ? string.Empty : "+";
var command = $"#:Sd{s}{dms}#"; var command = $":Sd{s}{dms}#";
LogMessage("TargetDeclination Set", $"{command}"); LogMessage("TargetDeclination Set", $"{command}");
var result = _sharedResourcesWrapper.SendChar(command); var result = _sharedResourcesWrapper.SendChar(command);
@@ -2040,7 +2040,7 @@ namespace ASCOM.Meade.net
if (_targetRightAscension.Equals(InvalidParameter)) if (_targetRightAscension.Equals(InvalidParameter))
throw new InvalidOperationException("Target not set"); throw new InvalidOperationException("Target not set");
//var result = SerialPort.CommandTerminated("#:Gr#", "#"); //var result = SerialPort.CommandTerminated(":Gr#", "#");
////:Gr# Get current/target object RA ////:Gr# Get current/target object RA
////Returns: HH: MM.T# or HH:MM:SS ////Returns: HH: MM.T# or HH:MM:SS
////Depending upon which precision is set for the telescope ////Depending upon which precision is set for the telescope
@@ -2064,7 +2064,7 @@ namespace ASCOM.Meade.net
//todo implement the low precision version //todo implement the low precision version
var hms = _utilities.HoursToHMS(value, ":", ":", ":", 2); var hms = _utilities.HoursToHMS(value, ":", ":", ":", 2);
var response = _sharedResourcesWrapper.SendChar($"#:Sr{hms}#"); var response = _sharedResourcesWrapper.SendChar($":Sr{hms}#");
//:SrHH:MM.T# //:SrHH:MM.T#
//:SrHH:MM:SS# //:SrHH:MM:SS#
//Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting. //Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting.
@@ -2103,7 +2103,7 @@ namespace ASCOM.Meade.net
get get
{ {
//todo implement this with the GW command //todo implement this with the GW command
//var result = SerialPort.CommandTerminated("#:GT#", "#"); //var result = SerialPort.CommandTerminated(":GT#", "#");
//double rate = double.Parse(result); //double rate = double.Parse(result);
@@ -2125,17 +2125,17 @@ namespace ASCOM.Meade.net
switch (value) switch (value)
{ {
case DriveRates.driveSidereal: case DriveRates.driveSidereal:
_sharedResourcesWrapper.SendBlind("#:TQ#"); _sharedResourcesWrapper.SendBlind(":TQ#");
//:TQ# Selects sidereal tracking rate //:TQ# Selects sidereal tracking rate
//Returns: Nothing //Returns: Nothing
break; break;
case DriveRates.driveLunar: case DriveRates.driveLunar:
_sharedResourcesWrapper.SendBlind("#:TL#"); _sharedResourcesWrapper.SendBlind(":TL#");
//:TL# Set Lunar Tracking Rage //:TL# Set Lunar Tracking Rage
//Returns: Nothing //Returns: Nothing
break; break;
//case DriveRates.driveSolar: //case DriveRates.driveSolar:
// SerialPort.Command("#:TS#"); // SerialPort.Command(":TS#");
// //:TS# Select Solar tracking rate. [LS Only] // //:TS# Select Solar tracking rate. [LS Only]
// //Returns: Nothing // //Returns: Nothing
// break; // break;
@@ -2167,7 +2167,7 @@ namespace ASCOM.Meade.net
private TimeSpan GetUtcCorrection() private TimeSpan GetUtcCorrection()
{ {
string utcOffSet = _sharedResourcesWrapper.SendString("#:GG#"); string utcOffSet = _sharedResourcesWrapper.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
@@ -2196,11 +2196,11 @@ namespace ASCOM.Meade.net
{ {
var tdd = new TelescopeDateDetails var tdd = new TelescopeDateDetails
{ {
TelescopeDate = _sharedResourcesWrapper.SendString("#:GC#"), TelescopeDate = _sharedResourcesWrapper.SendString(":GC#"),
//:GC# Get current date. //:GC# Get current date.
//Returns: MM/DD/YY# //Returns: MM/DD/YY#
//The current local calendar date for the telescope. //The current local calendar date for the telescope.
TelescopeTime = _sharedResourcesWrapper.SendString("#:GL#"), TelescopeTime = _sharedResourcesWrapper.SendString(":GL#"),
//:GL# Get Local Time in 24 hour format //:GL# Get Local Time in 24 hour format
//Returns: HH:MM:SS# //Returns: HH:MM:SS#
//The Local Time in 24 - hour Format //The Local Time in 24 - hour Format
@@ -2241,7 +2241,7 @@ namespace ASCOM.Meade.net
var utcCorrection = GetUtcCorrection(); var utcCorrection = GetUtcCorrection();
var localDateTime = value - utcCorrection; var localDateTime = value - utcCorrection;
string localStingCommand = $"#:SL{localDateTime:HH:mm:ss}#"; string localStingCommand = $":SL{localDateTime:HH:mm:ss}#";
var timeResult = _sharedResourcesWrapper.SendChar(localStingCommand); var timeResult = _sharedResourcesWrapper.SendChar(localStingCommand);
//:SLHH:MM:SS# //:SLHH:MM:SS#
//Set the local Time //Set the local Time
@@ -2253,7 +2253,7 @@ namespace ASCOM.Meade.net
throw new InvalidOperationException("Failed to set local time"); throw new InvalidOperationException("Failed to set local time");
} }
string localDateCommand = $"#:SC{localDateTime:MM/dd/yy}#"; string localDateCommand = $":SC{localDateTime:MM/dd/yy}#";
var dateResult = _sharedResourcesWrapper.SendChar(localDateCommand); var dateResult = _sharedResourcesWrapper.SendChar(localDateCommand);
//:SCMM/DD/YY# //:SCMM/DD/YY#
//Change Handbox Date to MM/DD/YY //Change Handbox Date to MM/DD/YY
+27 -10
View File
@@ -50,6 +50,8 @@ namespace ASCOM.Meade.net
private static bool _reverseFocusDirection; private static bool _reverseFocusDirection;
private static bool _useDynamicBreaking;
/// <summary> /// <summary>
/// Private variable to hold an ASCOM Utilities object /// Private variable to hold an ASCOM Utilities object
/// </summary> /// </summary>
@@ -372,19 +374,27 @@ namespace ASCOM.Meade.net
_tl.LogMessage("Move", "Applying backlash compensation"); _tl.LogMessage("Move", "Applying backlash compensation");
MoveFocuser(!direction, backlashCompensationSteps); MoveFocuser(!direction, backlashCompensationSteps);
} }
//This gives the focuser time to physically stop. Not sure if this is really needed.
//_utilities.WaitForMilliseconds(1000);
DynamicBreaking(direction);
//todo implement dynamic braking //todo implement dynamic braking
//dynamic breaking is sending the command to move in the opposite direction immediatly followed by the command to stop. //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)
return;
_tl.LogMessage("Move", "Applying dynamic breaking");
PerformFocuserMove(directionOut);
Halt();
}
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
@@ -396,16 +406,21 @@ namespace ASCOM.Meade.net
//All others Not Supported //All others Not Supported
_utilities.WaitForMilliseconds(100); _utilities.WaitForMilliseconds(100);
_sharedResourcesWrapper.SendBlind(directionOut ? "#:F+#" : "#:F-#"); PerformFocuserMove(directionOut);
_utilities.WaitForMilliseconds(steps);
Halt();
}
private void PerformFocuserMove(bool directionOut)
{
_sharedResourcesWrapper.SendBlind(directionOut ? ":F+#" : ":F-#");
//:F+# Start Focuser moving inward (toward objective) //:F+# Start Focuser moving inward (toward objective)
//Returns: None //Returns: None
//:F-# Start Focuser moving outward (away from objective) //:F-# Start Focuser moving outward (away from objective)
//Returns: None //Returns: None
_utilities.WaitForMilliseconds(steps);
Halt();
} }
public int Position => throw new PropertyNotImplementedException("Position", false); public int Position => throw new PropertyNotImplementedException("Position", false);
@@ -566,10 +581,12 @@ namespace ASCOM.Meade.net
_comPort = profileProperties.ComPort; _comPort = profileProperties.ComPort;
_backlashCompensation = profileProperties.BacklashCompensation; _backlashCompensation = profileProperties.BacklashCompensation;
_reverseFocusDirection = profileProperties.ReverseFocusDirection; _reverseFocusDirection = profileProperties.ReverseFocusDirection;
_useDynamicBreaking = profileProperties.DynamicBreaking;
LogMessage("ReadProfile", $"Trace logger enabled: {_tl.Enabled}"); LogMessage("ReadProfile", $"Trace logger enabled: {_tl.Enabled}");
LogMessage("ReadProfile", $"Com Port: {_comPort}"); LogMessage("ReadProfile", $"Com Port: {_comPort}");
LogMessage("ReadProfile", $"Backlash Steps: {_backlashCompensation}"); LogMessage("ReadProfile", $"Backlash Steps: {_backlashCompensation}");
LogMessage("ReadProfile", $"Dynamic breaking: {_useDynamicBreaking}");
} }
/// <summary> /// <summary>
+1 -1
View File
@@ -3,7 +3,7 @@
<AutoEnable>True</AutoEnable> <AutoEnable>True</AutoEnable>
<CurrentEngineMode>Run all tests automatically [Global]</CurrentEngineMode> <CurrentEngineMode>Run all tests automatically [Global]</CurrentEngineMode>
<MetricsTreeShowTestProjects>False</MetricsTreeShowTestProjects> <MetricsTreeShowTestProjects>False</MetricsTreeShowTestProjects>
<StatusIndicatorSplitterDistance>25</StatusIndicatorSplitterDistance> <StatusIndicatorSplitterDistance>80</StatusIndicatorSplitterDistance>
<TestsWindowMenuOptions> <TestsWindowMenuOptions>
<VerticalSplitMenuOption>false</VerticalSplitMenuOption> <VerticalSplitMenuOption>false</VerticalSplitMenuOption>
<ShowPassingTestsMenuOption>false</ShowPassingTestsMenuOption> <ShowPassingTestsMenuOption>false</ShowPassingTestsMenuOption>
+1
View File
@@ -10,5 +10,6 @@ namespace ASCOM.Meade.net
public string GuidingStyle { get; set; } public string GuidingStyle { get; set; }
public int BacklashCompensation { get; set; } public int BacklashCompensation { get; set; }
public bool ReverseFocusDirection { get; set; } public bool ReverseFocusDirection { get; set; }
public bool DynamicBreaking { get; set; }
} }
} }
+4 -2
View File
@@ -84,6 +84,7 @@ namespace ASCOM.Meade.net
txtBacklashSteps.Text = profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture); txtBacklashSteps.Text = profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture);
cbxReverseDirection.Checked = profileProperties.ReverseFocusDirection; cbxReverseDirection.Checked = profileProperties.ReverseFocusDirection;
cbxDynamicBreaking.Checked = profileProperties.DynamicBreaking;
} }
public ProfileProperties GetProfile() public ProfileProperties GetProfile()
@@ -96,8 +97,9 @@ namespace ASCOM.Meade.net
Precision = cboPrecision.SelectedItem.ToString(), Precision = cboPrecision.SelectedItem.ToString(),
GuidingStyle = cboGuidingStyle.SelectedItem.ToString(), GuidingStyle = cboGuidingStyle.SelectedItem.ToString(),
BacklashCompensation = int.Parse(txtBacklashSteps.Text), BacklashCompensation = int.Parse(txtBacklashSteps.Text),
ReverseFocusDirection = cbxReverseDirection.Checked ReverseFocusDirection = cbxReverseDirection.Checked,
}; DynamicBreaking = cbxDynamicBreaking.Checked
};
return profileProperties; return profileProperties;
} }
+9
View File
@@ -54,6 +54,7 @@ namespace ASCOM.Meade.net
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label();
this.cbxReverseDirection = new System.Windows.Forms.CheckBox(); this.cbxReverseDirection = new System.Windows.Forms.CheckBox();
this.cbxDynamicBreaking = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@@ -194,10 +195,17 @@ namespace ASCOM.Meade.net
this.cbxReverseDirection.Name = "cbxReverseDirection"; this.cbxReverseDirection.Name = "cbxReverseDirection";
this.cbxReverseDirection.UseVisualStyleBackColor = true; this.cbxReverseDirection.UseVisualStyleBackColor = true;
// //
// cbxDynamicBreaking
//
resources.ApplyResources(this.cbxDynamicBreaking, "cbxDynamicBreaking");
this.cbxDynamicBreaking.Name = "cbxDynamicBreaking";
this.cbxDynamicBreaking.UseVisualStyleBackColor = true;
//
// SetupDialogForm // SetupDialogForm
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.cbxDynamicBreaking);
this.Controls.Add(this.cbxReverseDirection); this.Controls.Add(this.cbxReverseDirection);
this.Controls.Add(this.label11); this.Controls.Add(this.label11);
this.Controls.Add(this.label10); this.Controls.Add(this.label10);
@@ -257,5 +265,6 @@ namespace ASCOM.Meade.net
private Label label10; private Label label10;
private Label label11; private Label label11;
private CheckBox cbxReverseDirection; private CheckBox cbxReverseDirection;
private CheckBox cbxDynamicBreaking;
} }
} }
+51 -24
View File
@@ -123,7 +123,7 @@
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmdOK.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmdOK.Location" type="System.Drawing.Point, System.Drawing">
<value>281, 387</value> <value>281, 413</value>
</data> </data>
<data name="cmdOK.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmdOK.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 24</value> <value>59, 24</value>
@@ -145,13 +145,13 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;cmdOK.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cmdOK.ZOrder" xml:space="preserve">
<value>21</value> <value>22</value>
</data> </data>
<data name="cmdCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="cmdCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value> <value>Bottom, Right</value>
</data> </data>
<data name="cmdCancel.Location" type="System.Drawing.Point, System.Drawing"> <data name="cmdCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>281, 417</value> <value>281, 443</value>
</data> </data>
<data name="cmdCancel.Size" type="System.Drawing.Size, System.Drawing"> <data name="cmdCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 25</value> <value>59, 25</value>
@@ -172,7 +172,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;cmdCancel.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cmdCancel.ZOrder" xml:space="preserve">
<value>20</value> <value>21</value>
</data> </data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing"> <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 9</value> <value>12, 9</value>
@@ -196,7 +196,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>19</value> <value>20</value>
</data> </data>
<data name="picASCOM.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="picASCOM.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value> <value>Top, Right</value>
@@ -223,7 +223,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;picASCOM.ZOrder" xml:space="preserve"> <data name="&gt;&gt;picASCOM.ZOrder" xml:space="preserve">
<value>18</value> <value>19</value>
</data> </data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib"> <data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -250,7 +250,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>17</value> <value>18</value>
</data> </data>
<data name="chkTrace.AutoSize" type="System.Boolean, mscorlib"> <data name="chkTrace.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -277,7 +277,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;chkTrace.ZOrder" xml:space="preserve"> <data name="&gt;&gt;chkTrace.ZOrder" xml:space="preserve">
<value>16</value> <value>17</value>
</data> </data>
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing"> <data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 87</value> <value>97, 87</value>
@@ -298,7 +298,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;comboBoxComPort.ZOrder" xml:space="preserve"> <data name="&gt;&gt;comboBoxComPort.ZOrder" xml:space="preserve">
<value>15</value> <value>16</value>
</data> </data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib"> <data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -325,7 +325,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>14</value> <value>15</value>
</data> </data>
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 199</value> <value>97, 199</value>
@@ -349,7 +349,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;txtGuideRate.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtGuideRate.ZOrder" xml:space="preserve">
<value>13</value> <value>14</value>
</data> </data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib"> <data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -376,7 +376,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>12</value> <value>13</value>
</data> </data>
<data name="lblPercentOfSiderealRate.AutoSize" type="System.Boolean, mscorlib"> <data name="lblPercentOfSiderealRate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -403,7 +403,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;lblPercentOfSiderealRate.ZOrder" xml:space="preserve"> <data name="&gt;&gt;lblPercentOfSiderealRate.ZOrder" xml:space="preserve">
<value>11</value> <value>12</value>
</data> </data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib"> <data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -430,7 +430,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>10</value> <value>11</value>
</data> </data>
<data name="cboPrecision.Items" xml:space="preserve"> <data name="cboPrecision.Items" xml:space="preserve">
<value>Unchanged</value> <value>Unchanged</value>
@@ -460,7 +460,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;cboPrecision.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cboPrecision.ZOrder" xml:space="preserve">
<value>9</value> <value>10</value>
</data> </data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib"> <data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -490,7 +490,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>8</value> <value>9</value>
</data> </data>
<data name="cboGuidingStyle.Items" xml:space="preserve"> <data name="cboGuidingStyle.Items" xml:space="preserve">
<value>Auto</value> <value>Auto</value>
@@ -520,7 +520,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;cboGuidingStyle.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cboGuidingStyle.ZOrder" xml:space="preserve">
<value>7</value> <value>8</value>
</data> </data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib"> <data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -550,7 +550,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>6</value> <value>7</value>
</data> </data>
<data name="label8.AutoSize" type="System.Boolean, mscorlib"> <data name="label8.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -583,7 +583,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label8.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label8.ZOrder" xml:space="preserve">
<value>5</value> <value>6</value>
</data> </data>
<data name="txtBacklashSteps.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtBacklashSteps.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 335</value> <value>97, 335</value>
@@ -607,7 +607,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;txtBacklashSteps.ZOrder" xml:space="preserve"> <data name="&gt;&gt;txtBacklashSteps.ZOrder" xml:space="preserve">
<value>3</value> <value>4</value>
</data> </data>
<data name="label9.AutoSize" type="System.Boolean, mscorlib"> <data name="label9.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -637,7 +637,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>4</value> <value>5</value>
</data> </data>
<data name="label10.AutoSize" type="System.Boolean, mscorlib"> <data name="label10.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -667,7 +667,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>2</value> <value>3</value>
</data> </data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib"> <data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -700,7 +700,7 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>1</value> <value>2</value>
</data> </data>
<data name="cbxReverseDirection.AutoSize" type="System.Boolean, mscorlib"> <data name="cbxReverseDirection.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@@ -727,6 +727,33 @@
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;cbxReverseDirection.ZOrder" xml:space="preserve"> <data name="&gt;&gt;cbxReverseDirection.ZOrder" xml:space="preserve">
<value>1</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>97, 384</value>
</data>
<data name="cbxDynamicBreaking.Size" type="System.Drawing.Size, System.Drawing">
<value>112, 17</value>
</data>
<data name="cbxDynamicBreaking.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="cbxDynamicBreaking.Text" xml:space="preserve">
<value>Dynamic Breaking</value>
</data>
<data name="&gt;&gt;cbxDynamicBreaking.Name" xml:space="preserve">
<value>cbxDynamicBreaking</value>
</data>
<data name="&gt;&gt;cbxDynamicBreaking.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbxDynamicBreaking.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cbxDynamicBreaking.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -736,7 +763,7 @@
<value>6, 13</value> <value>6, 13</value>
</data> </data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>350, 450</value> <value>350, 476</value>
</data> </data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms"> <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value> <value>CenterScreen</value>
+4
View File
@@ -143,6 +143,7 @@ namespace ASCOM.Meade.net
private const string GuidingStyleProfileName = "Guiding Style"; private const string GuidingStyleProfileName = "Guiding Style";
private const string BacklashCompensationName = "Backlash Compensation"; private const string BacklashCompensationName = "Backlash Compensation";
private const string ReverseFocusDirectionName = "Reverse Focuser Direction"; private const string ReverseFocusDirectionName = "Reverse Focuser Direction";
private const string DynamicBreakingName = "Dynamic Breaking";
public static void WriteProfile(ProfileProperties profileProperties) public static void WriteProfile(ProfileProperties profileProperties)
{ {
@@ -158,6 +159,7 @@ namespace ASCOM.Meade.net
driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle); driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle);
driverProfile.WriteValue(DriverId, BacklashCompensationName, profileProperties.BacklashCompensation.ToString()); driverProfile.WriteValue(DriverId, BacklashCompensationName, profileProperties.BacklashCompensation.ToString());
driverProfile.WriteValue(DriverId, ReverseFocusDirectionName, profileProperties.ReverseFocusDirection.ToString()); driverProfile.WriteValue(DriverId, ReverseFocusDirectionName, profileProperties.ReverseFocusDirection.ToString());
driverProfile.WriteValue(DriverId, DynamicBreakingName, profileProperties.DynamicBreaking.ToString());
} }
} }
} }
@@ -169,6 +171,7 @@ namespace ASCOM.Meade.net
private const string GuidingStyleDefault = "Auto"; private const string GuidingStyleDefault = "Auto";
private const string BacklashCompensationDefault = "3000"; private const string BacklashCompensationDefault = "3000";
private const string ReverseFocuserDiectionDefault = "true"; private const string ReverseFocuserDiectionDefault = "true";
private const string DynamicBreakingDefault = "true";
public static ProfileProperties ReadProfile() public static ProfileProperties ReadProfile()
{ {
@@ -185,6 +188,7 @@ namespace ASCOM.Meade.net
profileProperties.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault); profileProperties.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault);
profileProperties.BacklashCompensation = Convert.ToInt32(driverProfile.GetValue(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault)); profileProperties.BacklashCompensation = Convert.ToInt32(driverProfile.GetValue(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault));
profileProperties.ReverseFocusDirection = Convert.ToBoolean(driverProfile.GetValue(DriverId, ReverseFocusDirectionName, string.Empty, ReverseFocuserDiectionDefault)); profileProperties.ReverseFocusDirection = Convert.ToBoolean(driverProfile.GetValue(DriverId, ReverseFocusDirectionName, string.Empty, ReverseFocuserDiectionDefault));
profileProperties.DynamicBreaking = Convert.ToBoolean(driverProfile.GetValue(DriverId, DynamicBreakingName, string.Empty, DynamicBreakingDefault));
} }
return profileProperties; return profileProperties;