Exemplo n.º 1
0
        /// <summary>
        /// 启动线程
        /// </summary>
        /// <param name="plc"></param>
        public void SpinUp(CMONCom devMon, EBIMode runMode = EBIMode.普通老化模式, bool autoMode = false)
        {
            this._devMon = devMon;

            this.autoMode = autoMode;

            this._runMode = runMode;

            if (_threadMon == null)
            {
                _dispose = false;

                if (_autoMode)
                {
                    _paused       = false;
                    _threadStatus = EThreadStatus.运行;
                }
                else
                {
                    _paused       = true;
                    _threadStatus = EThreadStatus.暂停;
                }
                _iniOK                  = false;
                _threadMon              = new Thread(OnStart);
                _threadMon.Name         = _name;
                _threadMon.IsBackground = true;
                _threadMon.Start();
                OnStatusArgs.OnEvented(new CConArgs("创建" + _threadMon.Name + "监控线程"));
            }
        }