public RunComReadDataThread()
 {
     this.commHandler = CommHandle.Instance;
     this.commHandler.PortDataReceiveEvent += PortDataReceive_Event;
     commReadThread = new Thread(new ThreadStart(Run));
     commReadThread.IsBackground = true;
     commReadThread.Start();
 }
Exemple #2
0
        public RunComWriteDataThread()
        {
            this.commHandler = CommHandle.Instance;
            this.commHandler.PortDataReceiveEvent += PortDataReceive_Event;
            if (commHandler != null)
            {
                commWriteThread = new Thread(new ThreadStart(Run));
                commWriteThread.IsBackground = true;
                commWriteThread.Start();

                feedbacktimeout           = new System.Timers.Timer(500);
                feedbacktimeout.AutoReset = false;                //false:表示只产生一次Elapsed事件;true:表示重复的产生该事件
                feedbacktimeout.Elapsed  += feedbacktimeout_Tick;
            }
            else
            {
                Util.Notify(Common.Basic.Level.Err, "写线程传入的AppInterlockHelper实例为null");
            }
        }
 public frmCommSetting()
 {
     InitializeComponent();
     this.mainCommHandler = CommHandle.Instance;
 }