Example #1
0
 public static WebPandaPumpCommand CreateInitPumpRealData(PandaParam param)
 {
     return(new WebPandaPumpCommand()
     {
         Type = WebPandaPumpCommandType.InitPumpRealData, param = param
     });
 }
Example #2
0
 public static WebPandaZHCDScadaCommand CreateInitSensorRealData(PandaParam param)
 {
     return(new WebPandaZHCDScadaCommand()
     {
         Type = WebPandaZHCDScadaCommandType.InitSensorRealData, param = param
     });
 }
Example #3
0
 public static WebPandaPumpCommand CreateCollectAndSavePumpPoints(PandaParam param)
 {
     return(new WebPandaPumpCommand()
     {
         Type = WebPandaPumpCommandType.CollectAndSavePumpPoints, param = param
     });
 }
Example #4
0
 public static WebPandaZHCDScadaCommand CreateCollectAndSaveScadaSensors(PandaParam param)
 {
     return(new WebPandaZHCDScadaCommand()
     {
         Type = WebPandaZHCDScadaCommandType.CollectAndSaveScadaSensors, param = param
     });
 }
Example #5
0
        public void Start(out string errMsg)
        {
            errMsg = "";
            if (IsRuning)
            {
                return;
            }

            // 环境检查
            if (!EnvChecker.CheckPandaYaLiWEB(out errMsg))
            {
                return;
            }
            TraceManagerForWeb.AppendDebug("Scada-WEB-压力监测点环境检查通过");
            this.param = Config.pandaYaLiParam;

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

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

            // 控制器服务
            if (commandCustomer != null)
            {
                commandCustomer.Stop();
            }
            commandCustomer = new CommandConsumer(ConsumerCommand);
            commandCustomer.Start();
            if (commandCustomer.IsRuning)
            {
                TraceManagerForWeb.AppendDebug("Scada-WEB-压力监测点控制器服务已经打开");
            }
            else
            {
                TraceManagerForWeb.AppendErrMsg("Scada-WEB-压力监测点控制器服务打开失败");
                Stop();
                return;
            }

            IsRuning = true;

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

            action.BeginInvoke(null, null);
        }