Implementation of backlash compensation feature

This commit is contained in:
2020-06-02 23:52:25 +01:00
parent 3d47e03240
commit 946fb4b141
8 changed files with 352 additions and 73 deletions
@@ -313,7 +313,6 @@ namespace Meade.net.Focuser.UnitTests
_focuser.Halt();
_sharedResourcesWrapperMock.Verify( x => x.SendBlind(":FQ#"), Times.AtLeastOnce);
_utilMock.Verify( x => x.WaitForMilliseconds(250), Times.AtLeastOnce);
}
[Test]
@@ -395,29 +394,61 @@ namespace Meade.net.Focuser.UnitTests
[TestCase(-200)]
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuser( int position)
{
_profileProperties.BacklashCompensation = 0;
ConnectFocuser();
_focuser.Move(position);
if (position < 0)
{
_sharedResourcesWrapperMock.Verify( x => x.SendBlind("#:F-#"), Times.AtLeastOnce);
_sharedResourcesWrapperMock.Verify( x => x.SendBlind("#:F-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Never);
}
else
{
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F-#"), Times.Never);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.AtLeastOnce);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Once);
}
_sharedResourcesWrapperMock.Verify( x => x.Lock(It.IsAny<Action>()), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(250), Times.AtLeastOnce);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Never);
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Once());
_utilMock.Verify(x => x.WaitForMilliseconds(1000), Times.Once());
}
[TestCase(200, 3, 3)]
[TestCase(-200, 1, 0)]
public void Move_WhenIncrementIsNot0_ThenMovesFocuserAndStopsFocuserWithBacklashCompensation(int position, int hundredMsWaitCount, int backlashCompensaionCount)
{
_profileProperties.BacklashCompensation = 3000;
ConnectFocuser();
_focuser.Move(position);
if (position < 0)
{
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Never);
}
else
{
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F-#"), Times.Once);
_sharedResourcesWrapperMock.Verify(x => x.SendBlind("#:F+#"), Times.Exactly(2));
}
_sharedResourcesWrapperMock.Verify(x => x.Lock(It.IsAny<Action>()), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(position)), Times.Once);
_utilMock.Verify(x => x.WaitForMilliseconds(Math.Abs(_profileProperties.BacklashCompensation)), Times.Exactly(backlashCompensaionCount));
_utilMock.Verify(x => x.WaitForMilliseconds(100), Times.Exactly(hundredMsWaitCount));
_utilMock.Verify(x => x.WaitForMilliseconds(1000), Times.Once);
}
[Test]
public void Position_WhenCalled_ThenThrowsException()
{
@@ -140,6 +140,7 @@ namespace Meade.net.UnitTests
string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
string PrecisionDefault = "Unchanged";
string GuidingStyleDefault = "Auto";
string BacklashCompensationDefault = "3000";
Mock<IProfileWrapper> profileWrapperMock = new Mock<IProfileWrapper>();
profileWrapperMock.SetupAllProperties();
@@ -155,6 +156,8 @@ namespace Meade.net.UnitTests
.Returns(PrecisionDefault);
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Guiding Style", string.Empty, GuidingStyleDefault))
.Returns(GuidingStyleDefault);
profileWrapperMock.Setup(x => x.GetValue(DriverId, "Backlash Compensation", string.Empty, BacklashCompensationDefault))
.Returns(BacklashCompensationDefault);
IProfileWrapper profeWrapper = profileWrapperMock.Object;
@@ -172,6 +175,7 @@ namespace Meade.net.UnitTests
Assert.That(profileProperties.TraceLogger, Is.EqualTo(bool.Parse(TraceStateDefault)));
Assert.That(profileProperties.Precision, Is.EqualTo(PrecisionDefault));
Assert.That(profileProperties.GuidingStyle, Is.EqualTo(GuidingStyleDefault));
Assert.That(profileProperties.BacklashCompensation, Is.EqualTo(int.Parse(BacklashCompensationDefault)));
}
[TestCase("TCP")]
+29 -21
View File
@@ -47,6 +47,7 @@ namespace ASCOM.Meade.net
private static string _comPort; // Variables to hold the currrent device configuration
private static int _backlashCompensation;
/// <summary>
/// Private variable to hold an ASCOM Utilities object
/// </summary>
@@ -286,17 +287,11 @@ namespace ASCOM.Meade.net
CheckConnected("Halt");
//A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe.
//todo make this mockable
Stopwatch stopwatch = Stopwatch.StartNew();
while (stopwatch.ElapsedMilliseconds < 1000)
{
//todo fix this issue: A single halt command is sometimes missed by the #909 apm, so let's do it a few times to be safe.
_sharedResourcesWrapper.SendBlind(":FQ#");
//:FQ# Halt Focuser Motion
//Returns: Nothing
_utilities.WaitForMilliseconds(250);
}
}
public bool IsMoving
@@ -359,12 +354,31 @@ namespace ASCOM.Meade.net
if (position == 0)
return;
_sharedResourcesWrapper.Lock(() =>
{
MoveFocuser(position > 0, Math.Abs(position));
ApplyBacklashCompensation(position > 0);
//This gives the focuser time to physically stop.
_utilities.WaitForMilliseconds(1000);
});
}
private void ApplyBacklashCompensation(bool directionOut)
{
if (_backlashCompensation == 0)
return;
_tl.LogMessage("Move", "Applying backlash compensation");
if (directionOut)
{
MoveFocuser(directionOut, Math.Abs(_backlashCompensation));
_utilities.WaitForMilliseconds(Math.Abs(_backlashCompensation));
MoveFocuser(!directionOut, Math.Abs(_backlashCompensation));
}
}
private void MoveFocuser(bool directionOut, int steps)
{
_sharedResourcesWrapper.Lock(() =>
{
//_sharedResourcesWrapper.SendBlind("#:FF#");
//:FF# Set Focus speed to fastest setting
@@ -378,11 +392,8 @@ namespace ASCOM.Meade.net
//All others Not Supported
_utilities.WaitForMilliseconds(100);
//A Single focus command sometimes gets lost on the #909, so sending lots of them solves the issue.
//todo make this mockable
Stopwatch stopwatch = Stopwatch.StartNew();
while (stopwatch.ElapsedMilliseconds < steps)
{
//Todo fix this issue. A Single focus command sometimes gets lost on the #909, so sending lots of them solves the issue.
_sharedResourcesWrapper.SendBlind(directionOut ? "#:F+#" : "#:F-#");
//:F+# Start Focuser moving inward (toward objective)
//Returns: None
@@ -390,14 +401,9 @@ namespace ASCOM.Meade.net
//:F-# Start Focuser moving outward (away from objective)
//Returns: None
_utilities.WaitForMilliseconds(250);
}
_utilities.WaitForMilliseconds(steps);
Halt();
//This gives the focuser time to physically stop.
_utilities.WaitForMilliseconds(1000);
});
}
public int Position => throw new PropertyNotImplementedException("Position", false);
@@ -556,9 +562,11 @@ namespace ASCOM.Meade.net
var profileProperties = _sharedResourcesWrapper.ReadProfile();
_tl.Enabled = profileProperties.TraceLogger;
_comPort = profileProperties.ComPort;
_backlashCompensation = profileProperties.BacklashCompensation;
LogMessage("ReadProfile", $"Trace logger enabled: {_tl.Enabled}");
LogMessage("ReadProfile", $"Com Port: {_comPort}");
LogMessage("ReadProfile", $"Backlash Steps: {_backlashCompensation}");
}
/// <summary>
+1
View File
@@ -8,5 +8,6 @@ namespace ASCOM.Meade.net
public double GuideRateArcSecondsPerSecond { get; set; }
public string Precision { get; set; }
public string GuidingStyle { get; set; }
public int BacklashCompensation { get; set; }
}
}
+3 -1
View File
@@ -81,6 +81,7 @@ namespace ASCOM.Meade.net
cboGuidingStyle.SelectedItem = "Auto";
}
txtBacklashSteps.Text = profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture);
}
public ProfileProperties GetProfile()
@@ -91,7 +92,8 @@ namespace ASCOM.Meade.net
ComPort = comboBoxComPort.SelectedItem.ToString(),
GuideRateArcSecondsPerSecond = double.Parse(txtGuideRate.Text.Trim()),
Precision = cboPrecision.SelectedItem.ToString(),
GuidingStyle = cboGuidingStyle.SelectedItem.ToString()
GuidingStyle = cboGuidingStyle.SelectedItem.ToString(),
BacklashCompensation = int.Parse(txtBacklashSteps.Text)
};
return profileProperties;
+48
View File
@@ -47,6 +47,12 @@ namespace ASCOM.Meade.net
this.cboPrecision = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.cboGuidingStyle = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.txtBacklashSteps = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
this.SuspendLayout();
//
@@ -151,10 +157,46 @@ namespace ASCOM.Meade.net
resources.ApplyResources(this.cboGuidingStyle, "cboGuidingStyle");
this.cboGuidingStyle.Name = "cboGuidingStyle";
//
// label7
//
resources.ApplyResources(this.label7, "label7");
this.label7.Name = "label7";
//
// label8
//
resources.ApplyResources(this.label8, "label8");
this.label8.Name = "label8";
//
// txtBacklashSteps
//
resources.ApplyResources(this.txtBacklashSteps, "txtBacklashSteps");
this.txtBacklashSteps.Name = "txtBacklashSteps";
//
// label9
//
resources.ApplyResources(this.label9, "label9");
this.label9.Name = "label9";
//
// label10
//
resources.ApplyResources(this.label10, "label10");
this.label10.Name = "label10";
//
// label11
//
resources.ApplyResources(this.label11, "label11");
this.label11.Name = "label11";
//
// SetupDialogForm
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label11);
this.Controls.Add(this.label10);
this.Controls.Add(this.txtBacklashSteps);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.cboGuidingStyle);
this.Controls.Add(this.label6);
this.Controls.Add(this.cboPrecision);
@@ -200,5 +242,11 @@ namespace ASCOM.Meade.net
private ComboBox cboPrecision;
private Label label6;
private ComboBox cboGuidingStyle;
private Label label7;
private Label label8;
private TextBox txtBacklashSteps;
private Label label9;
private Label label10;
private Label label11;
}
}
+208 -28
View File
@@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cmdOK.Location" type="System.Drawing.Point, System.Drawing">
<value>281, 250</value>
<value>281, 387</value>
</data>
<data name="cmdOK.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 24</value>
@@ -145,13 +145,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cmdOK.ZOrder" xml:space="preserve">
<value>14</value>
<value>20</value>
</data>
<data name="cmdCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
</data>
<data name="cmdCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>281, 280</value>
<value>281, 417</value>
</data>
<data name="cmdCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 25</value>
@@ -172,7 +172,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cmdCancel.ZOrder" xml:space="preserve">
<value>13</value>
<value>19</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 9</value>
@@ -196,7 +196,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>12</value>
<value>18</value>
</data>
<data name="picASCOM.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
@@ -223,13 +223,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;picASCOM.ZOrder" xml:space="preserve">
<value>11</value>
<value>17</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 90</value>
<value>12, 90</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
@@ -250,13 +250,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>10</value>
<value>16</value>
</data>
<data name="chkTrace.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="chkTrace.Location" type="System.Drawing.Point, System.Drawing">
<value>86, 136</value>
<value>97, 114</value>
</data>
<data name="chkTrace.Size" type="System.Drawing.Size, System.Drawing">
<value>69, 17</value>
@@ -277,10 +277,10 @@
<value>$this</value>
</data>
<data name="&gt;&gt;chkTrace.ZOrder" xml:space="preserve">
<value>9</value>
<value>15</value>
</data>
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
<value>86, 87</value>
<value>97, 87</value>
</data>
<data name="comboBoxComPort.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 21</value>
@@ -298,13 +298,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;comboBoxComPort.ZOrder" xml:space="preserve">
<value>8</value>
<value>14</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 162</value>
<value>12, 202</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
@@ -325,10 +325,10 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>7</value>
<value>13</value>
</data>
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
<value>86, 159</value>
<value>97, 199</value>
</data>
<data name="txtGuideRate.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 20</value>
@@ -349,13 +349,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;txtGuideRate.ZOrder" xml:space="preserve">
<value>6</value>
<value>12</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>138, 162</value>
<value>149, 202</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>122, 13</value>
@@ -376,13 +376,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>5</value>
<value>11</value>
</data>
<data name="lblPercentOfSiderealRate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblPercentOfSiderealRate.Location" type="System.Drawing.Point, System.Drawing">
<value>138, 175</value>
<value>149, 215</value>
</data>
<data name="lblPercentOfSiderealRate.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 13</value>
@@ -403,13 +403,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;lblPercentOfSiderealRate.ZOrder" xml:space="preserve">
<value>4</value>
<value>10</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 194</value>
<value>12, 234</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 13</value>
@@ -430,7 +430,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>3</value>
<value>9</value>
</data>
<data name="cboPrecision.Items" xml:space="preserve">
<value>Unchanged</value>
@@ -442,7 +442,7 @@
<value>High</value>
</data>
<data name="cboPrecision.Location" type="System.Drawing.Point, System.Drawing">
<value>86, 191</value>
<value>97, 231</value>
</data>
<data name="cboPrecision.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 21</value>
@@ -460,7 +460,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cboPrecision.ZOrder" xml:space="preserve">
<value>2</value>
<value>8</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@@ -469,7 +469,7 @@
<value>NoControl</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 221</value>
<value>12, 261</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 13</value>
@@ -490,7 +490,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>1</value>
<value>7</value>
</data>
<data name="cboGuidingStyle.Items" xml:space="preserve">
<value>Auto</value>
@@ -502,7 +502,7 @@
<value>Pulse guiding</value>
</data>
<data name="cboGuidingStyle.Location" type="System.Drawing.Point, System.Drawing">
<value>86, 218</value>
<value>97, 258</value>
</data>
<data name="cboGuidingStyle.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 21</value>
@@ -520,6 +520,186 @@
<value>$this</value>
</data>
<data name="&gt;&gt;cboGuidingStyle.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label7.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
</data>
<data name="label7.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 176</value>
</data>
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
<value>66, 13</value>
</data>
<data name="label7.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="label7.Text" xml:space="preserve">
<value>Telescope</value>
</data>
<data name="&gt;&gt;label7.Name" xml:space="preserve">
<value>label7</value>
</data>
<data name="&gt;&gt;label7.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label7.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="label8.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label8.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
</data>
<data name="label8.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 317</value>
</data>
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 13</value>
</data>
<data name="label8.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="label8.Text" xml:space="preserve">
<value>Focuser</value>
</data>
<data name="&gt;&gt;label8.Name" xml:space="preserve">
<value>label8</value>
</data>
<data name="&gt;&gt;label8.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label8.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label8.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="txtBacklashSteps.Location" type="System.Drawing.Point, System.Drawing">
<value>97, 335</value>
</data>
<data name="txtBacklashSteps.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 20</value>
</data>
<data name="txtBacklashSteps.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="txtBacklashSteps.Text" xml:space="preserve">
<value>3000</value>
</data>
<data name="&gt;&gt;txtBacklashSteps.Name" xml:space="preserve">
<value>txtBacklashSteps</value>
</data>
<data name="&gt;&gt;txtBacklashSteps.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;txtBacklashSteps.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;txtBacklashSteps.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label9.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 338</value>
</data>
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
<value>79, 13</value>
</data>
<data name="label9.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
</data>
<data name="label9.Text" xml:space="preserve">
<value>Backlash steps</value>
</data>
<data name="&gt;&gt;label9.Name" xml:space="preserve">
<value>label9</value>
</data>
<data name="&gt;&gt;label9.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label9.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label10.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
<value>149, 338</value>
</data>
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
<value>20, 13</value>
</data>
<data name="label10.TabIndex" type="System.Int32, mscorlib">
<value>20</value>
</data>
<data name="label10.Text" xml:space="preserve">
<value>ms</value>
</data>
<data name="&gt;&gt;label10.Name" xml:space="preserve">
<value>label10</value>
</data>
<data name="&gt;&gt;label10.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label10.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label11.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 8.25pt, style=Bold</value>
</data>
<data name="label11.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label11.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 67</value>
</data>
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 13</value>
</data>
<data name="label11.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
</data>
<data name="label11.Text" xml:space="preserve">
<value>Connection</value>
</data>
<data name="&gt;&gt;label11.Name" xml:space="preserve">
<value>label11</value>
</data>
<data name="&gt;&gt;label11.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label11.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -529,7 +709,7 @@
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>350, 313</value>
<value>350, 450</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
+5
View File
@@ -140,6 +140,7 @@ namespace ASCOM.Meade.net
private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second";
private const string PrecisionProfileName = "Precision";
private const string GuidingStyleProfileName = "Guiding Style";
private const string BacklashCompensationName = "Backlash Compensation";
public static void WriteProfile(ProfileProperties profileProperties)
{
@@ -153,6 +154,7 @@ namespace ASCOM.Meade.net
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString(CultureInfo.InvariantCulture));
driverProfile.WriteValue(DriverId, PrecisionProfileName, profileProperties.Precision);
driverProfile.WriteValue(DriverId, GuidingStyleProfileName, profileProperties.GuidingStyle);
driverProfile.WriteValue(DriverId, BacklashCompensationName, profileProperties.BacklashCompensation.ToString());
}
}
}
@@ -162,6 +164,8 @@ namespace ASCOM.Meade.net
private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
private const string PrecisionDefault = "Unchanged";
private const string GuidingStyleDefault = "Auto";
private const string BacklashCompensationDefault = "3000";
public static ProfileProperties ReadProfile()
@@ -177,6 +181,7 @@ namespace ASCOM.Meade.net
profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault), NumberFormatInfo.InvariantInfo);
profileProperties.Precision = driverProfile.GetValue(DriverId, PrecisionProfileName, string.Empty, PrecisionDefault);
profileProperties.GuidingStyle = driverProfile.GetValue(DriverId, GuidingStyleProfileName, string.Empty, GuidingStyleDefault);
profileProperties.BacklashCompensation = Convert.ToInt32(driverProfile.GetValue(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault));
}
return profileProperties;