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