Compare commits

...

36 Commits

Author SHA1 Message Date
ColinD a101d3a2d7 Merged in develop (pull request #30)
Develop
2021-04-29 15:18:42 +00:00
ColinD d7637928b7 Made sure that the telescope doesn't think it's parked for the first Telescope to connect. 2021-04-27 22:14:22 +01:00
ColinD 486a9205ee Fixed the defect when one instance of the driver gets parked, the info is shared to the other instances. 2021-04-27 22:08:25 +01:00
ColinD 2c2c59290e Reinstated the Real Alt Az methods for the LX200GPS. Changes how the parked behaviour is implemented, so that it doesn't need to make as many calls. 2021-04-27 20:14:57 +01:00
ColinD 70e615bb4e Made sure that CommandString, CommandBool and CommandBlind work as expected, complete with Raw and non raw support. (Implementation is the same as one of the LX200 drivers.) 2021-04-26 20:51:41 +01:00
ColinD 43ec63b0f5 Merged in develop (pull request #29)
Develop
2021-04-25 19:54:35 +00:00
ColinD f354bcdee1 Merged in feature/AddDateTimeByPass (pull request #28)
Feature/AddDateTimeByPass
2021-04-25 19:27:23 +00:00
ColinD e32c2aa50a Sorted out some code inspection issues 2021-04-25 20:16:07 +01:00
ColinD 795dc0c741 Added parked behaviour modes to the unit testing. 2021-04-25 19:58:09 +01:00
ColinD 22a8a794ba Added unit tests for check Parked, when parked mode is set to no coordinates 2021-04-25 19:17:56 +01:00
ColinD c6b54e273d Added unit testing for bypass feature, and setting the date on first connection 2021-04-25 18:27:44 +01:00
ColinD 7eec6c0008 Fixed some issued with the telescope parking and unparking. Now reports reported correctly for the LX200GPS, and Autostars 2021-04-24 22:29:11 +01:00
ColinD f9bb2aa879 Fixed the date format for the bypass date time setting for the LX-200GPS 2021-04-24 21:23:12 +01:00
ColinD 18ea52c972 Impemented the code changes to return co-ordinated when the telescope is parked.
Also added loads of checks for if the telescope is parked.
2021-04-24 20:52:21 +01:00
ColinD f4eafa668d Added a log for the display output 2021-04-24 19:30:46 +01:00
ColinD 53abdba374 Added extra logging. 2021-04-24 19:20:05 +01:00
ColinD fdd008fcfb Adding support for sending co-ordinates when scope is parked. 2021-04-24 19:16:36 +01:00
ColinD eaeae4d66b Combined the skip prompts and set date time code, to just one check box. 2021-04-24 13:16:08 +01:00
ColinD 6ac80c408c Fixed problem with changing the modifying the profile on the fly! 2021-04-24 13:07:42 +01:00
ColinD 9c5620edee Going to try the proper command for bypassing the date entry for AutostarII 2021-04-23 21:13:46 +01:00
ColinD ad40eb8b9a Fixed problem with Autostar not returning the correct value for IsSlewing 2021-04-23 20:45:48 +01:00
ColinD aca01de4ee Added a # prefix before the commands. 2021-04-23 19:45:10 +01:00
ColinD 384deecc3f More attempts to detect the slewing character 2021-04-23 19:11:45 +01:00
ColinD b27adf2649 Added check that returns [7F] when slewing 2021-04-23 18:58:14 +01:00
ColinD 2776b469c8 Fixed broken logic, and fixed broken unit tests. 2021-04-23 18:26:49 +01:00
ColinD fc3c91b975 Added extra logging to get slewing 2021-04-23 17:14:33 +01:00
ColinD e7c81aba24 Added code to force the date time to happen after the display bypass for autostar 497's 2021-04-23 16:51:05 +01:00
ColinD a15bf22785 Switched the order of the setting of the date and time, then skipping the prompts. 2021-04-23 15:00:03 +01:00
ColinD ed84313c2e Added initial display values bypass for the Autostar 497 2021-04-22 21:40:07 +01:00
ColinD e4af93dd07 Added ability to skip the prompts initial connect, and added ability to send the date and time on initial connect 2021-04-21 20:17:00 +01:00
ColinD 5538f51cf0 Merged in feature/SerialPort (pull request #27)
Feature/SerialPort
2021-04-21 16:35:02 +00:00
ColinD d0f12a604a Made the new serial options dropdownLists to help avoid ID10T errors. 2021-04-09 21:35:19 +01:00
ColinD 178ef8b11d Fixed the dataBits profile name, and upgraded the sharedresources unit tests for the new comport settings. 2021-04-09 20:43:12 +01:00
ColinD 0835431e76 Added new profile settings to the unit tests 2021-04-09 20:07:52 +01:00
ColinD bf6203d901 Added support for setting all serial properties. 2021-04-09 19:57:43 +01:00
ColinD 51bf99cb8c Started adding full serial port settings, so that people can do crazy things at their own risk. 2021-04-09 12:54:25 +01:00
20 changed files with 2752 additions and 916 deletions
@@ -90,6 +90,10 @@
<Project>{64308775-bd4a-469c-bcab-3ed830b811af}</Project>
<Name>Meade.net.Telescope</Name>
</ProjectReference>
<ProjectReference Include="..\Meade.net\Meade.net.csproj">
<Project>{3689a2cb-94c5-4012-a5cf-7e7d1dd27143}</Project>
<Name>Meade.net</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
+35 -25
View File
@@ -27,6 +27,12 @@ namespace Meade.net.Focuser.UnitTests
{
TraceLogger = false,
ComPort = "TestCom1",
Speed = 9600,
Parity = "None",
Handshake = "None",
StopBits = "One",
DataBits = 8,
GuideRateArcSecondsPerSecond = 1.23,
Precision = "Unchanged",
GuidingStyle = "Auto"
@@ -103,16 +109,17 @@ namespace Meade.net.Focuser.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBlind"));
}
[Test]
public void CommandBlind_WhenConnected_ThenSendsExpectedMessage()
[TestCase(false)]
[TestCase(true)]
public void CommandBlind_WhenConnected_ThenSendsExpectedMessage(bool raw)
{
string expectedMessage = "test blind Message";
ConnectFocuser();
_focuser.CommandBlind(expectedMessage, true);
_focuser.CommandBlind(expectedMessage, raw);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(expectedMessage), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(expectedMessage, raw), Times.Once);
}
[Test]
@@ -124,16 +131,19 @@ namespace Meade.net.Focuser.UnitTests
Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: CommandBool"));
}
[Test]
public void CommandBool_WhenConnected_ThenSendsExpectedMessage()
[TestCase(false)]
[TestCase(true)]
public void CommandBool_WhenConnected_ThenSendsExpectedMessage(bool raw)
{
string expectedMessage = "test blind Message";
_sharedResourcesWrapperMock.Setup(x => x.SendBool(expectedMessage, raw)).Returns(true);
ConnectFocuser();
var exception = Assert.Throws<MethodNotImplementedException>(() => { _focuser.CommandBool(expectedMessage, true); });
var result = _focuser.CommandBool(expectedMessage, raw);
Assert.That(exception.Message, Is.EqualTo("Method CommandBool is not implemented in this driver."));
_sharedResourcesWrapperMock.Verify(x => x.SendBool(expectedMessage, raw), Times.Once);
Assert.That(result, Is.True);
}
[Test]
@@ -153,11 +163,11 @@ namespace Meade.net.Focuser.UnitTests
ConnectFocuser();
_sharedResourcesWrapperMock.Setup(x => x.SendString(sendMessage)).Returns(() => expectedMessage);
_sharedResourcesWrapperMock.Setup(x => x.SendString(sendMessage, true)).Returns(() => expectedMessage);
var actualMessage = _focuser.CommandString(sendMessage, true);
_sharedResourcesWrapperMock.Verify(x => x.SendString(sendMessage), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendString(sendMessage, true), Times.Once);
Assert.That(actualMessage, Is.EqualTo(expectedMessage));
}
@@ -313,7 +323,7 @@ namespace Meade.net.Focuser.UnitTests
_focuser.Halt();
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":FQ#"), Times.AtLeastOnce);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("FQ", false), Times.AtLeastOnce);
}
[Test]
@@ -328,13 +338,13 @@ namespace Meade.net.Focuser.UnitTests
[TestCase(false)]
[TestCase(true)]
public void Link_Get_ReturnsSameValueAsConnected( bool connected)
public void Link_Get_ReturnsSameValueAsConnected(bool connected)
{
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497);
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee);
_focuser.Connected = connected;
Assert.That( _focuser.Link, Is.EqualTo(connected));
Assert.That(_focuser.Link, Is.EqualTo(connected));
}
[TestCase(false)]
@@ -388,12 +398,12 @@ namespace Meade.net.Focuser.UnitTests
_focuser.Move(0);
_utilMock.Verify( x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Never);
_utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny<int>()), Times.Never);
}
[TestCase(200)]
[TestCase(-200)]
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuser( int position)
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuser(int position)
{
_profileProperties.BacklashCompensation = 0;
@@ -403,16 +413,16 @@ namespace Meade.net.Focuser.UnitTests
if (position < 0)
{
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":F-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Never);
}
else
{
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Once);
}
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.Lock(It.IsAny<Action>()), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
@@ -431,16 +441,16 @@ namespace Meade.net.Focuser.UnitTests
if (position < 0)
{
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Never);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(1));
}
else
{
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":F+#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F-", false), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("F+", false), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position) + _profileProperties.BacklashCompensation), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(_profileProperties.BacklashCompensation), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(2));
@@ -497,7 +507,7 @@ namespace Meade.net.Focuser.UnitTests
{
var exception = Assert.Throws<PropertyNotImplementedException>(() =>
{
var result = _focuser.Temperature;
var result = _focuser.Temperature;
Assert.Fail($"{result} should not have a value");
});
Assert.That(exception.Message, Is.EqualTo("Property read Temperature is not implemented in this driver."));
File diff suppressed because it is too large Load Diff
@@ -122,7 +122,6 @@
<Compile Include="AstroMaths\AstroMathExtensions.cs" />
<Compile Include="AstroMaths\AstroMaths.cs" />
<Compile Include="AstroMaths\EquatorialCoordinates.cs" />
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
<Compile Include="AstroMaths\IAstroMaths.cs" />
<Compile Include="Clock.cs" />
<Compile Include="ComparisonResult.cs" />
File diff suppressed because it is too large Load Diff
+279 -44
View File
@@ -32,42 +32,44 @@ namespace Meade.net.UnitTests
Assert.That(SharedResources.SharedSerial,Is.EqualTo(_serialMock.Object));
}
[Test]
public void SendBlind_WhenCalled_Then_ClearsBuffersAndSendsMessage()
[TestCase(true, "Test")]
[TestCase(false, "#:Test#")]
public void SendBlind_WhenCalled_Then_ClearsBuffersAndSendsMessage(bool raw, string expectedMessage)
{
var expectedMessage = "Test";
SharedResources.SendBlind(expectedMessage);
var sendMessage = "Test";
SharedResources.SendBlind(sendMessage, raw);
_serialMock.Verify(x=> x.ClearBuffers(), Times.Once);
_serialMock.Verify(x=>x.Transmit(expectedMessage), Times.Once);
}
[Test]
public void SendChar_WhenCalled_ThenSendsMessageAndReadsExpectedNumberOfCharacters()
[TestCase(false, "#:Test#")]
[TestCase(true, "Test")]
public void SendChar_WhenCalled_ThenSendsMessageAndReadsExpectedNumberOfCharacters(bool raw, string expectedCommand)
{
var expectedMessage = "Test";
var command = "Test";
var expectedResult = "A";
_serialMock.Setup(x => x.ReceiveCounted(1)).Returns(expectedResult);
var result = SharedResources.SendChar(expectedMessage);
var result = SharedResources.SendChar(command, raw);
_serialMock.Verify(x => x.ClearBuffers(), Times.Once);
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once);
_serialMock.Verify(x => x.Transmit(expectedCommand), Times.Once);
_serialMock.Verify(x => x.ReceiveCounted(1), Times.Once);
Assert.That(result, Is.EqualTo(expectedResult));
}
[Test]
public void SendString_WhenCalled_ThenSendsMessageAndReadsResultUntilTerminatorFound()
[TestCase(true, "Test")]
[TestCase(false, "#:Test#")]
public void SendString_WhenCalled_ThenSendsMessageAndReadsResultUntilTerminatorFound(bool includePrefix, string expectedMessage)
{
var expectedMessage = "Test";
var transmitMessage = "Test";
var expectedResult = "TestMessage#";
_serialMock.Setup(x => x.ReceiveTerminated("#")).Returns(expectedResult);
var result = SharedResources.SendString(expectedMessage);
var result = SharedResources.SendString(transmitMessage, includePrefix);
_serialMock.Verify(x => x.ClearBuffers(), Times.Once);
_serialMock.Verify(x => x.Transmit(expectedMessage), Times.Once);
@@ -123,10 +125,19 @@ namespace Meade.net.UnitTests
Assert.That(profeWrapper.DeviceType, Is.EqualTo("Telescope"));
profileWrapperMock.Verify( x => x.WriteValue(DriverId, "Trace Level", profileProperties.TraceLogger.ToString()), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "COM Port", profileProperties.ComPort), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Speed", profileProperties.Speed.ToString()), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Data Bits", profileProperties.DataBits.ToString()), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Stop Bits", profileProperties.StopBits), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Hand Shake", profileProperties.Handshake), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Parity", profileProperties.Parity), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Rts / Dtr", profileProperties.RtsDtrEnabled.ToString()), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Guide Rate Arc Seconds Per Second", profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.CurrentCulture)), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Precision", profileProperties.Precision), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Guiding Style", profileProperties.GuidingStyle), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Backlash Compensation", profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture)), Times.Once);
profileWrapperMock.Verify(x => x.WriteValue(DriverId, "Reverse Focuser Direction", profileProperties.ReverseFocusDirection.ToString()), Times.Once);
}
@@ -136,14 +147,30 @@ namespace Meade.net.UnitTests
{
string DriverId = "ASCOM.MeadeGeneric.Telescope";
string ComPortDefault = "COM1";
string TraceStateDefault = "false";
string ComPortDefault = "COM1";
string SpeedDefault = "9600";
string DataBitsDefault = "8";
string StopBitsDefault = "One";
string HandshakeDefault = "None";
string ParityDefault = "None";
string RtsDtrEnabledDefault = "true";
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string GuidingStyleDefault = "Auto";
string BacklashCompensationDefault = "3000";
string ReverseFocuserDiectionDefault = "true";
string SendDateTimeDefault = "true";
string SkipPromptsDefault = "true";
string ParkedBehaviourDefault = "No Coordinates";
string ParkedAltDefault = "0";
string ParkedAzimuthDefault = "180";
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
profileWrapperMock.SetupAllProperties();
@@ -163,8 +190,46 @@ namespace Meade.net.UnitTests
x.GetValue(DriverId, "Backlash Compensation", string.Empty, BacklashCompensationDefault))
.Returns(BacklashCompensationDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Reverse Focuser Direction", string.Empty, ReverseFocuserDiectionDefault))
x.GetValue(DriverId, "Reverse Focuser Direction", string.Empty, "true"))
.Returns(() => ReverseFocuserDiectionDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => SpeedDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
.Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
.Returns(() => StopBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
.Returns(() => HandshakeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, "false"))
.Returns(() => RtsDtrEnabledDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
.Returns(() => ParkedAltDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
.Returns(() => ParkedAzimuthDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Send Date and time on connect", string.Empty, "false"))
.Returns(() => SendDateTimeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Skip date prompts on connect", string.Empty, "false"))
.Returns(() => SkipPromptsDefault);
IProfileWrapper profeWrapper = profileWrapperMock.Object;
@@ -174,16 +239,29 @@ namespace Meade.net.UnitTests
SharedResources.ProfileFactory = profileFactoryMock.Object;
var profileProperties = SharedResources.ReadProfile();
Assert.That(profeWrapper.DeviceType, Is.EqualTo("Telescope"));
Assert.That(profileProperties.ComPort, Is.EqualTo(ComPortDefault));
Assert.That(profileProperties.GuideRateArcSecondsPerSecond,
Is.EqualTo(double.Parse(GuideRateProfileNameDefault)));
Assert.That(profileProperties.TraceLogger, Is.EqualTo(bool.Parse(TraceStateDefault)));
Assert.That(profileProperties.ComPort, Is.EqualTo(ComPortDefault));
Assert.That(profileProperties.GuideRateArcSecondsPerSecond,
Is.EqualTo(double.Parse(GuideRateProfileNameDefault)));
Assert.That(profileProperties.Precision, Is.EqualTo(PrecisionDefault));
Assert.That(profileProperties.GuidingStyle, Is.EqualTo(GuidingStyleDefault));
Assert.That(profileProperties.BacklashCompensation, Is.EqualTo(int.Parse(BacklashCompensationDefault)));
Assert.That(profileProperties.ReverseFocusDirection, Is.EqualTo(bool.Parse(ReverseFocuserDiectionDefault)));
Assert.That(profileProperties.Speed, Is.EqualTo(int.Parse(SpeedDefault)));
Assert.That(profileProperties.DataBits, Is.EqualTo(int.Parse(DataBitsDefault)));
Assert.That(profileProperties.StopBits, Is.EqualTo(StopBitsDefault));
Assert.That(profileProperties.Handshake, Is.EqualTo(HandshakeDefault));
Assert.That(profileProperties.Parity, Is.EqualTo(ParityDefault));
Assert.That(profileProperties.RtsDtrEnabled, Is.EqualTo(bool.Parse(RtsDtrEnabledDefault)));
Assert.That(profileProperties.SendDateTime, Is.EqualTo(bool.Parse(SendDateTimeDefault)));
}
[TestCase("TCP")]
@@ -199,27 +277,66 @@ namespace Meade.net.UnitTests
public void Connect_WhenDeviceIdIsSerialButGVPEchos_ThenThrowsException()
{
string deviceId = "Serial";
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
string DriverId = "ASCOM.MeadeGeneric.Telescope";
string ComPortDefault = "COM1";
string SpeedDefault = "9600";
string DataBitsDefault = "8";
string StopBitsDefault = "One";
string HandshakeDefault = "None";
string ParityDefault = "None";
string RtsDtrEnabledDefault = "false";
string TraceStateDefault = "false";
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string ParkedBehaviourDefault = "No Coordinates";
string ParkedAltDefault = "0";
string ParkedAzimuthDefault = "180";
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
profileWrapperMock.SetupAllProperties();
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
.Returns(TraceStateDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
.Returns(ComPortDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => SpeedDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
.Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
.Returns(() => StopBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
.Returns(() => HandshakeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
.Returns(() => RtsDtrEnabledDefault);
profileWrapperMock
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
.Returns(() => ParkedAltDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
.Returns(() => ParkedAzimuthDefault);
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
@@ -239,26 +356,65 @@ namespace Meade.net.UnitTests
public void Connect_WhenDeviceIdIsSerialButGVPNotSupported_ThenConnectsAndSetsProductToLX200Classic()
{
string deviceId = "Serial";
string DriverId = "ASCOM.MeadeGeneric.Telescope";
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
string TraceStateDefault = "false";
string ComPortDefault = "COM1";
string TraceStateDefault = "false";
string SpeedDefault = "9600";
string DataBitsDefault = "8";
string StopBitsDefault = "One";
string HandshakeDefault = "None";
string ParityDefault = "None";
string RtsDtrEnabledDefault = "false";
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string ParkedBehaviourDefault = "No Coordinates";
string ParkedAltDefault = "0";
string ParkedAzimuthDefault = "180";
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
profileWrapperMock.SetupAllProperties();
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
.Returns(TraceStateDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
.Returns(ComPortDefault);
profileWrapperMock
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => SpeedDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
.Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
.Returns(() => StopBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
.Returns(() => HandshakeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
.Returns(() => RtsDtrEnabledDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
.Returns(() => ParkedAltDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
.Returns(() => ParkedAzimuthDefault);
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
@@ -293,25 +449,65 @@ namespace Meade.net.UnitTests
{
string deviceId = "Serial";
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
string DriverId = "ASCOM.MeadeGeneric.Telescope";
string TraceStateDefault = "false";
string ComPortDefault = "COM1";
string TraceStateDefault = "false";
string SpeedDefault = "9600";
string DataBitsDefault = "8";
string StopBitsDefault = "One";
string HandshakeDefault = "None";
string ParityDefault = "None";
string RtsDtrEnabledDefault = "false";
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string ParkedBehaviourDefault = "No Coordinates";
string ParkedAltDefault = "0";
string ParkedAzimuthDefault = "180";
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
profileWrapperMock.SetupAllProperties();
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
.Returns(TraceStateDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
.Returns(ComPortDefault);
profileWrapperMock
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => SpeedDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
.Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
.Returns(() => StopBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
.Returns(() => HandshakeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
.Returns(() => RtsDtrEnabledDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
.Returns(() => ParkedAltDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
.Returns(() => ParkedAzimuthDefault);
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
@@ -343,25 +539,64 @@ namespace Meade.net.UnitTests
{
string deviceId = "Serial";
string driverDriverId = "ASCOM.MeadeGeneric.Telescope";
string DriverId = "ASCOM.MeadeGeneric.Telescope";
string TraceStateDefault = "false";
string ComPortDefault = "COM1";
string TraceStateDefault = "false";
string SpeedDefault = "9600";
string DataBitsDefault = "8";
string StopBitsDefault = "One";
string HandshakeDefault = "None";
string ParityDefault = "None";
string RtsDtrEnabledDefault = "false";
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string ParkedBehaviourDefault = "No Coordinates";
string ParkedAltDefault = "0";
string ParkedAzimuthDefault = "180";
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
profileWrapperMock.SetupAllProperties();
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Trace Level", string.Empty, TraceStateDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Trace Level", string.Empty, TraceStateDefault))
.Returns(TraceStateDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "COM Port", string.Empty, ComPortDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "COM Port", string.Empty, ComPortDefault))
.Returns(ComPortDefault);
profileWrapperMock
.Setup(x => x.GetValue(driverDriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
.Setup(x => x.GetValue(DriverId, "Guide Rate Arc Seconds Per Second", string.Empty,
GuideRateProfileNameDefault)).Returns(GuideRateProfileNameDefault);
profileWrapperMock.Setup(x => x.GetValue(driverDriverId, "Precision", string.Empty, PrecisionDefault))
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Precision", string.Empty, PrecisionDefault))
.Returns(PrecisionDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Speed", string.Empty, SpeedDefault))
.Returns(() => SpeedDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Data Bits", string.Empty, DataBitsDefault))
.Returns(() => DataBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Stop Bits", string.Empty, StopBitsDefault))
.Returns(() => StopBitsDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Hand Shake", string.Empty, HandshakeDefault))
.Returns(() => HandshakeDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parity", string.Empty, ParityDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Rts / Dtr", string.Empty, RtsDtrEnabledDefault))
.Returns(() => RtsDtrEnabledDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Behaviour", string.Empty, ParkedBehaviourDefault))
.Returns(() => ParityDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Altitude", string.Empty, ParkedAltDefault))
.Returns(() => ParkedAltDefault);
profileWrapperMock.Setup(x =>
x.GetValue(DriverId, "Parked Azimuth", string.Empty, ParkedAzimuthDefault))
.Returns(() => ParkedAzimuthDefault);
Mock<IProfileFactory> profileFactoryMock = new Mock<IProfileFactory>();
profileFactoryMock.Setup(x => x.Create()).Returns(profileWrapperMock.Object);
+7 -6
View File
@@ -104,7 +104,7 @@ namespace ASCOM.Meade.net
CheckConnected("CommandBlind");
// Call CommandString and return as soon as it finishes
//this.CommandString(command, raw);
SharedResourcesWrapper.SendBlind(command);
SharedResourcesWrapper.SendBlind(command, raw);
// or
//throw new ASCOM.MethodNotImplementedException("CommandBlind");
// DO NOT have both these sections! One or the other
@@ -114,9 +114,10 @@ namespace ASCOM.Meade.net
{
CheckConnected("CommandBool");
//string ret = CommandString(command, raw);
return SharedResourcesWrapper.SendBool(command, raw);
// decode the return string and return true or false
// or
throw new MethodNotImplementedException("CommandBool");
//throw new MethodNotImplementedException("CommandBool");
// DO NOT have both these sections! One or the other
}
@@ -126,7 +127,7 @@ namespace ASCOM.Meade.net
// it's a good idea to put all the low level communication with the device here,
// then all communication calls this function
// you need something to ensure that only one command is in progress at a time
return SharedResourcesWrapper.SendString(command);
return SharedResourcesWrapper.SendString(command, raw);
//throw new ASCOM.MethodNotImplementedException("CommandString");
}
@@ -225,7 +226,7 @@ namespace ASCOM.Meade.net
//todo fix this issue: A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe.
SharedResourcesWrapper.SendBlind(":FQ#");
SharedResourcesWrapper.SendBlind("FQ");
//:FQ# Halt Focuser Motion
//Returns: Nothing
}
@@ -329,7 +330,7 @@ namespace ASCOM.Meade.net
private void MoveFocuser(bool directionOut, int steps)
{
//_sharedResourcesWrapper.SendBlind(":FF#");
//_sharedResourcesWrapper.SendBlind("FF");
//:FF# Set Focus speed to fastest setting
//Returns: Nothing
@@ -350,7 +351,7 @@ namespace ASCOM.Meade.net
private void PerformFocuserMove(bool directionOut)
{
SharedResourcesWrapper.SendBlind(directionOut ? ":F+#" : ":F-#");
SharedResourcesWrapper.SendBlind(directionOut ? "F+" : "F-");
//:F+# Start Focuser moving inward (toward objective)
//Returns: None
+39
View File
@@ -0,0 +1,39 @@
using System;
using System.Linq;
using System.Reflection;
namespace ASCOM.Meade.net
{
public static class EnumExtensionMethods
{
public static string GetDescription(this Enum GenericEnum)
{
var genericEnumType = GenericEnum.GetType();
var memberInfo = genericEnumType.GetMember(GenericEnum.ToString());
if (memberInfo.Length > 0)
{
var _Attribs = memberInfo[0]
.GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false);
if (_Attribs.Any())
{
return ((System.ComponentModel.DescriptionAttribute) _Attribs.ElementAt(0)).Description;
}
}
return GenericEnum.ToString();
}
public static T GetValueFromDescription<T>( string description) where T : Enum
{
foreach (T value in Enum.GetValues(typeof(T)))
{
if (value.GetDescription() == description)
{
return value;
}
}
return default;
}
}
}
+5
View File
@@ -129,6 +129,7 @@
<Compile Include="AssemblyInfo.cs" />
<Compile Include="ClassFactory.cs" />
<Compile Include="ConnectionInfo.cs" />
<Compile Include="EnumExtensionMethods.cs" />
<Compile Include="frmMain.cs">
<SubType>Form</SubType>
</Compile>
@@ -136,8 +137,11 @@
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="GarbageCollection.cs" />
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
<Compile Include="LocalServer.cs" />
<Compile Include="MeadeTelescopeBase.cs" />
<Compile Include="ParkedBehaviour.cs" />
<Compile Include="ParkedPosition.cs" />
<Compile Include="ProfileFactory.cs" />
<Compile Include="ProfileProperties.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -199,6 +203,7 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
+17 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using ASCOM.Meade.net.AstroMaths;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
@@ -28,8 +29,11 @@ namespace ASCOM.Meade.net
protected string GuidingStyle;
protected double SiteElevation;
protected short ProfileSettleTime;
protected bool SendDateTime;
protected ParkedBehaviour ParkedBehaviour;
protected HorizonCoordinates ParkedAltAz;
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
public MeadeTelescopeBase()
{
@@ -69,7 +73,15 @@ namespace ASCOM.Meade.net
GuidingStyle = profileProperties.GuidingStyle.ToLower();
SiteElevation = profileProperties.SiteElevation;
ProfileSettleTime = profileProperties.SettleTime;
SendDateTime = profileProperties.SendDateTime;
ParkedBehaviour = profileProperties.ParkedBehaviour;
ParkedAltAz = new HorizonCoordinates
{
Altitude = profileProperties.ParkedAlt,
Azimuth = profileProperties.ParkedAz
};
LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}");
LogMessage("ReadProfile", $"Com Port: {ComPort}");
LogMessage("ReadProfile", $"Backlash Steps: {BacklashCompensation}");
@@ -79,6 +91,10 @@ namespace ASCOM.Meade.net
LogMessage("ReadProfile", $"Guiding Style: {GuidingStyle}");
LogMessage("ReadProfile", $"Site Elevation: {SiteElevation}");
LogMessage("ReadProfile", $"Settle Time after slew: {ProfileSettleTime}");
LogMessage("ReadProfile", $"Send date and time on connect: {SendDateTime}");
LogMessage("ReadProfile", $"Parked Behaviour: {ParkedBehaviour}");
LogMessage("ReadProfile", $"Parked Alt: {ParkedAltAz.Altitude}");
LogMessage("ReadProfile", $"Parked Az: {ParkedAltAz.Azimuth}");
}
/// <summary>
+14
View File
@@ -0,0 +1,14 @@
using System.ComponentModel;
namespace ASCOM.Meade.net
{
public enum ParkedBehaviour
{
[Description("No Coordinates")]
NoCoordinates,
[Description("Last Good Position")]
LastGoodPosition,
[Description("Report coordinates as")]
ReportCoordinates
}
}
+10
View File
@@ -0,0 +1,10 @@
namespace ASCOM.Meade.net
{
public class ParkedPosition
{
public double Altitude { get; set; }
public double Azimuth { get; set; }
public double RightAscension { get; set; }
public double Declination { get; set; }
}
}
+9
View File
@@ -14,5 +14,14 @@ namespace ASCOM.Meade.net
public bool RtsDtrEnabled { get; set; }
public double SiteElevation { get; set; }
public short SettleTime { get; set; }
public int DataBits { get; set; }
public string StopBits { get; set; }
public string Parity { get; set; }
public int Speed { get; set; }
public string Handshake { get; set; }
public bool SendDateTime { get; set; }
public ParkedBehaviour ParkedBehaviour { get; set; }
public double ParkedAlt { get; set; }
public double ParkedAz { get; set; }
}
}
+143 -3
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
@@ -7,6 +8,7 @@ using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using ASCOM.Meade.net.Properties;
using ASCOM.Utilities;
namespace ASCOM.Meade.net
{
@@ -20,6 +22,33 @@ namespace ASCOM.Meade.net
var assemblyInfo = new AssemblyInfo();
Text = string.Format(Resources.SetupDialogForm_SetupDialogForm__0__Settings___1__, assemblyInfo.Product, assemblyInfo.AssemblyVersion);
SetItemsFromEnum(cboStopBits.Items, typeof(SerialStopBits));
SetItemsFromEnum(cboParity.Items, typeof(SerialParity));
SetItemsFromEnumValues(cboSpeed.Items, typeof(SerialSpeed));
SetItemsFromEnum(cboHandShake.Items, typeof(SerialHandshake));
SetItemsFromEnum(cboParkedBehaviour.Items, typeof(ParkedBehaviour));
}
private void SetItemsFromEnum(IList items, Type enumItems)
{
items.Clear();
foreach (var value in Enum.GetValues(enumItems) )
{
var val = value as Enum;
items.Add(val.GetDescription());
}
}
private void SetItemsFromEnumValues(IList items, Type enumItems)
{
items.Clear();
foreach (int item in Enum.GetValues(enumItems))
{
items.Add(item);
}
}
public sealed override string Text
@@ -83,12 +112,83 @@ namespace ASCOM.Meade.net
cboGuidingStyle.SelectedItem = "Auto";
}
numDatabits.Value = profileProperties.DataBits;
try
{
cboStopBits.SelectedItem = profileProperties.StopBits;
}
catch (Exception)
{
cboStopBits.SelectedItem = "One";
}
try
{
cboParity.SelectedItem = profileProperties.Parity;
}
catch (Exception)
{
cboParity.SelectedItem = "None";
}
try
{
cboSpeed.SelectedItem = profileProperties.Speed;
}
catch (Exception)
{
cboParity.SelectedItem = "9600";
}
try
{
cboHandShake.SelectedItem = profileProperties.Handshake;
}
catch (Exception)
{
cboHandShake.SelectedItem = "None";
}
txtBacklashSteps.Text = profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture);
txtElevation.Text = profileProperties.SiteElevation.ToString(CultureInfo.CurrentCulture);
cbxReverseDirection.Checked = profileProperties.ReverseFocusDirection;
cbxDynamicBreaking.Checked = profileProperties.DynamicBreaking;
nudSettleTime.Value = profileProperties.SettleTime;
cbxSendDateTime.Checked = profileProperties.SendDateTime;
try
{
cboParkedBehaviour.SelectedItem = profileProperties.ParkedBehaviour.GetDescription();
}
catch (Exception)
{
cboParkedBehaviour.SelectedItem = ParkedBehaviour.NoCoordinates.GetDescription();
}
try
{
txtParkedAlt.Text = profileProperties.ParkedAlt.ToString(CultureInfo.CurrentCulture);
}
catch (Exception)
{
txtParkedAlt.Text = "0";
}
try
{
txtParkedAz.Text = profileProperties.ParkedAz.ToString(CultureInfo.CurrentCulture);
}
catch (Exception)
{
txtParkedAz.Text = "180";
}
UpdateParkedItemsEnabled();
}
public ProfileProperties GetProfile()
@@ -98,6 +198,11 @@ namespace ASCOM.Meade.net
TraceLogger = chkTrace.Checked,
ComPort = comboBoxComPort.SelectedItem.ToString(),
RtsDtrEnabled = cbxRtsDtr.Checked,
DataBits = Convert.ToInt32(numDatabits.Value),
StopBits = cboStopBits.SelectedItem.ToString(),
Parity = cboParity.SelectedItem.ToString(),
Speed = Convert.ToInt32(cboSpeed.SelectedItem),
Handshake = cboHandShake.SelectedItem.ToString(),
GuideRateArcSecondsPerSecond = double.Parse(txtGuideRate.Text.Trim()),
Precision = cboPrecision.SelectedItem.ToString(),
GuidingStyle = cboGuidingStyle.SelectedItem.ToString(),
@@ -105,8 +210,12 @@ namespace ASCOM.Meade.net
ReverseFocusDirection = cbxReverseDirection.Checked,
DynamicBreaking = cbxDynamicBreaking.Checked,
SiteElevation = double.Parse(txtElevation.Text),
SettleTime = Convert.ToInt16(nudSettleTime.Value)
};
SettleTime = Convert.ToInt16(nudSettleTime.Value),
SendDateTime = cbxSendDateTime.Checked,
ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(cboParkedBehaviour.SelectedItem.ToString()),
ParkedAlt = double.Parse(txtParkedAlt.Text),
ParkedAz = double.Parse(txtParkedAz.Text)
};
return profileProperties;
}
@@ -182,5 +291,36 @@ namespace ASCOM.Meade.net
txtBacklashSteps.Text = txtElevation.Text.Remove(txtBacklashSteps.Text.Length - 1);
}
}
private void cboParkedBehaviour_SelectionChangeCommitted(object sender, EventArgs e)
{
UpdateParkedItemsEnabled();
}
private void UpdateParkedItemsEnabled()
{
txtParkedAlt.Enabled = cboParkedBehaviour.SelectedItem?.ToString() == "Report coordinates as";
txtParkedAz.Enabled = txtParkedAlt.Enabled;
}
private void txtParkedAlt_TextChanged(object sender, EventArgs e)
{
if (System.Text.RegularExpressions.Regex.IsMatch(txtParkedAlt.Text, "[^0-9]"))
{
MessageBox.Show(Resources.SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_);
txtParkedAlt.Text = txtParkedAlt.Text.Remove(txtParkedAlt.Text.Length - 1);
}
}
private void txtParkedAz_TextChanged(object sender, EventArgs e)
{
if (System.Text.RegularExpressions.Regex.IsMatch(txtParkedAz.Text, "[^0-9]"))
{
MessageBox.Show(Resources.SetupDialogForm_txtElevation_TextChanged_1_Please_enter_only_numbers_);
txtParkedAz.Text = txtParkedAz.Text.Remove(txtParkedAz.Text.Length - 1);
}
}
}
}
}
+171
View File
@@ -58,14 +58,33 @@ namespace ASCOM.Meade.net
this.cbxDynamicBreaking = new System.Windows.Forms.CheckBox();
this.cbxRtsDtr = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.cbxSendDateTime = new System.Windows.Forms.CheckBox();
this.label12 = new System.Windows.Forms.Label();
this.txtElevation = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.nudSettleTime = new System.Windows.Forms.NumericUpDown();
this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.cboStopBits = new System.Windows.Forms.ComboBox();
this.numDatabits = new System.Windows.Forms.NumericUpDown();
this.cboParity = new System.Windows.Forms.ComboBox();
this.cboSpeed = new System.Windows.Forms.ComboBox();
this.cboHandShake = new System.Windows.Forms.ComboBox();
this.label17 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.cboParkedBehaviour = new System.Windows.Forms.ComboBox();
this.label22 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.txtParkedAlt = new System.Windows.Forms.TextBox();
this.txtParkedAz = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit();
this.SuspendLayout();
//
// cmdOK
@@ -125,6 +144,7 @@ namespace ASCOM.Meade.net
//
resources.ApplyResources(this.txtGuideRate, "txtGuideRate");
this.txtGuideRate.Name = "txtGuideRate";
this.toolTip1.SetToolTip(this.txtGuideRate, resources.GetString("txtGuideRate.ToolTip"));
this.txtGuideRate.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
//
// label4
@@ -219,6 +239,13 @@ namespace ASCOM.Meade.net
this.toolTip1.SetToolTip(this.cbxRtsDtr, resources.GetString("cbxRtsDtr.ToolTip"));
this.cbxRtsDtr.UseVisualStyleBackColor = true;
//
// cbxSendDateTime
//
resources.ApplyResources(this.cbxSendDateTime, "cbxSendDateTime");
this.cbxSendDateTime.Name = "cbxSendDateTime";
this.toolTip1.SetToolTip(this.cbxSendDateTime, resources.GetString("cbxSendDateTime.ToolTip"));
this.cbxSendDateTime.UseVisualStyleBackColor = true;
//
// label12
//
resources.ApplyResources(this.label12, "label12");
@@ -255,10 +282,135 @@ namespace ASCOM.Meade.net
resources.ApplyResources(this.label15, "label15");
this.label15.Name = "label15";
//
// label16
//
resources.ApplyResources(this.label16, "label16");
this.label16.Name = "label16";
//
// cboStopBits
//
this.cboStopBits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboStopBits.FormattingEnabled = true;
resources.ApplyResources(this.cboStopBits, "cboStopBits");
this.cboStopBits.Name = "cboStopBits";
//
// numDatabits
//
resources.ApplyResources(this.numDatabits, "numDatabits");
this.numDatabits.Maximum = new decimal(new int[] {
32767,
0,
0,
0});
this.numDatabits.Name = "numDatabits";
//
// cboParity
//
this.cboParity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboParity.FormattingEnabled = true;
resources.ApplyResources(this.cboParity, "cboParity");
this.cboParity.Name = "cboParity";
//
// cboSpeed
//
this.cboSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboSpeed.FormattingEnabled = true;
resources.ApplyResources(this.cboSpeed, "cboSpeed");
this.cboSpeed.Name = "cboSpeed";
//
// cboHandShake
//
this.cboHandShake.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboHandShake.FormattingEnabled = true;
resources.ApplyResources(this.cboHandShake, "cboHandShake");
this.cboHandShake.Name = "cboHandShake";
//
// label17
//
resources.ApplyResources(this.label17, "label17");
this.label17.Name = "label17";
//
// label18
//
resources.ApplyResources(this.label18, "label18");
this.label18.Name = "label18";
//
// label19
//
resources.ApplyResources(this.label19, "label19");
this.label19.Name = "label19";
//
// label20
//
resources.ApplyResources(this.label20, "label20");
this.label20.Name = "label20";
//
// label21
//
resources.ApplyResources(this.label21, "label21");
this.label21.Name = "label21";
//
// cboParkedBehaviour
//
this.cboParkedBehaviour.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboParkedBehaviour.FormattingEnabled = true;
this.cboParkedBehaviour.Items.AddRange(new object[] {
resources.GetString("cboParkedBehaviour.Items"),
resources.GetString("cboParkedBehaviour.Items1"),
resources.GetString("cboParkedBehaviour.Items2")});
resources.ApplyResources(this.cboParkedBehaviour, "cboParkedBehaviour");
this.cboParkedBehaviour.Name = "cboParkedBehaviour";
this.cboParkedBehaviour.SelectionChangeCommitted += new System.EventHandler(this.cboParkedBehaviour_SelectionChangeCommitted);
//
// label22
//
resources.ApplyResources(this.label22, "label22");
this.label22.Name = "label22";
//
// label23
//
resources.ApplyResources(this.label23, "label23");
this.label23.Name = "label23";
//
// label24
//
resources.ApplyResources(this.label24, "label24");
this.label24.Name = "label24";
//
// txtParkedAlt
//
resources.ApplyResources(this.txtParkedAlt, "txtParkedAlt");
this.txtParkedAlt.Name = "txtParkedAlt";
this.txtParkedAlt.TextChanged += new System.EventHandler(this.txtParkedAlt_TextChanged);
//
// txtParkedAz
//
resources.ApplyResources(this.txtParkedAz, "txtParkedAz");
this.txtParkedAz.Name = "txtParkedAz";
this.txtParkedAz.TextChanged += new System.EventHandler(this.txtParkedAz_TextChanged);
//
// SetupDialogForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.txtParkedAz);
this.Controls.Add(this.txtParkedAlt);
this.Controls.Add(this.label24);
this.Controls.Add(this.label23);
this.Controls.Add(this.label22);
this.Controls.Add(this.cboParkedBehaviour);
this.Controls.Add(this.cbxSendDateTime);
this.Controls.Add(this.label21);
this.Controls.Add(this.label20);
this.Controls.Add(this.label19);
this.Controls.Add(this.label18);
this.Controls.Add(this.label17);
this.Controls.Add(this.cboHandShake);
this.Controls.Add(this.cboSpeed);
this.Controls.Add(this.cboParity);
this.Controls.Add(this.numDatabits);
this.Controls.Add(this.cboStopBits);
this.Controls.Add(this.label16);
this.Controls.Add(this.label15);
this.Controls.Add(this.nudSettleTime);
this.Controls.Add(this.label14);
@@ -298,6 +450,7 @@ namespace ASCOM.Meade.net
this.Shown += new System.EventHandler(this.SetupDialogForm_Shown);
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numDatabits)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -336,5 +489,23 @@ namespace ASCOM.Meade.net
private Label label14;
private NumericUpDown nudSettleTime;
private Label label15;
private Label label16;
private ComboBox cboStopBits;
private NumericUpDown numDatabits;
private ComboBox cboParity;
private ComboBox cboSpeed;
private ComboBox cboHandShake;
private Label label17;
private Label label18;
private Label label19;
private Label label20;
private Label label21;
private CheckBox cbxSendDateTime;
private ComboBox cboParkedBehaviour;
private Label label22;
private Label label23;
private Label label24;
private TextBox txtParkedAlt;
private TextBox txtParkedAz;
}
}
+525 -60
View File
@@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmdOK.Location" type="System.Drawing.Point, System.Drawing">
<value>281, 457</value>
<value>765, 391</value>
</data>
<data name="cmdOK.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 24</value>
@@ -145,13 +145,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cmdOK.ZOrder" xml:space="preserve">
<value>29</value>
<value>47</value>
</data>
<data name="cmdCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
</data>
<data name="cmdCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>281, 487</value>
<value>765, 421</value>
</data>
<data name="cmdCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 25</value>
@@ -172,7 +172,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cmdCancel.ZOrder" xml:space="preserve">
<value>28</value>
<value>46</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 9</value>
@@ -196,13 +196,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>27</value>
<value>45</value>
</data>
<data name="picASCOM.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="picASCOM.Location" type="System.Drawing.Point, System.Drawing">
<value>292, 9</value>
<value>776, 9</value>
</data>
<data name="picASCOM.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 56</value>
@@ -223,7 +223,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;picASCOM.ZOrder" xml:space="preserve">
<value>26</value>
<value>44</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -250,22 +250,22 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>25</value>
<value>43</value>
</data>
<data name="chkTrace.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chkTrace.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 137</value>
<value>97, 305</value>
</data>
<data name="chkTrace.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 17</value>
<value>90, 17</value>
</data>
<data name="chkTrace.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="chkTrace.Text" xml:space="preserve">
<value>Trace on</value>
<value>Trace Log on</value>
</data>
<data name="&gt;&gt;chkTrace.Name" xml:space="preserve">
<value>chkTrace</value>
@@ -277,7 +277,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;chkTrace.ZOrder" xml:space="preserve">
<value>24</value>
<value>42</value>
</data>
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 87</value>
@@ -298,13 +298,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;comboBoxComPort.ZOrder" xml:space="preserve">
<value>23</value>
<value>41</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 278</value>
<value>290, 169</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
@@ -325,10 +325,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>22</value>
<value>40</value>
</data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 275</value>
<value>375, 166</value>
</data>
<data name="txtGuideRate.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 20</value>
@@ -339,6 +342,9 @@
<data name="txtGuideRate.Text" xml:space="preserve">
<value>10.0</value>
</data>
<data name="txtGuideRate.ToolTip" xml:space="preserve">
<value>LX-200GPS only</value>
</data>
<data name="&gt;&gt;txtGuideRate.Name" xml:space="preserve">
<value>txtGuideRate</value>
</data>
@@ -349,13 +355,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;txtGuideRate.ZOrder" xml:space="preserve">
<value>21</value>
<value>39</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>149, 278</value>
<value>427, 169</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>122, 13</value>
@@ -376,13 +382,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>20</value>
<value>38</value>
</data>
<data name="lblPercentOfSiderealRate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblPercentOfSiderealRate.Location" type="System.Drawing.Point, System.Drawing">
<value>149, 291</value>
<value>427, 182</value>
</data>
<data name="lblPercentOfSiderealRate.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 13</value>
@@ -403,13 +409,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;lblPercentOfSiderealRate.ZOrder" xml:space="preserve">
<value>19</value>
<value>37</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 310</value>
<value>290, 201</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 13</value>
@@ -430,7 +436,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>18</value>
<value>36</value>
</data>
<data name="cboPrecision.Items" xml:space="preserve">
<value>Unchanged</value>
@@ -442,7 +448,7 @@
<value>High</value>
</data>
<data name="cboPrecision.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 307</value>
<value>375, 198</value>
</data>
<data name="cboPrecision.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 21</value>
@@ -460,7 +466,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cboPrecision.ZOrder" xml:space="preserve">
<value>17</value>
<value>35</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -469,7 +475,7 @@
<value>NoControl</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 337</value>
<value>290, 228</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 13</value>
@@ -490,7 +496,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>16</value>
<value>34</value>
</data>
<data name="cboGuidingStyle.Items" xml:space="preserve">
<value>Auto</value>
@@ -502,7 +508,7 @@
<value>Pulse guiding</value>
</data>
<data name="cboGuidingStyle.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 334</value>
<value>375, 225</value>
</data>
<data name="cboGuidingStyle.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 21</value>
@@ -520,7 +526,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cboGuidingStyle.ZOrder" xml:space="preserve">
<value>15</value>
<value>33</value>
</data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -529,7 +535,7 @@
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
</data>
<data name="label7.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 176</value>
<value>290, 67</value>
</data>
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
<value>66, 13</value>
@@ -550,7 +556,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>14</value>
<value>32</value>
</data>
<data name="label8.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -562,7 +568,7 @@
<value>NoControl</value>
</data>
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 393</value>
<value>290, 284</value>
</data>
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 13</value>
@@ -583,10 +589,10 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label8.ZOrder" xml:space="preserve">
<value>13</value>
<value>31</value>
</data>
<data name="txtBacklashSteps.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 411</value>
<value>375, 302</value>
</data>
<data name="txtBacklashSteps.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 20</value>
@@ -607,7 +613,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;txtBacklashSteps.ZOrder" xml:space="preserve">
<value>11</value>
<value>29</value>
</data>
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -616,7 +622,7 @@
<value>NoControl</value>
</data>
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 414</value>
<value>290, 305</value>
</data>
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
<value>79, 13</value>
@@ -637,7 +643,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>12</value>
<value>30</value>
</data>
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -646,7 +652,7 @@
<value>NoControl</value>
</data>
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
<value>149, 414</value>
<value>427, 305</value>
</data>
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
<value>20, 13</value>
@@ -667,7 +673,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>10</value>
<value>28</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -700,13 +706,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>9</value>
<value>27</value>
</data>
<data name="cbxReverseDirection.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cbxReverseDirection.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 437</value>
<value>375, 328</value>
</data>
<data name="cbxReverseDirection.Size" type="System.Drawing.Size, System.Drawing">
<value>109, 17</value>
@@ -727,13 +733,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cbxReverseDirection.ZOrder" xml:space="preserve">
<value>8</value>
<value>26</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, 460</value>
<value>375, 351</value>
</data>
<data name="cbxDynamicBreaking.Size" type="System.Drawing.Size, System.Drawing">
<value>112, 17</value>
@@ -754,11 +760,8 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cbxDynamicBreaking.ZOrder" xml:space="preserve">
<value>7</value>
<value>25</value>
</data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="cbxRtsDtr.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@@ -790,16 +793,49 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cbxRtsDtr.ZOrder" xml:space="preserve">
<value>6</value>
<value>24</value>
</data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="cbxSendDateTime.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cbxSendDateTime.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cbxSendDateTime.Location" type="System.Drawing.Point, System.Drawing">
<value>671, 96</value>
</data>
<data name="cbxSendDateTime.Size" type="System.Drawing.Size, System.Drawing">
<value>145, 17</value>
</data>
<data name="cbxSendDateTime.TabIndex" type="System.Int32, mscorlib">
<value>41</value>
</data>
<data name="cbxSendDateTime.Text" xml:space="preserve">
<value>Set current date and time</value>
</data>
<data name="cbxSendDateTime.ToolTip" xml:space="preserve">
<value>Send Current Date and Time (will also skip the opening dialogs on the LX200GPS)</value>
</data>
<data name="&gt;&gt;cbxSendDateTime.Name" xml:space="preserve">
<value>cbxSendDateTime</value>
</data>
<data name="&gt;&gt;cbxSendDateTime.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;cbxSendDateTime.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cbxSendDateTime.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 205</value>
<value>290, 96</value>
</data>
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
<value>72, 13</value>
@@ -820,10 +856,10 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>5</value>
<value>23</value>
</data>
<data name="txtElevation.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 202</value>
<value>375, 93</value>
</data>
<data name="txtElevation.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 20</value>
@@ -841,13 +877,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;txtElevation.ZOrder" xml:space="preserve">
<value>4</value>
<value>22</value>
</data>
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
<value>203, 205</value>
<value>481, 96</value>
</data>
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
<value>38, 13</value>
@@ -868,13 +904,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label13.ZOrder" xml:space="preserve">
<value>3</value>
<value>21</value>
</data>
<data name="label14.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label14.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 236</value>
<value>290, 127</value>
</data>
<data name="label14.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 13</value>
@@ -895,10 +931,10 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label14.ZOrder" xml:space="preserve">
<value>2</value>
<value>20</value>
</data>
<data name="nudSettleTime.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 234</value>
<value>375, 125</value>
</data>
<data name="nudSettleTime.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 20</value>
@@ -916,13 +952,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;nudSettleTime.ZOrder" xml:space="preserve">
<value>1</value>
<value>19</value>
</data>
<data name="label15.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label15.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 236</value>
<value>501, 127</value>
</data>
<data name="label15.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 13</value>
@@ -943,16 +979,445 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label15.ZOrder" xml:space="preserve">
<value>18</value>
</data>
<data name="label16.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label16.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 139</value>
</data>
<data name="label16.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 13</value>
</data>
<data name="label16.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="label16.Text" xml:space="preserve">
<value>Data bits</value>
</data>
<data name="&gt;&gt;label16.Name" xml:space="preserve">
<value>label16</value>
</data>
<data name="&gt;&gt;label16.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label16.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label16.ZOrder" xml:space="preserve">
<value>17</value>
</data>
<data name="cboStopBits.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 163</value>
</data>
<data name="cboStopBits.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value>
</data>
<data name="cboStopBits.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="&gt;&gt;cboStopBits.Name" xml:space="preserve">
<value>cboStopBits</value>
</data>
<data name="&gt;&gt;cboStopBits.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboStopBits.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cboStopBits.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="numDatabits.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 137</value>
</data>
<data name="numDatabits.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 20</value>
</data>
<data name="numDatabits.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;numDatabits.Name" xml:space="preserve">
<value>numDatabits</value>
</data>
<data name="&gt;&gt;numDatabits.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;numDatabits.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;numDatabits.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<data name="cboParity.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 190</value>
</data>
<data name="cboParity.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value>
</data>
<data name="cboParity.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="&gt;&gt;cboParity.Name" xml:space="preserve">
<value>cboParity</value>
</data>
<data name="&gt;&gt;cboParity.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboParity.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cboParity.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="cboSpeed.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 217</value>
</data>
<data name="cboSpeed.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value>
</data>
<data name="cboSpeed.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="&gt;&gt;cboSpeed.Name" xml:space="preserve">
<value>cboSpeed</value>
</data>
<data name="&gt;&gt;cboSpeed.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboSpeed.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cboSpeed.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="cboHandShake.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 244</value>
</data>
<data name="cboHandShake.Size" type="System.Drawing.Size, System.Drawing">
<value>121, 21</value>
</data>
<data name="cboHandShake.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="&gt;&gt;cboHandShake.Name" xml:space="preserve">
<value>cboHandShake</value>
</data>
<data name="&gt;&gt;cboHandShake.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboHandShake.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cboHandShake.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="label17.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label17.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 166</value>
</data>
<data name="label17.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 13</value>
</data>
<data name="label17.TabIndex" type="System.Int32, mscorlib">
<value>35</value>
</data>
<data name="label17.Text" xml:space="preserve">
<value>Stop Bits</value>
</data>
<data name="&gt;&gt;label17.Name" xml:space="preserve">
<value>label17</value>
</data>
<data name="&gt;&gt;label17.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label17.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label17.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="label18.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label18.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 193</value>
</data>
<data name="label18.Size" type="System.Drawing.Size, System.Drawing">
<value>33, 13</value>
</data>
<data name="label18.TabIndex" type="System.Int32, mscorlib">
<value>36</value>
</data>
<data name="label18.Text" xml:space="preserve">
<value>Parity</value>
</data>
<data name="&gt;&gt;label18.Name" xml:space="preserve">
<value>label18</value>
</data>
<data name="&gt;&gt;label18.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label18.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label18.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="label19.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label19.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 220</value>
</data>
<data name="label19.Size" type="System.Drawing.Size, System.Drawing">
<value>38, 13</value>
</data>
<data name="label19.TabIndex" type="System.Int32, mscorlib">
<value>37</value>
</data>
<data name="label19.Text" xml:space="preserve">
<value>Speed</value>
</data>
<data name="&gt;&gt;label19.Name" xml:space="preserve">
<value>label19</value>
</data>
<data name="&gt;&gt;label19.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label19.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label19.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="label20.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label20.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 247</value>
</data>
<data name="label20.Size" type="System.Drawing.Size, System.Drawing">
<value>62, 13</value>
</data>
<data name="label20.TabIndex" type="System.Int32, mscorlib">
<value>38</value>
</data>
<data name="label20.Text" xml:space="preserve">
<value>Handshake</value>
</data>
<data name="&gt;&gt;label20.Name" xml:space="preserve">
<value>label20</value>
</data>
<data name="&gt;&gt;label20.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label20.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label20.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="label21.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label21.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
</data>
<data name="label21.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label21.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 284</value>
</data>
<data name="label21.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 13</value>
</data>
<data name="label21.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="label21.Text" xml:space="preserve">
<value>Diagnostics</value>
</data>
<data name="&gt;&gt;label21.Name" xml:space="preserve">
<value>label21</value>
</data>
<data name="&gt;&gt;label21.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label21.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label21.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="cboParkedBehaviour.Items" xml:space="preserve">
<value>No Coordinates</value>
</data>
<data name="cboParkedBehaviour.Items1" xml:space="preserve">
<value>Last Good Position</value>
</data>
<data name="cboParkedBehaviour.Items2" xml:space="preserve">
<value>Report coordinates as</value>
</data>
<data name="cboParkedBehaviour.Location" type="System.Drawing.Point, System.Drawing">
<value>671, 124</value>
</data>
<data name="cboParkedBehaviour.Size" type="System.Drawing.Size, System.Drawing">
<value>126, 21</value>
</data>
<data name="cboParkedBehaviour.TabIndex" type="System.Int32, mscorlib">
<value>42</value>
</data>
<data name="&gt;&gt;cboParkedBehaviour.Name" xml:space="preserve">
<value>cboParkedBehaviour</value>
</data>
<data name="&gt;&gt;cboParkedBehaviour.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cboParkedBehaviour.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cboParkedBehaviour.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="label22.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label22.Location" type="System.Drawing.Point, System.Drawing">
<value>574, 127</value>
</data>
<data name="label22.Size" type="System.Drawing.Size, System.Drawing">
<value>91, 13</value>
</data>
<data name="label22.TabIndex" type="System.Int32, mscorlib">
<value>43</value>
</data>
<data name="label22.Text" xml:space="preserve">
<value>Parked behaviour</value>
</data>
<data name="&gt;&gt;label22.Name" xml:space="preserve">
<value>label22</value>
</data>
<data name="&gt;&gt;label22.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label22.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label22.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="label23.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label23.Location" type="System.Drawing.Point, System.Drawing">
<value>668, 154</value>
</data>
<data name="label23.Size" type="System.Drawing.Size, System.Drawing">
<value>19, 13</value>
</data>
<data name="label23.TabIndex" type="System.Int32, mscorlib">
<value>44</value>
</data>
<data name="label23.Text" xml:space="preserve">
<value>Alt</value>
</data>
<data name="&gt;&gt;label23.Name" xml:space="preserve">
<value>label23</value>
</data>
<data name="&gt;&gt;label23.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label23.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label23.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label24.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label24.Location" type="System.Drawing.Point, System.Drawing">
<value>668, 180</value>
</data>
<data name="label24.Size" type="System.Drawing.Size, System.Drawing">
<value>19, 13</value>
</data>
<data name="label24.TabIndex" type="System.Int32, mscorlib">
<value>45</value>
</data>
<data name="label24.Text" xml:space="preserve">
<value>Az</value>
</data>
<data name="&gt;&gt;label24.Name" xml:space="preserve">
<value>label24</value>
</data>
<data name="&gt;&gt;label24.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label24.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label24.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="txtParkedAlt.Location" type="System.Drawing.Point, System.Drawing">
<value>697, 151</value>
</data>
<data name="txtParkedAlt.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 20</value>
</data>
<data name="txtParkedAlt.TabIndex" type="System.Int32, mscorlib">
<value>46</value>
</data>
<data name="&gt;&gt;txtParkedAlt.Name" xml:space="preserve">
<value>txtParkedAlt</value>
</data>
<data name="&gt;&gt;txtParkedAlt.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtParkedAlt.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;txtParkedAlt.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="txtParkedAz.Location" type="System.Drawing.Point, System.Drawing">
<value>697, 177</value>
</data>
<data name="txtParkedAz.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 20</value>
</data>
<data name="txtParkedAz.TabIndex" type="System.Int32, mscorlib">
<value>47</value>
</data>
<data name="&gt;&gt;txtParkedAz.Name" xml:space="preserve">
<value>txtParkedAz</value>
</data>
<data name="&gt;&gt;txtParkedAz.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtParkedAz.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;txtParkedAz.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>350, 520</value>
<value>834, 454</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
+102 -16
View File
@@ -17,6 +17,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security.AccessControl;
using System.Windows.Forms;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
@@ -76,12 +78,13 @@ namespace ASCOM.Meade.net
}
//todo add code to ensure that there is a minimum gap between commands. 5ms as default.
public static void SendBlind(string message)
public static void SendBlind(string message, bool raw = false)
{
lock (LockObject)
{
SharedSerial.ClearBuffers();
SharedSerial.Transmit(message);
var encodedMessage = raw ? message : $"#:{message}#";
SharedSerial.Transmit(encodedMessage);
}
}
@@ -92,24 +95,59 @@ namespace ASCOM.Meade.net
/// and that the reply will always be terminated by a "#" character.
/// </summary>
/// <param name="message"></param>
/// <param name="raw"></param>
/// <returns></returns>
public static string SendString(string message)
public static string SendString(string message, bool raw = false)
{
lock (LockObject)
{
SharedSerial.ClearBuffers();
SharedSerial.Transmit(message);
return SharedSerial.ReceiveTerminated("#").TrimEnd('#');
var encodedMessage = raw ? message : $"#:{message}#";
SharedSerial.Transmit(encodedMessage);
try
{
return SharedSerial.ReceiveTerminated("#").TrimEnd('#');
}
catch (COMException ex)
{
if (ex.Message.Contains("Timed out waiting for received data"))
throw new TimeoutException(ex.Message, ex);
throw;
}
}
}
public static string SendChar(string message)
public static bool SendBool(string command, bool raw = false)
{
var result = SendChar(command, raw);
return result == "1";
}
public static string SendChar(string command, bool raw = false)
{
lock (LockObject)
{
SharedSerial.ClearBuffers();
SharedSerial.Transmit(message);
return SharedSerial.ReceiveCounted(1);
var encodedMessage = raw ? command : $"#:{command}#";
SharedSerial.Transmit(encodedMessage);
try
{
return SharedSerial.ReceiveCounted(1);
}
catch (COMException ex)
{
if (ex.Message.Contains("Timed out waiting for received data"))
throw new TimeoutException(ex.Message, ex);
throw;
}
}
}
@@ -148,6 +186,16 @@ namespace ASCOM.Meade.net
private const string SiteElevationName = "Site Elevation";
private const string SettleTimeName = "Settle Time";
private const string SpeedName = "Speed";
private const string DataBitsName = "Data Bits";
private const string StopBitsName = "Stop Bits";
private const string HandShakeName = "Hand Shake";
private const string ParityName = "Parity";
private const string SendDateTimeName = "Send Date and time on connect";
private const string ParkedBehaviourName = "Parked Behaviour";
private const string ParkedAltName = "Parked Altitude";
private const string ParkedAzimuthName = "Parked Azimuth";
public static void WriteProfile(ProfileProperties profileProperties)
{
lock (LockObject)
@@ -158,6 +206,11 @@ namespace ASCOM.Meade.net
driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString());
driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort);
driverProfile.WriteValue(DriverId, RtsDtrProfileName, profileProperties.RtsDtrEnabled.ToString());
driverProfile.WriteValue(DriverId, SpeedName, profileProperties.Speed.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, DataBitsName, profileProperties.DataBits.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, StopBitsName, profileProperties.StopBits);
driverProfile.WriteValue(DriverId, HandShakeName, profileProperties.Handshake);
driverProfile.WriteValue(DriverId, ParityName, profileProperties.Parity);
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision);
driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle);
@@ -166,6 +219,10 @@ namespace ASCOM.Meade.net
driverProfile.WriteValue(DriverId, DynamicBreakingName, profileProperties.DynamicBreaking.ToString());
driverProfile.WriteValue(DriverId, SiteElevationName, profileProperties.SiteElevation.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, SettleTimeName, profileProperties.SettleTime.ToString());
driverProfile.WriteValue(DriverId, SendDateTimeName, profileProperties.SendDateTime.ToString());
driverProfile.WriteValue(DriverId, ParkedBehaviourName, profileProperties.ParkedBehaviour.GetDescription());
driverProfile.WriteValue(DriverId, ParkedAltName, profileProperties.ParkedAlt.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, ParkedAzimuthName, profileProperties.ParkedAz.ToString(CultureInfo.InvariantCulture));
}
}
}
@@ -181,6 +238,15 @@ namespace ASCOM.Meade.net
private const string DynamicBreakingDefault = "true";
private const string SiteElevationDefault = "0";
private const string SettleTimeDefault = "2";
private const string SpeedDefault = "9600";
private const string DataBitsDefault = "8";
private const string StopBitsDefault = "One";
private const string HandShakeDefault = "None";
private const string ParityDefault = "None";
private const string SendDateTimeDefault = "false";
private static string ParkedBehaviourDefault = "No Coordinates";
private const string ParkedAltDefault = "0";
private const string ParkedAzimuthDefault = "180";
public static ProfileProperties ReadProfile()
{
@@ -201,6 +267,16 @@ namespace ASCOM.Meade.net
profileProperties.DynamicBreaking = Convert.ToBoolean(driverProfile.GetValue(DriverId, DynamicBreakingName, string.Empty, DynamicBreakingDefault));
profileProperties.SiteElevation = Convert.ToInt32(driverProfile.GetValue(DriverId, SiteElevationName, string.Empty, SiteElevationDefault));
profileProperties.SettleTime = Convert.ToInt16(driverProfile.GetValue(DriverId, SettleTimeName, string.Empty, SettleTimeDefault));
profileProperties.StopBits = driverProfile.GetValue(DriverId, StopBitsName, string.Empty, StopBitsDefault);
profileProperties.DataBits = Convert.ToInt32(driverProfile.GetValue(DriverId, DataBitsName, string.Empty, DataBitsDefault));
profileProperties.Handshake = driverProfile.GetValue(DriverId, HandShakeName, string.Empty, HandShakeDefault);
profileProperties.Speed = Convert.ToInt32(driverProfile.GetValue(DriverId, SpeedName, string.Empty, SpeedDefault));
profileProperties.Parity = driverProfile.GetValue(DriverId, ParityName, string.Empty, ParityDefault);
profileProperties.SendDateTime = Convert.ToBoolean(driverProfile.GetValue(DriverId, SendDateTimeName, string.Empty, SendDateTimeDefault));
profileProperties.ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(driverProfile.GetValue(DriverId, ParkedBehaviourName, string.Empty, ParkedBehaviourDefault));
profileProperties.ParkedAlt = double.Parse(driverProfile.GetValue(DriverId, ParkedAltName, string.Empty, ParkedAltDefault), NumberFormatInfo.InvariantInfo);
profileProperties.ParkedAz = double.Parse(driverProfile.GetValue(DriverId, ParkedAzimuthName, string.Empty, ParkedAzimuthDefault), NumberFormatInfo.InvariantInfo);
}
return profileProperties;
@@ -286,17 +362,17 @@ namespace ASCOM.Meade.net
SharedSerial.PortName = profileProperties.ComPort;
SharedSerial.DTREnable = profileProperties.RtsDtrEnabled;
SharedSerial.RTSEnable = profileProperties.RtsDtrEnabled;
SharedSerial.DataBits = 8;
SharedSerial.StopBits = SerialStopBits.One;
SharedSerial.Parity = SerialParity.None;
SharedSerial.Speed = SerialSpeed.ps9600;
SharedSerial.Handshake = SerialHandshake.None;
SharedSerial.DataBits = profileProperties.DataBits;
SharedSerial.StopBits = (SerialStopBits)Enum.Parse(typeof(SerialStopBits), profileProperties.StopBits );
SharedSerial.Parity = (SerialParity)Enum.Parse(typeof(SerialParity), profileProperties.Parity);
SharedSerial.Speed = (SerialSpeed)profileProperties.Speed;
SharedSerial.Handshake = (SerialHandshake)Enum.Parse(typeof(SerialHandshake), profileProperties.Handshake);
SharedSerial.Connected = true;
try
{
ProductName = SendString("#:GVP#");
FirmwareVersion = SendString("#:GVN#");
ProductName = SendString("GVP");
FirmwareVersion = SendString("GVN");
}
catch (Exception ex)
{
@@ -316,7 +392,7 @@ namespace ASCOM.Meade.net
try
{
string utcOffSet = SendString("#:GG#");
string utcOffSet = SendString("GG");
//:GG# Get UTC offset time
//Returns: sHH# or sHH.H#
//The number of decimal hours to add to local time to convert it to UTC. If the number is a whole number the
@@ -417,5 +493,15 @@ namespace ASCOM.Meade.net
Count = 0;
}
}
public static void SetParked(bool atPark, ParkedPosition parkedPosition)
{
IsParked = atPark;
ParkedPosition = parkedPosition;
}
public static bool IsParked { get; private set; }
public static ParkedPosition ParkedPosition { get; private set; }
}
}
+2
View File
@@ -14,6 +14,8 @@
// ReSharper disable once InconsistentNaming
public const string Autostar497_43Eg = "43Eg";
// ReSharper disable once InconsistentNaming
public const string AudioStar_A4S4 = "A4S4";
#endregion
#region LX200GPS
+28 -9
View File
@@ -15,9 +15,10 @@ namespace ASCOM.Meade.net.Wrapper
void Lock(Action action);
T Lock<T>(Func<T> func);
string SendString(string message);
void SendBlind(string message);
string SendChar(string message);
string SendString(string message, bool raw = false);
void SendBlind(string message, bool raw = false);
bool SendBool(string command, bool raw = false);
string SendChar(string message, bool raw = false);
string ReadTerminated();
@@ -26,6 +27,10 @@ namespace ASCOM.Meade.net.Wrapper
void SetupDialog();
void WriteProfile(ProfileProperties profileProperties);
void ReadCharacters(int throwAwayCharacters);
void SetParked(bool atPark, ParkedPosition parkedPosition);
bool IsParked { get; }
ParkedPosition ParkedPosition { get; }
}
public class SharedResourcesWrapper : ISharedResourcesWrapper
@@ -54,19 +59,24 @@ namespace ASCOM.Meade.net.Wrapper
return SharedResources.Lock(func);
}
public string SendString(string message)
public string SendString(string message, bool raw = false)
{
return SharedResources.SendString(message);
return SharedResources.SendString(message, raw);
}
public void SendBlind(string message)
public void SendBlind(string message, bool raw = false)
{
SharedResources.SendBlind(message);
SharedResources.SendBlind(message, raw);
}
public string SendChar(string message)
public bool SendBool(string command, bool raw = false)
{
return SharedResources.SendChar(message);
return SharedResources.SendBool(command, raw);
}
public string SendChar(string message,bool raw = false)
{
return SharedResources.SendChar(message, raw);
}
public string ReadTerminated()
@@ -93,5 +103,14 @@ namespace ASCOM.Meade.net.Wrapper
{
SharedResources.WriteProfile(profileProperties);
}
public void SetParked(bool atPark, ParkedPosition parkedPosition)
{
SharedResources.SetParked(atPark, parkedPosition);
}
public bool IsParked => SharedResources.IsParked;
public ParkedPosition ParkedPosition => SharedResources.ParkedPosition;
}
}