private void button_run_Click(object sender, EventArgs e) { var outDir = directorySelectionControl_outputDir.Path; var outVersion = namedFloatControl_outVersion.GetValue(); List <string> files = new List <string>(fileOpenControl_inputs.FilePathes); if (files.Count == 0) { Geo.Utils.FormUtil.ShowWarningMessageBox("巧妇难为无米之炊!"); return; } progressBarComponent1.InitProcess(files.Count); string currentSiteName = null; RinexObsFile currentFile = null; string readiedFilePath = null; foreach (var path in files) { progressBarComponent1.PerformProcessStep(); var siteName = Path.GetFileName(path).Substring(0, 4); if (currentSiteName == null) { currentSiteName = siteName; } if (!String.Equals(currentSiteName, siteName, StringComparison.CurrentCultureIgnoreCase)) { OutputFile(outDir, outVersion, currentSiteName, currentFile, readiedFilePath); currentSiteName = siteName; currentFile = null; } RinexObsFile file = new RinexObsFileReader(path, true).ReadObsFile(); readiedFilePath = path;//存储刚刚读取的路径,用户获取后缀名 if (currentFile == null) { currentFile = file; } else//拼接 { currentFile.Add(file); } } OutputFile(outDir, outVersion, currentSiteName, currentFile, readiedFilePath); currentFile = null; progressBarComponent1.Full(); Geo.Utils.FormUtil.ShowOkAndOpenDirectory(outDir); }
/// <summary> /// 读取 /// </summary> /// <returns></returns> public RinexObsFile Read() { ObjectTableReader reader = new ObjectTableReader(Path); Table = reader.Read(); RinexObsFile obsFile = new RinexObsFile(); obsFile.Header = TableToRinexObsFileBuilder.BuidHeader(Table); var indexColName = Table.GetIndexColName(); foreach (var row in Table.BufferedValues) { obsFile.Add(TableToRinexObsFileBuilder.BuildObs(row, indexColName)); } return(obsFile); }
private void CombineFilesInOneSite(int keyCount, string outDir, double outVersion, List <string> oneSiteFiles) { RinexObsFile currentFile = null; string readiedFilePath = null; string currentSiteName = null; oneSiteFiles.Sort(); foreach (var path in oneSiteFiles) { var siteName = Path.GetFileName(path).Substring(0, keyCount); if (currentSiteName == null) { currentSiteName = siteName; } if (!String.Equals(currentSiteName, siteName, StringComparison.CurrentCultureIgnoreCase)) { OutputFile(outDir, outVersion, currentSiteName, currentFile, readiedFilePath); currentSiteName = siteName; currentFile = null; } RinexObsFile file = new RinexObsFileReader(path, true).ReadObsFile(); readiedFilePath = path;//存储刚刚读取的路径,用户获取后缀名 if (currentFile == null) { currentFile = file; } else//拼接 { currentFile.Add(file); } } OutputFile(outDir, outVersion, currentSiteName, currentFile, readiedFilePath); currentFile = null; }