Beispiel #1
0
        private void BuildJogRatesList()
        {
            JogRates jogRates = null;

            if (Capabilities != null)
            {
                IRate[] primaryAxisRates = Capabilities.PrimaryAxisRates;
                jogRates = JogRates.FromAxisRates(primaryAxisRates);
            }

            if (jogRates == null)
            {
                JogRates        = null;
                SelectedJogRate = null;
            }
            else
            {
                JogRates        = jogRates;
                SelectedJogRate = jogRates[0];
            }
        }
Beispiel #2
0
        private void BuildJogRatesLists()
        {
            JogRates jogRates          = null;
            JogRates secondaryJogRates = null;

            bool asymmetricRates = false;

            if (Capabilities != null)
            {
                // We need to be careful because the jog rates can be null if the telescope does
                // not support MoveAxis!

                IRate[] primaryAxisRates = Capabilities.PrimaryAxisRates;
                jogRates = JogRates.FromAxisRates(primaryAxisRates);

                IRate[] secondaryAxisRates = Capabilities.SecondaryAxisRates;
                secondaryJogRates = JogRates.FromAxisRates(secondaryAxisRates);

                // If we cannot move both primary and secondary axes then we cannot have asymmetric rates.
                // This shows up in the jog rates being null.

                if (jogRates != null && secondaryJogRates != null)
                {
                    if (jogRates.Count == secondaryJogRates.Count)
                    {
                        for (int i = 0; i < jogRates.Count; ++i)
                        {
                            if (jogRates[i].Rate != secondaryJogRates[i].Rate)
                            {
                                asymmetricRates = true;
                                break;
                            }
                        }
                    }
                    else
                    {
                        asymmetricRates = true;
                    }
                }
            }

            if (jogRates == null)
            {
                JogRates        = null;
                SelectedJogRate = null;

                SecondaryJogRates        = null;
                SelectedSecondaryJogRate = null;

                HasAsymmetricJogRates = false;
            }
            else
            {
                JogRates        = jogRates;
                SelectedJogRate = jogRates[0];

                if (asymmetricRates)
                {
                    SecondaryJogRates        = secondaryJogRates;
                    SelectedSecondaryJogRate = secondaryJogRates[0];
                }
                else
                {
                    SecondaryJogRates        = null;
                    SelectedSecondaryJogRate = null;
                }

                HasAsymmetricJogRates = asymmetricRates;
            }
        }