Added support for reading Declination
This commit is contained in:
@@ -536,5 +536,20 @@ namespace MeadeAutostar497.UnitTests
|
|||||||
|
|
||||||
Assert.That( az, Is.EqualTo(expectedResult));
|
Assert.That( az, Is.EqualTo(expectedResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase("+75*13", 75.2166666666666654)]
|
||||||
|
[TestCase("+65*13'21", 65.222499999999997)]
|
||||||
|
public void Declination_CanGetValue(string response, double expectedResult)
|
||||||
|
{
|
||||||
|
serialMock.Setup(x => x.CommandTerminated(":GD#", "#")).Returns(response);
|
||||||
|
|
||||||
|
_isConnected = true;
|
||||||
|
|
||||||
|
_telescopeController.Connected = true;
|
||||||
|
|
||||||
|
var result = _telescopeController.Declination;
|
||||||
|
|
||||||
|
Assert.That(result, Is.EqualTo(expectedResult));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -524,7 +524,7 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
double declination = 0.0;
|
double declination = _telescopeController.Declination;
|
||||||
tl.LogMessage("Declination", "Get - " + utilities.DegreesToDMS(declination, ":", ":"));
|
tl.LogMessage("Declination", "Get - " + utilities.DegreesToDMS(declination, ":", ":"));
|
||||||
return declination;
|
return declination;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
AlignmentModes AlignmentMode { get; set; }
|
AlignmentModes AlignmentMode { get; set; }
|
||||||
bool AtPark { get; }
|
bool AtPark { get; }
|
||||||
double Azimuth { get; }
|
double Azimuth { get; }
|
||||||
|
double Declination { get; }
|
||||||
void AbortSlew();
|
void AbortSlew();
|
||||||
void PulseGuide(GuideDirections direction, int duration);
|
void PulseGuide(GuideDirections direction, int duration);
|
||||||
void Park();
|
void Park();
|
||||||
|
|||||||
@@ -322,6 +322,21 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double Declination
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var result = SerialPort.CommandTerminated(":GD#", "#");
|
||||||
|
//:GD# Get Telescope Declination.
|
||||||
|
//Returns: sDD* MM# or sDD*MM’SS#
|
||||||
|
//Depending upon the current precision setting for the telescope.
|
||||||
|
|
||||||
|
double az = DMSToDouble(result);
|
||||||
|
|
||||||
|
return az;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void AbortSlew()
|
public void AbortSlew()
|
||||||
{
|
{
|
||||||
SerialPort.Command("#:Q#");
|
SerialPort.Command("#:Q#");
|
||||||
|
|||||||
Reference in New Issue
Block a user