public PipelineTestRunPublisher(IClientFactory clientFactory, IPipelineConfig pipelineConfig, ITraceLogger logger, ITelemetryDataCollector telemetry)
 {
     _logger         = logger;
     _telemetry      = telemetry;
     _pipelineConfig = pipelineConfig;
     _httpClient     = clientFactory.GetClient <TestResultsHttpClient>();
 }
示例#2
0
 public frmMapLayerOrganize(IMap pMap, IPipelineConfig config)
 {
     InitializeComponent();
     _map    = pMap;
     _config = config;
     InitData();
 }
示例#3
0
 public PoPointAlarmForm(IAppContext context, IPipelineConfig config)
 {
     this.InitializeComponent();
     m_iApp     = context;
     MapControl = m_iApp.MapControl as IMapControl3;
     pPipeCfg   = config;
 }
示例#4
0
        public static object GetValueFromTable(IPipelineConfig config, string strTableName, string strKeyFieldName,
                                               string strKeyFieldValue, string strDstFieldName)
        {
            object obj;
            ITable table = CommonUtils.GetTable(config, strTableName);

            if (table != null)
            {
                string       str = string.Concat(strKeyFieldName, " = '", strKeyFieldValue, "'");
                IQueryFilter queryFilterClass = new QueryFilter();
                queryFilterClass.WhereClause = (str);
                ICursor cursor     = table.Search(queryFilterClass, false);
                IRow    row        = cursor.NextRow();
                int     fieldIndex = CommonUtils.GetFieldIndex(table, strDstFieldName);
                if (row != null)
                {
                    object value = row.get_Value(fieldIndex);
                    Marshal.ReleaseComObject(cursor);
                    obj = value;
                }
                else
                {
                    Marshal.ReleaseComObject(cursor);
                    obj = null;
                }
            }
            else
            {
                obj = null;
            }
            return(obj);
        }
示例#5
0
        public static bool IsPipeLine(IPipelineConfig config, string strLayerName)
        {
            object valueFromTable = CommonUtils.GetValueFromTable(config, "EmFeatureClassInfo", "层名", strLayerName,
                                                                  "管线类别");

            return(valueFromTable == null ? false : !Convert.IsDBNull(valueFromTable));
        }
示例#6
0
        public override void OnClick(object sender, EventArgs args)
        {
            _context.SetCurrentTool(this);

            //this._iFeature = null;
            _pipelineConfig = _plugin.PipeConfig;
        }
示例#7
0
        public override void Initialize(IAppContext context)
        {
            _context          = context;
            _menuGenerator    = context.Container.GetInstance <MenuGenerator>();
            _config           = context.Container.GetSingleton <PipelineConfig>();
            _dockPanelService = context.Container.GetInstance <DockPanelService>();
            if (string.IsNullOrEmpty(_config.XmlFile))
            {
                string fileName =
                    ((ISecureContext)_context).YutaiProject?.FindPlugin("f804e812-481e-45c3-be08-749da82075d1")
                    .ConfigXML;
                if (string.IsNullOrEmpty(fileName))
                {
                    return;
                }
                fileName = FileHelper.GetFullPath(fileName);
                _config.LoadFromXml(fileName);
            }

            _projectListener = context.Container.GetInstance <ProjectListener>();
            //_contextEvents.OnProjectChanged += _contextEvents_OnProjectChanged;
            //_menuListener = context.Container.GetInstance<MenuListener>();
            //_mapListener = context.Container.GetInstance<MapListener>();
            // _dockPanelService = context.Container.GetInstance<TemplateDockPanelService>();
        }
示例#8
0
 public ImageRequestAction(string virtualPath, NameValueCollection query, IPipelineConfig conf = null)
 {
     this.conf = (conf == null) ? Config.Current.Pipeline : conf;
     ReauthorizeFinalPath = true;
     Source = virtualPath;
     Settings = new ResizeSettings(query);
 }
 public GivenPipelineConfigForTestingPolymorphicCommands()
 {
     PipelineConfig      = new PipelineConfig();
     HistoryOfVisits     = new List <string>();
     StageConfigVisitorA = new StageConfig <Visitor>(StageName.VisitorA, () => new Visitor(StageName.VisitorA, HistoryOfVisits));
     PipelineConfig.AddStage(StageConfigVisitorA);
 }
 public GivenPipelineConfigForTestingStageOrdering()
 {
     _pipelineConfig = new PipelineConfig();
     _pipelineConfig.AddStage(new StageConfig <SimpleLogger>("S1", () => new SimpleLogger()));
     _pipelineConfig.AddStage(new StageConfig <Visitor>("S2", () => new Visitor("Visitor A")));
     _pipelineConfig.AddStage(new StageConfig <Visitor>("S3", () => new Visitor("Visitor B")));
 }
示例#11
0
 public FormMaiShenAnalysis(IAppContext context, IPipelineConfig config)
 {
     this.InitializeComponent();
     _context = context;
     _config  = config;
     m_RuleMs = new RuleMs(config);
 }
示例#12
0
        public override void OnClick()
        {
            _context.SetCurrentTool(this);

            //this._iFeature = null;
            _pipelineConfig = _plugin.PipeConfig;
        }
示例#13
0
文件: RuleMs.cs 项目: secondii/Yutai
        public RuleMs(IPipelineConfig config)
        {
            ITable table = ((IFeatureWorkspace)config.Workspace).OpenTable("YT_PIPE_DEPTH");

            _rules = new List <RuleMsItem>();
            ICursor cursor  = table.Search(null, false);
            int     codeIdx = cursor.FindField("PipeCode");
            int     nameIdx = cursor.FindField("PipeName");
            int     msfsIdx = cursor.FindField("MSFS");
            int     rxdIdx  = cursor.FindField("RXDDepth");
            int     cxdIdx  = cursor.FindField("CXDDepth");
            int     bzIdx   = cursor.FindField("Remark");
            IRow    row     = cursor.NextRow();

            while (row != null)
            {
                RuleMsItem item = new RuleMsItem()
                {
                    Code     = row.get_Value(codeIdx).ToString(),
                    Name     = row.get_Value(nameIdx).ToString(),
                    MSFS     = row.get_Value(msfsIdx).ToString(),
                    RxdDepth = Convert.ToDouble(row.get_Value(rxdIdx).ToString()),
                    CxdDepth = Convert.ToDouble(row.get_Value(cxdIdx).ToString()),
                    Remark   = row.get_Value(bzIdx).ToString()
                };
                _rules.Add(item);
                row = cursor.NextRow();
            }
            Marshal.ReleaseComObject(cursor);
            Marshal.ReleaseComObject(table);
        }
示例#14
0
        public static string GetPipeCatNameFromLayerName(IPipelineConfig config, string strLayerName)
        {
            object valueFromTable = CommonUtils.GetValueFromTable(config, "EmFeatureClassInfo", "层名", strLayerName,
                                                                  "管线类别");

            return(valueFromTable != null ? (string)valueFromTable : "");
        }
示例#15
0
 public CorePipeline(IPipelineConfig config) : this()
 {
     _config = config as IPipelineConfigAccess;
     _config.Data.OnGetCurrentStage   += OnGetCurrentStage;
     _config.Data.OnGetEventListeners += () => new ReadOnlyCollection <EventListener>(_eventListeners);
     _config.Data.OnGetStages         += () => _config.Stages;
     //   RegisterObserver<ExceptionObserver>();
 }
示例#16
0
文件: Section.cs 项目: secondii/Yutai
 public Section(object objFrom, IAppContext pApp, IPipelineConfig pipeConfig)
 {
     this.m_context                 = pApp;
     this.PipeConfig                = pipeConfig;
     this.m_nSelectIndex            = -1;
     this.m_pSectionDisp            = new SectionDisp(objFrom);
     this.m_pSectionDisp.PipeConfig = pipeConfig;
 }
示例#17
0
 public FrmPipeLabelsSetting(IAppContext context, IPipelineConfig pipelineConfig)
 {
     InitializeComponent();
     _context        = context;
     _pipelineConfig = pipelineConfig;
     LoadPipelineLayers();
     ComboBoxHelper.AddItemsFromSystemFonts(cmbSetAnnoPointFront);
     ComboBoxHelper.AddItemsFromSystemFonts(cmbSetAnnoLineFront);
 }
示例#18
0
        public VerDistDlg(IAppContext pApp, IPipelineConfig config)
        {
            this.InitializeComponent();
            chitAnalyse_0 = new CHitAnalyse(config);

            this.m_commonDistAls = new CommonDistAnalyse()
            {
                m_nAnalyseType = DistAnalyseType.emVerDist
            };
            this.m_app = pApp;
            _config    = config;
            this.m_commonDistAls.PipeConfig = _config;
            this.m_nTimerCount = 0;
        }
示例#19
0
 public SectionViewFrm(SectionViewFrm.SectionType stVal, IAppContext pApp, IPipelineConfig config)
 {
     this.m_sectionType = stVal;
     this._context      = pApp;
     if (this.m_sectionType == SectionViewFrm.SectionType.SectionTypeTransect)
     {
         this.m_pSection = new TranSection(this, _context, config);
     }
     if (this.m_sectionType == SectionViewFrm.SectionType.SectionTypeVersect)
     {
         this.m_pSection = new VerSection(this, _context, config);
     }
     this.m_pSection.PipeConfig = config;
     this.InitializeComponent();
 }
示例#20
0
        public Frm3DBuilder(IPipelineConfig config)
        {
            InitializeComponent();
            _config = config;

            _items = new List <I3DItem>();
            foreach (IPipelineLayer pipelineLayer in _config.Layers)
            {
                _items.Add(new Pipeline3DItem(this, pipelineLayer));
            }

            this.checkedListBoxPipelineLayers.DataSource = _items;
            checkedListBoxPipelineLayers.DisplayMember   = "Name";

            Register();
        }
示例#21
0
        public HitAnalyseDlg(IAppContext pApp, IPipelineConfig config)
        {
            this.InitializeComponent();
            cmbDepthType.SelectedIndex = 0;
            this.m_commonDistAls       = new CommonDistAnalyse()
            {
                m_nAnalyseType = DistAnalyseType.emHitDist
            };
            chitAnalyse_0 = new CHitAnalyse(config);

            this.m_app   = pApp;
            m_PipeConfig = config;
            this.m_commonDistAls.PipeConfig = config;
            this.m_nTimerCount    = 0;
            this.hitAnalyseType_0 = HitAnalyseDlg.HitAnalyseType.emHitAnalyseSelect;
        }
示例#22
0
        public static bool IsPipeLineByFeatureClassName(IPipelineConfig config, string strFeaClassName)
        {
            bool   flag;
            object valueFromTable = CommonUtils.GetValueFromTable(config, "EmFeatureClassInfo", "要素类", strFeaClassName,
                                                                  "管线类别");

            if (valueFromTable != null)
            {
                flag = (!Convert.IsDBNull(valueFromTable) ? ((string)valueFromTable).Trim() != "" : false);
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
示例#23
0
        protected DefaultConfiguredVisitorsPipelineScenarioTests(string visitCommandName)
        {
            PipelineConfig  = new PipelineConfig();
            HistoryOfVisits = new List <string>();
            var visitorA = new StageConfig <Visitor>("V1", () => new Visitor(VisitorA, HistoryOfVisits));
            var visitorB = new StageConfig <Visitor>("V2", () => new Visitor(VisitorB, HistoryOfVisits));

            visitorA.CommandConfig
            .WithVisitCommand(visitCommandName)
            .WithSessionCommands();
            visitorB.CommandConfig
            .WithVisitCommand(visitCommandName)
            .WithSessionCommands();

            PipelineConfig.AddStage(visitorA);
            PipelineConfig.AddStage(visitorB);
        }
示例#24
0
        /// <inheritdoc />
        public async Task InitializeAsync(IClientFactory clientFactory, IPipelineConfig pipelineConfig, ITraceLogger traceLogger)
        {
            await Task.Run(() =>
            {
                _logger         = traceLogger;
                var publisher   = new PipelineTestRunPublisher(clientFactory, pipelineConfig);
                var telemetry   = new TelemetryDataCollector(clientFactory);
                _testRunManager = new TestRunManager(publisher, _logger);
                var parsers     = ParserFactory.GetTestResultParsers(_testRunManager, traceLogger, telemetry);

                foreach (var parser in parsers)
                {
                    //Subscribe parsers to Pub-Sub model
                    Subscribe(parser.Parse);
                }
            });
        }
示例#25
0
        public static float GetPipeLineAlarmHrzDistByFeatureClassName(IPipelineConfig config, string strFeaClassName1,
                                                                      string strFeaClassName2)
        {
            float  single;
            string str;
            string str1;
            object valueFromTable = CommonUtils.GetValueFromTable(config, "EMFeatureClassInfo", "要素类", strFeaClassName1,
                                                                  "管线类别");

            if (valueFromTable != null)
            {
                str            = (!Convert.IsDBNull(valueFromTable) ? valueFromTable.ToString() : "");
                valueFromTable = CommonUtils.GetValueFromTable(config, "EMFeatureClassInfo", "要素类", strFeaClassName2,
                                                               "管线类别");
                if (valueFromTable != null)
                {
                    str1 = (!Convert.IsDBNull(valueFromTable) ? valueFromTable.ToString() : "");
                    if (str.Length > 2)
                    {
                        str = str.Substring(0, 2);
                    }
                    if (str1.Length > 2)
                    {
                        str1 = str1.Substring(0, 2);
                    }
                    object pipeLineAlarmHrzDist = CommonUtils.GetPipeLineAlarmHrzDist(config, str, str1);
                    if (pipeLineAlarmHrzDist != null)
                    {
                        single = (!Convert.IsDBNull(pipeLineAlarmHrzDist) ? Convert.ToSingle(pipeLineAlarmHrzDist) : 0f);
                    }
                    else
                    {
                        single = 0f;
                    }
                }
                else
                {
                    single = 0f;
                }
            }
            else
            {
                single = 0f;
            }
            return(single);
        }
示例#26
0
        /// <inheritdoc />
        public async Task InitializeAsync(IClientFactory clientFactory, IPipelineConfig pipelineConfig, ITraceLogger traceLogger, ITelemetryDataCollector telemetry)
        {
            await Task.Run(() =>
            {
                _logger         = traceLogger;
                _telemetry      = telemetry;
                var publisher   = new PipelineTestRunPublisher(clientFactory, pipelineConfig, _logger, _telemetry);
                _testRunManager = new TestRunManager(publisher, _logger, _telemetry);
                var parsers     = ParserFactory.GetTestResultParsers(_testRunManager, traceLogger, _telemetry).ToList();

                _telemetry.AddOrUpdate(TelemetryConstants.ParserCount, parsers.Count);

                foreach (var parser in parsers)
                {
                    // Subscribe parsers to Pub-Sub model
                    Subscribe(parser.Parse);
                }
            });
        }
示例#27
0
        public static ITable GetTable(IPipelineConfig config, string strTableName)
        {
            ITable table;

            if (config.Workspace != null)
            {
                IFeatureWorkspace workspace = config.Workspace as IFeatureWorkspace;
                if (!(config.Workspace as IWorkspace2).get_NameExists(esriDatasetType.esriDTTable, strTableName))
                {
                    table = null;
                }
                else
                {
                    table = workspace.OpenTable(strTableName);
                }
            }
            else
            {
                table = null;
            }
            return(table);
        }
示例#28
0
 public override void Initialize(IAppContext context)
 {
     _context       = context;
     _menuGenerator = context.Container.GetInstance <MenuGenerator>();
     _config        = context.Container.GetSingleton <PipelineConfig>();
     //_dockPanelService = context.Container.GetInstance<DockPanelService>();
     if (string.IsNullOrEmpty(_config.XmlFile))
     {
         string fileName =
             ((ISecureContext)_context).YutaiProject.FindPlugin("95ab64f9-65ca-400f-8f68-c18cadff1421")
             .ConfigXML;
         if (string.IsNullOrEmpty(fileName))
         {
             return;
         }
         fileName = FileHelper.GetFullPath(fileName);
         _config.LoadFromXml(fileName);
     }
     //_menuListener = context.Container.GetInstance<MenuListener>();
     //_mapListener = context.Container.GetInstance<MapListener>();
     // _dockPanelService = context.Container.GetInstance<TemplateDockPanelService>();
 }
示例#29
0
        public static float GetPipeLineAlarmVerDistByFeatureClassName(IPipelineConfig config, string className1,
                                                                      string className2, string strBuryKind1, string strBuryKind2)
        {
            float           single;
            string          str;
            string          str1;
            IBasicLayerInfo pipeLayer1           = config.GetBasicLayerInfo(className1);
            IBasicLayerInfo pipeLayer2           = config.GetBasicLayerInfo(className2);
            IPipelineLayer  pipeline1            = config.GetPipelineLayer(pipeLayer1.FeatureClass);
            IPipelineLayer  pipeline2            = config.GetPipelineLayer(pipeLayer2.FeatureClass);
            object          pipeLineAlarmVerDist = CommonUtils.GetPipeLineAlarmVerDist(config, pipeline1.ClassCode,
                                                                                       pipeline2.ClassCode, strBuryKind1, strBuryKind2);

            if (pipeLineAlarmVerDist != null)
            {
                single = (!Convert.IsDBNull(pipeLineAlarmVerDist) ? Convert.ToSingle(pipeLineAlarmVerDist) : 0f);
            }
            else
            {
                single = 0f;
            }

            return(single);
        }
示例#30
0
        public static float GetPipeLineAlarmHrzDistByFeatureClassName2(IPipelineConfig config, string strFeaClassName1,
                                                                       string strFeaClassName2, IFeature pFeature1, IFeature pFeature2)
        {
            float           single;
            string          str;
            string          str1;
            IBasicLayerInfo pipeLayer1            = config.GetBasicLayerInfo(strFeaClassName1);
            IBasicLayerInfo pipeLayer2            = config.GetBasicLayerInfo(strFeaClassName2);
            IPipelineLayer  pipeline1             = config.GetPipelineLayer(pipeLayer1.FeatureClass);
            IPipelineLayer  pipeline2             = config.GetPipelineLayer(pipeLayer2.FeatureClass);
            object          pipeLineAlarmHrzDist2 = CommonUtils.GetPipeLineAlarmHrzDist2(config, pipeline1.ClassCode,
                                                                                         pipeline2.ClassCode, pFeature1, pFeature2, pipeLayer1, pipeLayer2);

            if (pipeLineAlarmHrzDist2 != null)
            {
                single = (!Convert.IsDBNull(pipeLineAlarmHrzDist2) ? Convert.ToSingle(pipeLineAlarmHrzDist2) : 0f);
            }
            else
            {
                single = 0f;
            }

            return(single);
        }
示例#31
0
        public override void Initialize(IAppContext context)
        {
            _context       = context;
            _menuGenerator = context.Container.GetInstance <MenuGenerator>();

            //_menuListener = context.Container.GetInstance<MenuListener>();
            //_mapListener = context.Container.GetInstance<MapListener>();
            _dockPanelService = context.Container.GetInstance <TemplateDockPanelService>();

            //获取配置对象
            _pipelineConfig = context.Container.GetSingleton <PipelineConfig>();
            if (string.IsNullOrEmpty(_pipelineConfig.XmlFile))
            {
                string fileName =
                    ((ISecureContext)_context).YutaiProject.FindPlugin("4a3bcaab-9d3e-4ca7-a19d-7ee08fb0629e")
                    .ConfigXML;
                if (string.IsNullOrEmpty(fileName))
                {
                    return;
                }
                //fileName = FileHelper.GetFullPath(fileName);
                //_pipelineConfig.LoadFromXml(fileName);
            }
        }
示例#32
0
 public ImageRequestAction(object source, NameValueCollection query, string cachingKey, IPipelineConfig conf = null)
 {
     this.conf = (conf == null) ? Config.Current.Pipeline : conf;
     this.Source = source;
     this.Settings = new ResizeSettings(query);
 }