Exemple #1
0
        public static SignalGenerator Connect(string currentAddress, SignalGenerator.ValidateSupportDelegate supportDelegate, bool interactive)
        {
            SignalGenerator AnalogSignalGenerator = null;
            string          str = (currentAddress != null ? currentAddress : "GPIB0::19::INSTR");

            SignalGenerator.m_validateSupportDelegate = supportDelegate;
            if (interactive)
            {
                throw new Exception("不支持交互模式");
            }
            try
            {
                string str1 = SignalGenerator.DetermineSupport(str);
                if (str1 != null)
                {
                    throw new Exception(str1);
                }
                AnalogSignalGenerator = SignalGenerator.CreateDetectedAnalogSignalGenerator(str);
            }
            catch
            {
                //throw;
            }
            SignalGenerator.m_validateSupportDelegate = null;
            if (AnalogSignalGenerator != null)
            {
                AnalogSignalGenerator.Connected   = true;
                SignalGenerator.m_FirmwareVersion = AnalogSignalGenerator.GetFirmwareVersion(AnalogSignalGenerator);
            }
            return(AnalogSignalGenerator);
        }
Exemple #2
0
        public static VectorSignalGenerator ConnectVecorSG(string currentAddress, SignalGenerator.ValidateSupportDelegate supportDelegate, bool interactive)
        {
            VectorSignalGenerator VectorSigGen = null;
            string str = (currentAddress != null ? currentAddress : "GPIB0::19::INSTR");

            SignalGenerator.m_validateSupportDelegate = supportDelegate;
            if (interactive)
            {
                throw new Exception("不支持交互模式");
            }
            try
            {
                string str1 = VectorSignalGenerator.DetermineSupport(str);
                if (str1 != null)
                {
                    throw new Exception(str1);
                }
                VectorSigGen = VectorSignalGenerator.CreateDetectedVectorSignalGenerator(str);
            }
            catch
            {
                throw;
            }
            VectorSignalGenerator.m_validateSupportDelegate = null;
            if (VectorSigGen != null)
            {
                VectorSigGen.Connected         = true;
                VectorSigGen.m_firmwareVersion = VectorSigGen.GetFirmwareVersion(VectorSigGen);
            }
            return(VectorSigGen);
        }
Exemple #3
0
 static SignalGenerator()
 {
     SignalGenerator.m_validateSupportDelegate = null;
 }