public static MvaOmronPlcLdd GetOrCreate(string key) { if (!PlcMapper.ContainsKey(key)) { PlcMapper[key] = new MvaOmronPlcLdd(); } var plc = PlcMapper[key]; return(plc); }
public static MvaOmronPlcLdd Create(string key) { if (PlcMapper.ContainsKey(key)) { throw new Exception("PLC己經存在"); } var plc = PlcMapper[key] = new MvaOmronPlcLdd(); return(plc); }