Implemented SyncToTarget functionality
This commit is contained in:
@@ -297,8 +297,10 @@ namespace ASCOM.MeadeAutostar497
|
||||
{
|
||||
get
|
||||
{
|
||||
tl.LogMessage("AlignmentMode Get", "Not implemented");
|
||||
return _telescopeController.AlignmentMode;
|
||||
tl.LogMessage("AlignmentMode Get", "Getting alignmode");
|
||||
var alignmode = _telescopeController.AlignmentMode;
|
||||
tl.LogMessage("AlignmentMode Get", $"alignmode = {alignmode}");
|
||||
return alignmode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,14 +833,17 @@ namespace ASCOM.MeadeAutostar497
|
||||
|
||||
public void SyncToCoordinates(double RightAscension, double Declination)
|
||||
{
|
||||
tl.LogMessage("SyncToCoordinates", "Not implemented");
|
||||
throw new ASCOM.MethodNotImplementedException("SyncToCoordinates");
|
||||
tl.LogMessage("SyncToCoordinates", $"RA={RightAscension} Dec={Declination}");
|
||||
_telescopeController.TargetRightAscension = RightAscension;
|
||||
_telescopeController.TargetDeclination = Declination;
|
||||
|
||||
SyncToTarget();
|
||||
}
|
||||
|
||||
public void SyncToTarget()
|
||||
{
|
||||
tl.LogMessage("SyncToTarget", "Not implemented");
|
||||
throw new ASCOM.MethodNotImplementedException("SyncToTarget");
|
||||
tl.LogMessage("SyncToTarget", "Executing");
|
||||
_telescopeController.SyncToTarget();
|
||||
}
|
||||
|
||||
public double TargetDeclination
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user