Ejemplo n.º 1
0
        public void CloseShutter()                                           // 13-4-17
        {
            pkShutter.ClearBuffers();
            pkShutter.Transmit("CS#");


            tl.LogMessage("CloseShutter", "Shutter has been closed");
            // domeShutterState = false;
        }
Ejemplo n.º 2
0
        private void Dispose()
        {
            Connect(DomeImpl.ConnectionState.NOT_CONNECTED);
            commPort.ClearBuffers();
            commPort.Connected = false;
            commPort.LogMessage("DeviceComms:I2cSerialComms.Dispose", "comm port" + commPort.Port + " disposed in Dome driver");

            //super.Dispose();
        }
Ejemplo n.º 3
0
        private void initialise_stepper()
        {
            double AzimuthInitialise = 261.00;

            try
            {
                pkstepper.ClearBuffers();

                pkstepper.Transmit("SA" + AzimuthInitialise.ToString("0.##") + "#");
            }
            catch (Exception ex)
            {
                pkstepper.ClearBuffers();

                pkstepper.Transmit("SA" + AzimuthInitialise.ToString("0.##") + "#");
                // log
                tl.LogMessage("Attempt to initialise azimuth for the stepper", ex.ToString());
            }
        }
Ejemplo n.º 4
0
        private ASCOM.Utilities.Serial OpenPort(string portName)
        {
            ASCOM.Utilities.Serial port = new ASCOM.Utilities.Serial();
            port.PortName       = portName;
            port.DTREnable      = false;
            port.RTSEnable      = false;
            port.ReceiveTimeout = 10000;

            port.Speed     = SerialSpeed.ps19200;
            port.Connected = true;
            port.ClearBuffers();

            return(port);
        }
        public bool ConnectTelescope()
        {
            SerialConnection.Connected = true;
            SerialConnection.ClearBuffers();

            HC.WaitForMilliseconds(5000);
            SerialConnection.Transmit(": C 127 15 #"); // Tell the telescope to connect
            string ack = SerialConnection.ReceiveTerminated("\r");

            if (ack == "OK\r")
            {
                ctrl = new ControlBox(this);
                ctrl.Show();
                return(true);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(ack);
                return(false);
            }
        }
Ejemplo n.º 6
0
 private void buttonConnect_Click(object sender, EventArgs e)
 {
     if (IsConnected)
     {
         driver.Connected = false;
     }
     else
     {
         driver                 = new ASCOM.DriverAccess.FilterWheel(Properties.Settings.Default.DriverId);
         driver.Connected       = true;
         serPort                = new ASCOM.Utilities.Serial();
         serPort.ReceiveTimeout = 15;
         serPort.Port           = 2;
         serPort.Speed          = (SerialSpeed)9600;
         serPort.StopBits       = SerialStopBits.One;
         serPort.DataBits       = 8;
         serPort.Parity         = SerialParity.None;
         serPort.Connected      = true;
         serPort.ClearBuffers();
     }
     SetUIState();
 }