Added support for CommandBlind and CommandString
Modified the tracking rates to be setable. However, the get is now simulated.
This commit is contained in:
@@ -20,7 +20,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
double Declination { get; }
|
||||
double TargetRightAscension { get; set; }
|
||||
double TargetDeclination { get; set; }
|
||||
DriveRates TrackingRate { get; }
|
||||
DriveRates TrackingRate { get; set; }
|
||||
int FocuserMaxIncrement { get; set; }
|
||||
int FocuserMaxStep { get; set; }
|
||||
void AbortSlew();
|
||||
@@ -36,5 +36,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
void MoveAxis(TelescopeAxes axis, double rate);
|
||||
void FocuserHalt();
|
||||
void FocuserMove(int position);
|
||||
string CommandString(string command, bool raw);
|
||||
void CommandBlind(string command, bool raw);
|
||||
}
|
||||
}
|
||||
@@ -478,21 +478,23 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
}
|
||||
}
|
||||
|
||||
private DriveRates _trackingRate = DriveRates.driveSidereal;
|
||||
public DriveRates TrackingRate
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = SerialPort.CommandTerminated(":GT#", "#");
|
||||
//var result = SerialPort.CommandTerminated(":GT#", "#");
|
||||
|
||||
double rate = double.Parse(result);
|
||||
//double rate = double.Parse(result);
|
||||
|
||||
|
||||
if (rate == 60.1)
|
||||
return DriveRates.driveLunar;
|
||||
else if (rate == 60.1)
|
||||
return DriveRates.driveSidereal;
|
||||
//if (rate == 60.1)
|
||||
// return DriveRates.driveLunar;
|
||||
//else if (rate == 60.1)
|
||||
// return DriveRates.driveSidereal;
|
||||
|
||||
return DriveRates.driveKing;
|
||||
//return DriveRates.driveKing;
|
||||
return _trackingRate;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -508,16 +510,20 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
//:TL# Set Lunar Tracking Rage
|
||||
//Returns: Nothing
|
||||
break;
|
||||
case DriveRates.driveSolar:
|
||||
SerialPort.Command(":TS#");
|
||||
//:TS# Select Solar tracking rate. [LS Only]
|
||||
//Returns: Nothing
|
||||
break;
|
||||
//case DriveRates.driveSolar:
|
||||
// SerialPort.Command(":TS#");
|
||||
// //:TS# Select Solar tracking rate. [LS Only]
|
||||
// //Returns: Nothing
|
||||
// break;
|
||||
case DriveRates.driveKing:
|
||||
//:TM# Select custom tracking rate [ no-op in Autostar II]
|
||||
//Returns: Nothing
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
||||
}
|
||||
|
||||
_trackingRate = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,6 +878,16 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
}
|
||||
}
|
||||
|
||||
public string CommandString(string command, bool raw)
|
||||
{
|
||||
return SerialPort.CommandTerminated(command, "#");
|
||||
}
|
||||
|
||||
public void CommandBlind(string command, bool raw)
|
||||
{
|
||||
SerialPort.Command(command);
|
||||
}
|
||||
|
||||
private void MoveFocuser(bool directionOut, int steps)
|
||||
{
|
||||
SerialPort.Command(directionOut ? ":F+#" : ":F-#");
|
||||
|
||||
Reference in New Issue
Block a user