|
@@ -22,6 +22,7 @@ using System.Windows.Documents;
|
|
|
using System.Windows.Forms;
|
|
|
using XdCxRhDW.App.Api.时差粗值预测;
|
|
|
using XdCxRhDW.App.Api.时差线;
|
|
|
+using XdCxRhDW.App.Api.星历推算;
|
|
|
using XdCxRhDW.App.DTO;
|
|
|
using XdCxRhDW.App.UserControl;
|
|
|
using XzXdDw.App.Api;
|
|
@@ -85,7 +86,17 @@ namespace XzXdDw.App.UserControl
|
|
|
.AddMenu("手动定位", SvgHelper.LoadFromFile("Image\\Pos.svg"), XdPos)
|
|
|
.AddMenu("绘制时差线", SvgHelper.LoadFromFile("Image\\DrawLine.svg"), DrawDtoLine)
|
|
|
.AddMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), LoadSimulationData)
|
|
|
- .AddMenu("绘制误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), DrawErrorEllipse2X1D)
|
|
|
+ .AddMenu("绘制误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"),()=> {
|
|
|
+ var ctrl = new X2D1ErrEllipseParam();
|
|
|
+ PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
|
|
|
+ {
|
|
|
+ if (hideReason == HideReason.Defalut) return;
|
|
|
+ var model = ctrl.Model;
|
|
|
+ double[] main_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime);
|
|
|
+ double[] adja_sat = Tle2XYZ.GetXyz(model.TleAdja, model.CapTime);
|
|
|
+ DrawErrorEllipse2X1D(main_sat, adja_sat, new double[] { model.StationLon, model.StationLat, 0 }, new double[] { model.RefLon, model.RefLat, 0 }, model.DtousErr, model.SatLocErr);
|
|
|
+ });
|
|
|
+ })
|
|
|
.AddMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), () => stoped = true);
|
|
|
|
|
|
|
|
@@ -153,44 +164,14 @@ namespace XzXdDw.App.UserControl
|
|
|
|
|
|
.AddPosMenu<XDPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
|
|
|
{
|
|
|
- string msg = "星地我这里只有GDOP和定位\r\n罗博士和黎强应该有相关算法\r\n关闭后将自动绘制高轨双星误差椭圆";
|
|
|
- PopupHelper.ShowPopup(new MsgUserControl(msg), mapControl1, mapControl1.Width / 4, onHide: hideReason =>
|
|
|
+ var ctrl = new X2D1ErrEllipseParam();
|
|
|
+ PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
|
|
|
{
|
|
|
- if (hideReason == HideReason.Defalut)
|
|
|
- {
|
|
|
- var (listSat, data) = ErrEllipseHelper.ErrEllipse2SatDtoDfoRef(TestData.TleMain, TestData.TleAdja1, DateTime.Now, 1000, 500, 2225, 2225,
|
|
|
- new double[] { TestData.TarLon, TestData.TarLat },
|
|
|
- new double[] { TestData.RefLon, TestData.RefLat },
|
|
|
- out double R1, out double R2);
|
|
|
-
|
|
|
- if (data == null)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (listSat != null)//画卫星
|
|
|
- {
|
|
|
- foreach (var sat in listSat)
|
|
|
- {
|
|
|
- mapControl1.Invoke(new Action(() =>
|
|
|
- {
|
|
|
- string satCode = sat.SatCode == null ? "未知" : sat.SatCode.ToString();
|
|
|
- mapControl1.DrawFixedImg("sat", sat.SatLat, sat.SatLon, DxHelper.SvgHelper.CreateSat(), new Size(32, 32), $"卫星编号:{satCode}\r\n轨道经度:{sat.SatLon}°\r\n轨道纬度:{sat.SatLat}°");
|
|
|
- }));
|
|
|
- }
|
|
|
- }
|
|
|
- foreach (var errLins in data)//画误差椭圆
|
|
|
- {
|
|
|
- foreach (var line in errLins.MapLines)
|
|
|
- {
|
|
|
- var newLine = SampleDots(line);
|
|
|
- mapControl1.Invoke(new Action(() =>
|
|
|
- {
|
|
|
- var mapLines = newLine.Line.Select(p => (p.Lon, p.Lat));
|
|
|
- mapControl1.DrawErrEllipse(R1, R2, mapLines);
|
|
|
- }));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (hideReason == HideReason.Defalut) return;
|
|
|
+ var model = ctrl.Model;
|
|
|
+ double[] main_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime);
|
|
|
+ double[] adja_sat = Tle2XYZ.GetXyz(model.TleAdja, model.CapTime);
|
|
|
+ DrawErrorEllipse2X1D(main_sat, adja_sat, new double[] { model.StationLon, model.StationLat, 0 }, new double[] { model.RefLon, model.RefLat, 0 }, model.DtousErr, model.SatLocErr);
|
|
|
});
|
|
|
})
|
|
|
.AddRectMenu<XDPosRes>("时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
|
|
@@ -409,7 +390,7 @@ namespace XzXdDw.App.UserControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async void DrawErrorEllipse2X1D()
|
|
|
+ private void DrawErrorEllipse2X1D(double[] MsEph, double[] NsEph, double[] CDBAnt, double[] RefGeod,double DtoErr,double EphErr)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -422,32 +403,38 @@ namespace XzXdDw.App.UserControl
|
|
|
var item = gridView1.GetRow(ids[0]) as XDPosRes;
|
|
|
List<TxInfo> listTx = new List<TxInfo>();
|
|
|
List<Model.SatInfo> listSat = new List<Model.SatInfo>();
|
|
|
- CgRes cg;
|
|
|
+ //CgRes cg;
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
|
listTx = db.TxInfos.ToList();
|
|
|
listSat = db.SatInfos.ToList();
|
|
|
- cg = await db.CgRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
+ // cg = await db.CgRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
|
|
|
}
|
|
|
- if (cg == null)
|
|
|
- {
|
|
|
- XtraMessageBox.Show($"未找到定位相关的计算[{item.CgResID}]信息");
|
|
|
- return;
|
|
|
- }
|
|
|
+ //if (cg == null)
|
|
|
+ //{
|
|
|
+ // XtraMessageBox.Show($"未找到定位相关的计算[{item.CgResID}]信息");
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
|
|
|
var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
|
|
|
var satNTx = listTx.Find(p => p.TxType == EnumTxType.AdjaSat);
|
|
|
- var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
|
|
|
- var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
|
|
|
+ //var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
|
|
|
+ //var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
|
|
|
XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption Option = new XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption();
|
|
|
- Option.MsEph = new double[] { cg.MainX, cg.MainY, cg.MainZ, 0, 0, 0 };
|
|
|
- Option.NsEph = new double[] { cg.AdjaX, cg.AdjaY, cg.AdjaZ, 0, 0, 0 };
|
|
|
- Option.CDBAnt = new double[] { cdbTx.Lon, cdbTx.Lat, 0 };
|
|
|
- Option.RefGeod = new double[] { refTx.Lon, refTx.Lat, 0 };
|
|
|
+ //Option.MsEph = new double[] { cg.MainX, cg.MainY, cg.MainZ, 0, 0, 0 };
|
|
|
+ //Option.NsEph = new double[] { cg.AdjaX, cg.AdjaY, cg.AdjaZ, 0, 0, 0 };
|
|
|
+ //Option.CDBAnt = new double[] { cdbTx.Lon, cdbTx.Lat, 0 };
|
|
|
+ //Option.RefGeod = new double[] { refTx.Lon, refTx.Lat, 0 };
|
|
|
+ Option.MsEph = MsEph;
|
|
|
+ Option.NsEph = NsEph;
|
|
|
+ Option.CDBAnt = CDBAnt;
|
|
|
+ Option.RefGeod = RefGeod;
|
|
|
Option.SelectPoint = new double[3] { item.PosLon, item.PosLat, 0 };
|
|
|
- Option.DtoErr = 1.0e-6;
|
|
|
- Option.EphErr = 1.0e3;
|
|
|
+ //Option.DtoErr = 1.0e-6;
|
|
|
+ //Option.EphErr = 1.0e3;
|
|
|
+ Option.DtoErr = DtoErr;
|
|
|
+ Option.EphErr = EphErr;
|
|
|
|
|
|
/*Option.MsEph = new double[] { -41250768, 5295530, 6825975, 0, 0, 0 };
|
|
|
Option.NsEph = new double[] { -38198363, 17843895, 8881, 0, 0, 0 };
|