using WCS.Core; using PLCType = WCS.Core.PLCType; namespace WCS.Service.PLCAccessors { /// /// PLC访问器创建者 /// public class PLCAccessorsCreater : IPLCAccessorCreater { public static string RedisConnStr = default; /// /// 创建PLC访问器 /// /// PLC信息 /// /// public IPLCAccessor Create(PLCInfo data) { switch (data.Type) { case PLCType.Siemens: return new SiemensS7PLC(data.IP, data.Port, data.Rack, data.Slot); default: return new VitrualRedisPLC(data, RedisConnStr); } } } }