Exemple #1
0
        public FocuserPosition GetCurrentPosition()
        {
            var rv = new FocuserPosition();

            var sw = new Stopwatch();
            try
            {
                sw.Start();

                rv.Absolute = m_Focuser.Absolute;
                try
                {
                    if (rv.Absolute)
                        rv.Position = m_Focuser.Position;
                }
                catch (PropertyNotImplementedException)
                {
                    rv.Position = 0;
                }
            }
            finally
            {
                sw.Stop();
                Trace.WriteLine(string.Format("Focuser.GetCurrentPosition() took {0} ms", (int)sw.ElapsedMilliseconds));
            }

            return rv;
        }
 private void OnFocuserPosition(FocuserPosition position)
 {
     EventHelper.RaiseEvent(FocuserPositionUpdated, position);
 }
Exemple #3
0
 public void FocuserPositionUpdated(FocuserPosition position)
 {
 }
Exemple #4
0
        private void UpdateFocuserPosition(FocuserPosition position)
        {
            if (position != null)
            {
                Trace.WriteLine(position.AsXmlString());

                DisableEnableControls(true);

                Text = "Focuser: " + position.Position.ToString();
            }
            else
            {
                pnlFocuserControls.Enabled = false;
                gbxTargetControl.Enabled = false;
            }
        }