Exemplo n.º 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;
        }
Exemplo n.º 2
0
 private void OnFocuserPosition(FocuserPosition position)
 {
     EventHelper.RaiseEvent(FocuserPositionUpdated, position);
 }
Exemplo n.º 3
0
 public void FocuserPositionUpdated(FocuserPosition position)
 {
 }
Exemplo n.º 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;
            }
        }