Example #1
0
        /// <summary>Tests the specified serial port to see if there is a PTU controller attached. This method is blocking, but throws if the unit is unresponsive (2000ms timeout).</summary>
        public static PTFirmwareInfo GetFirmwareInfo(String portName)
        {
            PTFirmwareInfo ret;

            using (PTConnection c = new PTConnection(portName)) {
                try {
                    c.ResetParser();

                    c.SetTimeout(500);
                    String firmware = c.GetLine(PTCommand.GetFirmwareVersion);
                    ret = PTFirmwareInfo.FromString(firmware);
                    c.SetTimeout(_defaultTimeout);
                } catch (TimeoutException) {
                    return(null);
                }
            }

            return(ret);
        }
Example #2
0
        public void Initialize()
        {
            _c.ResetParser();

            _c.SetTimeout(_defaultTimeout);

            this.SetSpeedMode(PTSpeedControlMode.Independent);
            this.SetCommandMode(PTCommandMode.Immediate);

            _panResolution  = this.GetPanPositionResolutionArcs();
            _tiltResolution = this.GetTiltPositionResolutionArcs();

            _panStepMode  = this.GetPanStepMode();
            _tiltStepMode = this.GetTiltStepMode();

            _limitsMode = this.GetPositionLimitsMode();
        }