public void Start(out string errMsg) { errMsg = ""; if (IsRuning) { return; } LoadConfig(); WebPandaZHCDScadaCommand.CreateInitSensorRealData(Config.yaLiParam).Execute(); //初始化实时表 timer = new System.Timers.Timer(); timer.Interval = collectInterval * 60 * 1000; timer.Elapsed += (o, e) => { try { ReceiveCommand(new ReciveData()); } catch (Exception ee) { TraceManagerForWeb.AppendErrMsg("Scada-WEB-综合监测点定时任务执行失败:" + ee.Message); } }; timer.Enabled = true; IsRuning = true; // 开始异步执行一次-防止启动卡死 Action <ReciveData> action = ReceiveCommand; action.BeginInvoke(new ReciveData(), null, null); }
private void ExcuteHandle() { // 报警维护 WebPandaZHCDScadaCommand.CreateCollectAndSaveScadaSensors(Config.CeDianParam).Execute(); }