//
 // Constructor - Internal prevents public creation
 // of instances. Returned by Telescope.AxisRates.
 //
 internal AxisRates(TelescopeAxes axis)
 {
     this.axis = axis;
     //
     // This collection must hold zero or more Rate objects describing the
     // rates of motion ranges for the Telescope.MoveAxis() method
     // that are supported by your driver. It is OK to leave this
     // array empty, indicating that MoveAxis() is not supported.
     //
     // Note that we are constructing a rate array for the axis passed
     // to the constructor. Thus we switch() below, and each case should
     // initialize the array for the rate for the selected axis.
     //
     switch (axis)
     {
         case TelescopeAxes.axisPrimary:
             // TODO Initialize this array with any Primary axis rates that your driver may provide
             // Example: m_Rates = new Rate[] { new Rate(10.5, 30.2), new Rate(54.0, 43.6) }
             //var sid = Utils.Const.SiderealRateDegPerSec;
             this.rates = new Rate[]
             {
                 new Rate(0, Const.MaxAxisRate),
     /*
                 new Rate(sid / 2, sid / 2),     //Rate 1
                 new Rate(sid, sid),             //Rate 2
                 new Rate(sid * 2, sid * 2),     //Rate 3
                 new Rate(sid * 4, sid * 4),     //Rate 4
                 new Rate(sid * 8, sid * 8),     //Rate 5
                 new Rate(sid * 16, sid * 16),   //Rate 6
                 new Rate(sid * 64, sid * 64),   //Rate 6
                 new Rate(0.5, 0.5),             //Rate 7
                 new Rate(2, 2),                 //Rate 8
                 new Rate(3, 3),                 //Rate 9
      */
             };
             break;
         case TelescopeAxes.axisSecondary:
             // TODO Initialize this array with any Secondary axis rates that your driver may provide
             this.rates = new Rate[]
             {
                 new Rate(0, Const.MaxAxisRate),
             };
             break;
         case TelescopeAxes.axisTertiary:
             // TODO Initialize this array with any Tertiary axis rates that your driver may provide
             this.rates = new Rate[0];
             break;
     }
 }
 //
 // Constructor - Internal prevents public creation
 // of instances. Returned by Telescope.AxisRates.
 //
 internal AxisRates(TelescopeAxes Axis)
 {
     m_Axis = Axis;
     //
     // This collection must hold zero or more Rate objects describing the
     // rates of motion ranges for the Telescope.MoveAxis() method
     // that are supported by your driver. It is OK to leave this
     // array empty, indicating that MoveAxis() is not supported.
     //
     // Note that we are constructing a rate array for the axis passed
     // to the constructor. Thus we switch() below, and each case should
     // initialize the array for the rate for the selected axis.
     //
     switch (Axis)
     {
         case TelescopeAxes.axisPrimary:
             // TODO Initialize this array with any Primary axis rates that your driver may provide
             // Example: m_Rates = new Rate[] { new Rate(10.5, 30.2), new Rate(54.0, 43.6) }
             m_Rates = new Rate[0];
             break;
         case TelescopeAxes.axisSecondary:
             // TODO Initialize this array with any Secondary axis rates that your driver may provide
             m_Rates = new Rate[0];
             break;
         case TelescopeAxes.axisTertiary:
             // TODO Initialize this array with any Tertiary axis rates that your driver may provide
             m_Rates = new Rate[0];
             break;
     }
 }
Beispiel #3
0
 //
 // Constructor - Internal prevents public creation
 // of instances. Returned by Telescope.AxisRates.
 //
 internal AxisRates(TelescopeAxes axis)
 {
     this.axis = axis;
     //
     // This collection must hold zero or more Rate objects describing the
     // rates of motion ranges for the Telescope.MoveAxis() method
     // that are supported by your driver. It is OK to leave this
     // array empty, indicating that MoveAxis() is not supported.
     //
     // Note that we are constructing a rate array for the axis passed
     // to the constructor. Thus we switch() below, and each case should
     // initialize the array for the rate for the selected axis.
     //
     switch (axis)
     {
         case TelescopeAxes.axisPrimary:
             // Example: m_Rates = new Rate[] { new Rate(10.5, 30.2), new Rate(54.0, 43.6) }
             this.rates = new Rate[]{new Rate(0, Constants.DEGREES_PER_SECOND * Constants.MAX_RATE_MULTIPLYER)};
             break;
         case TelescopeAxes.axisSecondary:
             this.rates = new Rate[] { new Rate(0, Constants.DEGREES_PER_SECOND * Constants.MAX_RATE_MULTIPLYER) };
             break;
         case TelescopeAxes.axisTertiary:
             this.rates = new Rate[0];
             break;
     }
 }
Beispiel #4
0
 //
 // Constructor - Internal prevents public creation
 // of instances. Returned by Telescope.AxisRates.
 //
 internal AxisRates(TelescopeAxes axis)
 {
     switch (axis)
     {
         case TelescopeAxes.axisPrimary:
             this.rates = new Rate[] { new Rate(0, Constants.DEGREES_PER_SECOND * 8) };//8X Sideral Rate
             break;
         case TelescopeAxes.axisSecondary:
             this.rates = new Rate[] { new Rate(0, Constants.DEGREES_PER_SECOND * 8) };//8X Sideral Rate
             break;
         case TelescopeAxes.axisTertiary:
             this.rates = new Rate[] { new Rate(0, Constants.DEGREES_PER_SECOND * 8) };//8X Sideral Rate
             break;
     }
 }
        //
        // Constructor - Internal prevents public creation
        // of instances. Returned by Telescope.AxisRates.
        //
        internal AxisRates(TelescopeAxes Axis)
        {
            m_Axis = Axis;
            //
            // This collection must hold zero or more Rate objects describing the 
            // rates of motion ranges for the Telescope.MoveAxis() method
            // that are supported by your driver. It is OK to leave this 
            // array empty, indicating that MoveAxis() is not supported.
            //
            // Note that we are constructing a rate array for the axis passed
            // to the constructor. Thus we switch() below, and each case should 
            // initialize the array for the rate for the selected axis.
            //

            if (Axis == TelescopeAxes.axisTertiary)
            {
                m_Rates = new Rate[0];
                return;
            }

            // goto slew, centering, and guiding speeds from the mount
            string[] get_rates = { "<140:", "<170:", "<150:" };
            string[] result = null;

            GeminiHardware.Instance.DoCommandResult(get_rates, 3000, false, out result);

            // if didn't get a result or one of the results timed out, throw an error:
            if (result == null) throw new TimeoutException("AxisRates");
            foreach (string s in result)
                if (s == null) throw new TimeoutException("AxisRates");

            switch (Axis)
            {
                case TelescopeAxes.axisPrimary:
                case TelescopeAxes.axisSecondary:
                    m_Rates = new Rate[result.Length];
                    for (int idx = 0; idx < result.Length; ++idx)
                    {
                        double rate = 0;
                        if (!GeminiHardware.Instance.m_Util.StringToDouble(result[idx], out rate))
                            throw new TimeoutException("AxisRates");
                        rate = rate * SharedResources.EARTH_ANG_ROT_DEG_MIN / 60.0;  // convert to rate in deg/sec
                        m_Rates[idx] = new Rate(rate, rate);
                    }
                    break;
            }
        }