/// <summary> /// delegate保存位置 /// </summary> public static CtrlUnit Connect(string currentAddress, CtrlUnit.ValidateSupportDelegate supportDelegate, bool interactive) { CtrlUnit tempUnit = null; try { //CtrlUnit tempUnit = null; string str = (currentAddress != null ? currentAddress : "GPIB0::18::INSTR"); if (CtrlUnit.DetermineSupport(str)) { tempUnit = CtrlUnit.CreateDetectedDCPowerSupply(str); } tempUnit.Connected = true; return(tempUnit); } catch (Exception exception) { return(null); //throw new Exception(exception.ToString()); } //if (tempUnit != null) //{ //tempUnit.Connected = true; //} }
/// <summary> /// 判断是否可以支持对应型号的频率测量模块 /// </summary> /// <param name="address"></param> /// <returns></returns> private static bool DetermineSupport(string address) { CtrlUnit tempUnit = null; try { tempUnit = CtrlUnit.CreateDetectedDCPowerSupply(address); } catch { throw; } return(tempUnit != null); }