private static void ConvertToOneTable(string outDir, string inputPath) { var fileName = Path.GetFileName(inputPath); var outputPath = Path.Combine(outDir, fileName + ".txt.xls"); var ObsFile = ObsFileUtil.ReadFile(inputPath); var table = ObsFile.BuildObjectTable(true); ObjectTableWriter.Write(table, outputPath); }
private void button_read_Click(object sender, EventArgs e) { if (!File.Exists(ObsPath)) { Geo.Utils.FormUtil.ShowWarningMessageBox("文件不存在!"); return; } this.ObsFile = ObsFileUtil.ReadFile(ObsPath); EntityToUi(); }
private void button_read_Click(object sender, EventArgs e) { if (!File.Exists(ObsPath)) { Gdp.Utils.FormUtil.ShowWarningMessageBox("The file does not exist!"); return; } this.ObsFile = ObsFileUtil.ReadFile(ObsPath); //View file info StringBuilder sb = new StringBuilder(); sb.AppendLine("FileName:\t" + Path.GetFileName(ObsPath)); sb.AppendLine("MarkerName:\t" + this.ObsFile.Header.MarkerName); sb.AppendLine("Antenna:\t" + this.ObsFile.Header.SiteInfo.AntennaType + " " + this.ObsFile.Header.SiteInfo.AntennaNumber); sb.AppendLine("TimePeriod:\t" + this.ObsFile.Header.TimePeriod); sb.AppendLine("Interval(s):\t" + this.ObsFile.Header.Interval); var fileSize = new FileInfo(ObsPath).Length; var mb = fileSize / 1024.0 / 1024.0; sb.AppendLine("FileSize:\t" + mb.ToString("0.00") + " MB"); var prns = this.ObsFile.GetSatTypedPrns(); int total = 0; foreach (var kv in prns) { sb.AppendLine(kv.Key + " (Count " + kv.Value.Count + "):\t" + Gdp.Utils.StringUtil.ToString(kv.Value, ",")); total += kv.Value.Count; } sb.AppendLine("Total Sats :\t" + total); var codes = this.ObsFile.Header.ObsCodes; foreach (var kv in codes) { sb.AppendLine(kv.Key + " ObsCode(" + kv.Value.Count + "):\t" + Gdp.Utils.StringUtil.ToString(kv.Value, ",")); } richTextBoxControl_info.Text = sb.ToString(); EntityToUi(); }
/// <summary> /// 读取数据 /// </summary> private void ReadFile() { ObsFile = ObsFileUtil.ReadFile(ObsPath); if (ObsFile == null) { Geo.Utils.FormUtil.ShowWarningMessageBox("不支持输入文件格式!"); return; } this.bindingSource_obsInfo.DataSource = ObsFile; var prns = ObsFile.GetPrns(); prns.Sort(); this.bindingSource_sat.DataSource = prns; this.attributeBox1.DataGridView.DataSource = Geo.Utils.ObjectUtil.GetAttributes(ObsFile.Header, false); string msg = ""; msg += "首次观测时间:" + ObsFile.Header.StartTime + "\r\n"; msg += "最后观测时间:" + ObsFile.Header.EndTime + "\r\n"; msg += "采样间隔:" + ObsFile.Header.Interval + " 秒" + "\r\n"; this.textBox_show.Text = msg; Data.Rinex.RinexObsFile ObsFile1 = ObsFileUtil.ReadFile(ObsPath); var observations = new MemoRinexFileObsDataSource(ObsFile1); foreach (var epochInfo in observations) { int a = 1; int b = 2; } }