Fixed some issued with the telescope parking and unparking. Now reports reported correctly for the LX200GPS, and Autostars

This commit is contained in:
2021-04-24 22:29:11 +01:00
parent f9bb2aa879
commit 7eec6c0008
4 changed files with 173 additions and 66 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ namespace ASCOM.Meade.net
SendDateTime = profileProperties.SendDateTime;
ParkedBehaviour = profileProperties.ParkedBehaviour;
var ParkedAltAz = new HorizonCoordinates
ParkedAltAz = new HorizonCoordinates
{
Altitude = profileProperties.ParkedAlt,
Azimuth = profileProperties.ParkedAz
+24 -2
View File
@@ -17,6 +17,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
@@ -104,7 +105,17 @@ namespace ASCOM.Meade.net
else
SharedSerial.Transmit(message);
return SharedSerial.ReceiveTerminated("#").TrimEnd('#');
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;
}
}
}
@@ -114,7 +125,18 @@ namespace ASCOM.Meade.net
{
SharedSerial.ClearBuffers();
SharedSerial.Transmit(message);
return SharedSerial.ReceiveCounted(1);
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;
}
}
}