示例#1
0
        private void SetSystemArguments(IMonitoringSubProduct subProduct)
        {
            IMonitoringSession msession = _session.MonitoringSession as IMonitoringSession;

            subProduct.ArgumentProvider.SetArg("ThemeGraphyGenerator", msession.ThemeGraphGenerator);
            subProduct.ArgumentProvider.SetArg("FileNameGenerator", FileNameGeneratorDefault.GetFileNameGenerator());
            subProduct.ArgumentProvider.SetArg("SmartSession", _session);
            if (subProduct.Definition.IsNeedCurrentRaster)
            {
                ICanvasViewer cv = _session.SmartWindowManager.ActiveCanvasViewer;
                if (cv != null)
                {
                    subProduct.ArgumentProvider.SetArg(ArgumentProvider.ARGUMENT_NAME_INTERACTIVER, cv as ICurrentRasterInteractiver);
                }
            }
            subProduct.ArgumentProvider.SetArg(ArgumentProvider.ENV_VAR_PROVIDER, _session.MonitoringSession as IEnvironmentVarProvider);
        }
示例#2
0
        private IMonitoringSubProduct CreateMonitoringSubProduct(string rstFileName, string productIdentify, string subProductIdentify)
        {
            MonitoringSession     session        = new MonitoringSession(_session);
            IMonitoringProduct    monitorProduct = session.ChangeActiveProduct(productIdentify);
            IMonitoringSubProduct subprd         = session.ChangeActiveSubProduct(subProductIdentify);

            if (monitorProduct == null || subprd == null)
            {
                return(null);
            }
            RasterIdentify           rstIdentify = new RasterIdentify(rstFileName);
            ExtractAlgorithmIdentify id          = new ExtractAlgorithmIdentify();

            id.Satellite = rstIdentify.Satellite;
            id.Sensor    = rstIdentify.Sensor;
            AlgorithmDef alg = subprd.Definition.GetAlgorithmDefByAlgorithmIdentify(id);

            if (alg == null)
            {
                PrintInfo("没有匹配的算法:" + "卫星" + rstIdentify.Satellite + ",传感器" + rstIdentify.Sensor);
                return(null);
            }
            subprd.ResetArgumentProvider(alg.Identify);
            subprd.ArgumentProvider.SetArg("AlgorithmName", alg.Identify);
            subprd.ArgumentProvider.SetArg("FileNameGenerator", FileNameGeneratorDefault.GetFileNameGenerator());
            if (alg.Bands != null && alg.Bands.Length > 0)
            {
                MonitoringThemeFactory.SetBandArgs(subprd, rstIdentify.Satellite, rstIdentify.Sensor);
                foreach (BandDef band in alg.Bands)
                {
                    if (subprd.ArgumentProvider.GetArg(band.Identify).ToString() == "-1")
                    {
                        PrintInfo("从波段映射表获取\"" + band.Identify + "\"的波段序号失败,生成过程终止!");
                        return(null);
                    }
                }
            }
            return(subprd);
        }