Implemented SyncToTarget functionality

This commit is contained in:
2019-05-06 23:00:58 +01:00
parent eab151d295
commit 56febb46cc
4 changed files with 218 additions and 184 deletions
@@ -27,5 +27,6 @@ namespace ASCOM.MeadeAutostar497.Controller
void SlewToCoordinatesAsync(double rightAscension, double declination);
void SlewToAltAz(double azimuth, double altitude);
void SlewToAltAzAsync(double azimuth, double altitude);
void SyncToTarget();
}
}
@@ -621,6 +621,18 @@ namespace ASCOM.MeadeAutostar497.Controller
DoSlewAsync(false);
}
public void SyncToTarget()
{
var result = SerialPort.CommandTerminated(":CM#", "#");
//:CM# Synchronizes the telescope's position with the currently selected database object's coordinates.
//Returns:
//LX200's - a "#" terminated string with the name of the object that was synced.
// Autostars & Autostar II - At static string: " M31 EX GAL MAG 3.5 SZ178.0'#"
if (result == string.Empty)
throw new ASCOM.InvalidOperationException("Unable to perform sync");
}
//todo remove the polar parameter and split method into two.
private void DoSlewAsync( bool polar)
{