コード例 #1
0
        /// <summary>
        /// 采用两表联合查询的方式验证预警数据
        /// </summary>
        /// <param name="ds"></param>
        private void Match(DeviceDataSource ds)
        {
            //读取数据库中JsonColumnName列,并且匹配
            IDataSource dataSource = ds.DataSource;

            AbstractEarlyWarningPlugin plugin = Plugins.Where(p => ((EarlyWarningPluginInfo)p.PluginInfo).Match(dataSource)).FirstOrDefault();

            if (plugin != null)
            {
                plugin.Execute(dataSource);
            }
            if (KeyWordPlugin != null)
            {
                KeyWordPlugin.Execute(dataSource);
            }
            return;
        }
コード例 #2
0
        private void Match(DeviceDataSource ds, List <DataNode> dataNodes)
        {
            //读取数据库中JsonColumnName列,并且匹配
            IDataSource dataSource = ds.DataSource;

            AbstractEarlyWarningPlugin plugin = Plugins.Where(p => ((EarlyWarningPluginInfo)p.PluginInfo).Match(dataSource)).FirstOrDefault();

            if (plugin != null)
            {
                EarlyWarningPluginArgument arg = new EarlyWarningPluginArgument(ds, dataNodes, earlyWarningResult);
                plugin.Execute(arg, null);
            }
            if (KeyWordPlugin != null)
            {
                EarlyWarningPluginArgument arg = new EarlyWarningPluginArgument(ds, dataNodes, earlyWarningResult);
                KeyWordPlugin.Execute(arg, null);
            }
            return;
        }