Readded support for guide rate get and set. This will use a default value of 0.67 sidereal rate. But can be overridden by a user.
This commit is contained in:
@@ -30,6 +30,7 @@ namespace Meade.net.Telescope.UnitTests
|
||||
_profileProperties = new ProfileProperties();
|
||||
_profileProperties.TraceLogger = false;
|
||||
_profileProperties.ComPort = "TestCom1";
|
||||
_profileProperties.GuideRateArcSecondsPerSecond = 1.23;
|
||||
|
||||
_utilMock = new Mock<IUtil>();
|
||||
_utilExtraMock = new Mock<IUtilExtra>();
|
||||
@@ -37,7 +38,8 @@ namespace Meade.net.Telescope.UnitTests
|
||||
|
||||
_sharedResourcesWrapperMock = new Mock<ISharedResourcesWrapper>();
|
||||
_sharedResourcesWrapperMock.Setup(x => x.SendString(":GZ#")).Returns("DDD*MM’SS");
|
||||
|
||||
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ReadProfile()).Returns(_profileProperties);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Action>())).Callback<Action>(action => { action(); });
|
||||
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Func<ASCOM.Meade.net.Telescope.TelescopeDateDetails>>())).Returns<Func<ASCOM.Meade.net.Telescope.TelescopeDateDetails>>( (func) => func());
|
||||
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Func<AltitudeData>>())).Returns<Func<AltitudeData>>((func) => func());
|
||||
@@ -643,8 +645,7 @@ namespace Meade.net.Telescope.UnitTests
|
||||
|
||||
var result = _telescope.CanSetGuideRates;
|
||||
|
||||
//Assert.That(result, Is.True);
|
||||
Assert.That(result, Is.False);
|
||||
Assert.That(result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -829,7 +830,7 @@ namespace Meade.net.Telescope.UnitTests
|
||||
{
|
||||
var result = _telescope.GuideRateDeclination;
|
||||
|
||||
Assert.That(result, Is.EqualTo(0.004178074616551509));
|
||||
Assert.That(result, Is.EqualTo(0.00034166666666666666));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -843,26 +844,26 @@ namespace Meade.net.Telescope.UnitTests
|
||||
Assert.That(excpetion.AccessorSet, Is.True);
|
||||
}
|
||||
|
||||
//[Test]
|
||||
//public void GuideRateDeclination_Set_WhenIsSupported_ThenSetsNewGuideRate()
|
||||
//{
|
||||
// var newGuideRate = 10;
|
||||
[Test]
|
||||
public void GuideRateDeclination_Set_WhenIsSupported_ThenSetsNewGuideRate()
|
||||
{
|
||||
var newGuideRate = 0.00034166666666666666;
|
||||
|
||||
// _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS);
|
||||
|
||||
// _telescope.GuideRateDeclination = newGuideRate;
|
||||
_telescope.GuideRateDeclination = newGuideRate;
|
||||
|
||||
// _sharedResourcesWrapperMock.Verify( x => x.SendBlind(":Rg10.0#"),Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg01.2#"), Times.Once);
|
||||
|
||||
// Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate));
|
||||
//}
|
||||
Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GuideRateRightAscension_Get_ThenThrowsException()
|
||||
{
|
||||
var result = _telescope.GuideRateRightAscension;
|
||||
|
||||
Assert.That(result, Is.EqualTo(0.004178074616551509));
|
||||
Assert.That(result, Is.EqualTo(0.00034166666666666666));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -876,19 +877,19 @@ namespace Meade.net.Telescope.UnitTests
|
||||
Assert.That(excpetion.AccessorSet, Is.True);
|
||||
}
|
||||
|
||||
//[Test]
|
||||
//public void GuideRateRightAscension_Set_WhenIsSupported_ThenSetsNewGuideRate()
|
||||
//{
|
||||
// var newGuideRate = 10;
|
||||
[Test]
|
||||
public void GuideRateRightAscension_Set_WhenIsSupported_ThenSetsNewGuideRate()
|
||||
{
|
||||
var newGuideRate = 0.00034166666666666666;
|
||||
|
||||
// _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS);
|
||||
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS);
|
||||
|
||||
// _telescope.GuideRateRightAscension = newGuideRate;
|
||||
_telescope.GuideRateRightAscension = newGuideRate;
|
||||
|
||||
// _sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg10.0#"), Times.Once);
|
||||
_sharedResourcesWrapperMock.Verify(x => x.SendBlind(":Rg01.2#"), Times.Once);
|
||||
|
||||
// Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate));
|
||||
//}
|
||||
Assert.That(_telescope.GuideRateDeclination, Is.EqualTo(newGuideRate));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsPulseGuiding_Get_ReturnsFalse()
|
||||
|
||||
@@ -6,5 +6,10 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
return int.Parse(str);
|
||||
}
|
||||
|
||||
public static double ToDouble(this string str)
|
||||
{
|
||||
return double.Parse(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,9 +111,7 @@ namespace ASCOM.Meade.net
|
||||
ReadProfile(); // Read device configuration from the ASCOM Profile store
|
||||
|
||||
IsConnected = false; // Initialise connected to false
|
||||
|
||||
_guideRate = 15.0 * (1.0 / 3600.0) / SIDRATE;
|
||||
|
||||
|
||||
LogMessage("Telescope", "Completed initialisation");
|
||||
}
|
||||
|
||||
@@ -376,15 +374,14 @@ namespace ASCOM.Meade.net
|
||||
return false;
|
||||
}
|
||||
|
||||
//todo implement ability to read and write the guide rate from the telescope.
|
||||
//private bool IsGuideRateSettingSupported()
|
||||
//{
|
||||
// if (_sharedResourcesWrapper.ProductName == TelescopeList.LX200GPS)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
private bool IsGuideRateSettingSupported()
|
||||
{
|
||||
if (_sharedResourcesWrapper.ProductName == TelescopeList.LX200GPS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool FirmwareIsGreaterThan(string minVersion)
|
||||
{
|
||||
@@ -759,8 +756,7 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
CheckConnected("CanSetGuideRates Get");
|
||||
|
||||
//var canSetGuideRate = IsGuideRateSettingSupported();
|
||||
var canSetGuideRate = false;
|
||||
var canSetGuideRate = IsGuideRateSettingSupported();
|
||||
|
||||
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate.ToString());
|
||||
return canSetGuideRate;
|
||||
@@ -946,33 +942,48 @@ namespace ASCOM.Meade.net
|
||||
|
||||
private void SetNewGuideRate(double value, string propertyName)
|
||||
{
|
||||
//if (!IsGuideRateSettingSupported())
|
||||
//{
|
||||
if (!IsGuideRateSettingSupported())
|
||||
{
|
||||
LogMessage("GuideRateDeclination Set", "Not implemented");
|
||||
throw new PropertyNotImplementedException(propertyName, true);
|
||||
//}
|
||||
}
|
||||
|
||||
//if (!value.InRange(0, 15.0417))
|
||||
//{
|
||||
// throw new InvalidValueException(propertyName, value.ToString(), "0 to 15.0417”/sec");
|
||||
//}
|
||||
var valueInArcSecondsPerSecond = DegreesPerSecondToArcSecondPerSecond(value);
|
||||
|
||||
//_sharedResourcesWrapper.SendBlind($":Rg{value:00.0}#");
|
||||
////:RgSS.S#
|
||||
////Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking
|
||||
////Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed
|
||||
////sidereal speed(approx 15.0417”/sec)[Autostar II only]
|
||||
////Returns: Nothing
|
||||
if (!valueInArcSecondsPerSecond.InRange(0, 15.0417))
|
||||
{
|
||||
throw new InvalidValueException(propertyName, valueInArcSecondsPerSecond.ToString(), "0 to 15.0417”/sec");
|
||||
}
|
||||
|
||||
// _guideRate = value;
|
||||
_sharedResourcesWrapper.SendBlind($":Rg{valueInArcSecondsPerSecond:00.0}#");
|
||||
//:RgSS.S#
|
||||
//Set guide rate to +/ -SS.S to arc seconds per second.This rate is added to or subtracted from the current tracking
|
||||
//Rates when the CCD guider or handbox guider buttons are pressed when the guide rate is selected.Rate shall not exceed
|
||||
//sidereal speed(approx 15.0417”/sec)[Autostar II only]
|
||||
//Returns: Nothing
|
||||
|
||||
_guideRate = valueInArcSecondsPerSecond;
|
||||
|
||||
WriteProfile();
|
||||
}
|
||||
|
||||
private double DegreesPerSecondToArcSecondPerSecond(double value)
|
||||
{
|
||||
return value * 3600.0;
|
||||
}
|
||||
|
||||
private double ArcSecondPerSecondToDegreesPerSecond(double value)
|
||||
{
|
||||
return value / 3600.0;
|
||||
}
|
||||
|
||||
public double GuideRateDeclination
|
||||
{
|
||||
get
|
||||
{
|
||||
LogMessage("GuideRateDeclination Get", "Not implemented");
|
||||
return _guideRate;
|
||||
var degreesPerSecond = ArcSecondPerSecondToDegreesPerSecond(_guideRate);
|
||||
LogMessage("GuideRateDeclination Get", $"{_guideRate:00.0} arc seconds / second = {degreesPerSecond} degrees per second");
|
||||
return degreesPerSecond;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -984,8 +995,9 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
get
|
||||
{
|
||||
LogMessage("GuideRateRightAscension Get", "Not implemented");
|
||||
return _guideRate;
|
||||
var degreesPerSecond = ArcSecondPerSecondToDegreesPerSecond(_guideRate);
|
||||
LogMessage("GuideRateRightAscension Get", $"{_guideRate:00.0} arc seconds / second = {degreesPerSecond} degrees per second");
|
||||
return degreesPerSecond;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -2087,11 +2099,24 @@ namespace ASCOM.Meade.net
|
||||
/// </summary>
|
||||
internal void ReadProfile()
|
||||
{
|
||||
var profileProperties = _sharedResourcesWrapper.ReadProfile();
|
||||
ProfileProperties profileProperties = _sharedResourcesWrapper.ReadProfile();
|
||||
_tl.Enabled = profileProperties.TraceLogger;
|
||||
_comPort = profileProperties.ComPort;
|
||||
_guideRate = profileProperties.GuideRateArcSecondsPerSecond;
|
||||
}
|
||||
|
||||
internal void WriteProfile()
|
||||
{
|
||||
var profileProperties = new ProfileProperties
|
||||
{
|
||||
TraceLogger = _tl.Enabled,
|
||||
ComPort = _comPort,
|
||||
GuideRateArcSecondsPerSecond = _guideRate
|
||||
};
|
||||
|
||||
_sharedResourcesWrapper.WriteProfile(profileProperties);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Log helper function that takes formatted strings and arguments
|
||||
/// </summary>
|
||||
|
||||
@@ -9,14 +9,12 @@ namespace ASCOM.Meade.net
|
||||
class GarbageCollection
|
||||
{
|
||||
private bool _mbContinueThread;
|
||||
private bool _mGcWatchStopped;
|
||||
private readonly int _miInterval;
|
||||
private readonly ManualResetEvent _mEventThreadEnded;
|
||||
|
||||
public GarbageCollection(int iInterval)
|
||||
{
|
||||
_mbContinueThread = true;
|
||||
_mGcWatchStopped = false;
|
||||
_miInterval = iInterval;
|
||||
_mEventThreadEnded = new ManualResetEvent(false);
|
||||
}
|
||||
|
||||
@@ -5,5 +5,6 @@ namespace ASCOM.Meade.net
|
||||
// properies that are part of the profile
|
||||
public string ComPort { get; set; }
|
||||
public bool TraceLogger { get; set; }
|
||||
public double GuideRateArcSecondsPerSecond { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,8 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
comboBoxComPort.SelectedItem = profileProperties.ComPort;
|
||||
}
|
||||
|
||||
txtGuideRate.Text = profileProperties.GuideRateArcSecondsPerSecond.ToString();
|
||||
}
|
||||
|
||||
public ProfileProperties GetProfile()
|
||||
@@ -63,5 +65,16 @@ namespace ASCOM.Meade.net
|
||||
{
|
||||
Activate();
|
||||
}
|
||||
|
||||
private void TextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//const double SIDRATE = 0.9972695677; //synodic/solar seconds per sidereal second
|
||||
var newGuideRate = double.Parse(txtGuideRate.Text);
|
||||
|
||||
const double siderealArcSecondsPerSecond = 15.041;
|
||||
var percentOfSideReal = (newGuideRate / siderealArcSecondsPerSecond * 100);
|
||||
|
||||
lblPercentOfSiderealRate.Text = $"({percentOfSideReal:00.0}% of sidereal rate)";
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+33
@@ -36,6 +36,10 @@ namespace ASCOM.Meade.net
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.chkTrace = new System.Windows.Forms.CheckBox();
|
||||
this.comboBoxComPort = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.txtGuideRate = new System.Windows.Forms.TextBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.lblPercentOfSiderealRate = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -86,10 +90,35 @@ namespace ASCOM.Meade.net
|
||||
resources.ApplyResources(this.comboBoxComPort, "comboBoxComPort");
|
||||
this.comboBoxComPort.Name = "comboBoxComPort";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.Name = "label3";
|
||||
//
|
||||
// txtGuideRate
|
||||
//
|
||||
resources.ApplyResources(this.txtGuideRate, "txtGuideRate");
|
||||
this.txtGuideRate.Name = "txtGuideRate";
|
||||
this.txtGuideRate.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// lblPercentOfSiderealRate
|
||||
//
|
||||
resources.ApplyResources(this.lblPercentOfSiderealRate, "lblPercentOfSiderealRate");
|
||||
this.lblPercentOfSiderealRate.Name = "lblPercentOfSiderealRate";
|
||||
//
|
||||
// SetupDialogForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.lblPercentOfSiderealRate);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.txtGuideRate);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.comboBoxComPort);
|
||||
this.Controls.Add(this.chkTrace);
|
||||
this.Controls.Add(this.label2);
|
||||
@@ -118,5 +147,9 @@ namespace ASCOM.Meade.net
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.CheckBox chkTrace;
|
||||
private System.Windows.Forms.ComboBox comboBoxComPort;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.TextBox txtGuideRate;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label lblPercentOfSiderealRate;
|
||||
}
|
||||
}
|
||||
@@ -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, 112</value>
|
||||
<value>281, 225</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>6</value>
|
||||
<value>10</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, 142</value>
|
||||
<value>281, 255</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>5</value>
|
||||
<value>9</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>4</value>
|
||||
<value>8</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>3</value>
|
||||
<value>7</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>2</value>
|
||||
<value>6</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>1</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="comboBoxComPort.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>77, 87</value>
|
||||
@@ -298,6 +298,111 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>comboBoxComPort.ZOrder" xml:space="preserve">
|
||||
<value>4</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>13, 225</value>
|
||||
</data>
|
||||
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>61, 13</value>
|
||||
</data>
|
||||
<data name="label3.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="label3.Text" xml:space="preserve">
|
||||
<value>Guide Rate</value>
|
||||
</data>
|
||||
<data name=">>label3.Name" xml:space="preserve">
|
||||
<value>label3</value>
|
||||
</data>
|
||||
<data name=">>label3.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=">>label3.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label3.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>80, 222</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>46, 20</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="txtGuideRate.Text" xml:space="preserve">
|
||||
<value>10.0</value>
|
||||
</data>
|
||||
<data name=">>txtGuideRate.Name" xml:space="preserve">
|
||||
<value>txtGuideRate</value>
|
||||
</data>
|
||||
<data name=">>txtGuideRate.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=">>txtGuideRate.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtGuideRate.ZOrder" xml:space="preserve">
|
||||
<value>2</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>132, 225</value>
|
||||
</data>
|
||||
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>122, 13</value>
|
||||
</data>
|
||||
<data name="label4.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="label4.Text" xml:space="preserve">
|
||||
<value>Arc seconds per second</value>
|
||||
</data>
|
||||
<data name=">>label4.Name" xml:space="preserve">
|
||||
<value>label4</value>
|
||||
</data>
|
||||
<data name=">>label4.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=">>label4.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>label4.ZOrder" xml:space="preserve">
|
||||
<value>1</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>132, 238</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>105, 13</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="lblPercentOfSiderealRate.Text" xml:space="preserve">
|
||||
<value>(67% of sidereal rate)</value>
|
||||
</data>
|
||||
<data name=">>lblPercentOfSiderealRate.Name" xml:space="preserve">
|
||||
<value>lblPercentOfSiderealRate</value>
|
||||
</data>
|
||||
<data name=">>lblPercentOfSiderealRate.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=">>lblPercentOfSiderealRate.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblPercentOfSiderealRate.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">
|
||||
@@ -307,7 +412,7 @@
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>350, 175</value>
|
||||
<value>350, 288</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterScreen</value>
|
||||
|
||||
@@ -158,6 +158,7 @@ namespace ASCOM.Meade.net
|
||||
// Constants used for Profile persistence
|
||||
private const string ComPortProfileName = "COM Port";
|
||||
private const string TraceStateProfileName = "Trace Level";
|
||||
private const string GuideRateProfileName = "Guide Rate Arc Seconds Per Second";
|
||||
|
||||
public static void WriteProfile(ProfileProperties profileProperties)
|
||||
{
|
||||
@@ -168,12 +169,14 @@ namespace ASCOM.Meade.net
|
||||
driverProfile.DeviceType = "Telescope";
|
||||
driverProfile.WriteValue(DriverId, TraceStateProfileName, profileProperties.TraceLogger.ToString());
|
||||
driverProfile.WriteValue(DriverId, ComPortProfileName, profileProperties.ComPort);
|
||||
driverProfile.WriteValue(DriverId, GuideRateProfileName, profileProperties.GuideRateArcSecondsPerSecond.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private const string ComPortDefault = "COM1";
|
||||
private const string TraceStateDefault = "false";
|
||||
private const string GuideRateProfileNameDefault = "10.077939"; //67% of sidereal rate
|
||||
|
||||
public static ProfileProperties ReadProfile()
|
||||
{
|
||||
@@ -183,10 +186,9 @@ namespace ASCOM.Meade.net
|
||||
using (Profile driverProfile = new Profile())
|
||||
{
|
||||
driverProfile.DeviceType = "Telescope";
|
||||
profileProperties.ComPort =
|
||||
driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault);
|
||||
profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId,
|
||||
TraceStateProfileName, string.Empty, TraceStateDefault));
|
||||
profileProperties.ComPort = driverProfile.GetValue(DriverId, ComPortProfileName, string.Empty, ComPortDefault);
|
||||
profileProperties.TraceLogger = Convert.ToBoolean(driverProfile.GetValue(DriverId, TraceStateProfileName, string.Empty, TraceStateDefault));
|
||||
profileProperties.GuideRateArcSecondsPerSecond = double.Parse(driverProfile.GetValue(DriverId, GuideRateProfileName, string.Empty, GuideRateProfileNameDefault));
|
||||
}
|
||||
|
||||
return profileProperties;
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
ProfileProperties ReadProfile();
|
||||
|
||||
void SetupDialog();
|
||||
void WriteProfile(ProfileProperties profileProperties);
|
||||
}
|
||||
|
||||
public class SharedResourcesWrapper : ISharedResourcesWrapper
|
||||
@@ -80,5 +81,10 @@ namespace ASCOM.Meade.net.Wrapper
|
||||
{
|
||||
SharedResources.SetupDialog();
|
||||
}
|
||||
|
||||
public void WriteProfile(ProfileProperties profileProperties)
|
||||
{
|
||||
SharedResources.WriteProfile(profileProperties);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
|
||||
Reference in New Issue
Block a user