using WCS.Core; using PLCType = WCS.Core.PLCType; namespace WCS.Service.PLCAccessors { /// /// PLC访问器创建者 /// public class PLCAccessorsCreater : IPLCAccessorCreater { /// /// 创建PLC访问器 /// /// PLC信息 /// /// public IPLCAccessor Create(PLCInfo data) { if (data.Type == PLCType.Siemens) return new SiemensS7PLC(data.IP, data.Port, data.Rack, data.Slot); else throw new Exception("不支持此PLC"); } } }