public static void Register(PointVirtualCollcet points, ILog log) { var mapping = ModbusPointMapping.GetInstance(log); foreach (var point in points.BoolPoints) { if (mapping.Find(point.Name)) { log.ErrorLog(string.Concat("Point Register Error:Duplication point name <", point.Name, ">")); } else { mapping.Register(point.Name, point); } } foreach (var point in points.UshortPoints) { if (mapping.Find(point.Name)) { log.ErrorLog(string.Concat("Point Register Error:Duplication point name <", point.Name, ">")); } else { mapping.Register(point.Name, point); } } }
public bool Init() { _mapping = ModbusPointMapping.GetInstance(_log); var factory = new SocketServerFactroy(_ipString, _port, _log, _timeOut, readCacheSize, _maxConnect); _socketServer = factory.CreateInstance(_socketServerType); if (_socketServer.Init()) { _socketServer.ReadComplete += recivceDataHanding; _socketServer.SendComplete += sendComplete; return(true); } return(false); }