Browse Source

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

wyq 1 year ago
parent
commit
c4402b7147

+ 6 - 20
XdDw.App/UserControl/CtrlPosXd.cs

@@ -39,8 +39,6 @@ namespace XdDw.App.UserControl
     public partial class CtrlPosXd : DevExpress.XtraEditors.XtraUserControl
     public partial class CtrlPosXd : DevExpress.XtraEditors.XtraUserControl
     {
     {
         DtXDParam dtxdctrl = null;
         DtXDParam dtxdctrl = null;
-        X2D1GDOPParam x2D1GdopParam = null;
-        X2D1ErrEllipseParam x2D1ErrEllipseParam = null;
         TcpServer tcpServer;
         TcpServer tcpServer;
         public CtrlPosXd()
         public CtrlPosXd()
         {
         {
@@ -99,10 +97,7 @@ namespace XdDw.App.UserControl
                             return;
                             return;
                         }
                         }
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
-                        if (x2D1GdopParam == null)
-                        {
-                            x2D1GdopParam = new X2D1GDOPParam(item.CgResID);
-                        }
+                        X2D1GDOPParam x2D1GdopParam = new X2D1GDOPParam(item.CgResID);
                         x2D1GdopParam.mapControl1 = mapControl1;
                         x2D1GdopParam.mapControl1 = mapControl1;
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                     })
                     })
@@ -115,10 +110,7 @@ namespace XdDw.App.UserControl
                             return;
                             return;
                         }
                         }
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
-                        if (x2D1ErrEllipseParam == null)
-                        {
-                            x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.CgResID);
-                        }
+                        X2D1ErrEllipseParam x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.CgResID);
                         x2D1ErrEllipseParam.mapControl1 = mapControl1;
                         x2D1ErrEllipseParam.mapControl1 = mapControl1;
                         x2D1ErrEllipseParam.lon = item.PosLon;
                         x2D1ErrEllipseParam.lon = item.PosLon;
                         x2D1ErrEllipseParam.lat = item.PosLat;
                         x2D1ErrEllipseParam.lat = item.PosLat;
@@ -156,25 +148,19 @@ namespace XdDw.App.UserControl
                      })
                      })
                     .AddPosMenu<XDPosRes>("GDOP分析", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
                     .AddPosMenu<XDPosRes>("GDOP分析", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
                     {
                     {
-                        if (x2D1GdopParam == null)
-                        {
-                            x2D1GdopParam = new X2D1GDOPParam(item.CgResID);
-                        }
+                        X2D1GDOPParam x2D1GdopParam = new X2D1GDOPParam(item.CgResID);
                         x2D1GdopParam.mapControl1 = mapControl1;
                         x2D1GdopParam.mapControl1 = mapControl1;
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                     })
                     })
                     .AddPosMenu<XDPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     .AddPosMenu<XDPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     {
                     {
-                        if (x2D1ErrEllipseParam == null)
-                        {
-                            x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.CgResID);
-                        }
+                        X2D1ErrEllipseParam x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.CgResID);
                         x2D1ErrEllipseParam.mapControl1 = mapControl1;
                         x2D1ErrEllipseParam.mapControl1 = mapControl1;
                         x2D1ErrEllipseParam.lon = item.PosLon;
                         x2D1ErrEllipseParam.lon = item.PosLon;
                         x2D1ErrEllipseParam.lat = item.PosLat;
                         x2D1ErrEllipseParam.lat = item.PosLat;
                         PopupHelper.ShowPopup(x2D1ErrEllipseParam, mapControl1, mapControl1.Width / 4);
                         PopupHelper.ShowPopup(x2D1ErrEllipseParam, mapControl1, mapControl1.Width / 4);
 
 
-                       
+
                     })
                     })
                     .AddRectMenu<XDPosRes>("时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
                     .AddRectMenu<XDPosRes>("时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
                     {
                     {
@@ -438,7 +424,7 @@ namespace XdDw.App.UserControl
                 Serilog.Log.Error("绘制时差线失败", ex);
                 Serilog.Log.Error("绘制时差线失败", ex);
                 XtraMessageBox.Show($"绘制时差线失败,失败信息:{ex.Message}");
                 XtraMessageBox.Show($"绘制时差线失败,失败信息:{ex.Message}");
             }
             }
-        }      
+        }
 
 
     }
     }
 }
 }

+ 17 - 64
XzXdDw.App/UserControl/CtrlPosXd.cs

@@ -33,14 +33,12 @@ using XzXdDw.App.Model;
 
 
 namespace XzXdDw.App.UserControl
 namespace XzXdDw.App.UserControl
 {
 {
-
     /// <summary>
     /// <summary>
     /// 星地定位
     /// 星地定位
     /// </summary>
     /// </summary>
     public partial class CtrlPosXd : DevExpress.XtraEditors.XtraUserControl
     public partial class CtrlPosXd : DevExpress.XtraEditors.XtraUserControl
     {
     {
         DtXDParam dtxdctrl = null;
         DtXDParam dtxdctrl = null;
-        X2D1GDOPParam x2D1GdopParam = null;
         TcpServer tcpServer;
         TcpServer tcpServer;
         public CtrlPosXd()
         public CtrlPosXd()
         {
         {
@@ -99,10 +97,7 @@ namespace XzXdDw.App.UserControl
                             return;
                             return;
                         }
                         }
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
-                        if (x2D1GdopParam == null)
-                        {
-                            x2D1GdopParam = new X2D1GDOPParam(item.SigTime);
-                        }
+                        X2D1GDOPParam x2D1GdopParam = new X2D1GDOPParam(item.CgResID);
                         x2D1GdopParam.mapControl1 = mapControl1;
                         x2D1GdopParam.mapControl1 = mapControl1;
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                     })
                     })
@@ -115,15 +110,11 @@ namespace XzXdDw.App.UserControl
                             return;
                             return;
                         }
                         }
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
                         var item = gridView1.GetRow(ids[0]) as XDPosRes;
-                        var ctrl = new X2D1ErrEllipseParam(item.SigTime);
-                        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(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 x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.CgResID);
+                        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);
                     .AddMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), () => stoped = true);
 
 
@@ -157,24 +148,19 @@ namespace XzXdDw.App.UserControl
                      })
                      })
                     .AddPosMenu<XDPosRes>("GDOP分析", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
                     .AddPosMenu<XDPosRes>("GDOP分析", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
                     {
                     {
-                        if (x2D1GdopParam == null)
-                        {
-                            x2D1GdopParam = new X2D1GDOPParam(item.SigTime);
-                        }
+                        X2D1GDOPParam x2D1GdopParam = new X2D1GDOPParam(item.CgResID);
                         x2D1GdopParam.mapControl1 = mapControl1;
                         x2D1GdopParam.mapControl1 = mapControl1;
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                         PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
                     })
                     })
                     .AddPosMenu<XDPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     .AddPosMenu<XDPosRes>("误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), item =>
                     {
                     {
-                        var ctrl = new X2D1ErrEllipseParam(item.SigTime);
-                        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(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 x2D1ErrEllipseParam = new X2D1ErrEllipseParam(item.CgResID);
+                        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 =>
                     .AddRectMenu<XDPosRes>("时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
                     {
                     {
@@ -187,10 +173,10 @@ namespace XzXdDw.App.UserControl
                         PopupHelper.ShowPopup(dtxdctrl, mapControl1, mapControl1.Width / 4);
                         PopupHelper.ShowPopup(dtxdctrl, mapControl1, mapControl1.Width / 4);
                     })
                     })
                    .AddPosMenu<XDPosRes>("手动定位", SvgHelper.LoadFromFile("Image\\Pos.svg"), item =>
                    .AddPosMenu<XDPosRes>("手动定位", SvgHelper.LoadFromFile("Image\\Pos.svg"), item =>
-                    {
-                        XdPos(item);
+                   {
+                       XdPos(item);
 
 
-                    });
+                   });
 
 
                 //查询已有的定位记录
                 //查询已有的定位记录
                 using (RHDWContext db = new RHDWContext())
                 using (RHDWContext db = new RHDWContext())
@@ -440,38 +426,5 @@ namespace XzXdDw.App.UserControl
             }
             }
         }
         }
 
 
-        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);
-                XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption Option = new XzXdDw.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 = XzXdDw.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
XzXdDw.App/UserControl/X2D1ErrEllipseParam.Designer.cs

@@ -28,16 +28,16 @@
         /// </summary>
         /// </summary>
         private void InitializeComponent()
         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.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = 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.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.btnOK = new DevExpress.XtraEditors.SimpleButton();
             this.btnOK = new DevExpress.XtraEditors.SimpleButton();
             this.txtCapTime = new DevExpress.XtraEditors.DateEdit();
             this.txtCapTime = new DevExpress.XtraEditors.DateEdit();
@@ -60,6 +60,8 @@
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.emptySpaceItem2 = 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();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtCapTime.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtCapTime.Properties)).BeginInit();
@@ -83,6 +85,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
             // layoutControl1
             // layoutControl1
@@ -95,6 +98,7 @@
             this.layoutControl1.Controls.Add(this.txtTleAdja);
             this.layoutControl1.Controls.Add(this.txtTleAdja);
             this.layoutControl1.Controls.Add(this.txtDtousErr1);
             this.layoutControl1.Controls.Add(this.txtDtousErr1);
             this.layoutControl1.Controls.Add(this.txtSatLocErr1);
             this.layoutControl1.Controls.Add(this.txtSatLocErr1);
+            this.layoutControl1.Controls.Add(this.btnClose);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(4);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(4);
@@ -227,7 +231,7 @@
             this.txtDtousErr1.Name = "txtDtousErr1";
             this.txtDtousErr1.Name = "txtDtousErr1";
             this.txtDtousErr1.Properties.AutoHeight = false;
             this.txtDtousErr1.Properties.AutoHeight = false;
             this.txtDtousErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             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("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtDtousErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtDtousErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtDtousErr1.Properties.MaskSettings.Set("mask", "f");
             this.txtDtousErr1.Properties.MaskSettings.Set("mask", "f");
@@ -246,7 +250,7 @@
             this.txtSatLocErr1.Name = "txtSatLocErr1";
             this.txtSatLocErr1.Name = "txtSatLocErr1";
             this.txtSatLocErr1.Properties.AutoHeight = false;
             this.txtSatLocErr1.Properties.AutoHeight = false;
             this.txtSatLocErr1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             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("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtSatLocErr1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
             this.txtSatLocErr1.Properties.MaskSettings.Set("mask", "f");
             this.txtSatLocErr1.Properties.MaskSettings.Set("mask", "f");
@@ -268,7 +272,8 @@
             this.layoutControlItem5,
             this.layoutControlItem5,
             this.layoutControlItem1,
             this.layoutControlItem1,
             this.emptySpaceItem1,
             this.emptySpaceItem1,
-            this.emptySpaceItem2});
+            this.emptySpaceItem2,
+            this.layoutControlItem2});
             this.Root.Name = "Root";
             this.Root.Name = "Root";
             this.Root.Size = new System.Drawing.Size(394, 716);
             this.Root.Size = new System.Drawing.Size(394, 716);
             this.Root.TextVisible = false;
             this.Root.TextVisible = false;
@@ -358,16 +363,16 @@
             this.layoutControlItem1.Location = new System.Drawing.Point(197, 378);
             this.layoutControlItem1.Location = new System.Drawing.Point(197, 378);
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 11, 2);
             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.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem1.TextVisible = false;
             this.layoutControlItem1.TextVisible = false;
             // 
             // 
             // emptySpaceItem1
             // emptySpaceItem1
             // 
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
             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.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);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // 
             // emptySpaceItem2
             // emptySpaceItem2
@@ -375,9 +380,28 @@
             this.emptySpaceItem2.AllowHotTrack = false;
             this.emptySpaceItem2.AllowHotTrack = false;
             this.emptySpaceItem2.Location = new System.Drawing.Point(0, 378);
             this.emptySpaceItem2.Location = new System.Drawing.Point(0, 378);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
             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);
             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
             // X2D1ErrEllipseParam
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
@@ -409,6 +433,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
             this.ResumeLayout(false);
 
 
         }
         }
@@ -436,5 +461,7 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+        private DevExpress.XtraEditors.SimpleButton btnClose;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
     }
 }
 }

+ 62 - 6
XzXdDw.App/UserControl/X2D1ErrEllipseParam.cs

@@ -1,4 +1,5 @@
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors;
+using DevExpress.XtraMap;
 using DxHelper;
 using DxHelper;
 using ExtensionsDev;
 using ExtensionsDev;
 using System;
 using System;
@@ -10,13 +11,20 @@ using System.Linq;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Windows.Forms;
+using XdCxRhDW.App.Api.星历推算;
 using XzXdDw.App;
 using XzXdDw.App;
+using XzXdDw.App.Api.低轨GDOP误差椭圆;
+using XzXdDw.App.EFContext;
 using XzXdDw.App.Model;
 using XzXdDw.App.Model;
 
 
 namespace XdCxRhDW.App.UserControl
 namespace XdCxRhDW.App.UserControl
 {
 {
     public partial class X2D1ErrEllipseParam : DevExpress.XtraEditors.XtraUserControl
     public partial class X2D1ErrEllipseParam : DevExpress.XtraEditors.XtraUserControl
     {
     {
+        public MapControl mapControl1;
+        public double lon;
+        public double lat;
+
         public ErrEllipse星地两星一地接口 Model => new ErrEllipse星地两星一地接口()
         public ErrEllipse星地两星一地接口 Model => new ErrEllipse星地两星一地接口()
         {
         {
             TleMain = txtTleMain.Text.Trim(),
             TleMain = txtTleMain.Text.Trim(),
@@ -29,26 +37,74 @@ namespace XdCxRhDW.App.UserControl
             DtousErr = Convert.ToDouble(txtDtousErr1.Text),
             DtousErr = Convert.ToDouble(txtDtousErr1.Text),
             SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
             SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
         };
         };
-        public X2D1ErrEllipseParam(DateTime sigTime)
+        public X2D1ErrEllipseParam(long cgResID)
         {
         {
             InitializeComponent();
             InitializeComponent();
             txtCapTime.UseDefault();
             txtCapTime.UseDefault();
-            txtCapTime.DateTime = sigTime;
             txtTleMain.UseDoubleClickToSelectAll();
             txtTleMain.UseDoubleClickToSelectAll();
             txtTleAdja.UseDoubleClickToSelectAll();
             txtTleAdja.UseDoubleClickToSelectAll();
             txtStationLocation1.UseDoubleClickToSelectAll();
             txtStationLocation1.UseDoubleClickToSelectAll();
             txtRefLocation1.UseDoubleClickToSelectAll();
             txtRefLocation1.UseDoubleClickToSelectAll();
 
 
-            this.txtCapTime.DateTime = sigTime;
-            this.txtStationLocation1.Text = TestData.RecLoc;
-            this.txtRefLocation1.Text = TestData.RefLoc;
+            List<TxInfo> listTx = new List<TxInfo>();
+            CgRes cg;
+            using (RHDWContext db = new RHDWContext())
+            {
+                listTx = db.TxInfos.ToList();
+                cg = db.CgRes.Where(m => m.ID == cgResID).FirstOrDefault();
+            }
+            var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
+            var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
+            this.txtCapTime.DateTime = cg.SigTime;
+            this.txtStationLocation1.Text = $"{cdbTx.Lon},{cdbTx.Lat}";
+            this.txtRefLocation1.Text = $"{refTx.Lon},{refTx.Lat}";
             txtTleMain.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleMain;
             txtTleMain.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleMain;
             txtTleAdja.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleAdja1;
             txtTleAdja.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleAdja1;
             this.txtDtousErr1.EditValue = TestData.DtousErr;
             this.txtDtousErr1.EditValue = TestData.DtousErr;
             this.txtSatLocErr1.EditValue = TestData.SatLocErr;
             this.txtSatLocErr1.EditValue = TestData.SatLocErr;
         }
         }
-       
+
         private void btnOK_Click(object sender, EventArgs e)
         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);
+              ErrorEllipseDTO2X1DOption Option = new 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 = 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);
             PopupHelper.HidePopup(this);
         }
         }

+ 33 - 5
XzXdDw.App/UserControl/X2D1GDOPParam.Designer.cs

@@ -49,6 +49,7 @@
             this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.txtDtousErr1 = new DevExpress.XtraEditors.ButtonEdit();
             this.txtDtousErr1 = new DevExpress.XtraEditors.ButtonEdit();
             this.txtSatLocErr1 = new DevExpress.XtraEditors.ButtonEdit();
             this.txtSatLocErr1 = new DevExpress.XtraEditors.ButtonEdit();
+            this.btnClose = new DevExpress.XtraEditors.SimpleButton();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
             this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
@@ -60,6 +61,7 @@
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtCapTime.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtCapTime.Properties)).BeginInit();
@@ -83,6 +85,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
             // layoutControl1
             // layoutControl1
@@ -95,6 +98,7 @@
             this.layoutControl1.Controls.Add(this.txtTleAdja);
             this.layoutControl1.Controls.Add(this.txtTleAdja);
             this.layoutControl1.Controls.Add(this.txtDtousErr1);
             this.layoutControl1.Controls.Add(this.txtDtousErr1);
             this.layoutControl1.Controls.Add(this.txtSatLocErr1);
             this.layoutControl1.Controls.Add(this.txtSatLocErr1);
+            this.layoutControl1.Controls.Add(this.btnClose);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(4);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(4);
@@ -255,6 +259,17 @@
             this.txtSatLocErr1.TabIndex = 6;
             this.txtSatLocErr1.TabIndex = 6;
             this.txtSatLocErr1.ToolTip = "ECEF坐标X";
             this.txtSatLocErr1.ToolTip = "ECEF坐标X";
             // 
             // 
+            // btnClose
+            // 
+            this.btnClose.Location = new System.Drawing.Point(2, 390);
+            this.btnClose.Margin = new System.Windows.Forms.Padding(2);
+            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);
+            // 
             // Root
             // Root
             // 
             // 
             this.Root.GroupBordersVisible = false;
             this.Root.GroupBordersVisible = false;
@@ -268,7 +283,8 @@
             this.layoutControlItem5,
             this.layoutControlItem5,
             this.layoutControlItem1,
             this.layoutControlItem1,
             this.emptySpaceItem1,
             this.emptySpaceItem1,
-            this.emptySpaceItem2});
+            this.emptySpaceItem2,
+            this.layoutControlItem2});
             this.Root.Name = "Root";
             this.Root.Name = "Root";
             this.Root.Size = new System.Drawing.Size(394, 716);
             this.Root.Size = new System.Drawing.Size(394, 716);
             this.Root.TextVisible = false;
             this.Root.TextVisible = false;
@@ -358,16 +374,16 @@
             this.layoutControlItem1.Location = new System.Drawing.Point(197, 378);
             this.layoutControlItem1.Location = new System.Drawing.Point(197, 378);
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Name = "layoutControlItem1";
             this.layoutControlItem1.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 11, 2);
             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.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem1.TextVisible = false;
             this.layoutControlItem1.TextVisible = false;
             // 
             // 
             // emptySpaceItem1
             // emptySpaceItem1
             // 
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
             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.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);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // 
             // emptySpaceItem2
             // emptySpaceItem2
@@ -375,9 +391,18 @@
             this.emptySpaceItem2.AllowHotTrack = false;
             this.emptySpaceItem2.AllowHotTrack = false;
             this.emptySpaceItem2.Location = new System.Drawing.Point(0, 378);
             this.emptySpaceItem2.Location = new System.Drawing.Point(0, 378);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
             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);
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
             // 
             // 
+            // 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;
+            // 
             // X2D1GDOPParam
             // X2D1GDOPParam
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
@@ -409,6 +434,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
             this.ResumeLayout(false);
 
 
         }
         }
@@ -436,5 +462,7 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+        private DevExpress.XtraEditors.SimpleButton btnClose;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
     }
 }
 }

+ 18 - 7
XzXdDw.App/UserControl/X2D1GDOPParam.cs

@@ -14,6 +14,7 @@ using System.Windows.Forms;
 using XzXdDw.App;
 using XzXdDw.App;
 using XzXdDw.App.Model;
 using XzXdDw.App.Model;
 using XzXdDw.App.Api.星地GDOP误差椭圆;
 using XzXdDw.App.Api.星地GDOP误差椭圆;
+using XzXdDw.App.EFContext;
 namespace XdCxRhDW.App.UserControl
 namespace XdCxRhDW.App.UserControl
 {
 {
     public partial class X2D1GDOPParam : DevExpress.XtraEditors.XtraUserControl
     public partial class X2D1GDOPParam : DevExpress.XtraEditors.XtraUserControl
@@ -31,19 +32,28 @@ namespace XdCxRhDW.App.UserControl
             DtousErr = Convert.ToDouble(txtDtousErr1.Text),
             DtousErr = Convert.ToDouble(txtDtousErr1.Text),
             SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
             SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
         };
         };
-        public X2D1GDOPParam(DateTime sigTime)
+        public X2D1GDOPParam(long cgResID)
         {
         {
             InitializeComponent();
             InitializeComponent();
             txtCapTime.UseDefault();
             txtCapTime.UseDefault();
-            txtCapTime.DateTime = sigTime;
             txtTleMain.UseDoubleClickToSelectAll();
             txtTleMain.UseDoubleClickToSelectAll();
             txtTleAdja.UseDoubleClickToSelectAll();
             txtTleAdja.UseDoubleClickToSelectAll();
             txtStationLocation1.UseDoubleClickToSelectAll();
             txtStationLocation1.UseDoubleClickToSelectAll();
             txtRefLocation1.UseDoubleClickToSelectAll();
             txtRefLocation1.UseDoubleClickToSelectAll();
 
 
-            this.txtCapTime.DateTime = sigTime;
-            this.txtStationLocation1.Text = TestData.RecLoc;
-            this.txtRefLocation1.Text = TestData.RefLoc;
+            List<TxInfo> listTx = new List<TxInfo>();
+            CgRes cg;
+            using (RHDWContext db = new RHDWContext())
+            {
+                listTx = db.TxInfos.ToList();
+                cg = db.CgRes.Where(m => m.ID == cgResID).FirstOrDefault();
+            }
+            var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
+            var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
+
+            this.txtCapTime.DateTime = cg.SigTime;
+            this.txtStationLocation1.Text = $"{cdbTx.Lon},{cdbTx.Lat}";
+            this.txtRefLocation1.Text = $"{refTx.Lon},{refTx.Lat}";
             txtTleMain.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleMain;
             txtTleMain.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleMain;
             txtTleAdja.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleAdja1;
             txtTleAdja.UseDefault().SetStringData(TestData.AllTle).Text = TestData.TleAdja1;
             this.txtDtousErr1.EditValue = TestData.DtousErr;
             this.txtDtousErr1.EditValue = TestData.DtousErr;
@@ -51,6 +61,7 @@ namespace XdCxRhDW.App.UserControl
         }
         }
 
 
 
 
+
         private void btnOK_Click(object sender, EventArgs e)
         private void btnOK_Click(object sender, EventArgs e)
         {
         {
             mapControl1.ClearMap();
             mapControl1.ClearMap();
@@ -92,12 +103,12 @@ namespace XdCxRhDW.App.UserControl
             }
             }
         }
         }
 
 
-        public DTO.MapLine SampleDots(DTO.MapLine line)
+        public XdCxRhDW.App.DTO.MapLine SampleDots(XdCxRhDW.App.DTO.MapLine line)
         {
         {
             var dots = line.Line;
             var dots = line.Line;
             if (dots.Count < 30) return line;
             if (dots.Count < 30) return line;
             var tmp = dots.Count / 30;
             var tmp = dots.Count / 30;
-            var newLine = new DTO.MapLine();
+            var newLine = new XdCxRhDW.App.DTO.MapLine();
             for (int i = 0; i < dots.Count; i += tmp)
             for (int i = 0; i < dots.Count; i += tmp)
             {
             {
                 newLine.Line.Add(dots[i]);
                 newLine.Line.Add(dots[i]);