public SyncComReceiver(ComDtuConnection comconn, string dtuid, float timeout)
 {
     this.port               = comconn._port;
     this._comconn           = comconn;
     this.dtuId              = dtuid;
     this.timeout            = timeout;
     this.port.DataReceived += this.OnDataReceived;
 }
Beispiel #2
0
        // COM 建立连接.
        public IDtuConnection GetConnection(DtuNode dtuInfo)
        {
            ComDtuConnection cc    = null;
            string           dtuId = dtuInfo.DtuCode;

            if (!this._connectPool.ContainsKey(dtuId))
            {
                cc = new ComDtuConnection(dtuInfo);
                this._connectPool[dtuId] = cc;
            }
            else
            {
                cc = this._connectPool[dtuId];
            }
            return(cc);
        }