/// <summary> /// 构建。 /// </summary> /// <param name="DopCaculator"></param> /// <param name="table"></param> /// <param name="Time"></param> /// <param name="geoCoord"></param> private void Build(DopCaculator DopCaculator, Geo.ObjectTableStorage table, Time Time, Geo.Coordinates.GeoCoord geoCoord, bool isSimpleModel) { //var xyz = Geo.Coordinates.CoordTransformer.GeoCoordToXyz(geoCoord); //if (geoCoord.Lon == 0) //{ // var geoCoord2 = Geo.Coordinates.CoordTransformer.XyzToGeoCoord(xyz); // int i = 0; //} var dop = DopCaculator.Calculate(geoCoord, Time); if (dop != null) { table.NewRow(); //table.AddItem("Epoch", Time); //table.AddItem("X", xyz.X); //table.AddItem("Y", xyz.Y); //table.AddItem("Z", xyz.Z); if (!isSimpleModel) { table.AddItem("Lon", geoCoord.Lon); table.AddItem("Lat", geoCoord.Lat); } //table.AddItem("Heigh", geoCoord.Height); table.AddItem("SatCount", dop.SatCount); if (Geo.Utils.DoubleUtil.IsValid(dop.GDop)) { table.AddItem("GDOP", GetValNotExceed(dop.GDop)); table.AddItem("PDOP", GetValNotExceed(dop.PDop)); table.AddItem("HDOP", GetValNotExceed(dop.HDop)); table.AddItem("VDOP", GetValNotExceed(dop.VDop)); table.AddItem("TDOP", GetValNotExceed(dop.TDop)); } table.EndRow(); } else if (isSimpleModel) //如果没有经纬度,则采用N替代,否书数据空缺很危险 { table.NewRow(); //table.AddItem("Epoch", Time); //table.AddItem("X", xyz.X); //table.AddItem("Y", xyz.Y); //table.AddItem("Z", xyz.Z); //table.AddItem("Lon", geoCoord.Lon); //table.AddItem("Lat", geoCoord.Lat); //table.AddItem("Heigh", geoCoord.Height); table.AddItem("SatCount", "N"); table.AddItem("GDOP", "N"); table.AddItem("PDOP", "N"); table.AddItem("HDOP", "N"); table.AddItem("VDOP", "N"); table.AddItem("TDOP", "N"); table.EndRow(); } }
void TimeLooper_Looping(Time Time) { log.Info("正在计算 " + Time); ObjectTableManager TableManager = new Geo.ObjectTableManager(OutputDirectory); var Table = TableManager.AddTable(FileNamePrefix + "_DOPS_at_" + Geo.Utils.DateTimeUtil.GetDateTimePathString(Time.DateTime)); GeoGridLooper NewGeoGridLooper = GeoGridLooper.Clone(); var DopCaculator = new DopCaculator(EphemerisService, EnabledPrns, CutOffAngle, SatWeights); NewGeoGridLooper.Looping += new Action <LonLat>(delegate(LonLat geo) { NewGeoGridLooper.IsCancel = GeoGridLooper.IsCancel; var geoCoord = new GeoCoord(geo.Lon, geo.Lat, 10); Build(DopCaculator, Table, Time, geoCoord, IsSimpleModel); }); NewGeoGridLooper.Init(); NewGeoGridLooper.Run(); TableManager.WriteAllToFileAndCloseStream(); log.Info("计算完毕 " + Time); }