コード例 #1
0
        public void Start(out string errMsg)
        {
            errMsg = "";
            if (IsRuning)
            {
                return;
            }

            LoadConfig();

            WebPandaYLScadaCommand.CreateInitSensorRealData(Config.yaLiParam).Execute(); //初始化实时表

            timer          = new System.Timers.Timer();
            timer.Interval = collectInterval * 60 * 1000;
            timer.Elapsed += (o, e) =>
            {
                try
                {
                    ReceiveCommand(new RequestCommand());
                }
                catch (Exception ee)
                {
                    TraceManagerForWeb.AppendErrMsg("Scada-WEB-压力监测点定时任务执行失败:" + ee.Message);
                }
            };
            timer.Enabled = true;

            IsRuning = true;

            // 开始异步执行一次-防止启动卡死
            Action <RequestCommand> action = ReceiveCommand;

            action.BeginInvoke(new RequestCommand(), null, null);
        }
コード例 #2
0
 private void ExcuteHandle()
 {
     // 报警维护
     WebPandaYLScadaCommand.CreateCollectAndSaveScadaSensors(Config.yaLiParam).Execute();
 }