示例#1
0
        // Constructor - Must be public for COM registration!
        /// <summary>
        /// Constructor
        /// </summary>
        public Telescope()
        {
            sysLog.Enabled = true;
            sysLog.LogMessage("Telescope", "Creating Telescope");
            m_AxisRates     = new AxisRates[2];
            m_AxisRates[0]  = new AxisRates(TelescopeAxes.axisPrimary);
            m_AxisRates[1]  = new AxisRates(TelescopeAxes.axisSecondary);
            m_TrackingRates = new TrackingRates();


            Serial theSerial = null;

            if (_profile.IsRegistered(s_csDriverID))
            {
                _profile.CreateSubKey(s_csDriverID, s_SerialSubKey);
                string portname = _profile.GetValue(s_csDriverID, "Port", s_SerialSubKey);
                string baudRate = _profile.GetValue(s_csDriverID, "Baud", s_SerialSubKey);

                if (portname.Length != 0 && baudRate.Length != 0)
                {
                    theSerial           = new Serial();
                    theSerial.Port      = Convert.ToInt16(portname);
                    theSerial.Speed     = (ASCOM.Utilities.SerialSpeed)Convert.ToInt16(baudRate);
                    theSerial.Connected = true;
                }
            }
            else
            {
                RegUnregASCOM(true);
            }
            Controller = new BoxdorferConnect(theSerial);

            m_Axes = new Axis.AxisControl[] {
                new Axis.RaAxisControl(Controller),
                //new Axis.DecAxisController(Controller);
            };
            RaAxis = m_Axes[0];
        }
示例#2
0
        // Constructor - Must be public for COM registration!
        /// <summary>
        /// Constructor
        /// </summary>
        public Telescope()
        {
            sysLog.Enabled = true;
            sysLog.LogMessage("Telescope", "Creating Telescope");
            m_AxisRates = new AxisRates[2];
            m_AxisRates[0] = new AxisRates(TelescopeAxes.axisPrimary);
            m_AxisRates[1] = new AxisRates(TelescopeAxes.axisSecondary);
            m_TrackingRates = new TrackingRates();

            Serial theSerial = null;

            if (_profile.IsRegistered(s_csDriverID))
            {
                _profile.CreateSubKey(s_csDriverID, s_SerialSubKey);
                string portname = _profile.GetValue(s_csDriverID, "Port", s_SerialSubKey);
                string baudRate = _profile.GetValue(s_csDriverID, "Baud", s_SerialSubKey);

                if (portname.Length != 0 && baudRate.Length != 0)
                {
                    theSerial = new Serial();
                    theSerial.Port = Convert.ToInt16(portname);
                    theSerial.Speed = (ASCOM.Utilities.SerialSpeed)Convert.ToInt16(baudRate);
                    theSerial.Connected = true;
                }
            }
            else
            {
                RegUnregASCOM(true);
            }
            Controller = new BoxdorferConnect(theSerial);

            m_Axes = new Axis.AxisControl[] {
                new Axis.RaAxisControl(Controller),
                //new Axis.DecAxisController(Controller);
            };
            RaAxis = m_Axes[0];
        }