private void ejecutaTest(MountCheck test) { // Si el usuario aun no escoge un test if (this.runningTest == null) { return; } // Si el test escogido esta en ejecucion if (this.runningTest.IsRunning) { return; } this.runningTest.start(); switch (runningTest.Id) { case 1: //telescopio.Connected = true; timerReadSerial.Stop(); telescopio.Park(); timerReadSerial.Start(); break; case 2: telescopio.Unpark(); telescopio.MoveAxis(TelescopeAxes.axisSecondary, -5); break; case 3: telescopio.MoveAxis(TelescopeAxes.axisSecondary, 5); break; case 4: telescopio.Unpark(); telescopio.SlewToAltAzAsync(270, 89); break; case 5: this.setMonturaProtection(false); telescopio.MoveAxis(TelescopeAxes.axisPrimary, 5); break; case 6: telescopio.Unpark(); telescopio.SlewToAltAzAsync(90, 89); break; case 7: this.setMonturaProtection(false); telescopio.MoveAxis(TelescopeAxes.axisPrimary, -5); break; } }
private void slewHorizontal(double az, double alt, bool async) { if (Math.Abs(az) > 90 || Math.Abs(alt) > 90) { return; } else if (telescope.CanSlewAltAz) { labelValStatus.Text = "Slewing..."; setTracking(false); if (telescope.CanSlewAltAzAsync) { telescope.SlewToAltAzAsync(az, alt); } else { telescope.SlewToAltAz(az, alt); } labelValStatus.Text = "Connected"; } }