Downgraded required .net to v4.0.

Added suppoer for "Handbox" custom action
Changes how the focuser in and out functions.  Now sends multiple :F+/-# and multiple stop commands to help get over problems with the #909 missing commands.

Added support for checking for the older firmware that does not support the guiding commands, so uses guide rate slew instead.
This commit is contained in:
2019-06-08 20:13:36 +01:00
parent 5501e97b7e
commit 22de5679b7
30 changed files with 196 additions and 69 deletions
@@ -15,7 +15,7 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<ApplicationIcon>ASCOM.ico</ApplicationIcon>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>ASCOMDriverTemplate.snk</AssemblyOriginatorKeyFile>
@@ -46,7 +46,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>true</RegisterForComInterop>
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -63,6 +63,10 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\bin\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<OutputPath>..\bin\Debug\</OutputPath>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="ASCOM.Astrometry, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
<Reference Include="ASCOM.Attributes, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7, processorArchitecture=MSIL" />
@@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
//
// TODO - Set your driver's version here
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")]
+1 -1
View File
@@ -19,7 +19,7 @@ namespace ASCOM.Meade.net.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
+1 -1
View File
@@ -12,7 +12,7 @@ namespace ASCOM.Meade.net.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+106 -8
View File
@@ -165,15 +165,92 @@ namespace ASCOM.Meade.net
get
{
tl.LogMessage("SupportedActions Get", "Returning empty arraylist");
return new ArrayList();
var supportedActions = new ArrayList();
supportedActions.Add("handbox");
return supportedActions;
}
}
public string Action(string actionName, string actionParameters)
{
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
throw new ASCOM.ActionNotImplementedException("Action " + actionName +
" is not implemented by this driver");
switch (actionName.ToLower())
{
case "handbox":
switch (actionParameters.ToLower())
{
//Read the screen
case "readdisplay":
var output = SharedResources.SendString(":ED#");
return output;
//top row of buttons
case "enter":
SharedResources.SendBlind(":EK13#");
break;
case "mode":
SharedResources.SendBlind(":EK9#");
break;
case "goto":
SharedResources.SendBlind(":EK24#");
break;
case "0": //light and 0
SharedResources.SendBlind(":EK48#");
break;
case "1":
SharedResources.SendBlind(":EK49#");
break;
case "2":
SharedResources.SendBlind(":EK50#");
break;
case "3":
SharedResources.SendBlind(":EK51#");
break;
case "4":
SharedResources.SendBlind(":EK52#");
break;
case "5":
SharedResources.SendBlind(":EK53#");
break;
case "6":
SharedResources.SendBlind(":EK54#");
break;
case "7":
SharedResources.SendBlind(":EK55#");
break;
case "8":
SharedResources.SendBlind(":EK56#");
break;
case "9":
SharedResources.SendBlind(":EK57#");
break;
case "up":
SharedResources.SendBlind(":EK94#");
break;
case "down":
SharedResources.SendBlind(":EK118#");
break;
case "back":
SharedResources.SendBlind(":EK87#");
break;
case "forward":
SharedResources.SendBlind(":EK69#");
break;
case "?":
SharedResources.SendBlind(":EK63#");
break;
default:
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
throw new ASCOM.ActionNotImplementedException($"Action {actionName}({actionParameters}) is not implemented by this driver");
}
break;
default:
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
throw new ASCOM.ActionNotImplementedException($"Action {actionName} is not implemented by this driver");
}
return string.Empty;
}
public void CommandBlind(string command, bool raw)
@@ -240,9 +317,15 @@ namespace ASCOM.Meade.net
SharedResources.Connect("Serial");
try
{
LogMessage("Connected Set", $"Commented to port {comPort}. Product: {SharedResources.ProductName} Version:{SharedResources.FirmwareVersion}");
SelectSite(1);
SetLongFormat(true);
_userNewerPulseGuiding = IsNewPulseGuidingSupported();
_connectedState = true;
}
catch (Exception)
@@ -265,6 +348,23 @@ namespace ASCOM.Meade.net
}
}
private bool IsNewPulseGuidingSupported()
{
if (SharedResources.ProductName == SharedResources.AUTOSTAR497)
{
return FirmwareIsGreaterThan(SharedResources.AUTOSTAR497_31EE);
}
return false;
}
private bool FirmwareIsGreaterThan(string minVersion)
{
var currentVersion = SharedResources.FirmwareVersion;
var comparison = currentVersion.CompareTo(minVersion);
return (comparison >= 0);
}
private void SetLongFormat(bool setLongFormat)
{
SharedResources.Lock(() =>
@@ -312,8 +412,7 @@ namespace ASCOM.Meade.net
{
Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
// TODO customise this driver description
string driverInfo = "Information about the driver itself. Version: " +
String.Format(CultureInfo.InvariantCulture, "{0}.{1}", version.Major,
string driverInfo = "Meade Generic .net driver. Version: " + String.Format(CultureInfo.InvariantCulture, "{0}.{1}", version.Major,
version.Minor);
tl.LogMessage("DriverInfo Get", driverInfo);
return driverInfo;
@@ -948,8 +1047,7 @@ namespace ASCOM.Meade.net
AtPark = true;
}
private readonly bool
_userNewerPulseGuiding = true; //todo make this a device setting based on firmware revision
private bool _userNewerPulseGuiding = true;
public void PulseGuide(GuideDirections direction, int duration)
{
+1 -1
View File
@@ -5,4 +5,4 @@
<section name="ASCOM.DeviceName.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>