private void AddBlockInfoItem(BlockInfo blockItem) { if (blockItem == null) { return; } string path = DataPathHelper.DataServerBlockPath + blockItem.datapath; //if (path.Contains("NOAA18") || path.Contains("NA18")) // path = path.Replace("T:", "D:"); if (!System.IO.File.Exists(path)) { return; } BlockInfoItem item = BlockInfoItem.Create(blockItem); if (item == null) { return; } //查找是否已经加载同文件名的数据 foreach (BlockInfoItem match in _recivedBlocks) { if (match.BlockInfo.datapath == item.BlockInfo.datapath) { return; } } _recivedBlocks.Add(item); }
public static BlockInfoItem Create(BlockInfo info) { if (info == null) { return(null); } if (string.IsNullOrWhiteSpace(info.datapath)) { return(null); } string fullfilename = DataPathHelper.DataServerBlockPath + info.datapath; if (!System.IO.File.Exists(fullfilename)) { return(null); } BlockInfoItem item = new BlockInfoItem(); item.BlockInfo = info; item.Name = info.envname; item.Envelope = new CoordEnvelope(info.minx.GetValueOrDefault(), info.maxx.GetValueOrDefault(), info.miny.GetValueOrDefault(), info.maxy.GetValueOrDefault()); if (info.mosaicInfo != null) { item.Satalite = info.mosaicInfo.satellite; item.Sensor = info.mosaicInfo == null ? "" : info.mosaicInfo.sensor; } else { item.Satalite = info.projectionInfo.orbitInfo.satellite; item.Sensor = info.projectionInfo.orbitInfo.sensor; } return(item); }
private void AddBlock(BlockInfoItem blockInfoItem) { string satellite = _filter.Satellite; string sensor = _filter.Sensor; if (blockInfoItem.BlockInfo.mosaicInfo.satellite != satellite || blockInfoItem.BlockInfo.mosaicInfo.sensor != sensor) { return; } string name = blockInfoItem.Name; AddAoi(_blockHost, name, blockInfoItem.Envelope); }
public static BlockInfoItem Create(BlockInfo info) { if (info == null) { return(null); } if (string.IsNullOrWhiteSpace(info.datapath)) { return(null); } BlockInfoItem item = new BlockInfoItem(); item.BlockInfo = info; item.Name = info.envname; item.Envelope = new Core.DrawEngine.CoordEnvelope(info.minx, info.maxx, info.miny, info.maxy); return(item); }
void tool_Click(object sender, EventArgs e) { ToolStripItem tool = sender as ToolStripItem; if (tool.Tag is BlockInfoItem) { BlockInfoItem item = tool.Tag as BlockInfoItem; string filename = Path.Combine(DataPathHelper.DataServerBlockPath, item.BlockInfo.datapath); OpenFile(filename); } else if (tool.Tag is OverViewObject) { OverViewObject item = tool.Tag as OverViewObject; string filename = Path.Combine(DataPathHelper.ProjectionRootPath, item.ProjectionInfo.datapath); OpenFile(filename); } }
/// <summary> /// 节点第一级是分幅 /// 第二级是卫星传感器 /// 第三级是数据 /// </summary> private void UpdateTreeView() { Dictionary <string, List <string> > blockFiles = new Dictionary <string, List <string> >(); for (int i = 0; i < _selectedBlockFiles.Count; i++) { BlockInfoItem item = _selectedBlockFiles[i]; if (item.Satalite != _filter.Satellite || item.Sensor != _filter.Sensor) { continue; } string key = item.BlockInfo.blockidentify; string file = DataPathHelper.DataServerBlockPath + item.BlockInfo.datapath; if (blockFiles.ContainsKey(key)) { blockFiles[key].Add(file); } else { blockFiles.Add(key, new List <string>(new string[] { file })); } } _treeView.Nodes.Clear(); RadTreeNode node = new RadTreeNode(_filter.Text, true); List <RadTreeNode> subNodes = new List <RadTreeNode>(); foreach (FilterField blockFilter in _blockFilter) { RadTreeNode blockNode = new RadTreeNode(blockFilter.Description); blockNode.CheckType = CheckType.CheckBox; blockNode.Checked = true; if (blockFiles.ContainsKey(blockFilter.Name)) { blockNode.Tag = blockFiles[blockFilter.Name].ToArray(); blockNode.Text += "(选中" + blockFiles[blockFilter.Name].Count + "条)"; } else { blockNode.Text += "(选中0条)"; } node.Nodes.Add(blockNode); } _treeView.Nodes.Add(node); }
private void AddBlockInfo(BlockInfo blockItem) { if (blockItem == null) { return; } string path = DataPathHelper.DataServerBlockPath + blockItem.datapath; if (!File.Exists(path)) { return; } BlockInfoItem item = BlockInfoItem.Create(blockItem); if (item == null) { return; } _recivedBlocks.Add(item); }