/// <summary> /// 当前 服务器用图按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ServerImg_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "TNCI");//根据模板自适应 ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "ONCI"); //原始 ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("HEAThemeGraphTemplateName", ""); ms.DoAutoExtract(false); }
void IceAreaImage_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("SIAI"); ms.DoAutoExtract(true); }
void mniFloodCountImage_Click(object sender, EventArgs e) //水体泛滥天数专题图 { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "FLCI"); ms.DoAutoExtract(true); }
void mniDisSnowDepth_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "SSDI"); ms.DoAutoExtract(true); }
/// <summary> /// 冰面温度专题图按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void IceTempImage_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("ISOI"); ms.DoAutoExtract(true); //MIFCommAnalysis.CreateThemeGraphy(_session, "ISOI", "ICEISOT", "ISOT", "海冰等温线模板", false, false); }
//洪涝专题图 public void grownfloodjc_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0MSI"); ms.DoAutoExtract(false); }
void mniCityArea_Click(object sender, EventArgs e) //判时水体按市县统计 { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("STAT"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0CCC"); ms.DoAutoExtract(true); }
void mniOrdNetImag_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "NCSI"); ms.DoAutoExtract(false); }
//土地类型面积统计 void btnLandType_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("STAT"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "CLUT"); ms.DoAutoExtract(true); }
void btnCompareImg_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "COMI"); ms.DoAutoExtract(true); }
//对比分析图(印巴临时) void mhiDBLVTempImgCurrent_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "TDBI"); ms.DoAutoExtract(true); }
//分市界面积统计 void mhiCity_Click(object sender, EventArgs e) { //按照Instance执行统计操作 IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("STAT"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0CCC"); ms.DoAutoExtract(true); }
/// <summary> /// 监测示意图 有边框 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnMulImage2_Click(object sender, EventArgs e) { //SetIsFixImageRegion(); IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0MSI"); ms.DoAutoExtract(false); }
/// <summary> /// 多通道合成图按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnMulImage_Click(object sender, EventArgs e) { //MIFCommAnalysis.DisplayMonitorShow(_session, "template:海冰产品多通道合成图,多通道合成图,ICE,MCSI"); IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "MCSI"); ms.DoAutoExtract(true); }
/// <summary> /// 热岛效应按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void mhiImgLMCZ_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0LMC"); ms.DoAutoExtract(true); //if (MIFCommAnalysis.CreateThemeGraphy(_session, "0LMC", "", "LMCZ", "陆表高温热效应图模板", false, true) == null) // return; }
private IExtractResult NCIMAlgorithm() { //真彩图处理逻辑 string natrueColorFile = Convert.ToString(_argumentProvider.GetArg("NatrueColorFile")); OpenFileFactory.Open(natrueColorFile); IMonitoringSession ms = _argumentProvider.EnvironmentVarProvider as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "NCIM"); ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "ONCI"); ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("OAIM"); return(null); }
//十级强度图 void mhiTenGradeImage_Click(object sender, EventArgs e) { //if (MIFCommAnalysis.CreateThemeGraphy(_session, "QD10", "QD10", "BPCD", "蓝藻强度专题图(十级)", false, true) == null) // return; IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "QD10"); ms.DoAutoExtract(false); }
/// <summary> /// 面积统计—按市县 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void _dbtnDivision_Click(object sender, EventArgs e) { //if (MIFCommAnalysis.AreaStat(_session, "0CCC", "分级行政区划", false, true) == null) // return; IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("STAT"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0CCC"); ms.DoAutoExtract(true); }
//十级强度面积统计 void mniTenDegreeArea_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("BCDA"); if (SetFileArg(_session, ms.ActiveMonitoringSubProduct.ArgumentProvider, "SelectedPrimaryFiles")) { ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "CDAE"); ms.DoAutoExtract(true); } }
/// <summary> /// 总云量专题图 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnLayoutTCA_Click(object sender, EventArgs e) { try { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "TCAM"); //GetCommandAndExecute(6601);//不显示面板 ms.DoAutoExtract(false); } catch { } }
void btnSVDModeLayout_Click(object sender, EventArgs e) { try { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "MSVD"); //GetCommandAndExecute(6602);//不显示面板 ms.DoAutoExtract(false); } catch (SystemException ex) { MessageBox.Show(ex.Message); } }
private IExtractResult NCIMAlgorithm() { //真彩图处理逻辑 string natrueColorFile = Convert.ToString(_argumentProvider.GetArg("NatrueColorFile")); OpenFileFactory.Open(natrueColorFile); //return new FileExtractResult("HAE", natrueColorFile, false); /* * <Instance name="监测示意图" fileprovider="ContextEnvironment:DBLV" * outfileidentify="0MSI" layoutname="大雾监测示意图模板" * aoiprovider="SystemAOI:DefaultAOI" autogenerategroup="Ord,Dis"/> */ IMonitoringSession ms = _argumentProvider.EnvironmentVarProvider as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "0MSI"); ms.DoAutoExtract(false); return(null); }
public override void Execute(string argument) { if (string.IsNullOrWhiteSpace(argument)) { return; } //string[] vals = argument.Split(','); IMonitoringSession ms = _smartSession.MonitoringSession as IMonitoringSession; IMonitoringSubProduct prd = ms.ChangeActiveSubProduct("DEGR"); if (argument == "DEG1") { prd.ArgumentProvider.SetArg("XInterval", 0.1); prd.ArgumentProvider.SetArg("YInterval", 0.1); } else if (argument == "DEG2") { prd.ArgumentProvider.SetArg("XInterval", 0.25); prd.ArgumentProvider.SetArg("YInterval", 0.25); } else { using (frmCustomIceDegree frm = new frmCustomIceDegree()) { if (frm.ShowDialog() == DialogResult.OK) { prd.ArgumentProvider.SetArg("XInterval", frm.X); prd.ArgumentProvider.SetArg("YInterval", frm.Y); } else { return; } } } prd.ArgumentProvider.SetArg("OutFileIdentify", argument); ms.DoAutoExtract(true); }
private void CreateThemegrahic(string filename) { IMonitoringSession ms = _argumentProvider.EnvironmentVarProvider as IMonitoringSession; IMonitoringSubProduct subDef = ms.ActiveMonitoringProduct.GetSubProductByIdentify("0IMG"); if (subDef != null) { try { subDef.Definition.IsKeepUserControl = true; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "LAOI"); ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("LAOD"); } finally { if (subDef != null) { subDef.Definition.IsKeepUserControl = false; } } } }
/// <summary> /// 雪深监测图(当前区域) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void mniDisSnowDepth_Click(object sender, EventArgs e) { IMonitoringSession ms = _session.MonitoringSession as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); string[] selectedFiles = null; if (TryGetSelectedPrimaryFiles(ref selectedFiles, ms)) { RasterIdentify id = new RasterIdentify(selectedFiles[0]); if (id.SubProductIdentify == "MFSD") { ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "MSDI"); } else if (id.SubProductIdentify == "0SSD") { ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "SSDI"); } } else { ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "SSDI"); } ms.DoAutoExtract(true); }
private IExtractResult HAZEAlgorithm() { float lonMin = float.Parse(_argumentProvider.GetArg("LonMin").ToString()); float lonMax = float.Parse(_argumentProvider.GetArg("LonMax").ToString()); float latMin = float.Parse(_argumentProvider.GetArg("LatMin").ToString()); float latMax = float.Parse(_argumentProvider.GetArg("LatMax").ToString()); float invaild = float.Parse(_argumentProvider.GetArg("Invaild").ToString()); float zoom = (float)_argumentProvider.GetArg("Zoom"); float touResolution = (float)_argumentProvider.GetArg("TouResolution"); int width = (int)_argumentProvider.GetArg("Width"); int height = (int)_argumentProvider.GetArg("Height"); string touFile = Obj2String(_argumentProvider.GetArg("TOUTxt")); bool IsComputerMid = (bool)_argumentProvider.GetArg("IsComputerMid"); bool IsBilinear = (bool)_argumentProvider.GetArg("IsBilinear"); float BilinearRes = float.Parse(_argumentProvider.GetArg("BilinearRes").ToString()); if (string.IsNullOrEmpty(touFile) || !File.Exists(touFile)) { return(null); } Dictionary <string, string> dic = Obj2Dic(_argumentProvider.GetArg("OutEnvelopeSetting")); float outlonMin = float.Parse(dic["outlonMin"]); float outlonMax = float.Parse(dic["outlonMax"]); float outlatMin = float.Parse(dic["outlatMin"]); float outlatMax = float.Parse(dic["outlatMax"]); UpdateOutEnvelope(ref outlonMin, ref outlonMax, ref outlatMin, ref outlatMax, touResolution); IMonitoringSession ms = null; #region 中国区域裁切 bool isChina = (bool)_argumentProvider.GetArg("isChina"); string outFilename = MifEnvironment.GetFullFileName(Path.GetFileName(touFile)); string chinaMask = string.Empty; if (isChina) { chinaMask = AppDomain.CurrentDomain.BaseDirectory + "\\SystemData\\ProductArgs\\FOG\\TOUChinaMask\\china_mask.txt"; } TouProcessor.ProcessTouFile(touFile, ref outFilename, chinaMask); touFile = outFilename; if (string.IsNullOrEmpty(touFile) || !File.Exists(touFile)) { return(null); } #endregion #region 数据格式转换 FY3TouImportSMART import = new FY3TouImportSMART(new Size(width, height), new CoordEnvelope(lonMin, lonMax, latMin, latMax), zoom, invaild, _progressTracker); string error; ISmartSession session = null; object obj = _argumentProvider.GetArg("SmartSession"); if (obj != null) { session = obj as ISmartSession; } bool isBackGround = _argumentProvider.DataProvider != null && session != null && session.SmartWindowManager.ActiveCanvasViewer != null ? true : false; float rasterResulotion = !isBackGround ? touResolution : _argumentProvider.DataProvider.ResolutionX; rasterResulotion = IsBilinear ? (BilinearRes == -1 ? rasterResulotion : BilinearRes) : touResolution; RasterIdentify rid = new RasterIdentify(!isBackGround ? touFile : _argumentProvider.DataProvider.fileName); //中间计算用临时文件,最终结果保存为dstFilename string dstFilename = GetDstFilename(new RasterIdentify(touFile).OrbitDateTime, rid.Satellite, rid.Sensor, rasterResulotion); string tempFilename = dstFilename.Insert(dstFilename.LastIndexOf('.'), "temp"); if (_progressTracker != null) { _progressTracker.Invoke(10, "正在转换指数数据到栅格数据...."); } if (!import.ConvertTextToDat(touFile, tempFilename, new CoordEnvelope(outlonMin, outlonMax, outlatMin, outlatMax), out error)) { if (_contextMessage != null && !string.IsNullOrEmpty(error)) { _contextMessage.PrintMessage(_error); } return(null); } #endregion else { #region 输出结果插值处理 //插值处理的放大 倍数 Int16 intervalZoom = (Int16)Math.Floor(touResolution / rasterResulotion); string tempMidFilename = tempFilename.Insert(tempFilename.LastIndexOf('.'), "_mid"); try { GeoDo.RSS.MIF.Prds.Comm.Raster.BiliNearAndSmoothHelper bilinear = new Comm.Raster.BiliNearAndSmoothHelper(); //中值滤波 if (IsComputerMid) { if (_progressTracker != null) { _progressTracker.Invoke(30, "正在进行中值滤波...."); } bilinear.SmoothComputer(tempFilename, 5, tempMidFilename); } else { tempMidFilename = tempFilename; } //插值 if (IsBilinear) { bilinear.AndBiliNear(tempMidFilename, intervalZoom, dstFilename); if (_progressTracker != null) { _progressTracker.Invoke(60, "正在进行插值处理...."); } } else { if (File.Exists(dstFilename)) { File.Delete(dstFilename); } File.Copy(tempMidFilename, dstFilename); } #endregion #region 专题产品生产 if (_progressTracker != null) { _progressTracker.Invoke(80, "正在生成专题产品...."); } ms = _argumentProvider.EnvironmentVarProvider as IMonitoringSession; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("IsBackGround", isBackGround); bool isOriginal = (bool)_argumentProvider.GetArg("isOriginal"); if (isOriginal) { ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "OHAI"); } else { ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "HAEI"); } ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("SelectedPrimaryFiles", new string[] { dstFilename }); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("isSpecifyFiles", true); ms.DoAutoExtract(false); #endregion } finally { //删除临时文件 if (File.Exists(tempFilename)) { DelteAboutFile(tempFilename); } if (File.Exists(tempMidFilename)) { DelteAboutFile(tempMidFilename); } } } if (File.Exists(dstFilename)) { DisplayResultClass.TrySaveFileToWorkspace(ms.ActiveMonitoringSubProduct, ms, dstFilename, new FileExtractResult("HAZE", dstFilename)); WriteAboutFile(dstFilename); } return(null); }
private IExtractResult NCIMAlgorithm() { //工作路径 string outImageDir = Convert.ToString(_argumentProvider.GetArg("OutImageDir")); if (string.IsNullOrWhiteSpace(outImageDir)) { MessageBox.Show("没有设置工作路径,不能进行数据处理!"); return(null); } string day = DateTime.Now.ToString("yyyyMMdd"); string outdir = Path.Combine(outImageDir, day); if (!Directory.Exists(outdir)) { Directory.CreateDirectory(outdir); } //真彩图处理逻辑 string natrueColorFile = Convert.ToString(_argumentProvider.GetArg("NatrueColorFile")); if (string.IsNullOrWhiteSpace(natrueColorFile)) { return(null); } string[] files = natrueColorFile.Split(new char[] { ',' }); if (files.Length != 2) { return(null); } string filename = files[0]; string newfilename = files[1]; string newfile = Path.Combine(outdir, newfilename); if (filename.ToUpper() != newfile.ToUpper()) { if (File.Exists(newfile)) { try { File.Delete(newfile); } catch (Exception ex) { MessageBox.Show("新文件被占用不能删除,请手动删除后尝试运行!"); return(null); } } File.Copy(filename, newfile); } OpenFileFactory.Open(newfile); bool onlyOpen = bool.Parse(_argumentProvider.GetArg("OnlyOpen").ToString()); if (onlyOpen) { return(null); } float resolution = 0f; int width = 0, height = 0; string rasterfilename = GetRasterFilenameFromDrawing(out resolution, out width, out height); IMonitoringSession ms = _argumentProvider.EnvironmentVarProvider as IMonitoringSession; IMonitoringSubProduct subDef = ms.ActiveMonitoringProduct.GetSubProductByIdentify("0IMG"); if (subDef != null) { try { subDef.Definition.IsKeepUserControl = true; ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "NCIM"); // 低分 "霾监测示意图模板"); string tempname1 = GetThemeGraphTemplateName(resolution, width, height, TemplateType.低分); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("HEAThemeGraphTemplateName", tempname1); ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "TNCI"); // 原始分辨率 //string tempname2 = GetThemeGraphTemplateName(resolution, width, height, TemplateType.低分); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("HEAThemeGraphTemplateName", ""); ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("0IMG"); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("OutFileIdentify", "ONCI"); // 原始 string tempname3 = GetThemeGraphTemplateName(resolution, width, height, TemplateType.原始); ms.ActiveMonitoringSubProduct.ArgumentProvider.SetArg("HEAThemeGraphTemplateName", tempname3); ms.DoAutoExtract(false); ms.ChangeActiveSubProduct("NCIM"); } finally { if (subDef != null) { subDef.Definition.IsKeepUserControl = false; } } } return(null); }