public static SpectrumAnalyzer CreateDetectedSpectrumAnalyzer(string address) { SpectrumAnalyzer scpiSpectrumAnalyzer; try { string str = ScpiInstrument.DetermineModel(address); if (SpectrumAnalyzer.IsMXA(str) || SpectrumAnalyzer.IsEXA(str) || SpectrumAnalyzer.IsPXA(str)) { scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzer(address); } else if (SpectrumAnalyzer.IsFSW(str)) { scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzerFSW(address); } else if (SpectrumAnalyzer.IsESA(str) || SpectrumAnalyzer.IsPSA(str) || SpectrumAnalyzer.IsE4446A(str)) { scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzerE4446A(address); } else if (SpectrumAnalyzer.IsAV4003(str)) { scpiSpectrumAnalyzer = new ScpiSpectrumAnalyzerAV4033(address); } else { throw new Exception(string.Concat(str, " 不支持对应型号的频谱仪")); } } catch (Exception exception) { throw new Exception(string.Concat("连接频谱仪错误: ", exception.Message)); } return(scpiSpectrumAnalyzer); }
public virtual bool IsMXA() { return(SpectrumAnalyzer.IsMXA(this.Model)); }