Example #1
0
        public void Refresh()
        {
// Stopwatch and timer used for debugging
            List <long> times = new List <long>();
            Stopwatch   sw    = new Stopwatch();

            sw.Start();

            _speedControlModeOld   = _speedControlMode = _unit.GetSpeedMode();
            _commandModeOld        = _commandMode = _unit.GetCommandMode();
            _positionLimitsModeOld = _positionLimitsMode = _unit.GetPositionLimitsMode();

            times.Add(sw.ElapsedTicks);

            _panMovePowerOld  = _panMovePower = _unit.GetPanMovePower();
            _panHoldPowerOld  = _panHoldPower = _unit.GetPanHoldPower();
            _tiltMovePowerOld = _tiltMovePower = _unit.GetTiltMovePower();
            _tiltHoldPowerOld = _tiltHoldPower = _unit.GetTiltHoldPower();

            times.Add(sw.ElapsedTicks);

            _panPositionLimitMaxOld  = _panPositionLimitMax = _unit.GetPanUserPositionLimitMax();
            _panPositionLimitMinOld  = _panPositionLimitMin = _unit.GetPanUserPositionLimitMin();
            _tiltPositionLimitMaxOld = _tiltPositionLimitMax = _unit.GetTiltUserPositionLimitMax();
            _tiltPositionLimitMinOld = _tiltPositionLimitMin = _unit.GetTiltUserPositionLimitMin();

            times.Add(sw.ElapsedTicks);

            _panSpeedLimitMaxOld  = _panSpeedLimitMax = _unit.GetPanSpeedLimitMax();
            _panSpeedLimitMinOld  = _panSpeedLimitMin = _unit.GetPanSpeedLimitMin();
            _tiltSpeedLimitMaxOld = _tiltSpeedLimitMax = _unit.GetTiltSpeedLimitMax();
            _tiltSpeedLimitMinOld = _tiltSpeedLimitMin = _unit.GetTiltSpeedLimitMin();

            times.Add(sw.ElapsedTicks);

            _panStepModeOld  = _panStepMode = _unit.GetPanStepMode();
            _tiltStepModeOld = _tiltStepMode = _unit.GetTiltStepMode();

            times.Add(sw.ElapsedTicks);

            _echoOld     = _echo = _unit.GetEchoEnabled();
            _verboseOld  = _verbose = _unit.GetVerboseEnabled();
            _joystickOld = _joystick = _unit.GetJoystickEnabled();

            times.Add(sw.ElapsedTicks);

            PanPositionResolution      = _unit.GetPanPositionResolution();
            PanPositionResolutionArcs  = _unit.GetPanPositionResolutionArcs();
            TiltPositionResolution     = _unit.GetTiltPositionResolution();
            TiltPositionResolutionArcs = _unit.GetTiltPositionResolutionArcs();

            times.Add(sw.ElapsedTicks);

            PanPositionLimitMax  = _unit.GetPanPositionLimitMax();
            PanPositionLimitMin  = _unit.GetPanPositionLimitMin();
            TiltPositionLimitMax = _unit.GetTiltPositionLimitMax();
            TiltPositionLimitMin = _unit.GetTiltPositionLimitMin();

            times.Add(sw.ElapsedTicks);

            PanDesiredPosition = _unit.GetPanDesiredPosition();
            PanCurrentPosition = _unit.GetPanCurrentPosition();

            TiltDesiredPosition = _unit.GetTiltDesiredPosition();
            TiltCurrentPosition = _unit.GetTiltCurrentPosition();

            times.Add(sw.ElapsedTicks);

            PanDesiredSpeed = _unit.GetPanDesiredSpeed();
            PanCurrentSpeed = _unit.GetPanCurrentSpeed();

            TiltDesiredSpeed = _unit.GetTiltDesiredSpeed();
            TiltCurrentSpeed = _unit.GetTiltCurrentSpeed();

            times.Add(sw.ElapsedTicks);

            PanBaseSpeed    = _unit.GetPanBaseSpeed();
            PanAcceleration = _unit.GetPanAcceleration();

            TiltBaseSpeed    = _unit.GetTiltBaseSpeed();
            TiltAcceleration = _unit.GetTiltAcceleration();

            sw.Stop();
            times.Add(sw.ElapsedTicks);
        }