private void btnAbort_Click(object sender, EventArgs e) { if (UIisActive && telescope.Slewing) { telescope.AbortSlew(); telescope.MoveAxis(TelescopeAxes.axisPrimary, 0); telescope.MoveAxis(TelescopeAxes.axisSecondary, 0); } }
/// <inheritdoc/> public void AbortSlewing() { try { lock (locker) { if (telescope != null && telescope.Slewing && !telescope.AtPark) { telescope.AbortSlew(); RaiseOnMessageShow("$Ascom.Messages.SlewingAborted"); NotifyPropertyChanged(nameof(IsSlewing)); } } } catch (Exception ex) { RaiseOnMessageShow("$Ascom.Messages.UnableAbortSlew"); Log.Error($"Unable to abort slewing: {ex}"); } }
private void btnAbort_Click(object sender, EventArgs e) { // 停止指向过程 telescope_.AbortSlew(); }
private void revisaTest() { Console.WriteLine("revisaTest"); if (this.runningTest == null) { return; } if (!this.runningTest.IsRunning) { lblMountCheck.Text = this.runningTest.status(); Console.WriteLine(this.runningTest.status()); this.runningTest = null; return; } double alt, az; alt = telescopio.Altitude; az = telescopio.Azimuth; Console.WriteLine("alt=" + alt + "\t az=" + az); Console.WriteLine(this.runningTest.status()); lblMountCheck.Text = this.runningTest.status(); switch (runningTest.Id) { case 1: if ((alt > 29) && (alt < 31) && (az > 178) && (alt < 181)) { runningTest.finish(1); } if (runningTest.isTimeOut()) { runningTest.finish(-1); } break; case 2: if (az > 190) { telescopio.MoveAxis(TelescopeAxes.axisSecondary, 0); runningTest.finish(1); } if (runningTest.isTimeOut()) { telescopio.MoveAxis(TelescopeAxes.axisSecondary, 0); runningTest.finish(-1); } break; case 3: if (this.stat.DecHome) { runningTest.Counter++; } if (az < 170) { telescopio.MoveAxis(TelescopeAxes.axisSecondary, 0); if (runningTest.Counter > 0) { runningTest.finish(1); } else { runningTest.finish(-1); } } if (runningTest.isTimeOut()) { telescopio.MoveAxis(TelescopeAxes.axisSecondary, 0); runningTest.finish(-1); } break; case 4: if ((!telescopio.Slewing) && (az > 260) && (alt > 80)) { runningTest.finish(1); } if (runningTest.isTimeOut()) { telescopio.AbortSlew(); runningTest.finish(-1); } break; case 5: if (stat.RaLimitEast) { telescopio.MoveAxis(TelescopeAxes.axisPrimary, 0); runningTest.finish(1); } if (runningTest.isTimeOut()) { telescopio.MoveAxis(TelescopeAxes.axisPrimary, 0); runningTest.finish(-1); } break; case 6: if (stat.RaHome) { runningTest.Counter++; } if ((!telescopio.Slewing) && (az < 100) && (alt > 80) && (runningTest.Counter > 0) ) { runningTest.finish(1); } if (runningTest.isTimeOut()) { telescopio.AbortSlew(); runningTest.finish(-1); } break; case 7: if (stat.RaLimitWest) { telescopio.MoveAxis(TelescopeAxes.axisPrimary, 0); runningTest.finish(1); } if (runningTest.isTimeOut()) { telescopio.MoveAxis(TelescopeAxes.axisPrimary, 0); runningTest.finish(-1); } break; } }