Пример #1
0
        public void doProcess_run()
        {
            CFATLogger.output_proc("#### Run Start ------>");
            m_nState = ESYS_STATE.RUN;
            OnInit();
            m_nInvalidTicks = 0;
            while (m_nState == ESYS_STATE.RUN)
            {
                if (!isWorkTime())
                {
                    CFATLogger.output_proc("No work time!!!");
                    break;
                }

                process_event();// If get event from Manager, do it.
                if (!OnTick())
                {
                    if (m_nInvalidTicks > 200)
                    {
                        CFATLogger.output_proc("Network connections fail!, Systom will stop!");
                        break;
                    }
                }

                //if ( CFATManager.isOnlineMode())
                //  Thread.Sleep(1);
                //Thread.Sleep(10);
            }

            CFATLogger.output_proc(string.Format("System Stoped , state = {0}", m_nState));
            if (m_nState != ESYS_STATE.STOP_ALL)
            {
                m_nState = ESYS_STATE.STOP;
            }

            makeReport();
            OnDeInit();
            CFATLogger.output_proc("#### Run End <------");
        }
Пример #2
0
 public void stop()
 {
     CFATLogger.output_proc("Clicked Stop All !!!");
     m_nState = ESYS_STATE.STOP_ALL;
 }