Added support for CommandBlind and CommandString
Modified the tracking rates to be setable. However, the get is now simulated.
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
|
|||||||
@@ -163,16 +163,20 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
|
|
||||||
public void CommandBlind(string command, bool raw)
|
public void CommandBlind(string command, bool raw)
|
||||||
{
|
{
|
||||||
|
tl.LogMessage("CommandBlind", $"command={command} raw={raw}");
|
||||||
|
|
||||||
CheckConnected("CommandBlind");
|
CheckConnected("CommandBlind");
|
||||||
// Call CommandString and return as soon as it finishes
|
// Call CommandString and return as soon as it finishes
|
||||||
//this.CommandString(command, raw);
|
//this.CommandString(command, raw);
|
||||||
|
_telescopeController.CommandBlind(command, raw);
|
||||||
// or
|
// or
|
||||||
throw new ASCOM.MethodNotImplementedException("CommandBlind");
|
//throw new ASCOM.MethodNotImplementedException("CommandBlind");
|
||||||
// DO NOT have both these sections! One or the other
|
// DO NOT have both these sections! One or the other
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CommandBool(string command, bool raw)
|
public bool CommandBool(string command, bool raw)
|
||||||
{
|
{
|
||||||
|
tl.LogMessage("CommandBool", $"command={command} raw={raw}");
|
||||||
CheckConnected("CommandBool");
|
CheckConnected("CommandBool");
|
||||||
string ret = CommandString(command, raw);
|
string ret = CommandString(command, raw);
|
||||||
// TODO decode the return string and return true or false
|
// TODO decode the return string and return true or false
|
||||||
@@ -183,11 +187,13 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
|
|
||||||
public string CommandString(string command, bool raw)
|
public string CommandString(string command, bool raw)
|
||||||
{
|
{
|
||||||
|
tl.LogMessage("CommandString", $"command={command} raw={raw}");
|
||||||
// it's a good idea to put all the low level communication with the device here,
|
// it's a good idea to put all the low level communication with the device here,
|
||||||
// then all communication calls this function
|
// then all communication calls this function
|
||||||
// you need something to ensure that only one command is in progress at a time
|
// you need something to ensure that only one command is in progress at a time
|
||||||
CheckConnected("CommandString");
|
CheckConnected("CommandString");
|
||||||
throw new ASCOM.MethodNotImplementedException("CommandString");
|
//throw new ASCOM.MethodNotImplementedException("CommandString");
|
||||||
|
return _telescopeController.CommandString(command, raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
@@ -455,8 +461,8 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
tl.LogMessage("CanSetTracking", "Get - " + false.ToString());
|
tl.LogMessage("CanSetTracking", "Get - " + true.ToString());
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,19 +882,20 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _tracking = true;
|
||||||
public bool Tracking
|
public bool Tracking
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
//todo implementing this, it exists.
|
//todo implementing this, it exists.
|
||||||
bool tracking = true;
|
|
||||||
tl.LogMessage("Tracking", "Get - " + tracking.ToString());
|
tl.LogMessage("Tracking", $"Get - {_tracking}" );
|
||||||
return tracking;
|
return _tracking;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
tl.LogMessage("Tracking Set", "Not implemented");
|
tl.LogMessage($"Tracking Set", $"{value}");
|
||||||
throw new ASCOM.PropertyNotImplementedException("Tracking", true);
|
_tracking = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -902,8 +909,8 @@ namespace ASCOM.MeadeAutostar497
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
tl.LogMessage("TrackingRate Set", "Not implemented");
|
tl.LogMessage("TrackingRate Set", $"{value}");
|
||||||
throw new ASCOM.PropertyNotImplementedException("TrackingRate", true);
|
_telescopeController.TrackingRate = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
double Declination { get; }
|
double Declination { get; }
|
||||||
double TargetRightAscension { get; set; }
|
double TargetRightAscension { get; set; }
|
||||||
double TargetDeclination { get; set; }
|
double TargetDeclination { get; set; }
|
||||||
DriveRates TrackingRate { get; }
|
DriveRates TrackingRate { get; set; }
|
||||||
int FocuserMaxIncrement { get; set; }
|
int FocuserMaxIncrement { get; set; }
|
||||||
int FocuserMaxStep { get; set; }
|
int FocuserMaxStep { get; set; }
|
||||||
void AbortSlew();
|
void AbortSlew();
|
||||||
@@ -36,5 +36,7 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
void MoveAxis(TelescopeAxes axis, double rate);
|
void MoveAxis(TelescopeAxes axis, double rate);
|
||||||
void FocuserHalt();
|
void FocuserHalt();
|
||||||
void FocuserMove(int position);
|
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
|
public DriveRates TrackingRate
|
||||||
{
|
{
|
||||||
get
|
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)
|
//if (rate == 60.1)
|
||||||
return DriveRates.driveLunar;
|
// return DriveRates.driveLunar;
|
||||||
else if (rate == 60.1)
|
//else if (rate == 60.1)
|
||||||
return DriveRates.driveSidereal;
|
// return DriveRates.driveSidereal;
|
||||||
|
|
||||||
return DriveRates.driveKing;
|
//return DriveRates.driveKing;
|
||||||
|
return _trackingRate;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -508,16 +510,20 @@ namespace ASCOM.MeadeAutostar497.Controller
|
|||||||
//:TL# Set Lunar Tracking Rage
|
//:TL# Set Lunar Tracking Rage
|
||||||
//Returns: Nothing
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
case DriveRates.driveSolar:
|
//case DriveRates.driveSolar:
|
||||||
SerialPort.Command(":TS#");
|
// SerialPort.Command(":TS#");
|
||||||
//:TS# Select Solar tracking rate. [LS Only]
|
// //:TS# Select Solar tracking rate. [LS Only]
|
||||||
//Returns: Nothing
|
// //Returns: Nothing
|
||||||
break;
|
// break;
|
||||||
case DriveRates.driveKing:
|
case DriveRates.driveKing:
|
||||||
|
//:TM# Select custom tracking rate [ no-op in Autostar II]
|
||||||
|
//Returns: Nothing
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
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)
|
private void MoveFocuser(bool directionOut, int steps)
|
||||||
{
|
{
|
||||||
SerialPort.Command(directionOut ? ":F+#" : ":F-#");
|
SerialPort.Command(directionOut ? ":F+#" : ":F-#");
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<RegisterForComInterop>true</RegisterForComInterop>
|
<RegisterForComInterop>true</RegisterForComInterop>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
|
|||||||
Reference in New Issue
Block a user