Impemented the code changes to return co-ordinated when the telescope is parked.

Also added loads of checks for if the telescope is parked.
This commit is contained in:
2021-04-24 20:52:21 +01:00
parent f4eafa668d
commit 18ea52c972
6 changed files with 97 additions and 25 deletions
@@ -0,0 +1,8 @@
namespace ASCOM.Meade.net.AstroMaths
{
public class HorizonCoordinates
{
public double Altitude { get; set; }
public double Azimuth { get; set; }
}
}
+2
View File
@@ -137,6 +137,7 @@
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="GarbageCollection.cs" />
<Compile Include="AstroMaths\HorizonCoordinates.cs" />
<Compile Include="LocalServer.cs" />
<Compile Include="MeadeTelescopeBase.cs" />
<Compile Include="ParkedBehaviour.cs" />
@@ -201,6 +202,7 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
+12 -8
View File
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using ASCOM.Meade.net.AstroMaths;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
@@ -30,10 +31,9 @@ namespace ASCOM.Meade.net
protected short ProfileSettleTime;
protected bool SendDateTime;
protected ParkedBehaviour ParkedBehaviour;
protected double ParkedAzimuth;
protected double ParkedAlt;
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
protected HorizonCoordinates ParkedAltAz;
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
public MeadeTelescopeBase()
{
@@ -75,9 +75,13 @@ namespace ASCOM.Meade.net
ProfileSettleTime = profileProperties.SettleTime;
SendDateTime = profileProperties.SendDateTime;
ParkedBehaviour = profileProperties.ParkedBehaviour;
ParkedAlt = profileProperties.ParkedAlt;
ParkedAzimuth = profileProperties.ParkedAz;
var ParkedAltAz = new HorizonCoordinates
{
Altitude = profileProperties.ParkedAlt,
Azimuth = profileProperties.ParkedAz
};
LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}");
LogMessage("ReadProfile", $"Com Port: {ComPort}");
LogMessage("ReadProfile", $"Backlash Steps: {BacklashCompensation}");
@@ -89,8 +93,8 @@ namespace ASCOM.Meade.net
LogMessage("ReadProfile", $"Settle Time after slew: {ProfileSettleTime}");
LogMessage("ReadProfile", $"Send date and time on connect: {SendDateTime}");
LogMessage("ReadProfile", $"Parked Behaviour: {ParkedBehaviour}");
LogMessage("ReadProfile", $"Parked Alt: {ParkedAlt}");
LogMessage("ReadProfile", $"Parked Az: {ParkedAzimuth}");
LogMessage("ReadProfile", $"Parked Alt: {ParkedAltAz.Altitude}");
LogMessage("ReadProfile", $"Parked Az: {ParkedAltAz.Azimuth}");
}
/// <summary>