public static ModulationUnit Connect(string currentAddress, ModulationUnit.ValidateSupportDelegate supportDelegate, bool interactive) { ModulationUnit AModulationUnit = null; string str = (currentAddress != null ? currentAddress : "GPIB0::19::INSTR"); ModulationUnit.m_ValidateSupportDelegate = supportDelegate; if (interactive) { throw new Exception("不支持交互模式"); } try { string str1 = ModulationUnit.DetermineSupport(str); if (str1 != null) { throw new Exception(str1); } AModulationUnit = new ModulationUnit504(currentAddress); } catch { throw; } return(AModulationUnit); }
private static string DetermineSupport(string address) { if (ModulationUnit.m_ValidateSupportDelegate == null) { return(null); } ModulationUnit AModulationUnit = null; if (AModulationUnit == null) { return("无法识别对应的调制单元"); } return(ModulationUnit.m_ValidateSupportDelegate(AModulationUnit)); }