private void button_convert_Click(object sender, EventArgs e) { try { var text = richTextBoxControl_text.Text; MemoryStream memory = new MemoryStream(); StreamWriter writer = new StreamWriter(memory, Encoding.Default); writer.Write(text); writer.Flush(); memory.Position = 0; var splitter = this.richTextBox_splitter.Lines; var isRemoveVacant = this.checkBox_removeVacant.Checked; var reader = new ObjectTableReader(memory, splitter); if (isRemoveVacant) { reader.StringSplitOptions = StringSplitOptions.RemoveEmptyEntries; } var table = reader.Read();//.GetDataTable(); var name = "文本表格_" + (index++); var form = new Geo.Winform.TableObjectViewForm(table) { Text = name }; form.FilePath = Path.Combine(Setting.TempDirectory, name + Setting.TextTableFileExtension); form.Show(); }catch (Exception ex) { Geo.Utils.FormUtil.ShowErrorMessageBox("转换出错:" + ex.Message); } }
private ObjectTableStorage GetSatEleTable(string[] inputPathes) { ObjectTableStorage satEleTable = null; bool isInputCoord = this.checkBox_inputCoord.Checked; var cutOffAngle = namedFloatControl1AngleCut.GetValue(); if (!isInputCoord) { log.Info("采用了文件输入高度角"); if (inputPathes.Length == 0) { Geo.Utils.FormUtil.ShowWarningMessageBox("请输入文件"); return(satEleTable); } var baseSiteEle = inputPathes[0]; if (baseSiteEle.ToLower().EndsWith(Setting.SatElevationFileExtension.ToLower())) { var reader = new ObjectTableReader(baseSiteEle); satEleTable = reader.Read(); } else if (baseSiteEle.ToLower().EndsWith("rnx") || baseSiteEle.ToLower().EndsWith("o"))//O文件 { satEleTable = SatElevatoinTableBuilder.BuildTable(baseSiteEle, cutOffAngle, GlobalNavEphemerisService.Instance); } } else//手动输入 { log.Info("即将跟输入计算高度角信息"); //输出的采样间隔 TimeLooper looper = timeLoopControl1.GetTimeLooper(); var xyz = XYZ.Parse(this.namedStringControl_coord.GetValue()); satEleTable = SatElevatoinTableBuilder.BuildTable(looper, xyz, this.SatelliteTypes, cutOffAngle, GlobalNavEphemerisService.Instance, "卫星高度角"); } return(satEleTable); }
private void button_convert_Click(object sender, EventArgs e) { try { var pathA = fileOpenControlA.FilePath; var pathB = fileOpenControlB.FilePath; var tableA = new ObjectTableReader(pathA, Encoding.Default).Read(); var tableB = new ObjectTableReader(pathB, Encoding.Default).Read(); ObjectTableStorage table = new ObjectTableStorage(tableA.Name + "-" + tableB.Name); var indexColNameA = tableA.GetIndexColName(); var indexColNameB = tableB.GetIndexColName(); var indexesInB = tableB.GetIndexValues(); progressBarComponent1.InitProcess(tableA.RowCount); foreach (var rowA in tableA.BufferedValues) { progressBarComponent1.PerformProcessStep(); var indexObj = rowA[indexColNameA]; var inB = indexesInB.IndexOf(indexObj); if (inB == -1) { continue; } var rowB = tableB.BufferedValues[inB]; table.NewRow(); table.AddItem(indexColNameA, indexObj); foreach (var item in rowA) { if (!rowB.ContainsKey(item.Key) || item.Key == indexColNameA) { continue; } var valObjB = rowB[item.Key]; if (!Geo.Utils.ObjectUtil.IsNumerial(item.Value) || !Geo.Utils.ObjectUtil.IsNumerial(valObjB)) { continue; } var valA = Geo.Utils.ObjectUtil.GetNumeral(item.Value); var valB = Geo.Utils.ObjectUtil.GetNumeral(valObjB); var differ = valA - valB; table.AddItem(item.Key, differ); } } progressBarComponent1.Full(); this.objectTableControl1.DataBind(table); Geo.Utils.FormUtil.ShowOkMessageBox(); } catch (Exception ex) { Geo.Utils.FormUtil.ShowErrorMessageBox("转换出错:" + ex.Message); } }
/// <summary> /// 批量计算,增加一个,最后统计 /// </summary> /// <param name="inputPath"></param> public void Add(string inputPath) { var table = ObjectTableReader.Read(inputPath); Add(table); }
/// <summary> /// 解析为对象 /// </summary> /// <param name="path"></param> /// <returns></returns> public static MultiSitePeriodValueStorage ParseDetailTable(string path) { var data = new ObjectTableReader(path).Read(); return(MultiSitePeriodValueStorage.ParseDetailTable(data)); }
public override IMatrix Read() { var table = ObjectTableReader.Read(this.FilePath); return(Matrix.Parse(table)); }
/// <summary> /// 设置订单或STOP的自定义数据的读取方法 /// </summary> /// <param name="reader"></param> /// <returns></returns> public StrategyServer SetFieldsReader(ObjectTableReader reader) { _fieldsReader = reader; return this; }
/// <summary> /// 加载所有数据源.//2015.05.12, czs, 应该采用懒加载模式,用则加载,不用则不加载,可以提高效率 /// </summary> public void LoadDataSource() { //如果没有设置输入源,则判断是否有路径 if (ObservationDataSources == null && this.Option.IsObsDataRequired) { AddObservationDataSources(); } if (Session == null) { Session = new SessionInfo(ObservationDataSources.TimePeriod, Option.SatelliteTypes); } if (this.Option.IsSiteCoordServiceRequired) { AddSiteCoordService(); } if (this.Option.IsStationInfoRequired) { AddStaionInfoService(); } SetAntennaDataSource(); //为所有测站附加天线信息 if (this.AntennaDataSource != null) { foreach (var item in ObservationDataSources.DataSources) { item.SiteInfo.Antenna = this.AntennaDataSource.Get(item.SiteInfo.AntennaType); } } if ((EphemerisService == null || EphemerisService.SatCount == 0) && this.Option.IsEphemerisRequired) { this.EphemerisService = new EphemerisServiceProvider(this.GlobalDataOption, Option, ObservationDataSources).GetService(); //第二星历 ObservationDataSources.TryLoadEphemerisServices(); if (ObservationDataSources.EphemerisServices.Count > 0) { this.SecondEphemerisService = ObservationDataSources.EphemerisServices.First; var msg = "自带了导航星历,加入备用星历服务之中" + this.SecondEphemerisService; log.Info(msg); } } if (!HasClockService && Option.IsPreciseClockFileRequired && Option.IsUsingFullClockService) { this.ClockService = new ClockServiceProvider(GlobalDataOption, Option).GetService(); } if (!HasClockService && Option.IsPreciseClockFileRequired) { this.SimpleClockService = new SimpleClockServiceProvider(GlobalDataOption, Option).GetService(); } var isIgsProductAwailable = IgsProductTimeAvailable.IsFinalAvailableGps(Session.TimePeriod.Start); if (isIgsProductAwailable && ErpDataService == null && Option.IsErpFileRequired) { var msg = "没有手动设置ERP文件,也没有启用文件自动匹配功能。"; if (!this.GlobalDataOption.EnableAutoFindingFile) { log.Info(msg); // throw new ArgumentException(msg); } else { this.ErpDataService = new ErpServiceProvider(GlobalDataOption, Option).GetService(); // this.ErpDataService = new CommonErpServiceProvider(IgsProductSourceOption).GetDataSourceService(); //this.ErpDataService = new ErpServiceProvider(GlobalDataOption, Option).GetService(); //this.Add(GnssDataType.ERP, new ErpFileService(Option.GetErpFileOption())); } } LoadIonoDataSourceService(isIgsProductAwailable); if (this.Option.IsTropAugmentEnabled && File.Exists(Option.TropAugmentFilePath)) { log.Info("即将加载对流层增强文件 " + Option.TropAugmentFilePath); this.TropAugService = new TropAugService(Option.TropAugmentFilePath); } //钟跳 if (Option.IsOpenClockJumpSwitcher && File.Exists(Option.OuterClockJumpFile)) { ClockJumpFile = new ObjectTableReader(Option.OuterClockJumpFile).Read(); } }