浏览代码

Merge branch 'master' of http://139.155.15.221:3000/zoulei/XzXdDw

wyq 1 年之前
父节点
当前提交
3bbd49c386

+ 5 - 0
XdDw.App/Properties/licenses.licx

@@ -0,0 +1,5 @@
+DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 18 - 50
XdDw.App/UserControl/CtrlPosXd.cs

@@ -40,6 +40,7 @@ namespace XdDw.App.UserControl
     {
         DtXDParam dtxdctrl = null;
         X2D1GDOPParam x2D1GdopParam = null;
+        X2D1ErrEllipseParam x2D1ErrEllipseParam = null;
         TcpServer tcpServer;
         public CtrlPosXd()
         {
@@ -114,15 +115,14 @@ namespace XdDw.App.UserControl
                             return;
                         }
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
-                        var ctrl = new X2D1ErrEllipseParam(item.SigTime);
-                        PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
+                        if (x2D1ErrEllipseParam == null)
                         {
-                            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(item.PosLon, item.PosLat, main_sat, adja_sat, new double[] { model.StationLon, model.StationLat, 0 }, new double[] { model.RefLon, model.RefLat, 0 }, model.DtousErr, model.SatLocErr);
-                        });
+                            x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.SigTime);
+                        }
+                        x2D1ErrEllipseParam.mapControl1 = mapControl1;
+                        x2D1ErrEllipseParam.lon = item.PosLon;
+                        x2D1ErrEllipseParam.lat = item.PosLat;
+                        PopupHelper.ShowPopup(x2D1ErrEllipseParam, mapControl1, mapControl1.Width / 4);
                     })
                     .AddMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), () => stoped = true);
 
@@ -165,15 +165,16 @@ namespace XdDw.App.UserControl
                     })
                     .AddPosMenu<XDPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     {
-                        var ctrl = new X2D1ErrEllipseParam(item.SigTime);
-                        PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
+                        if (x2D1ErrEllipseParam == null)
                         {
-                            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(item.PosLon, item.PosLat, main_sat, adja_sat, new double[] { model.StationLon, model.StationLat, 0 }, new double[] { model.RefLon, model.RefLat, 0 }, model.DtousErr, model.SatLocErr);
-                        });
+                            x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.SigTime);
+                        }
+                        x2D1ErrEllipseParam.mapControl1 = mapControl1;
+                        x2D1ErrEllipseParam.lon = item.PosLon;
+                        x2D1ErrEllipseParam.lat = item.PosLat;
+                        PopupHelper.ShowPopup(x2D1ErrEllipseParam, mapControl1, mapControl1.Width / 4);
+
+                       
                     })
                     .AddRectMenu<XDPosRes>("时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
                     {
@@ -437,40 +438,7 @@ namespace XdDw.App.UserControl
                 Serilog.Log.Error("绘制时差线失败", ex);
                 XtraMessageBox.Show($"绘制时差线失败,失败信息:{ex.Message}");
             }
-        }
-
-        private void DrawErrorEllipse2X1D(double posLon, double posLat, double[] MsEph, double[] NsEph, double[] CDBAnt, double[] RefGeod, double DtoErr, double EphErr)
-        {
-            try
-            {
-
-                List<TxInfo> listTx = new List<TxInfo>();
-                List<XzXdDw.App.Model.SatInfo> listSat = new List<XzXdDw.App.Model.SatInfo>();
-                using (RHDWContext db = new RHDWContext())
-                {
-                    listTx = db.TxInfos.ToList();
-                    listSat = db.SatInfos.ToList();
-                }
-                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
-                var satNTx = listTx.Find(p => p.TxType == EnumTxType.AdjaSat);
-                XdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption Option = new XdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption();
-                Option.MsEph = MsEph;
-                Option.NsEph = NsEph;
-                Option.CDBAnt = CDBAnt;
-                Option.RefGeod = RefGeod;
-                Option.SelectPoint = new double[3] { posLon, posLat, 0 };
-                Option.DtoErr = DtoErr * 1e-6;
-                Option.EphErr = EphErr;
-                var points = XdDw.App.Api.低轨GDOP误差椭圆.ErrEllipseHelper.ErrorEllipse2X1D(Option);
-                mapControl1.DrawDtoPonit($"双星[{listSat.FirstOrDefault(m => m.ID == satTx.ID)?.Sat},{listSat.FirstOrDefault(m => m.ID == satNTx.ID)?.Sat}]误差椭圆线", points);
-
-            }
-            catch (Exception ex)
-            {
-                Serilog.Log.Error("绘制误差椭圆线失败", ex);
-                XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
-            }
-        }
+        }      
 
     }
 }

+ 39 - 12
XdDw.App/UserControl/X2D1ErrEllipseParam.Designer.cs

@@ -28,16 +28,16 @@
         /// </summary>
         private void InitializeComponent()
         {
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions3 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject9 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject10 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject11 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject12 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.btnOK = new DevExpress.XtraEditors.SimpleButton();
             this.txtCapTime = new DevExpress.XtraEditors.DateEdit();
@@ -60,6 +60,8 @@
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.btnClose = new DevExpress.XtraEditors.SimpleButton();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtCapTime.Properties)).BeginInit();
@@ -83,6 +85,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
@@ -95,6 +98,7 @@
             this.layoutControl1.Controls.Add(this.txtTleAdja);
             this.layoutControl1.Controls.Add(this.txtDtousErr1);
             this.layoutControl1.Controls.Add(this.txtSatLocErr1);
+            this.layoutControl1.Controls.Add(this.btnClose);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(4);
@@ -227,7 +231,7 @@
             this.txtDtousErr1.Name = "txtDtousErr1";
             this.txtDtousErr1.Properties.AutoHeight = false;
             this.txtDtousErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtDtousErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtDtousErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtDtousErr1.Properties.MaskSettings.Set("mask", "f");
@@ -246,7 +250,7 @@
             this.txtSatLocErr1.Name = "txtSatLocErr1";
             this.txtSatLocErr1.Properties.AutoHeight = false;
             this.txtSatLocErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtSatLocErr1.Properties.MaskSettings.Set("mask", "f");
@@ -268,7 +272,8 @@
             this.layoutControlItem5,
             this.layoutControlItem1,
             this.emptySpaceItem1,
-            this.emptySpaceItem2});
+            this.emptySpaceItem2,
+            this.layoutControlItem2});
             this.Root.Name = "Root";
             this.Root.Size = new System.Drawing.Size(394, 716);
             this.Root.TextVisible = false;
@@ -358,16 +363,16 @@
             this.layoutControlItem1.Location = new System.Drawing.Point(197, 378);
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 11, 2);
-            this.layoutControlItem1.Size = new System.Drawing.Size(197, 40);
+            this.layoutControlItem1.Size = new System.Drawing.Size(197, 41);
             this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem1.TextVisible = false;
             // 
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 418);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 419);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(394, 298);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(394, 297);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // emptySpaceItem2
@@ -375,9 +380,28 @@
             this.emptySpaceItem2.AllowHotTrack = false;
             this.emptySpaceItem2.Location = new System.Drawing.Point(0, 378);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
-            this.emptySpaceItem2.Size = new System.Drawing.Size(197, 40);
+            this.emptySpaceItem2.Size = new System.Drawing.Size(197, 10);
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
             // 
+            // btnClose
+            // 
+            this.btnClose.Location = new System.Drawing.Point(2, 390);
+            this.btnClose.Name = "btnClose";
+            this.btnClose.Size = new System.Drawing.Size(193, 27);
+            this.btnClose.StyleController = this.layoutControl1;
+            this.btnClose.TabIndex = 13;
+            this.btnClose.Text = "关闭";
+            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.btnClose;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 388);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(197, 31);
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem2.TextVisible = false;
+            // 
             // X2D1ErrEllipseParam
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
@@ -409,6 +433,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -436,5 +461,7 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+        private DevExpress.XtraEditors.SimpleButton btnClose;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
 }

+ 46 - 0
XdDw.App/UserControl/X2D1ErrEllipseParam.cs

@@ -1,4 +1,5 @@
 using DevExpress.XtraEditors;
+using DevExpress.XtraMap;
 using DxHelper;
 using ExtensionsDev;
 using System;
@@ -11,12 +12,17 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using XdDw.App;
+using XdDw.App.Api.星历推算;
+using XdDw.App.EFContext;
 using XzXdDw.App.Model;
 
 namespace XdDw.App.UserControl
 {
     public partial class X2D1ErrEllipseParam : DevExpress.XtraEditors.XtraUserControl
     {
+        public MapControl mapControl1;
+        public double lon;
+        public double lat;
         public ErrEllipse星地两星一地接口 Model => new ErrEllipse星地两星一地接口()
         {
             TleMain = txtTleMain.Text.Trim(),
@@ -49,6 +55,46 @@ namespace XdDw.App.UserControl
         }
 
         private void btnOK_Click(object sender, EventArgs e)
+        {
+            mapControl1.ClearMap();
+            double[] main_sat = Tle2XYZ.GetXyz(Model.TleMain, Model.CapTime);
+            double[] adja_sat = Tle2XYZ.GetXyz(Model.TleAdja, Model.CapTime);
+            DrawErrorEllipse2X1D(lon,lat, main_sat, adja_sat, new double[] { Model.StationLon, Model.StationLat, 0 }, new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.SatLocErr);
+        }
+
+        private void DrawErrorEllipse2X1D(double posLon, double posLat, double[] MsEph, double[] NsEph, double[] CDBAnt, double[] RefGeod, double DtoErr, double EphErr)
+        {
+            try
+            {
+                List<TxInfo> listTx = new List<TxInfo>();
+                List<XzXdDw.App.Model.SatInfo> listSat = new List<XzXdDw.App.Model.SatInfo>();
+                using (RHDWContext db = new RHDWContext())
+                {
+                    listTx = db.TxInfos.ToList();
+                    listSat = db.SatInfos.ToList();
+                }
+                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
+                var satNTx = listTx.Find(p => p.TxType == EnumTxType.AdjaSat);
+                XdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption Option = new XdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption();
+                Option.MsEph = MsEph;
+                Option.NsEph = NsEph;
+                Option.CDBAnt = CDBAnt;
+                Option.RefGeod = RefGeod;
+                Option.SelectPoint = new double[3] { posLon, posLat, 0 };
+                Option.DtoErr = DtoErr * 1e-6;
+                Option.EphErr = EphErr;
+                var points = XdDw.App.Api.低轨GDOP误差椭圆.ErrEllipseHelper.ErrorEllipse2X1D(Option);
+                mapControl1.DrawDtoPonit($"双星[{listSat.FirstOrDefault(m => m.ID == satTx.ID)?.Sat},{listSat.FirstOrDefault(m => m.ID == satNTx.ID)?.Sat}]误差椭圆线", points);
+
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error("绘制误差椭圆线失败", ex);
+                XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
+            }
+        }
+
+        private void btnClose_Click(object sender, EventArgs e)
         {
             PopupHelper.HidePopup(this);
         }

+ 1 - 0
XdDw.App/XdDw.App.csproj

@@ -254,6 +254,7 @@
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="UserControl\CtrlCgRes.resx">
       <DependentUpon>CtrlCgRes.cs</DependentUpon>
     </EmbeddedResource>

+ 5 - 0
XzDw.App/Properties/licenses.licx

@@ -0,0 +1,5 @@
+DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.1, Version=23.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 16 - 51
XzDw.App/UserControl/CtrlPosSingle.cs

@@ -45,6 +45,7 @@ namespace XzXdDw.App.UserControl
     {
         DtXDParam dtxdctrl = null;
         DXGDOPParam dxGdopParam = null;
+        DXErrEllipseParam dxErrEllipseParam = null;
         double MBfu;
         TcpServer tcpServer;
         public CtrlPosSingle()
@@ -121,16 +122,14 @@ namespace XzXdDw.App.UserControl
                             return;
                         }
                         var item = gridView1.GetRow(ids[0]) as PosRes;
-                        var ctrl = new DXErrEllipseParam(MBfu, item.SigTime);
-                        PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
+                        if (dxErrEllipseParam == null)
                         {
-                            if (hideReason == HideReason.Defalut) return;
-                            var model = ctrl.Model;
-                            double[] main_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime);
-                            double[] adja1_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime1);
-                            double[] adja2_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime2);
-                            DrawErrorEllipse1X(item.PosLon,item.PosLat,main_sat, adja1_sat, adja2_sat, model.DfoErr, model.SatLocErr, model.EphVelErr, model.fu);
-                        });
+                            dxErrEllipseParam = new DXErrEllipseParam(MBfu, item.SigTime);
+                        }
+                        dxErrEllipseParam.mapControl1 = mapControl1;
+                        dxErrEllipseParam.lon = item.PosLon;
+                        dxErrEllipseParam.lat = item.PosLat;
+                        PopupHelper.ShowPopup(dxErrEllipseParam, mapControl1, mapControl1.Width / 4);
                     })
                     .AddMenu("手动定位", SvgHelper.LoadFromFile("Image\\Pos.svg"), SinglePos)
                     .AddMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), () => stoped = true);
@@ -174,16 +173,14 @@ namespace XzXdDw.App.UserControl
                     })
                     .AddPosMenu<PosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     {
-                        var ctrl = new DXErrEllipseParam(MBfu, item.SigTime);
-                        PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
+                        if (dxErrEllipseParam == null)
                         {
-                            if (hideReason == HideReason.Defalut) return;
-                            var model = ctrl.Model;
-                            double[] main_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime);
-                            double[] adja1_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime1);
-                            double[] adja2_sat = Tle2XYZ.GetXyz(model.TleMain, model.CapTime2);
-                            DrawErrorEllipse1X(item.PosLon,item.PosLat,main_sat, adja1_sat, adja2_sat, model.DfoErr, model.SatLocErr, model.EphVelErr, model.fu);
-                        });
+                            dxErrEllipseParam = new DXErrEllipseParam(MBfu, item.SigTime);
+                        }
+                        dxErrEllipseParam.mapControl1 = mapControl1;
+                        dxErrEllipseParam.lon = item.PosLon;
+                        dxErrEllipseParam.lat = item.PosLat;
+                        PopupHelper.ShowPopup(dxErrEllipseParam, mapControl1, mapControl1.Width / 4);
                     })
                      .AddPosMenu<PosRes>("手动定位", SvgHelper.LoadFromFile("Image\\Pos.svg"), item =>
                      {
@@ -349,39 +346,7 @@ namespace XzXdDw.App.UserControl
             tcpServer.SendData(setings.ServerIp, setings.Port, json);
         }
 
-        private void DrawErrorEllipse1X(double posLon,double posLat,double[] MsEph, double[] NsEph1, double[] NsEph2, double DfoErr, double EphPosErr, double EphVelErr, double fu)
-        {
-            try
-            {
-                List<TxInfo> listTx = new List<TxInfo>();
-                List<Model.SatInfo> listSat = new List<Model.SatInfo>();
-                using (RHDWContext db = new RHDWContext())
-                {
-                    listTx = db.TxInfos.ToList();
-                    listSat = db.SatInfos.ToList();
-                }
-                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
-#warning 但凡是和频差相关的 星历必须给速度
-                XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO1XOption Option = new XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO1XOption();
-                Option.MsEph = MsEph;
-                Option.NsEph1 = NsEph1;
-                Option.NsEph2 = NsEph2;
-                Option.SelectPoint = new double[3] { posLon, posLat, 0 };
-                Option.DfoErr = DfoErr;
-                Option.EphPosErr = EphPosErr;
-                Option.EphVelErr = EphVelErr;
-                Option.fu = fu;
-                var points = XzXdDw.App.Api.低轨GDOP误差椭圆.ErrEllipseHelper.ErrorEllipseSingleX(Option);
-                mapControl1.DrawDtoPonit($"单星[{listSat.FirstOrDefault(m => m.ID == satTx.ID)?.Sat}]误差椭圆线", points);
-
-            }
-            catch (Exception ex)
-            {
-                Serilog.Log.Error("绘制误差椭圆线失败", ex);
-                XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
-            }
-        }
-
+      
         private async void DrawDfoLine()
         {
             var ids = gridView1.GetSelectedRows();

+ 16 - 43
XzDw.App/UserControl/CtrlPosXz.cs

@@ -46,6 +46,7 @@ namespace XzXdDw.App.UserControl
         /// </summary>
         DtSXLParam dtsxlctrl = null;
         XZGDOPParam xzGdopParam = null;
+        XZErrEllipseParam xzErrEllipseParam = null;
         double MBfu;
         double CKfu;
         private TxInfo refTx;
@@ -134,15 +135,14 @@ namespace XzXdDw.App.UserControl
                              return;
                          }
                          var item = gridView1.GetRow(ids[0]) as XZPosRes;
-                         var ctrl = new XZErrEllipseParam(refTx, item.SigTime, MBfu, CKfu);
-                         PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
+                         if (xzErrEllipseParam == null)
                          {
-                             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);
-                             DrawErrorEllipseDTFO(item.PosLon, item.PosLat, main_sat, adja_sat, new double[] { model.RefLon, model.RefLat, 0 }, model.DtousErr, model.DfoErr, model.SatLocErr, model.EphVelErr, model.fu1, model.fu2);
-                         });
+                             xzErrEllipseParam = new XZErrEllipseParam(refTx, item.SigTime, MBfu, CKfu);
+                         }
+                         xzErrEllipseParam.mapControl1 = mapControl1;
+                         xzErrEllipseParam.lon = item.PosLon;
+                         xzErrEllipseParam.lat = item.PosLat;
+                         PopupHelper.ShowPopup(xzGdopParam, mapControl1, mapControl1.Width / 4);                        
                      })
                     .AddMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), () => stoped = true);
 
@@ -181,15 +181,14 @@ namespace XzXdDw.App.UserControl
                     })
                     .AddPosMenu<XZPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     {
-                        var ctrl = new XZErrEllipseParam(refTx, item.SigTime, MBfu, CKfu);
-                        PopupHelper.ShowPopup(ctrl, mapControl1, mapControl1.Width / 4, onHide: hideReason =>
+                        if (xzErrEllipseParam == null)
                         {
-                            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);
-                            DrawErrorEllipseDTFO(item.PosLon, item.PosLat, main_sat, adja_sat, new double[] { model.RefLon, model.RefLat, 0 }, model.DtousErr, model.DfoErr, model.SatLocErr, model.EphVelErr, model.fu1, model.fu2);
-                        });
+                            xzErrEllipseParam = new XZErrEllipseParam(refTx, item.SigTime, MBfu, CKfu);
+                        }
+                        xzErrEllipseParam.mapControl1 = mapControl1;
+                        xzErrEllipseParam.lon = item.PosLon;
+                        xzErrEllipseParam.lat = item.PosLat;
+                        PopupHelper.ShowPopup(xzGdopParam, mapControl1, mapControl1.Width / 4);
                     })
 
                      .AddPosMenu<XZPosRes>("绘制时差线", SvgHelper.LoadFromFile("Image\\DrawLine.svg"), item =>
@@ -522,33 +521,7 @@ namespace XzXdDw.App.UserControl
             }
         }
 
-        private void DrawErrorEllipseDTFO(double posLon, double posLat, double[] main_sat, double[] neigh_sat, double[] Ref_Station_LLH, double DtoErr, double DfoErr, double EphPosErr, double EphVelErr, double fu1, double fu2)
-        {
-            try
-            {
-                ErrorEllipseDTFOTSOption twoStartOption = new ErrorEllipseDTFOTSOption();
-                twoStartOption.MsEph = main_sat;
-                twoStartOption.NsEph = neigh_sat;
-                twoStartOption.RefGeod = Ref_Station_LLH;
-                twoStartOption.SelectPoint = new double[3] { posLon, posLat, 0 };
-                twoStartOption.DtoErr = DtoErr * 1e-6;
-                twoStartOption.DfoErr = DfoErr;
-                twoStartOption.EphPosErr = EphPosErr;
-                twoStartOption.EphVelErr = EphVelErr;
-                twoStartOption.fu1 = fu1;
-                twoStartOption.fu2 = fu2;
-
-                var points = Api.低轨GDOP误差椭圆.ErrEllipseHelper.ErrorEllipseDTFOTwoStart(twoStartOption);
-                mapControl1.DrawDtoPonit($"双星误差椭圆线", points);
-
-
-            }
-            catch (Exception ex)
-            {
-                Serilog.Log.Error("绘制误差椭圆线失败", ex);
-                XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
-            }
-        }
+      
 
     }
 }

+ 46 - 19
XzDw.App/UserControl/DXErrEllipseParam.Designer.cs

@@ -28,6 +28,16 @@
         /// </summary>
         private void InitializeComponent()
         {
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions4 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject13 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject14 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject15 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject16 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions5 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject17 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject18 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject19 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject20 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
@@ -38,16 +48,6 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions3 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject9 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject10 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject11 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject12 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions4 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject13 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject14 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject15 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject16 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.btnOK = new DevExpress.XtraEditors.SimpleButton();
             this.txtTleMain = new DevExpress.XtraEditors.SearchLookUpEdit();
@@ -71,6 +71,8 @@
             this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.btnClose = new DevExpress.XtraEditors.SimpleButton();
+            this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtTleMain.Properties)).BeginInit();
@@ -97,6 +99,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
@@ -110,6 +113,7 @@
             this.layoutControl1.Controls.Add(this.txtCapTime);
             this.layoutControl1.Controls.Add(this.txtCapTime1);
             this.layoutControl1.Controls.Add(this.txtCapTime2);
+            this.layoutControl1.Controls.Add(this.btnClose);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
@@ -169,7 +173,7 @@
             this.txtDfoErr1.Name = "txtDfoErr1";
             this.txtDfoErr1.Properties.AutoHeight = false;
             this.txtDfoErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -1, false, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtDfoErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtDfoErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtDfoErr1.Properties.MaskSettings.Set("mask", "f");
@@ -188,7 +192,7 @@
             this.txtSatLocErr1.Name = "txtSatLocErr1";
             this.txtSatLocErr1.Properties.AutoHeight = false;
             this.txtSatLocErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m", -1, false, true, false, editorButtonImageOptions5, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject17, serializableAppearanceObject18, serializableAppearanceObject19, serializableAppearanceObject20, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtSatLocErr1.Properties.MaskSettings.Set("mask", "f");
@@ -207,7 +211,7 @@
             this.txtEphVelErr1.Name = "txtEphVelErr1";
             this.txtEphVelErr1.Properties.AutoHeight = false;
             this.txtEphVelErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtEphVelErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtEphVelErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtEphVelErr1.Properties.MaskSettings.Set("mask", "f");
@@ -226,7 +230,7 @@
             this.txtFu1.Name = "txtFu1";
             this.txtFu1.Properties.AutoHeight = false;
             this.txtFu1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtFu1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtFu1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtFu1.Properties.MaskSettings.Set("mask", "f");
@@ -315,7 +319,8 @@
             this.layoutControlItem6,
             this.layoutControlItem11,
             this.layoutControlItem2,
-            this.layoutControlItem7});
+            this.layoutControlItem7,
+            this.layoutControlItem9});
             this.Root.Name = "Root";
             this.Root.Size = new System.Drawing.Size(397, 514);
             this.Root.TextVisible = false;
@@ -361,16 +366,16 @@
             this.layoutControlItem1.Location = new System.Drawing.Point(198, 432);
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 10, 3);
-            this.layoutControlItem1.Size = new System.Drawing.Size(199, 40);
+            this.layoutControlItem1.Size = new System.Drawing.Size(199, 41);
             this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem1.TextVisible = false;
             // 
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 472);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 473);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(397, 42);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(397, 41);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // emptySpaceItem2
@@ -378,7 +383,7 @@
             this.emptySpaceItem2.AllowHotTrack = false;
             this.emptySpaceItem2.Location = new System.Drawing.Point(0, 432);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
-            this.emptySpaceItem2.Size = new System.Drawing.Size(198, 40);
+            this.emptySpaceItem2.Size = new System.Drawing.Size(198, 10);
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
             // 
             // layoutControlItem3
@@ -441,6 +446,25 @@
             this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem7.TextSize = new System.Drawing.Size(90, 18);
             // 
+            // btnClose
+            // 
+            this.btnClose.Location = new System.Drawing.Point(2, 444);
+            this.btnClose.Name = "btnClose";
+            this.btnClose.Size = new System.Drawing.Size(194, 27);
+            this.btnClose.StyleController = this.layoutControl1;
+            this.btnClose.TabIndex = 13;
+            this.btnClose.Text = "关闭";
+            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+            // 
+            // layoutControlItem9
+            // 
+            this.layoutControlItem9.Control = this.btnClose;
+            this.layoutControlItem9.Location = new System.Drawing.Point(0, 442);
+            this.layoutControlItem9.Name = "layoutControlItem9";
+            this.layoutControlItem9.Size = new System.Drawing.Size(198, 31);
+            this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem9.TextVisible = false;
+            // 
             // DXErrEllipseParam
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
@@ -475,6 +499,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -503,5 +528,7 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
         private DevExpress.XtraEditors.DateEdit txtCapTime2;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
+        private DevExpress.XtraEditors.SimpleButton btnClose;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
     }
 }

+ 48 - 0
XzDw.App/UserControl/DXErrEllipseParam.cs

@@ -1,4 +1,5 @@
 using DevExpress.XtraEditors;
+using DevExpress.XtraMap;
 using DxHelper;
 using ExtensionsDev;
 using System;
@@ -10,13 +11,18 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using XdCxRhDW.App.Api.星历推算;
 using XzXdDw.App;
+using XzXdDw.App.EFContext;
 using XzXdDw.App.Model;
 
 namespace XdCxRhDW.App.UserControl
 {
     public partial class DXErrEllipseParam : DevExpress.XtraEditors.XtraUserControl
     {
+        public MapControl mapControl1;
+        public double lon;
+        public double lat;
         public ErrEllipse单星协同接口 Model => new ErrEllipse单星协同接口()
         {
             TleMain = txtTleMain.Text.Trim(),
@@ -43,6 +49,48 @@ namespace XdCxRhDW.App.UserControl
         }
 
         private void btnOK_Click(object sender, EventArgs e)
+        {
+            mapControl1.ClearMap();
+            double[] main_sat = Tle2XYZ.GetXyz(Model.TleMain, Model.CapTime);
+            double[] adja1_sat = Tle2XYZ.GetXyz(Model.TleMain, Model.CapTime1);
+            double[] adja2_sat = Tle2XYZ.GetXyz(Model.TleMain, Model.CapTime2);
+            DrawErrorEllipse1X(lon, lat, main_sat, adja1_sat, adja2_sat, Model.DfoErr, Model.SatLocErr, Model.EphVelErr, Model.fu);
+        }
+
+        private void DrawErrorEllipse1X(double posLon, double posLat, double[] MsEph, double[] NsEph1, double[] NsEph2, double DfoErr, double EphPosErr, double EphVelErr, double fu)
+        {
+            try
+            {
+                List<TxInfo> listTx = new List<TxInfo>();
+                List<XzXdDw.App.Model.SatInfo> listSat = new List<XzXdDw.App.Model.SatInfo>();
+                using (RHDWContext db = new RHDWContext())
+                {
+                    listTx = db.TxInfos.ToList();
+                    listSat = db.SatInfos.ToList();
+                }
+                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
+#warning 但凡是和频差相关的 星历必须给速度
+                XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO1XOption Option = new XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO1XOption();
+                Option.MsEph = MsEph;
+                Option.NsEph1 = NsEph1;
+                Option.NsEph2 = NsEph2;
+                Option.SelectPoint = new double[3] { posLon, posLat, 0 };
+                Option.DfoErr = DfoErr;
+                Option.EphPosErr = EphPosErr;
+                Option.EphVelErr = EphVelErr;
+                Option.fu = fu;
+                var points = XzXdDw.App.Api.低轨GDOP误差椭圆.ErrEllipseHelper.ErrorEllipseSingleX(Option);
+                mapControl1.DrawDtoPonit($"单星[{listSat.FirstOrDefault(m => m.ID == satTx.ID)?.Sat}]误差椭圆线", points);
+
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error("绘制误差椭圆线失败", ex);
+                XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
+            }
+        }
+
+        private void btnClose_Click(object sender, EventArgs e)
         {
             PopupHelper.HidePopup(this);
         }

+ 75 - 48
XzDw.App/UserControl/XZErrEllipseParam.Designer.cs

@@ -28,6 +28,11 @@
         /// </summary>
         private void InitializeComponent()
         {
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions7 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject25 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject26 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject27 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject28 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
@@ -53,11 +58,6 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject18 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject19 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject20 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions6 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject21 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject22 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject23 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject24 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.btnOK = new DevExpress.XtraEditors.SimpleButton();
             this.txtCapTime = new DevExpress.XtraEditors.DateEdit();
@@ -86,6 +86,8 @@
             this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.btnClose = new DevExpress.XtraEditors.SimpleButton();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtCapTime.Properties)).BeginInit();
@@ -115,6 +117,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
@@ -130,6 +133,7 @@
             this.layoutControl1.Controls.Add(this.txtEphVelErr1);
             this.layoutControl1.Controls.Add(this.txtFu1);
             this.layoutControl1.Controls.Add(this.txtFu2);
+            this.layoutControl1.Controls.Add(this.btnClose);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
@@ -142,7 +146,7 @@
             // 
             // btnOK
             // 
-            this.btnOK.Location = new System.Drawing.Point(198, 352);
+            this.btnOK.Location = new System.Drawing.Point(198, 334);
             this.btnOK.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
             this.btnOK.Name = "btnOK";
             this.btnOK.Size = new System.Drawing.Size(194, 27);
@@ -154,7 +158,7 @@
             // txtCapTime
             // 
             this.txtCapTime.EditValue = null;
-            this.txtCapTime.Location = new System.Drawing.Point(2, 140);
+            this.txtCapTime.Location = new System.Drawing.Point(2, 132);
             this.txtCapTime.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtCapTime.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtCapTime.MinimumSize = new System.Drawing.Size(0, 28);
@@ -171,7 +175,7 @@
             // txtRefLocation1
             // 
             this.txtRefLocation1.EditValue = "";
-            this.txtRefLocation1.Location = new System.Drawing.Point(198, 140);
+            this.txtRefLocation1.Location = new System.Drawing.Point(198, 132);
             this.txtRefLocation1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtRefLocation1.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtRefLocation1.MinimumSize = new System.Drawing.Size(0, 28);
@@ -185,7 +189,7 @@
             // txtTleMain
             // 
             this.txtTleMain.EditValue = "";
-            this.txtTleMain.Location = new System.Drawing.Point(2, 26);
+            this.txtTleMain.Location = new System.Drawing.Point(2, 24);
             this.txtTleMain.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtTleMain.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtTleMain.MinimumSize = new System.Drawing.Size(0, 28);
@@ -213,7 +217,7 @@
             // txtTleAdja
             // 
             this.txtTleAdja.EditValue = "";
-            this.txtTleAdja.Location = new System.Drawing.Point(2, 83);
+            this.txtTleAdja.Location = new System.Drawing.Point(2, 78);
             this.txtTleAdja.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtTleAdja.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtTleAdja.MinimumSize = new System.Drawing.Size(0, 28);
@@ -241,14 +245,14 @@
             // txtDtousErr1
             // 
             this.txtDtousErr1.EditValue = "";
-            this.txtDtousErr1.Location = new System.Drawing.Point(2, 197);
+            this.txtDtousErr1.Location = new System.Drawing.Point(2, 186);
             this.txtDtousErr1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtDtousErr1.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtDtousErr1.MinimumSize = new System.Drawing.Size(0, 28);
             this.txtDtousErr1.Name = "txtDtousErr1";
             this.txtDtousErr1.Properties.AutoHeight = false;
             this.txtDtousErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions7, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject25, serializableAppearanceObject26, serializableAppearanceObject27, serializableAppearanceObject28, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtDtousErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtDtousErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtDtousErr1.Properties.MaskSettings.Set("mask", "f");
@@ -260,14 +264,14 @@
             // txtSatLocErr1
             // 
             this.txtSatLocErr1.EditValue = "";
-            this.txtSatLocErr1.Location = new System.Drawing.Point(2, 254);
+            this.txtSatLocErr1.Location = new System.Drawing.Point(2, 240);
             this.txtSatLocErr1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtSatLocErr1.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtSatLocErr1.MinimumSize = new System.Drawing.Size(0, 28);
             this.txtSatLocErr1.Name = "txtSatLocErr1";
             this.txtSatLocErr1.Properties.AutoHeight = false;
             this.txtSatLocErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtSatLocErr1.Properties.MaskSettings.Set("mask", "f");
@@ -278,13 +282,13 @@
             // 
             // txtDfoErr1
             // 
-            this.txtDfoErr1.Location = new System.Drawing.Point(198, 197);
+            this.txtDfoErr1.Location = new System.Drawing.Point(198, 186);
             this.txtDfoErr1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtDfoErr1.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtDfoErr1.MinimumSize = new System.Drawing.Size(0, 28);
             this.txtDfoErr1.Name = "txtDfoErr1";
             this.txtDfoErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtDfoErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtDfoErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtDfoErr1.Properties.MaskSettings.Set("mask", "f");
@@ -294,13 +298,13 @@
             // 
             // txtEphVelErr1
             // 
-            this.txtEphVelErr1.Location = new System.Drawing.Point(198, 254);
+            this.txtEphVelErr1.Location = new System.Drawing.Point(198, 240);
             this.txtEphVelErr1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtEphVelErr1.MaximumSize = new System.Drawing.Size(0, 28);
             this.txtEphVelErr1.MinimumSize = new System.Drawing.Size(0, 28);
             this.txtEphVelErr1.Name = "txtEphVelErr1";
             this.txtEphVelErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -1, false, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtEphVelErr1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtEphVelErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtEphVelErr1.Properties.MaskSettings.Set("mask", "f");
@@ -310,11 +314,11 @@
             // 
             // txtFu1
             // 
-            this.txtFu1.Location = new System.Drawing.Point(2, 311);
+            this.txtFu1.Location = new System.Drawing.Point(2, 294);
             this.txtFu1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtFu1.Name = "txtFu1";
             this.txtFu1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions5, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject17, serializableAppearanceObject18, serializableAppearanceObject19, serializableAppearanceObject20, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtFu1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtFu1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtFu1.Properties.MaskSettings.Set("mask", "f");
@@ -324,11 +328,11 @@
             // 
             // txtFu2
             // 
-            this.txtFu2.Location = new System.Drawing.Point(198, 311);
+            this.txtFu2.Location = new System.Drawing.Point(198, 294);
             this.txtFu2.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
             this.txtFu2.Name = "txtFu2";
             this.txtFu2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions6, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject21, serializableAppearanceObject22, serializableAppearanceObject23, serializableAppearanceObject24, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions5, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject17, serializableAppearanceObject18, serializableAppearanceObject19, serializableAppearanceObject20, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtFu2.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtFu2.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtFu2.Properties.MaskSettings.Set("mask", "f");
@@ -352,7 +356,8 @@
             this.layoutControlItem14,
             this.layoutControlItem6,
             this.layoutControlItem7,
-            this.layoutControlItem12});
+            this.layoutControlItem12,
+            this.layoutControlItem2});
             this.Root.Name = "Root";
             this.Root.Size = new System.Drawing.Size(394, 716);
             this.Root.TextVisible = false;
@@ -363,7 +368,7 @@
             this.layoutControlItem8.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItem8.Location = new System.Drawing.Point(0, 0);
             this.layoutControlItem8.Name = "layoutControlItem8";
-            this.layoutControlItem8.Size = new System.Drawing.Size(394, 57);
+            this.layoutControlItem8.Size = new System.Drawing.Size(394, 54);
             this.layoutControlItem8.Text = "主星星历";
             this.layoutControlItem8.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem8.TextSize = new System.Drawing.Size(90, 18);
@@ -372,9 +377,9 @@
             // 
             this.layoutControlItem9.Control = this.txtTleAdja;
             this.layoutControlItem9.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
-            this.layoutControlItem9.Location = new System.Drawing.Point(0, 57);
+            this.layoutControlItem9.Location = new System.Drawing.Point(0, 54);
             this.layoutControlItem9.Name = "layoutControlItem9";
-            this.layoutControlItem9.Size = new System.Drawing.Size(394, 57);
+            this.layoutControlItem9.Size = new System.Drawing.Size(394, 54);
             this.layoutControlItem9.Text = "邻星星历";
             this.layoutControlItem9.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem9.TextSize = new System.Drawing.Size(90, 18);
@@ -383,9 +388,9 @@
             // 
             this.layoutControlItem11.Control = this.txtCapTime;
             this.layoutControlItem11.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
-            this.layoutControlItem11.Location = new System.Drawing.Point(0, 114);
+            this.layoutControlItem11.Location = new System.Drawing.Point(0, 108);
             this.layoutControlItem11.Name = "layoutControlItem11";
-            this.layoutControlItem11.Size = new System.Drawing.Size(196, 57);
+            this.layoutControlItem11.Size = new System.Drawing.Size(196, 54);
             this.layoutControlItem11.Text = "采集时刻";
             this.layoutControlItem11.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem11.TextSize = new System.Drawing.Size(90, 18);
@@ -395,9 +400,9 @@
             this.layoutControlItem5.Control = this.txtSatLocErr1;
             this.layoutControlItem5.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItem5.CustomizationFormText = "低轨卫星X";
-            this.layoutControlItem5.Location = new System.Drawing.Point(0, 228);
+            this.layoutControlItem5.Location = new System.Drawing.Point(0, 216);
             this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Size = new System.Drawing.Size(196, 57);
+            this.layoutControlItem5.Size = new System.Drawing.Size(196, 54);
             this.layoutControlItem5.Text = "星历位置误差";
             this.layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem5.TextSize = new System.Drawing.Size(90, 18);
@@ -405,27 +410,27 @@
             // layoutControlItem1
             // 
             this.layoutControlItem1.Control = this.btnOK;
-            this.layoutControlItem1.Location = new System.Drawing.Point(196, 342);
+            this.layoutControlItem1.Location = new System.Drawing.Point(196, 324);
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 10, 3);
-            this.layoutControlItem1.Size = new System.Drawing.Size(198, 40);
+            this.layoutControlItem1.Size = new System.Drawing.Size(198, 41);
             this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem1.TextVisible = false;
             // 
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 382);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 365);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(394, 334);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(394, 351);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // emptySpaceItem2
             // 
             this.emptySpaceItem2.AllowHotTrack = false;
-            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 342);
+            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 324);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
-            this.emptySpaceItem2.Size = new System.Drawing.Size(196, 40);
+            this.emptySpaceItem2.Size = new System.Drawing.Size(196, 10);
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
             // 
             // layoutControlItem4
@@ -433,9 +438,9 @@
             this.layoutControlItem4.Control = this.txtDtousErr1;
             this.layoutControlItem4.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItem4.CustomizationFormText = "低轨卫星X";
-            this.layoutControlItem4.Location = new System.Drawing.Point(0, 171);
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 162);
             this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(196, 57);
+            this.layoutControlItem4.Size = new System.Drawing.Size(196, 54);
             this.layoutControlItem4.Text = "时差误差";
             this.layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem4.TextSize = new System.Drawing.Size(90, 18);
@@ -443,9 +448,9 @@
             // layoutControlItem10
             // 
             this.layoutControlItem10.Control = this.txtFu1;
-            this.layoutControlItem10.Location = new System.Drawing.Point(0, 285);
+            this.layoutControlItem10.Location = new System.Drawing.Point(0, 270);
             this.layoutControlItem10.Name = "layoutControlItem10";
-            this.layoutControlItem10.Size = new System.Drawing.Size(196, 57);
+            this.layoutControlItem10.Size = new System.Drawing.Size(196, 54);
             this.layoutControlItem10.Text = "目标上行频点";
             this.layoutControlItem10.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem10.TextSize = new System.Drawing.Size(90, 18);
@@ -454,9 +459,9 @@
             // 
             this.layoutControlItem14.Control = this.txtRefLocation1;
             this.layoutControlItem14.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
-            this.layoutControlItem14.Location = new System.Drawing.Point(196, 114);
+            this.layoutControlItem14.Location = new System.Drawing.Point(196, 108);
             this.layoutControlItem14.Name = "layoutControlItem14";
-            this.layoutControlItem14.Size = new System.Drawing.Size(198, 57);
+            this.layoutControlItem14.Size = new System.Drawing.Size(198, 54);
             this.layoutControlItem14.Text = "参考站经纬度";
             this.layoutControlItem14.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem14.TextSize = new System.Drawing.Size(90, 18);
@@ -464,9 +469,9 @@
             // layoutControlItem6
             // 
             this.layoutControlItem6.Control = this.txtDfoErr1;
-            this.layoutControlItem6.Location = new System.Drawing.Point(196, 171);
+            this.layoutControlItem6.Location = new System.Drawing.Point(196, 162);
             this.layoutControlItem6.Name = "layoutControlItem6";
-            this.layoutControlItem6.Size = new System.Drawing.Size(198, 57);
+            this.layoutControlItem6.Size = new System.Drawing.Size(198, 54);
             this.layoutControlItem6.Text = "频差误差";
             this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem6.TextSize = new System.Drawing.Size(90, 18);
@@ -474,9 +479,9 @@
             // layoutControlItem7
             // 
             this.layoutControlItem7.Control = this.txtEphVelErr1;
-            this.layoutControlItem7.Location = new System.Drawing.Point(196, 228);
+            this.layoutControlItem7.Location = new System.Drawing.Point(196, 216);
             this.layoutControlItem7.Name = "layoutControlItem7";
-            this.layoutControlItem7.Size = new System.Drawing.Size(198, 57);
+            this.layoutControlItem7.Size = new System.Drawing.Size(198, 54);
             this.layoutControlItem7.Text = "星历速度误差";
             this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem7.TextSize = new System.Drawing.Size(90, 18);
@@ -484,13 +489,32 @@
             // layoutControlItem12
             // 
             this.layoutControlItem12.Control = this.txtFu2;
-            this.layoutControlItem12.Location = new System.Drawing.Point(196, 285);
+            this.layoutControlItem12.Location = new System.Drawing.Point(196, 270);
             this.layoutControlItem12.Name = "layoutControlItem12";
-            this.layoutControlItem12.Size = new System.Drawing.Size(198, 57);
+            this.layoutControlItem12.Size = new System.Drawing.Size(198, 54);
             this.layoutControlItem12.Text = "参考上行频点";
             this.layoutControlItem12.TextLocation = DevExpress.Utils.Locations.Top;
             this.layoutControlItem12.TextSize = new System.Drawing.Size(90, 18);
             // 
+            // btnClose
+            // 
+            this.btnClose.Location = new System.Drawing.Point(2, 336);
+            this.btnClose.Name = "btnClose";
+            this.btnClose.Size = new System.Drawing.Size(192, 27);
+            this.btnClose.StyleController = this.layoutControl1;
+            this.btnClose.TabIndex = 17;
+            this.btnClose.Text = "关闭";
+            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.btnClose;
+            this.layoutControlItem2.Location = new System.Drawing.Point(0, 334);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(196, 31);
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem2.TextVisible = false;
+            // 
             // XZErrEllipseParam
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
@@ -528,6 +552,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -561,5 +586,7 @@
         private DevExpress.XtraEditors.ButtonEdit txtFu2;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
+        private DevExpress.XtraEditors.SimpleButton btnClose;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
 }

+ 41 - 0
XzDw.App/UserControl/XZErrEllipseParam.cs

@@ -1,4 +1,5 @@
 using DevExpress.XtraEditors;
+using DevExpress.XtraMap;
 using DxHelper;
 using ExtensionsDev;
 using System;
@@ -10,13 +11,18 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using XdCxRhDW.App.Api.星历推算;
 using XzXdDw.App;
+using XzXdDw.App.Api.低轨GDOP误差椭圆;
 using XzXdDw.App.Model;
 
 namespace XdCxRhDW.App.UserControl
 {
     public partial class XZErrEllipseParam : DevExpress.XtraEditors.XtraUserControl
     {
+        public MapControl mapControl1;
+        public double lon;
+        public double lat;
         public ErrEllipse星座协同接口 Model => new ErrEllipse星座协同接口()
         {
             TleMain = txtTleMain.Text.Trim(),
@@ -53,6 +59,41 @@ namespace XdCxRhDW.App.UserControl
 
 
         private void btnOK_Click(object sender, EventArgs e)
+        {
+            mapControl1.ClearMap();
+            double[] main_sat = Tle2XYZ.GetXyz(Model.TleMain, Model.CapTime);
+            double[] adja_sat = Tle2XYZ.GetXyz(Model.TleAdja, Model.CapTime);
+            DrawErrorEllipseDTFO(lon, lat, main_sat, adja_sat, new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.DfoErr, Model.SatLocErr, Model.EphVelErr, Model.fu1, Model.fu2);
+        }
+        private void DrawErrorEllipseDTFO(double posLon, double posLat, double[] main_sat, double[] neigh_sat, double[] Ref_Station_LLH, double DtoErr, double DfoErr, double EphPosErr, double EphVelErr, double fu1, double fu2)
+        {
+            try
+            {
+                ErrorEllipseDTFOTSOption twoStartOption = new ErrorEllipseDTFOTSOption();
+                twoStartOption.MsEph = main_sat;
+                twoStartOption.NsEph = neigh_sat;
+                twoStartOption.RefGeod = Ref_Station_LLH;
+                twoStartOption.SelectPoint = new double[3] { posLon, posLat, 0 };
+                twoStartOption.DtoErr = DtoErr * 1e-6;
+                twoStartOption.DfoErr = DfoErr;
+                twoStartOption.EphPosErr = EphPosErr;
+                twoStartOption.EphVelErr = EphVelErr;
+                twoStartOption.fu1 = fu1;
+                twoStartOption.fu2 = fu2;
+
+                var points = ErrEllipseHelper.ErrorEllipseDTFOTwoStart(twoStartOption);
+                mapControl1.DrawDtoPonit($"双星误差椭圆线", points);
+
+
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error("绘制误差椭圆线失败", ex);
+                XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
+            }
+        }
+
+        private void btnClose_Click(object sender, EventArgs e)
         {
             PopupHelper.HidePopup(this);
         }

+ 1 - 0
XzDw.App/XzDw.App.csproj

@@ -281,6 +281,7 @@
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="UserControl\CtrlPosSingle.resx">
       <DependentUpon>CtrlPosSingle.cs</DependentUpon>
     </EmbeddedResource>