Esempio n. 1
0
        /// <summary>
        /// Timer Action的執行動作
        /// </summary>
        /// <param name="obj">The object.</param>
        public override void doProcess(object obj)
        {
            if (System.Threading.Interlocked.Exchange(ref synPoint, 1) == 0)
            {
                try
                {
                    doCheckIPLinkStatus();
                    //doCheckIPLinkStatusParallel();
                    doCheckEQAliveStatus();
                    scApp.CheckSystemEventHandler.CheckCheckSystemIsExist();

                    ALINE line = scApp.getEQObjCacheManager().getLine();
                    InlineEfficiencyMonitor(line);
                    Task.Run(() =>
                    {
                        CheckLinkStatus(line);
                    });
                    if (SCUtility.getCallContext <bool>(ALINE.CONTEXT_KEY_WORD_LINE_STATUS_HAS_CHANGE))
                    {
                        line.NotifyLineStatusChange();
                        SCUtility.setCallContext(ALINE.CONTEXT_KEY_WORD_LINE_STATUS_HAS_CHANGE, null);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex, "Exception");
                }
                finally
                {
                    System.Threading.Interlocked.Exchange(ref synPoint, 0);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Timer Action的執行動作
        /// </summary>
        /// <param name="obj">The object.</param>
        public override void doProcess(object obj)
        {
            if (System.Threading.Interlocked.Exchange(ref syncPoint, 1) == 0)
            {
                try
                {
                    doCheckIPLinkStatus();
                    scApp.CheckSystemEventHandler.CheckCheckSystemIsExist();

                    InlineEfficiencyMonitor();
                    if (SCUtility.getCallContext <bool>(ALINE.CONTEXT_KEY_WORD_LINE_STATUS_HAS_CHANGE))
                    {
                        line.NotifyLineStatusChange();
                        SCUtility.setCallContext(ALINE.CONTEXT_KEY_WORD_LINE_STATUS_HAS_CHANGE, null);
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex, "Exception");
                }
                finally
                {
                    System.Threading.Interlocked.Exchange(ref syncPoint, 0);
                }
            }
            //if (++excute_count % 2 == 0)
            //    Task.Run(() => doChcekPLCLinkStatus());
            //Task.Run(() => doReadPLCAlive());
        }