private Focuser _focuser; // = new Focuser();

        /// <summary>
        /// This is the method to run when the class is constructe
        /// </summary>
        public FocuserSettingsForm(Focuser MyFocuser)
        {
            _focuser = MyFocuser;
            _focuser.TL.LogMessage("FocusSettingsForm", "New");
            _focuser.TL.LogMessage("FocusSettingsForm", "Initialising component");
            InitializeComponent();
            _focuser.TL.LogMessage("FocusSettingsForm", "initialised OK");
        }
示例#2
0
        /// <summary>
        /// This is the method to run when the In button is clicked
        /// </summary>

        /*      private void BtnMoveIn_Click(object sender, EventArgs e)
         *    {
         *        UpdatePosition(-positionClick);
         *        UpdateDisplay();
         *    }
         *
         *    /// <summary>
         *    /// This is the method to run when the Out button is clicked
         *    /// </summary>
         *    private void btnMoveOut_Click(object sender, EventArgs e)
         *    {
         *        UpdatePosition(positionClick);
         *        UpdateDisplay();
         *    }
         */
        /// <summary>
        /// This is the method to run when the tempature compensator is turned on or off
        /// </summary>
        private void chkTempCompEnabled_CheckStateChanged(object sender, EventArgs e)
        {
            if (chkTempCompEnabled.Checked)
            {
                btnMoveIn.Enabled  = false;
                btnMoveOut.Enabled = false;
                _focuser.tempComp  = true;
            }
            else
            {
                btnMoveIn.Enabled  = true;
                btnMoveOut.Enabled = true;
                _focuser.tempComp  = false;
            }
            Focuser.SaveProfileSetting("TempComp", _focuser.tempComp.ToString(CultureInfo.InvariantCulture));
        }
示例#3
0
        /// <summary>
        /// This is the method to run when the class is constructed
        /// </summary>
        public FocuserHandboxForm(Focuser MyFocuser)
        {
            _focuser = MyFocuser; // Save supplied pointer to the owning focus driver
            InitializeComponent();
            UpdateDisplay();
            btnGoTo.Enabled = false;

            lblVersion.Text = _focuser.Name + @" v" + _focuser.DriverVersion;

            /* Adds the event and the event handler for the method that will process the timer event to the timer. */
            MyTimer.Tick += TimerEventProcessor;

            // Set the timer interval and start the timer.
            MyTimer.Interval = timerUpdateInterval;
            MyTimer.Start();

            btnMoveOut.MouseDown += new MouseEventHandler(btnMoveOut_MouseDown);
            btnMoveOut.MouseUp   += new MouseEventHandler(btnMove_MouseUp);
            btnMoveIn.MouseDown  += new MouseEventHandler(btnMoveIn_MouseDown);
            btnMoveIn.MouseUp    += new MouseEventHandler(btnMove_MouseUp);
            txtGoTo.TextChanged  += new EventHandler(txtGoTo_Changed);
            this.VisibleChanged  += FocuserHandboxForm_VisibleChanged;
        }