Added support for saving the site elevation into the driver profile
This commit is contained in:
@@ -1537,25 +1537,57 @@ namespace Meade.net.Telescope.UnitTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SiteElevation_Get_ThenThrowsException()
|
||||
public void SiteElevation_Get_WhenNotConnectedThrowsException()
|
||||
{
|
||||
var excpetion = Assert.Throws<PropertyNotImplementedException>(() =>
|
||||
var exception = Assert.Throws<NotConnectedException>(() =>
|
||||
{
|
||||
var result = _telescope.SiteElevation;
|
||||
Assert.Fail($"{result} should not have returned");
|
||||
var elevation = _telescope.SiteElevation;
|
||||
});
|
||||
|
||||
Assert.That(excpetion.Property, Is.EqualTo("SiteElevation"));
|
||||
Assert.That(excpetion.AccessorSet, Is.False);
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: SiteElevation Get"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SiteElevation_Set_ThenThrowsException()
|
||||
public void SiteElevation_Get_WhenConnectedReturnsExpectedValue()
|
||||
{
|
||||
var excpetion = Assert.Throws<PropertyNotImplementedException>(() => { _telescope.SiteElevation = 0; });
|
||||
double expectedValue = 2000;
|
||||
|
||||
Assert.That(excpetion.Property, Is.EqualTo("SiteElevation"));
|
||||
Assert.That(excpetion.AccessorSet, Is.True);
|
||||
_profileProperties.SiteElevation = expectedValue;
|
||||
|
||||
ConnectTelescope();
|
||||
|
||||
var result = _telescope.SiteElevation;
|
||||
Assert.That(result, Is.EqualTo(expectedValue));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SiteElevation_Set_WhenNotConnectedThrowsException()
|
||||
{
|
||||
var exception = Assert.Throws<NotConnectedException>(() =>
|
||||
{
|
||||
_telescope.SiteElevation = 1000;
|
||||
});
|
||||
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: SiteElevation Set"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SiteElevation_Set_WhenConnectedCanPersistNewValue()
|
||||
{
|
||||
double newElevation = 1000;
|
||||
|
||||
double writtenSiteElevation = 0;
|
||||
_sharedResourcesWrapperMock.Setup(x => x.WriteProfile(It.IsAny<ProfileProperties>())).Callback<ProfileProperties>(
|
||||
profile =>
|
||||
{
|
||||
writtenSiteElevation = profile.SiteElevation;
|
||||
});
|
||||
|
||||
ConnectTelescope();
|
||||
|
||||
_telescope.SiteElevation = newElevation;
|
||||
|
||||
Assert.That(_telescope.SiteElevation, Is.EqualTo(newElevation));
|
||||
_sharedResourcesWrapperMock.Verify( x => x.WriteProfile(It.IsAny<ProfileProperties>()), Times.Once);
|
||||
Assert.That(writtenSiteElevation, Is.EqualTo(newElevation));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -1540,14 +1540,26 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
LogMessage("SiteElevation Get", "Not implemented");
|
||||
throw new PropertyNotImplementedException("SiteElevation", false);
|
||||
CheckConnected("SiteElevation Get");
|
||||
|
||||
LogMessage("SiteElevation", $"Get {base.SiteElevation}");
|
||||
return base.SiteElevation;
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("SiteElevation Set", "Not implemented");
|
||||
throw new PropertyNotImplementedException("SiteElevation", true);
|
||||
CheckConnected("SiteElevation Set");
|
||||
|
||||
LogMessage("SiteElevation", $"Set: {value}");
|
||||
if (value == base.SiteElevation)
|
||||
{
|
||||
LogMessage("SiteElevation", $"Set: no change detected");
|
||||
return;
|
||||
}
|
||||
|
||||
LogMessage("SiteElevation", $"Set: {value} was {base.SiteElevation}");
|
||||
base.SiteElevation = value;
|
||||
base.UpdateSiteElevation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace ASCOM.Meade.net
|
||||
protected double GuideRate;
|
||||
protected string Precision;
|
||||
protected string GuidingStyle;
|
||||
protected double SiteElevation;
|
||||
|
||||
protected readonly ISharedResourcesWrapper SharedResourcesWrapper;
|
||||
|
||||
@@ -65,6 +66,7 @@ namespace ASCOM.Meade.net
|
||||
GuideRate = profileProperties.GuideRateArcSecondsPerSecond;
|
||||
Precision = profileProperties.Precision;
|
||||
GuidingStyle = profileProperties.GuidingStyle.ToLower();
|
||||
SiteElevation = profileProperties.SiteElevation;
|
||||
|
||||
LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}");
|
||||
LogMessage("ReadProfile", $"Com Port: {ComPort}");
|
||||
@@ -73,6 +75,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("ReadProfile", $"Guide Rate: {GuideRate}");
|
||||
LogMessage("ReadProfile", $"Precision: {Precision}");
|
||||
LogMessage("ReadProfile", $"Guiding Style: {GuidingStyle}");
|
||||
LogMessage("ReadProfile", $"Site Elevation: {SiteElevation}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -133,5 +136,12 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void UpdateSiteElevation()
|
||||
{
|
||||
var profileProperties = SharedResourcesWrapper.ReadProfile();
|
||||
profileProperties.SiteElevation = SiteElevation;
|
||||
SharedResourcesWrapper.WriteProfile(profileProperties);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,6 @@ namespace ASCOM.Meade.net
|
||||
public bool ReverseFocusDirection { get; set; }
|
||||
public bool DynamicBreaking { get; set; }
|
||||
public bool RtsDtrEnabled { get; set; }
|
||||
public double SiteElevation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,7 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
|
||||
txtBacklashSteps.Text = profileProperties.BacklashCompensation.ToString(CultureInfo.CurrentCulture);
|
||||
txtElevation.Text = profileProperties.SiteElevation.ToString(CultureInfo.CurrentCulture);
|
||||
|
||||
cbxReverseDirection.Checked = profileProperties.ReverseFocusDirection;
|
||||
cbxDynamicBreaking.Checked = profileProperties.DynamicBreaking;
|
||||
@@ -101,7 +102,8 @@ namespace ASCOM.Meade.net
|
||||
GuidingStyle = cboGuidingStyle.SelectedItem.ToString(),
|
||||
BacklashCompensation = int.Parse(txtBacklashSteps.Text),
|
||||
ReverseFocusDirection = cbxReverseDirection.Checked,
|
||||
DynamicBreaking = cbxDynamicBreaking.Checked
|
||||
DynamicBreaking = cbxDynamicBreaking.Checked,
|
||||
SiteElevation = double.Parse(txtElevation.Text)
|
||||
};
|
||||
|
||||
return profileProperties;
|
||||
@@ -160,5 +162,23 @@ namespace ASCOM.Meade.net
|
||||
//txtGuideRate.Enabled = false;
|
||||
//cboPrecision.Enabled = false;
|
||||
}
|
||||
|
||||
private void txtElevation_TextChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtElevation.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show("Please enter only numbers.");
|
||||
txtElevation.Text = txtElevation.Text.Remove(txtElevation.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void txtBacklashSteps_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (System.Text.RegularExpressions.Regex.IsMatch(txtBacklashSteps.Text, "[^0-9]"))
|
||||
{
|
||||
MessageBox.Show("Please enter only numbers.");
|
||||
txtBacklashSteps.Text = txtElevation.Text.Remove(txtBacklashSteps.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+26
@@ -58,6 +58,9 @@ namespace ASCOM.Meade.net
|
||||
this.cbxDynamicBreaking = new System.Windows.Forms.CheckBox();
|
||||
this.cbxRtsDtr = new System.Windows.Forms.CheckBox();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.txtElevation = new System.Windows.Forms.TextBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -176,6 +179,7 @@ namespace ASCOM.Meade.net
|
||||
//
|
||||
resources.ApplyResources(this.txtBacklashSteps, "txtBacklashSteps");
|
||||
this.txtBacklashSteps.Name = "txtBacklashSteps";
|
||||
this.txtBacklashSteps.TextChanged += new System.EventHandler(this.txtBacklashSteps_TextChanged);
|
||||
//
|
||||
// label9
|
||||
//
|
||||
@@ -211,10 +215,29 @@ namespace ASCOM.Meade.net
|
||||
this.toolTip1.SetToolTip(this.cbxRtsDtr, resources.GetString("cbxRtsDtr.ToolTip"));
|
||||
this.cbxRtsDtr.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
resources.ApplyResources(this.label12, "label12");
|
||||
this.label12.Name = "label12";
|
||||
//
|
||||
// txtElevation
|
||||
//
|
||||
resources.ApplyResources(this.txtElevation, "txtElevation");
|
||||
this.txtElevation.Name = "txtElevation";
|
||||
this.txtElevation.TextChanged += new System.EventHandler(this.txtElevation_TextChanged_1);
|
||||
//
|
||||
// label13
|
||||
//
|
||||
resources.ApplyResources(this.label13, "label13");
|
||||
this.label13.Name = "label13";
|
||||
//
|
||||
// SetupDialogForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label13);
|
||||
this.Controls.Add(this.txtElevation);
|
||||
this.Controls.Add(this.label12);
|
||||
this.Controls.Add(this.cbxRtsDtr);
|
||||
this.Controls.Add(this.cbxDynamicBreaking);
|
||||
this.Controls.Add(this.cbxReverseDirection);
|
||||
@@ -279,5 +302,8 @@ namespace ASCOM.Meade.net
|
||||
private CheckBox cbxDynamicBreaking;
|
||||
private CheckBox cbxRtsDtr;
|
||||
private ToolTip toolTip1;
|
||||
private Label label12;
|
||||
private TextBox txtElevation;
|
||||
private Label label13;
|
||||
}
|
||||
}
|
||||
+121
-43
@@ -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, 413</value>
|
||||
<value>281, 457</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=">>cmdOK.ZOrder" xml:space="preserve">
|
||||
<value>23</value>
|
||||
<value>26</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, 443</value>
|
||||
<value>281, 487</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=">>cmdCancel.ZOrder" xml:space="preserve">
|
||||
<value>22</value>
|
||||
<value>25</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=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>21</value>
|
||||
<value>24</value>
|
||||
</data>
|
||||
<data name="picASCOM.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Right</value>
|
||||
@@ -223,7 +223,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>picASCOM.ZOrder" xml:space="preserve">
|
||||
<value>20</value>
|
||||
<value>23</value>
|
||||
</data>
|
||||
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -250,7 +250,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label2.ZOrder" xml:space="preserve">
|
||||
<value>19</value>
|
||||
<value>22</value>
|
||||
</data>
|
||||
<data name="chkTrace.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -277,7 +277,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>chkTrace.ZOrder" xml:space="preserve">
|
||||
<value>18</value>
|
||||
<value>21</value>
|
||||
</data>
|
||||
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 87</value>
|
||||
@@ -298,13 +298,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>comboBoxComPort.ZOrder" xml:space="preserve">
|
||||
<value>17</value>
|
||||
<value>20</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>12, 202</value>
|
||||
<value>12, 278</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=">>label3.ZOrder" xml:space="preserve">
|
||||
<value>16</value>
|
||||
<value>19</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 199</value>
|
||||
<value>97, 275</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=">>txtGuideRate.ZOrder" xml:space="preserve">
|
||||
<value>15</value>
|
||||
<value>18</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>149, 202</value>
|
||||
<value>149, 278</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=">>label4.ZOrder" xml:space="preserve">
|
||||
<value>14</value>
|
||||
<value>17</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>149, 215</value>
|
||||
<value>149, 291</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=">>lblPercentOfSiderealRate.ZOrder" xml:space="preserve">
|
||||
<value>13</value>
|
||||
<value>16</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>12, 234</value>
|
||||
<value>12, 310</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=">>label5.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
<value>15</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>97, 231</value>
|
||||
<value>97, 307</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=">>cboPrecision.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
<value>14</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>12, 261</value>
|
||||
<value>12, 337</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=">>label6.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
<value>13</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>97, 258</value>
|
||||
<value>97, 334</value>
|
||||
</data>
|
||||
<data name="cboGuidingStyle.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>90, 21</value>
|
||||
@@ -520,7 +520,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cboGuidingStyle.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -550,7 +550,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label7.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="label8.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -562,7 +562,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label8.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 317</value>
|
||||
<value>12, 393</value>
|
||||
</data>
|
||||
<data name="label8.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>52, 13</value>
|
||||
@@ -583,10 +583,10 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label8.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="txtBacklashSteps.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 335</value>
|
||||
<value>97, 411</value>
|
||||
</data>
|
||||
<data name="txtBacklashSteps.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>46, 20</value>
|
||||
@@ -607,7 +607,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtBacklashSteps.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -616,7 +616,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label9.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 338</value>
|
||||
<value>12, 414</value>
|
||||
</data>
|
||||
<data name="label9.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>79, 13</value>
|
||||
@@ -637,7 +637,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label9.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -646,7 +646,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="label10.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>149, 338</value>
|
||||
<value>149, 414</value>
|
||||
</data>
|
||||
<data name="label10.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>20, 13</value>
|
||||
@@ -667,7 +667,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label10.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -700,13 +700,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label11.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="cbxReverseDirection.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="cbxReverseDirection.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 361</value>
|
||||
<value>97, 437</value>
|
||||
</data>
|
||||
<data name="cbxReverseDirection.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>109, 17</value>
|
||||
@@ -727,13 +727,13 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxReverseDirection.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="cbxDynamicBreaking.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="cbxDynamicBreaking.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 384</value>
|
||||
<value>97, 460</value>
|
||||
</data>
|
||||
<data name="cbxDynamicBreaking.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>112, 17</value>
|
||||
@@ -754,8 +754,11 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxDynamicBreaking.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="cbxRtsDtr.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
@@ -774,9 +777,6 @@
|
||||
<data name="cbxRtsDtr.Text" xml:space="preserve">
|
||||
<value>Enable RTS/DTR</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="cbxRtsDtr.ToolTip" xml:space="preserve">
|
||||
<value>Useful for Meade LS scopes</value>
|
||||
</data>
|
||||
@@ -790,6 +790,84 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbxRtsDtr.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label12.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>12, 205</value>
|
||||
</data>
|
||||
<data name="label12.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>72, 13</value>
|
||||
</data>
|
||||
<data name="label12.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>22</value>
|
||||
</data>
|
||||
<data name="label12.Text" xml:space="preserve">
|
||||
<value>Site Elevation</value>
|
||||
</data>
|
||||
<data name=">>label12.Name" xml:space="preserve">
|
||||
<value>label12</value>
|
||||
</data>
|
||||
<data name=">>label12.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=">>label12.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label12.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="txtElevation.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>97, 202</value>
|
||||
</data>
|
||||
<data name="txtElevation.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 20</value>
|
||||
</data>
|
||||
<data name="txtElevation.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>23</value>
|
||||
</data>
|
||||
<data name=">>txtElevation.Name" xml:space="preserve">
|
||||
<value>txtElevation</value>
|
||||
</data>
|
||||
<data name=">>txtElevation.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=">>txtElevation.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtElevation.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="label13.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="label13.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>203, 205</value>
|
||||
</data>
|
||||
<data name="label13.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>38, 13</value>
|
||||
</data>
|
||||
<data name="label13.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>24</value>
|
||||
</data>
|
||||
<data name="label13.Text" xml:space="preserve">
|
||||
<value>meters</value>
|
||||
</data>
|
||||
<data name=">>label13.Name" xml:space="preserve">
|
||||
<value>label13</value>
|
||||
</data>
|
||||
<data name=">>label13.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=">>label13.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label13.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">
|
||||
@@ -799,7 +877,7 @@
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>350, 476</value>
|
||||
<value>350, 520</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterScreen</value>
|
||||
|
||||
@@ -145,6 +145,7 @@ namespace ASCOM.Meade.net
|
||||
private const string BacklashCompensationName = "Backlash Compensation";
|
||||
private const string ReverseFocusDirectionName = "Reverse Focuser Direction";
|
||||
private const string DynamicBreakingName = "Dynamic Breaking";
|
||||
private const string SiteElevationName = "Site Elevation";
|
||||
|
||||
public static void WriteProfile(ProfileProperties profileProperties)
|
||||
{
|
||||
@@ -162,6 +163,7 @@ namespace ASCOM.Meade.net
|
||||
driverProfile.WriteValue(DriverId, BacklashCompensationName, profileProperties.BacklashCompensation.ToString());
|
||||
driverProfile.WriteValue(DriverId, ReverseFocusDirectionName, profileProperties.ReverseFocusDirection.ToString());
|
||||
driverProfile.WriteValue(DriverId, DynamicBreakingName, profileProperties.DynamicBreaking.ToString());
|
||||
driverProfile.WriteValue(DriverId, SiteElevationName, profileProperties.SiteElevation.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,6 +177,7 @@ namespace ASCOM.Meade.net
|
||||
private const string BacklashCompensationDefault = "3000";
|
||||
private const string ReverseFocuserDiectionDefault = "true";
|
||||
private const string DynamicBreakingDefault = "true";
|
||||
private const string SiteElevationDefault = "0";
|
||||
|
||||
public static ProfileProperties ReadProfile()
|
||||
{
|
||||
@@ -193,6 +196,7 @@ namespace ASCOM.Meade.net
|
||||
profileProperties.BacklashCompensation = Convert.ToInt32(driverProfile.GetValue(DriverId, BacklashCompensationName, string.Empty, BacklashCompensationDefault));
|
||||
profileProperties.ReverseFocusDirection = Convert.ToBoolean(driverProfile.GetValue(DriverId, ReverseFocusDirectionName, string.Empty, ReverseFocuserDiectionDefault));
|
||||
profileProperties.DynamicBreaking = Convert.ToBoolean(driverProfile.GetValue(DriverId, DynamicBreakingName, string.Empty, DynamicBreakingDefault));
|
||||
profileProperties.SiteElevation = Convert.ToInt32(driverProfile.GetValue(DriverId, SiteElevationName, string.Empty, SiteElevationDefault));
|
||||
}
|
||||
|
||||
return profileProperties;
|
||||
|
||||
Reference in New Issue
Block a user