private void btnPulseGuideNorth_Click(object sender, EventArgs e) { if (driver.IsPulseGuiding) { MessageBox.Show("Guiding"); } driver.PulseGuide(DeviceInterface.GuideDirections.guideNorth, int.Parse(txtPulseTime.Text)); }
private void guideNorthButton_Click(object sender, EventArgs e) { try { driver.PulseGuide(DeviceInterface.GuideDirections.guideNorth, (int)guideDurationNumericUpDown.Value); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnStepRight_Click(object sender, EventArgs e) { driver.GuideRateDeclination = Convert.ToDouble(tbNavSpeed.Text); driver.GuideRateRightAscension = Convert.ToDouble(tbNavSpeed.Text); driver.PulseGuide(DeviceInterface.GuideDirections.guideEast, 500); }
public void Test_PulseGuiding() { device.Connected = true; Assert.IsTrue(device.Connected); Assert.AreEqual("SLEW_MAX", device.CommandString("getCurrentSlewRate", true)); // Zero-time pulse guiding: no-op foreach (GuideDirections direction in Enum.GetValues(typeof(GuideDirections))) { device.PulseGuide(direction, 0); Assert.IsTrue(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsFalse(device.IsPulseGuiding); } // Single-axis pulse guiding foreach (GuideDirections direction in Enum.GetValues(typeof(GuideDirections))) { device.PulseGuide(direction, 500); Assert.IsFalse(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsTrue(device.IsPulseGuiding); System.Threading.Thread.Sleep(200); Assert.IsFalse(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsTrue(device.IsPulseGuiding); System.Threading.Thread.Sleep(350); Assert.IsTrue(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsFalse(device.IsPulseGuiding); } Assert.AreEqual("SLEW_MAX", device.CommandString("getCurrentSlewRate", true)); // Dual-axis pulse guiding, multiple times for (int i = 0; i < 5; i++) { device.PulseGuide(GuideDirections.guideWest, 500); Assert.AreEqual("SLEW_GUIDE", device.CommandString("getCurrentSlewRate", true)); System.Threading.Thread.Sleep(200); device.PulseGuide(GuideDirections.guideNorth, 500); Assert.IsFalse(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsTrue(device.IsPulseGuiding); Assert.ThrowsException <ASCOM.InvalidOperationException>(() => device.SyncToCoordinates(0, 0)); Assert.AreEqual("SLEW_GUIDE", device.CommandString("getCurrentSlewRate", true)); System.Threading.Thread.Sleep(350); Assert.IsFalse(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsTrue(device.IsPulseGuiding); Assert.ThrowsException <ASCOM.InvalidOperationException>(() => device.SyncToCoordinates(0, 0)); Assert.AreEqual("SLEW_GUIDE", device.CommandString("getCurrentSlewRate", true)); System.Threading.Thread.Sleep(200); Assert.IsTrue(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsFalse(device.IsPulseGuiding); Assert.AreEqual("SLEW_MAX", device.CommandString("getCurrentSlewRate", true)); } // Duplicate guide command device.PulseGuide(GuideDirections.guideWest, 500); device.PulseGuide(GuideDirections.guideWest, 100); System.Threading.Thread.Sleep(150); Assert.IsTrue(device.Tracking); Assert.IsFalse(device.Slewing); Assert.IsFalse(device.IsPulseGuiding); }