Пример #1
0
        /// <summary>
        /// 停止STSEvent管理模块
        /// </summary>
        /// <returns></returns>
        public bool Stop()
        {
            VM_TDRSInfo stsEventRecord = new VM_TDRSInfo();

            stsEventRecord.HeadingDirection = Direction.入库方向;
            stsEventRecord.PortInfo         = null;
            stsEventRecord.CREATED          = DateTime.Now;
            Instance.AddEventLog(stsEventRecord);
            String strMsg = "Stop STSEventLog modle.";

            LogHelper.WriteInfoLog(strMsg);
            Thread.Sleep(2);
            if (m_ThreadSaveSTSEvent != null)
            {
                m_ThreadSaveSTSEvent.Stop();
            }

            return(true);
        }
Пример #2
0
        /// <summary>
        /// 开启TDRSEvent管理模块
        /// </summary>
        /// <returns></returns>
        public bool Start()
        {
            String strMsg = "";

            m_ThreadSaveSTSEvent            = new ThreadSaveSTSEvent();
            m_ThreadSaveSTSEvent.ThreadName = "Thread_EventLog";
            if (!m_ThreadSaveSTSEvent.Start(2))
            {
                strMsg = String.Format("[0] Start EventLog failed.");
                LogHelper.WriteErrorLog(strMsg);
                m_ThreadSaveSTSEvent = null;
                return(false);
            }

            VM_TDRSInfo stsEventRecord = new VM_TDRSInfo();

            stsEventRecord.HeadingDirection = Direction.入库方向;
            stsEventRecord.InputDiInfo      = null;
            stsEventRecord.CREATED          = DateTime.Now;
            Instance.AddEventLog(stsEventRecord);
            strMsg = "STSEventLog Modle started! ";
            LogHelper.WriteInfoLog(strMsg);
            return(true);
        }