public bool Disconnect(object dtu) { FileDtuConnection fc = GetConnection(dtu as DtuNode) as FileDtuConnection; if (OnConnectStatusChanged != null) { OnConnectStatusChanged(fc, WorkingStatus.NA, WorkingStatus.IDLE); } return(true); }
public IDtuConnection GetConnection(DtuNode node) { FileDtuConnection fc = null; string dtuId = node.DtuCode; if (!_connectPool.ContainsKey(dtuId)) { fc = new FileDtuConnection(node); _connectPool[dtuId] = fc; } else { fc = _connectPool[dtuId]; } return(fc); }