Exemple #1
0
        public bool Disconnect(object dtu)
        {
            FileDtuConnection fc = GetConnection(dtu as DtuNode) as FileDtuConnection;

            if (OnConnectStatusChanged != null)
            {
                OnConnectStatusChanged(fc, WorkingStatus.NA, WorkingStatus.IDLE);
            }
            return(true);
        }
Exemple #2
0
        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);
        }