Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a97d151a4 |
@@ -0,0 +1,68 @@
|
|||||||
|
Conform Report Hash (V1): 55AB333E4394ADF3F35929567EAB46A092F3574DF38E1F00BF586967B7EE826AA2D92647409F699E62954B07AF3389CEA7DB7FAAFFE04E05BE358A744E95A624
|
||||||
|
|
||||||
|
|
||||||
|
ConformanceCheck ASCOM Device Conformance Checker Version 6.4.63.0, Build time: 18/12/2018 08:58:34
|
||||||
|
ConformanceCheck Running on: ASCOM Platform 6.4 SP1 6.4.1.2695
|
||||||
|
|
||||||
|
ConformanceCheck Driver ProgID: ASCOM.MeadeAutostar497.Telescope
|
||||||
|
|
||||||
|
Error handling
|
||||||
|
Error number for "Not Implemented" is: 80040400
|
||||||
|
Error number for "Invalid Value 1" is: 80040404
|
||||||
|
Error number for "Value Not Set 1" is: 80040402
|
||||||
|
Error number for "Value Not Set 2" is: 80040403
|
||||||
|
Error messages will not be interpreted to infer state.
|
||||||
|
|
||||||
|
00:21:34.375 Driver Access Checks OK
|
||||||
|
00:21:35.008 AccessChecks OK Successfully created driver using late binding
|
||||||
|
00:21:35.253 AccessChecks OK Successfully connected using late binding
|
||||||
|
00:21:35.257 AccessChecks INFO The driver is a .NET object
|
||||||
|
00:21:35.260 AccessChecks INFO The AssemblyQualifiedName is: ASCOM.MeadeAutostar497.Telescope, ASCOM.MeadeAutostar497.Telescope, Version=
|
||||||
|
00:21:35.265 AccessChecks INFO The driver implements interface: ASCOM.DeviceInterface.ITelescopeV3
|
||||||
|
00:21:35.269 AccessChecks INFO The driver implements interface: ASCOM.DeviceInterface.IFocuserV3
|
||||||
|
00:21:35.992 AccessChecks INFO Device does not expose IFocuser interface
|
||||||
|
00:21:36.147 AccessChecks INFO Device does not expose IFocuserV2 interface
|
||||||
|
00:21:36.479 AccessChecks INFO Device exposes IFocuserV3 interface
|
||||||
|
00:21:36.692 AccessChecks OK Successfully created driver using driver access toolkit
|
||||||
|
00:21:36.895 AccessChecks OK Successfully connected using driver access toolkit
|
||||||
|
00:21:36.958 AccessChecks OK Successfully disconnected using driver access toolkit
|
||||||
|
|
||||||
|
Conform is using ASCOM.DriverAccess.Focuser to get a Focuser object
|
||||||
|
00:21:37.078 ConformanceCheck OK Driver instance created successfully
|
||||||
|
00:21:37.311 ConformanceCheck OK Connected OK
|
||||||
|
|
||||||
|
Common Driver Methods
|
||||||
|
00:21:37.348 InterfaceVersion OK 3
|
||||||
|
00:21:37.374 Connected OK True
|
||||||
|
00:21:37.401 Description OK Meade Autostar 497 .net
|
||||||
|
00:21:37.428 DriverInfo OK Information about the driver itself. Version: 0.2
|
||||||
|
00:21:37.457 DriverVersion OK 0.2
|
||||||
|
00:21:37.485 Name OK Meade Autostar 497 .net
|
||||||
|
00:21:37.511 CommandXXX INFO Tests skipped
|
||||||
|
00:21:37.515 Action INFO Conform cannot test the Action method
|
||||||
|
00:21:37.521 SupportedActions OK Driver returned an empty action list
|
||||||
|
|
||||||
|
Properties
|
||||||
|
00:21:37.626 Absolute OK False
|
||||||
|
00:21:37.631 IsMoving OK False
|
||||||
|
00:21:37.637 MaxStep OK 7000
|
||||||
|
00:21:37.642 MaxIncrement OK 7000
|
||||||
|
00:21:37.820 Position OK Position must not be implemented for a relative focuser and a PropertyNotImplementedException exception was generated as expected
|
||||||
|
00:21:37.988 StepSize OK Optional member threw a PropertyNotImplementedException exception.
|
||||||
|
00:21:37.993 TempCompAvailable OK False
|
||||||
|
00:21:37.999 TempComp Read OK False
|
||||||
|
00:21:38.167 TempComp Write OK Temperature compensation is not available and a PropertyNotImplementedException exception was generated as expected
|
||||||
|
00:21:38.504 Temperature OK Optional member threw a PropertyNotImplementedException exception.
|
||||||
|
|
||||||
|
Methods
|
||||||
|
00:21:38.544 Halt OK Focuser halted OK
|
||||||
|
00:21:38.552 Move - TempComp False Moving by: 700
|
||||||
|
00:21:39.264 Move - TempComp False Asynchronous move found
|
||||||
|
00:21:39.270 Move - TempComp False OK Relative move OK
|
||||||
|
00:21:39.278 Move - TempComp False INFO Returning to original position: 0
|
||||||
|
|
||||||
|
Conformance test complete
|
||||||
|
|
||||||
|
No errors, warnings or issues found: your driver passes ASCOM validation!!
|
||||||
|
|
||||||
|
Driver Hash Value: DBF36156F87DA91F130E0AABEFE80B250D62C2DB689AD8B44243AE0D9322245CF15AAE2E663962402E87B6B1A15440A6DDB46562EFB9527E3596096319C2AC85
|
||||||
@@ -949,22 +949,22 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
|
|
||||||
#region IFocuser Implementation
|
#region IFocuser Implementation
|
||||||
|
|
||||||
private int focuserPosition = 0; // Class level variable to hold the current focuser position
|
//private int focuserPosition = 0; // Class level variable to hold the current focuser position
|
||||||
private const int focuserSteps = 10000;
|
//private const int focuserSteps = 10000;
|
||||||
|
|
||||||
public bool Absolute
|
public bool Absolute
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
tl.LogMessage("Absolute Get", true.ToString());
|
tl.LogMessage("Absolute Get", false.ToString());
|
||||||
return true; // This is an absolute focuser
|
return false; // This is an absolute focuser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Halt()
|
public void Halt()
|
||||||
{
|
{
|
||||||
tl.LogMessage("Halt", "Not implemented");
|
tl.LogMessage("Halt", "Halting");
|
||||||
throw new ASCOM.MethodNotImplementedException("Halt");
|
_telescopeController.FocuserHalt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsMoving
|
public bool IsMoving
|
||||||
@@ -994,8 +994,9 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
tl.LogMessage("MaxIncrement Get", focuserSteps.ToString());
|
var maxIncrement = _telescopeController.FocuserMaxIncrement;
|
||||||
return focuserSteps; // Maximum change in one move
|
tl.LogMessage("MaxIncrement Get", maxIncrement.ToString());
|
||||||
|
return maxIncrement; // Maximum change in one move
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1003,22 +1004,25 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
tl.LogMessage("MaxStep Get", focuserSteps.ToString());
|
var maxStep = _telescopeController.FocuserMaxStep;
|
||||||
return focuserSteps; // Maximum extent of the focuser, so position range is 0 to 10,000
|
tl.LogMessage("MaxStep Get", maxStep.ToString());
|
||||||
|
return maxStep;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Move(int Position)
|
public void Move(int Position)
|
||||||
{
|
{
|
||||||
tl.LogMessage("Move", Position.ToString());
|
tl.LogMessage("Move", Position.ToString());
|
||||||
focuserPosition = Position; // Set the focuser position
|
_telescopeController.FocuserMove(Position);
|
||||||
|
//focuserPosition = Position; // Set the focuser position
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Position
|
public int Position
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return focuserPosition; // Return the focuser position
|
throw new ASCOM.PropertyNotImplementedException("Position", false);
|
||||||
|
//return focuserPosition; // Return the focuser position
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
namespace ASCOM.MeadeAutostar497.Controller
|
||||||
|
{
|
||||||
|
enum FirmwareVersion
|
||||||
|
{
|
||||||
|
autostar497_30eb,
|
||||||
|
autostar497_30ed,
|
||||||
|
autostar497_30ee,
|
||||||
|
autostar497_31ee,
|
||||||
|
autostar497_32ea,
|
||||||
|
//PEC added for Polar mounted scopes
|
||||||
|
|
||||||
|
autostar497_32ee,
|
||||||
|
autostar497_32eh,
|
||||||
|
//Some serial strings fixed.
|
||||||
|
|
||||||
|
autostar497_32ei,
|
||||||
|
autostar497_33ef,
|
||||||
|
//Some serial strings fixed.
|
||||||
|
|
||||||
|
autostar497_33el,
|
||||||
|
autostar497_40eb,
|
||||||
|
autostar497_40ee,
|
||||||
|
autostar497_40ef,
|
||||||
|
autostar497_41ec,
|
||||||
|
autostar497_42ed,
|
||||||
|
//Get serial command for daylight savings (:GH# returns 0 for disabled 1 for enabled)
|
||||||
|
//Set serial command for daylight savings (:SH0# disables, :SH1# enables)
|
||||||
|
|
||||||
|
autostar497_43ea,
|
||||||
|
autostar497_43ed,
|
||||||
|
autostar497_43eg
|
||||||
|
//Added :GW#, :AL#, :AA#, & :AP#
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,8 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
double TargetRightAscension { get; set; }
|
double TargetRightAscension { get; set; }
|
||||||
double TargetDeclination { get; set; }
|
double TargetDeclination { get; set; }
|
||||||
DriveRates TrackingRate { get; }
|
DriveRates TrackingRate { get; }
|
||||||
|
int FocuserMaxIncrement { get; set; }
|
||||||
|
int FocuserMaxStep { get; set; }
|
||||||
void AbortSlew();
|
void AbortSlew();
|
||||||
void PulseGuide(GuideDirections direction, int duration);
|
void PulseGuide(GuideDirections direction, int duration);
|
||||||
void Park();
|
void Park();
|
||||||
@@ -32,5 +34,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
void SlewToTarget();
|
void SlewToTarget();
|
||||||
void SlewToTargetAsync();
|
void SlewToTargetAsync();
|
||||||
void MoveAxis(TelescopeAxes axis, double rate);
|
void MoveAxis(TelescopeAxes axis, double rate);
|
||||||
|
void FocuserHalt();
|
||||||
|
void FocuserMove(int position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,6 +97,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
SerialPort.Open();
|
SerialPort.Open();
|
||||||
|
|
||||||
TestConnectionActive();
|
TestConnectionActive();
|
||||||
|
SetFocuserSpeedFastest();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
@@ -520,6 +521,10 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int FocuserMaxIncrement { get; set; } = 7000;
|
||||||
|
|
||||||
|
public int FocuserMaxStep { get; set; } = 7000;
|
||||||
|
|
||||||
public double Altitude {
|
public double Altitude {
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -562,14 +567,22 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_serialPort.Command(":RG#"); //Make sure we are at guide rate
|
SerialPort.Lock();
|
||||||
_serialPort.Command($":M{d}#");
|
try
|
||||||
Thread.Sleep(duration);
|
{
|
||||||
_serialPort.Command($":Q{d}#");
|
_serialPort.Command(":RG#"); //Make sure we are at guide rate
|
||||||
|
_serialPort.Command($":M{d}#");
|
||||||
|
Thread.Sleep(duration);
|
||||||
|
_serialPort.Command($":Q{d}#");
|
||||||
|
|
||||||
//classic only !!!, this is needed since once in a while one is not enough
|
//classic only !!!, this is needed since once in a while one is not enough
|
||||||
Thread.Sleep(200);
|
Thread.Sleep(200);
|
||||||
_serialPort.Command($":Q{d}#");
|
_serialPort.Command($":Q{d}#");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
SerialPort.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,10 +607,18 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
|
|
||||||
public void SlewToCoordinatesAsync(double rightAscension, double declination)
|
public void SlewToCoordinatesAsync(double rightAscension, double declination)
|
||||||
{
|
{
|
||||||
TargetRightAscension = rightAscension;
|
SerialPort.Lock();
|
||||||
TargetDeclination = declination;
|
try
|
||||||
|
{
|
||||||
|
TargetRightAscension = rightAscension;
|
||||||
|
TargetDeclination = declination;
|
||||||
|
|
||||||
DoSlewAsync(true);
|
DoSlewAsync(true);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
SerialPort.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SlewToAltAz(double azimuth, double altitude)
|
public void SlewToAltAz(double azimuth, double altitude)
|
||||||
@@ -663,10 +684,18 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
|
|
||||||
public void SlewToAltAzAsync(double azimuth, double altitude)
|
public void SlewToAltAzAsync(double azimuth, double altitude)
|
||||||
{
|
{
|
||||||
TargetAltitude = altitude;
|
SerialPort.Lock();
|
||||||
TargetAzimuth = azimuth;
|
try
|
||||||
|
{
|
||||||
|
TargetAltitude = altitude;
|
||||||
|
TargetAzimuth = azimuth;
|
||||||
|
|
||||||
DoSlewAsync(false);
|
DoSlewAsync(false);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
SerialPort.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SyncToTarget()
|
public void SyncToTarget()
|
||||||
@@ -706,144 +735,239 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
|
|
||||||
private bool _movingPrimary;
|
private bool _movingPrimary;
|
||||||
private bool _movingSecondary;
|
private bool _movingSecondary;
|
||||||
|
|
||||||
public void MoveAxis(TelescopeAxes axis, double rate)
|
public void MoveAxis(TelescopeAxes axis, double rate)
|
||||||
{
|
{
|
||||||
var absrate = Math.Abs(rate);
|
SerialPort.Lock();
|
||||||
|
try
|
||||||
switch(absrate)
|
|
||||||
{
|
{
|
||||||
case 0:
|
var absrate = Math.Abs(rate);
|
||||||
//do nothing, it's ok this time as we're halting the slew.
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
SerialPort.Command(":RG#");
|
|
||||||
//:RG# Set Slew rate to Guiding Rate (slowest)
|
|
||||||
//Returns: Nothing
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
SerialPort.Command(":RC#");
|
|
||||||
//:RC# Set Slew rate to Centering rate (2nd slowest)
|
|
||||||
//Returns: Nothing
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
SerialPort.Command(":RM#");
|
|
||||||
//:RM# Set Slew rate to Find Rate (2nd Fastest)
|
|
||||||
//Returns: Nothing
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
SerialPort.Command(":RS#");
|
|
||||||
//:RS# Set Slew rate to max (fastest)
|
|
||||||
//Returns: Nothing
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new ASCOM.InvalidValueException($"Rate {rate} not supported");
|
|
||||||
|
|
||||||
|
switch (absrate)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
//do nothing, it's ok this time as we're halting the slew.
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
SerialPort.Command(":RG#");
|
||||||
|
//:RG# Set Slew rate to Guiding Rate (slowest)
|
||||||
|
//Returns: Nothing
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
SerialPort.Command(":RC#");
|
||||||
|
//:RC# Set Slew rate to Centering rate (2nd slowest)
|
||||||
|
//Returns: Nothing
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
SerialPort.Command(":RM#");
|
||||||
|
//:RM# Set Slew rate to Find Rate (2nd Fastest)
|
||||||
|
//Returns: Nothing
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
SerialPort.Command(":RS#");
|
||||||
|
//:RS# Set Slew rate to max (fastest)
|
||||||
|
//Returns: Nothing
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ASCOM.InvalidValueException($"Rate {rate} not supported");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (axis)
|
||||||
|
{
|
||||||
|
case TelescopeAxes.axisPrimary:
|
||||||
|
if (rate == 0)
|
||||||
|
{
|
||||||
|
_movingPrimary = false;
|
||||||
|
SerialPort.Command(":Qe#");
|
||||||
|
//:Qe# Halt eastward Slews
|
||||||
|
//Returns: Nothing
|
||||||
|
SerialPort.Command(":Qw#");
|
||||||
|
//:Qw# Halt westward Slews
|
||||||
|
//Returns: Nothing
|
||||||
|
}
|
||||||
|
else if (rate > 0)
|
||||||
|
{
|
||||||
|
SerialPort.Command(":Me#");
|
||||||
|
//:Me# Move Telescope East at current slew rate
|
||||||
|
//Returns: Nothing
|
||||||
|
_movingPrimary = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SerialPort.Command(":Mw#");
|
||||||
|
//:Mw# Move Telescope West at current slew rate
|
||||||
|
//Returns: Nothing
|
||||||
|
_movingPrimary = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case TelescopeAxes.axisSecondary:
|
||||||
|
if (rate == 0)
|
||||||
|
{
|
||||||
|
_movingSecondary = false;
|
||||||
|
SerialPort.Command(":Qn#");
|
||||||
|
//:Qn# Halt northward Slews
|
||||||
|
//Returns: Nothing
|
||||||
|
SerialPort.Command(":Qs#");
|
||||||
|
//:Qs# Halt southward Slews
|
||||||
|
//Returns: Nothing
|
||||||
|
}
|
||||||
|
else if (rate > 0)
|
||||||
|
{
|
||||||
|
SerialPort.Command(":Mn#");
|
||||||
|
//:Mn# Move Telescope North at current slew rate
|
||||||
|
//Returns: Nothing
|
||||||
|
_movingSecondary = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SerialPort.Command(":Ms#");
|
||||||
|
//:Ms# Move Telescope South at current slew rate
|
||||||
|
//Returns: Nothing
|
||||||
|
_movingSecondary = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ASCOM.MethodNotImplementedException("Can not move this axis.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
SerialPort.Unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FocuserHalt()
|
||||||
|
{
|
||||||
|
SerialPort.Command(":FQ#");
|
||||||
|
//:FQ# Halt Focuser Motion
|
||||||
|
//Returns: Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FocuserMove(int newPosition)
|
||||||
|
{
|
||||||
|
//todo implement backlash compensation
|
||||||
|
//todo implement direction reverse
|
||||||
|
//todo implement dynamic braking
|
||||||
|
|
||||||
|
if (newPosition < -FocuserMaxIncrement || newPosition > FocuserMaxIncrement)
|
||||||
|
{
|
||||||
|
throw new ASCOM.InvalidValueException($"position out of range {-FocuserMaxIncrement} < {newPosition} < {FocuserMaxIncrement}");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (axis)
|
if (newPosition == 0)
|
||||||
{
|
return;
|
||||||
case TelescopeAxes.axisPrimary:
|
|
||||||
if (rate == 0)
|
|
||||||
{
|
|
||||||
_movingPrimary = false;
|
|
||||||
SerialPort.Command(":Qe#");
|
|
||||||
//:Qe# Halt eastward Slews
|
|
||||||
//Returns: Nothing
|
|
||||||
SerialPort.Command(":Qw#");
|
|
||||||
//:Qw# Halt westward Slews
|
|
||||||
//Returns: Nothing
|
|
||||||
}
|
|
||||||
else if (rate > 0)
|
|
||||||
{
|
|
||||||
SerialPort.Command(":Me#");
|
|
||||||
//:Me# Move Telescope East at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_movingPrimary = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SerialPort.Command(":Mw#");
|
|
||||||
//:Mw# Move Telescope West at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_movingPrimary = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case TelescopeAxes.axisSecondary:
|
|
||||||
if (rate == 0)
|
|
||||||
{
|
|
||||||
_movingSecondary = false;
|
|
||||||
SerialPort.Command(":Qn#");
|
|
||||||
//:Qn# Halt northward Slews
|
|
||||||
//Returns: Nothing
|
|
||||||
SerialPort.Command(":Qs#");
|
|
||||||
//:Qs# Halt southward Slews
|
|
||||||
//Returns: Nothing
|
|
||||||
}
|
|
||||||
else if (rate > 0)
|
|
||||||
{
|
|
||||||
SerialPort.Command(":Mn#");
|
|
||||||
//:Mn# Move Telescope North at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_movingSecondary = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SerialPort.Command(":Ms#");
|
|
||||||
//:Ms# Move Telescope South at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_movingSecondary = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
if (newPosition > 0)
|
||||||
default:
|
{
|
||||||
throw new ASCOM.MethodNotImplementedException("Can not move this axis.");
|
//desired move direction is out
|
||||||
|
MoveFocuser(true, Math.Abs(newPosition));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//desired move direction is in
|
||||||
|
MoveFocuser(false, Math.Abs(newPosition));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MoveFocuser(bool directionOut, int steps)
|
||||||
|
{
|
||||||
|
SerialPort.Command(directionOut ? ":F+#" : ":F-#");
|
||||||
|
//:F+# Start Focuser moving inward (toward objective)
|
||||||
|
//Returns: None
|
||||||
|
|
||||||
|
//:F-# Start Focuser moving outward (away from objective)
|
||||||
|
//Returns: None
|
||||||
|
|
||||||
|
Util.WaitForMilliseconds(steps);
|
||||||
|
|
||||||
|
FocuserHalt();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetFocuserSpeedFastest()
|
||||||
|
{
|
||||||
|
SerialPort.Command(":FF#");
|
||||||
|
//:FF# Set Focus speed to fastest setting
|
||||||
|
//Returns: Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetFocuserSpeedSlowest()
|
||||||
|
{
|
||||||
|
SerialPort.Command(":FS#");
|
||||||
|
//:FS# Set Focus speed to slowest setting
|
||||||
|
//Returns: Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetFocuserSpeed( int speed)
|
||||||
|
{
|
||||||
|
if (speed < 1)
|
||||||
|
throw new ArgumentOutOfRangeException("speed is too low");
|
||||||
|
|
||||||
|
if (speed > 4)
|
||||||
|
throw new ArgumentOutOfRangeException("speed is too high");
|
||||||
|
|
||||||
|
SerialPort.Command($":F{speed}#");
|
||||||
|
//:F<n># Autostar, Autostar II – set focuser speed to <n> where <n> is an ASCII digit 1..4
|
||||||
|
//Returns: Nothing
|
||||||
|
//All others – Not Supported
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo remove the polar parameter and split method into two.
|
//todo remove the polar parameter and split method into two.
|
||||||
private void DoSlewAsync( bool polar)
|
private void DoSlewAsync( bool polar)
|
||||||
{
|
{
|
||||||
switch (polar)
|
SerialPort.Lock();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
case true:
|
switch (polar)
|
||||||
var response = SerialPort.CommandChar(":MS#");
|
{
|
||||||
//:MS# Slew to Target Object
|
case true:
|
||||||
//Returns:
|
var response = SerialPort.CommandChar(":MS#");
|
||||||
//0 Slew is Possible
|
//:MS# Slew to Target Object
|
||||||
//1<string># Object Below Horizon w/string message
|
//Returns:
|
||||||
//2<string># Object Below Higher w/string message
|
//0 Slew is Possible
|
||||||
|
//1<string># Object Below Horizon w/string message
|
||||||
|
//2<string># Object Below Higher w/string message
|
||||||
|
|
||||||
switch (response)
|
switch (response)
|
||||||
{
|
{
|
||||||
case '0':
|
case '0':
|
||||||
//We're slewing everything should be working just fine.
|
//We're slewing everything should be working just fine.
|
||||||
break;
|
break;
|
||||||
case '1':
|
case '1':
|
||||||
//Below Horizon
|
//Below Horizon
|
||||||
string belowHorizonMessage = SerialPort.ReadTerminated("#");
|
string belowHorizonMessage = SerialPort.ReadTerminated("#");
|
||||||
throw new ASCOM.InvalidOperationException(belowHorizonMessage);
|
throw new ASCOM.InvalidOperationException(belowHorizonMessage);
|
||||||
case '2':
|
case '2':
|
||||||
//Below Horizon
|
//Below Horizon
|
||||||
string belowMinimumElevationMessage = SerialPort.ReadTerminated("#");
|
string belowMinimumElevationMessage = SerialPort.ReadTerminated("#");
|
||||||
throw new ASCOM.InvalidOperationException(belowMinimumElevationMessage);
|
throw new ASCOM.InvalidOperationException(belowMinimumElevationMessage);
|
||||||
default:
|
default:
|
||||||
throw new ASCOM.DriverException("This error should not happen");
|
throw new ASCOM.DriverException("This error should not happen");
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case false:
|
|
||||||
var maResponse = SerialPort.CommandChar(":MA#");
|
|
||||||
//:MA# Autostar, LX 16”, Autostar II – Slew to target Alt and Az
|
|
||||||
//Returns:
|
|
||||||
//0 - No fault
|
|
||||||
//1 – Fault
|
|
||||||
// LX200 – Not supported
|
|
||||||
|
|
||||||
if (maResponse == '1')
|
break;
|
||||||
{
|
case false:
|
||||||
throw new ASCOM.InvalidOperationException("fault");
|
var maResponse = SerialPort.CommandChar(":MA#");
|
||||||
}
|
//:MA# Autostar, LX 16”, Autostar II – Slew to target Alt and Az
|
||||||
break;
|
//Returns:
|
||||||
|
//0 - No fault
|
||||||
|
//1 – Fault
|
||||||
|
// LX200 – Not supported
|
||||||
|
|
||||||
|
if (maResponse == '1')
|
||||||
|
{
|
||||||
|
throw new ASCOM.InvalidOperationException("fault");
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
SerialPort.Unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AscomClasses\Telescope.cs" />
|
<Compile Include="AscomClasses\Telescope.cs" />
|
||||||
|
<Compile Include="Controller\FirmwareVersion.cs" />
|
||||||
<Compile Include="Controller\ISerialProcessor.cs" />
|
<Compile Include="Controller\ISerialProcessor.cs" />
|
||||||
<Compile Include="Controller\ITelescopeController.cs" />
|
<Compile Include="Controller\ITelescopeController.cs" />
|
||||||
<Compile Include="Controller\SerialProcessor.cs" />
|
<Compile Include="Controller\SerialProcessor.cs" />
|
||||||
|
|||||||
@@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
|
|||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
//
|
//
|
||||||
// TODO - Set your driver's version here
|
// TODO - Set your driver's version here
|
||||||
[assembly: AssemblyVersion("0.0.0.0")]
|
[assembly: AssemblyVersion("0.2.0.0")]
|
||||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
[assembly: AssemblyFileVersion("0.2.0.0")]
|
||||||
|
|||||||
Reference in New Issue
Block a user