zoulei 1 ano atrás
pai
commit
063bb20007

+ 13 - 13
XdCxRhDW.App/EditForms/X2D1DTOParamEditor.cs

@@ -92,17 +92,17 @@ namespace XdCxRhDW.App.EditForms
                 txtRefLocation.Properties.ReadOnly = true;
                 this.txtRefLocation.Text = $"{0},{0}";
             }
-            //double tarLon = 46, tarLat = 24;
-            //double recLon = 45.9, recLat = 23.9;
-            //var tarEcef = PhysicsHelper.GeoToEcef((tarLon, tarLat, 0));
-            //var recEcef = PhysicsHelper.GeoToEcef((recLon, recLat, 0));
-            //var xl1Ecef = (cg.MainX.Value, cg.MainY.Value, cg.MainZ.Value);
-            //var xl2Ecef = (cg.Adja1X.Value, cg.Adja1Y.Value, cg.Adja1Z.Value);
-            //var dt1 = PhysicsHelper.Dto(tarEcef, xl1Ecef, recEcef);
-            //var dt2 = PhysicsHelper.Dto(tarEcef, xl2Ecef, recEcef);
-            //var dto1 = (dt1 - dt2) * 1e6;
-            //var dt3 = PhysicsHelper.Dto(tarEcef, recEcef);
-            //var dto2 = (dt1 - dt3) * 1e6;
+            double tarLon = 46, tarLat = 24;
+            double recLon = 45.9, recLat = 23.9;
+            var tarEcef = PhysicsHelper.GeoToEcef((tarLon, tarLat, 0));
+            var recEcef = PhysicsHelper.GeoToEcef((recLon, recLat, 0));
+            var xl1Ecef = (cg.MainX.Value, cg.MainY.Value, cg.MainZ.Value);
+            var xl2Ecef = (cg.Adja1X.Value, cg.Adja1Y.Value, cg.Adja1Z.Value);
+            var dt1 = PhysicsHelper.Dto(tarEcef, xl1Ecef, recEcef);
+            var dt2 = PhysicsHelper.Dto(tarEcef, xl2Ecef, recEcef);
+            var dto1 = (dt1 - dt2) * 1e6;
+            var dt3 = PhysicsHelper.Dto(tarEcef, recEcef);
+            var dto2 = (dt1 - dt3) * 1e6;
         }
 
         public bool CheckParam()
@@ -171,7 +171,7 @@ namespace XdCxRhDW.App.EditForms
                     mapControl1.DrawDtoLine($"[{msat},超短{CDBAnt[0]}°]时差线", xdDtoLine);
 
                     var tsDtoLine = DrawDtoLineHelper.DtoLine2XStart(twoStartOption);
-                    mapControl1.DrawDtoPonit($"[{msat},{nsat}]时差线", tsDtoLine);
+                    mapControl1.DrawDtoLine($"[{msat},{nsat}]时差线", tsDtoLine);
                 }
                 else
                 {
@@ -179,7 +179,7 @@ namespace XdCxRhDW.App.EditForms
                     mapControl1.DrawDtoLine($"[{msat},超短{CDBAnt[0]}°]时差线", xdDtoLine);
 
                     var tsDtoLine = DrawDtoLineHelper.DtoLine2XNoRefStart(twoStartOption);
-                    mapControl1.DrawDtoPonit($"[{msat},{nsat}]时差线", tsDtoLine);
+                    mapControl1.DrawDtoLine($"[{msat},{nsat}]时差线", tsDtoLine);
                 }
             }
             catch (Exception ex)

+ 1 - 1
XdCxRhDW.App/EditForms/X2DTOParamEditor.cs

@@ -127,7 +127,7 @@ namespace XdCxRhDW.App.EditForms
                 var nsat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat;
                 if (string.IsNullOrWhiteSpace(nsat)) nsat = cg.Adja1Code.Value.ToString();
                 var tsDtoLine = DrawDtoLineHelper.DtoLine2XStart(twoStartOption);
-                mapControl1.DrawDtoPonit($"[{msat},{nsat}]时差线", tsDtoLine);
+                mapControl1.DrawDtoLine($"[{msat},{nsat}]时差线", tsDtoLine);
 
             }
             catch (Exception ex)

+ 4 - 4
XdCxRhDW.App/EditForms/X3DTOParamEditor.cs

@@ -149,23 +149,23 @@ namespace XdCxRhDW.App.EditForms
                 if (info.PosResType == EnumPosResType.X3)
                 {
                     var tsDtoLine = DrawDtoLineHelper.DtoLine2XStart(twoStartOption);
-                    mapControl1.DrawDtoPonit($"[{msat},{nsat}]带参时差线", tsDtoLine);
+                    mapControl1.DrawDtoLine($"[{msat},{nsat}]带参时差线", tsDtoLine);
 
                     twoStartOption.NsEph = Ns2Eph;
                     twoStartOption.RefDto = YbMainDto - YbAdja2Dto;
                     twoStartOption.TargetDto = DtoSx1;
                     var tsDtoLine1 = DrawDtoLineHelper.DtoLine2XStart(twoStartOption);
-                    mapControl1.DrawDtoPonit($"[{msat},{ad2sat}]带参时差线", tsDtoLine1);
+                    mapControl1.DrawDtoLine($"[{msat},{ad2sat}]带参时差线", tsDtoLine1);
 
                 }
                 else
                 {
                     var tsDtoLine = DrawDtoLineHelper.DtoLine2XNoRefStart(twoStartOption);
-                    mapControl1.DrawDtoPonit($"[{msat},{nsat}]无参时差线", tsDtoLine);
+                    mapControl1.DrawDtoLine($"[{msat},{nsat}]无参时差线", tsDtoLine);
                     twoStartOption.NsEph = Ns2Eph;
                     twoStartOption.TargetDto = DtoSx1;
                     var tsDtoLine1 = DrawDtoLineHelper.DtoLine2XNoRefStart(twoStartOption);
-                    mapControl1.DrawDtoPonit($"[{msat},{ad2sat}]无参时差线", tsDtoLine1);
+                    mapControl1.DrawDtoLine($"[{msat},{ad2sat}]无参时差线", tsDtoLine1);
                 }
             }
             catch (Exception ex)

+ 33 - 5
XdCxRhDW.App/ExtensionsDev/MapControlEx.cs

@@ -136,11 +136,14 @@ public static class MapControlEx
         ctrl.ToolTipController.BeforeShow += (sender, e) =>
         {
             if (e.SelectedObject == null) return;
-            if (e.SelectedObject is MapPolyline)
+            if (e.SelectedObject is MapPolyline line)
             {
-                e.SuperTip = null;
-                e.ToolTip = null;
-                return;
+                if (line.Layer != ctrl.GetDrawLayer())
+                {
+                    e.SuperTip = null;
+                    e.ToolTip = null;
+                    return;
+                }
             }
             SuperToolTip superToolTip = new SuperToolTip();
             if (innerData.posMenu.Visible || innerData.mapMenu.Visible || innerData.rectMenu.Visible)
@@ -402,7 +405,22 @@ public static class MapControlEx
     /// <param name="mapCtrl"></param>
     /// <returns></returns>
     public static GridControl MountRowMenuToMapPos<T>(this GridControl grid, MapControl mapCtrl)
+        where T : PosData
     {
+        mapCtrl.PosSelectedChanged<T>(t =>
+        {
+            var view = grid.MainView as GridView;
+            view.ClearSelection();
+            for (int i = 0; i < view.RowCount; i++)
+            {
+                if ((view.GetRow(i) as T).ID == t.ID)
+                {
+                    view.FocusedRowHandle = i;
+                    view.SelectRow(i);
+                    break;
+                }
+            }
+        });
         var data = grid.Tag as GridControlEx.GridTag;
         data.RowButtonsItems.ForEach(t => mapCtrl.AddPosMenu<T>(t));
         return grid;
@@ -515,7 +533,17 @@ public static class MapControlEx
         innerData.barM.EndInit();
         return ctrl;
     }
-
+    public static MapControl PosSelectedChanged<T>(this MapControl ctrl, Action<T> action)
+    {
+        ctrl.MapItemClick += (sender, e) =>
+        {
+            if (e.Item.Tag is T val)
+            {
+                action(val);
+            }
+        };
+        return ctrl;
+    }
 
     /// <summary>
     /// 重新设置定位数据

+ 14 - 6
XdCxRhDW.App/MainForm.cs

@@ -59,6 +59,10 @@ namespace XdCxRhDW
             {
                 SysConfig.Config = db.SysSetings.FirstOrDefault();
             }
+            if (SysConfig.Config != null)
+            {
+                StartWebApi();
+            }
             btn_ItemClick(null, null);
             ServerContext.Instance.Init();
         }
@@ -73,13 +77,22 @@ namespace XdCxRhDW
                 XtraForm frm = new XtraForm() { StartPosition = FormStartPosition.CenterScreen, CloseBox = false, MinimizeBox = false, MaximizeBox = false };
                 frm.MinimumSize = frm.MaximumSize = frm.Size = size;
                 new CtrlSysSettings() { Dock = DockStyle.Fill, Parent = frm };
-                frm.ShowDialog();
+                if (frm.ShowDialog() != DialogResult.Cancel)
+                    StartWebApi();
             }
             this.HtmlText = $"<size=12>{text}(<size=9>{SysConfig.Config.TimeZoneDisplayName}</size>)";
             Messenger.Defalut.Sub<SysSetings>("时区改变", settings =>
             {
                 this.HtmlText = $"<size=12>{text}(<size=9>{settings.TimeZoneDisplayName}</size>)";
             });
+
+            StartProcess();
+            _ = XlScan();
+            _ = XlClear();
+            await XlLonCalc();
+        }
+        private void StartWebApi()
+        {
             try
             {
                 Startup.Start(SysConfig.Config.HttpPort, "多模式融合定位平台.Xml", "XdCxRhDW.Dto.xml", SysConfig.Config.TimeZoneUTC);
@@ -101,12 +114,7 @@ namespace XdCxRhDW
                 Serilog.Log.Error(ex, $"启动Http服务失败!");
                 DxHelper.MsgBoxHelper.ShowWarning($"启动Http服务失败!");
             }
-            StartProcess();
-            _ = XlScan();
-            _ = XlClear();
-            await XlLonCalc();
         }
-
         //自动导入Tle
         private async Task XlScan()
         {

+ 5 - 4
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -89,11 +89,12 @@ namespace XdCxRhDW.App.UserControl
 
             //mapService = "http://ows.mundialis.de/services/service";
             mapControl1.UseDefalutOptions()
-            //.UseCluster()//定位点使用内置聚合
-           .UseTrack()
+           //.UseCluster()//定位点使用内置聚合
+           .UseDrawRect()
            .UseClearAll()
            .UseDistanceLine()
            .UseMarkDot()
+           .UseTrack()
            .UseExportImg()
            .UseExportXlsx();
             if (SysConfig.Config == null)
@@ -916,7 +917,7 @@ namespace XdCxRhDW.App.UserControl
                         var ad1sat = listSat?.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat;
                         if (msat == null) msat = cg.MainCode.ToString();
                         if (ad1sat == null) ad1sat = cg.Adja1Code.ToString();
-                        mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{ad1sat}]频差线", tsDtoLine);
+                        mapControl1.DrawDtoLine($"{item.PosResType.GetEnumDisplayName()}[{msat},{ad1sat}]频差线", tsDtoLine);
 
                         if (item.PosResType == EnumPosResType.X3TwoDfo)
                         {
@@ -929,7 +930,7 @@ namespace XdCxRhDW.App.UserControl
                             {
                                 ad2sat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja2Code.Value)?.Sat;
                             }
-                            mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{ad2sat}]频差线", tsDtoLine1);
+                            mapControl1.DrawDtoLine($"{item.PosResType.GetEnumDisplayName()}[{msat},{ad2sat}]频差线", tsDtoLine1);
                         }
                     }
                     catch (Exception ex)

+ 0 - 12
XdCxRhDW.App/UserControl/UCEphXYZ.Designer.cs

@@ -69,10 +69,6 @@
             this.ephX.Properties.Appearance.Options.UseForeColor = true;
             this.ephX.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)});
-            this.ephX.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephX.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephX.Properties.MaskSettings.Set("mask", "f4");
-            this.ephX.Properties.MaxLength = 10;
             this.ephX.Properties.UseMaskAsDisplayFormat = true;
             this.ephX.Size = new System.Drawing.Size(169, 20);
             this.ephX.StyleController = this.layoutControl1;
@@ -84,10 +80,6 @@
             this.ephY.Name = "ephY";
             this.ephY.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)});
-            this.ephY.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephY.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephY.Properties.MaskSettings.Set("mask", "f4");
-            this.ephY.Properties.MaxLength = 10;
             this.ephY.Properties.UseMaskAsDisplayFormat = true;
             this.ephY.Size = new System.Drawing.Size(146, 20);
             this.ephY.StyleController = this.layoutControl1;
@@ -99,10 +91,6 @@
             this.ephZ.Name = "ephZ";
             this.ephZ.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)});
-            this.ephZ.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephZ.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephZ.Properties.MaskSettings.Set("mask", "f4");
-            this.ephZ.Properties.MaxLength = 10;
             this.ephZ.Properties.UseMaskAsDisplayFormat = true;
             this.ephZ.Size = new System.Drawing.Size(143, 20);
             this.ephZ.StyleController = this.layoutControl1;

+ 10 - 18
XdCxRhDW.App/UserControl/UCEphXYZ.cs

@@ -39,34 +39,26 @@ namespace XdCxRhDW.App.UserControl
 
         public (bool, string) ValidateParam()
         {
-            if (string.IsNullOrWhiteSpace(ephX.Text))
+            if (!double.TryParse(ephX.Text, out double _))
             {
-                return (false, $"{layoutControlItemx.Text}星历X不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历X格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephY.Text))
+            if (!double.TryParse(ephY.Text, out double _))
             {
-                return (false, $"{layoutControlItemy.Text}星历Y不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历Y格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephZ.Text))
+            if (!double.TryParse(ephZ.Text, out double _))
             {
-                return (false, $"{layoutControlItemz.Text}星历Z不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历Z格式错误!");
             }
             return (true, string.Empty);
         }
         public double[] EphXYZ()
         {
-            try
-            {
-                var x = Convert.ToDouble(ephX.EditValue);
-                var y = Convert.ToDouble(ephY.EditValue);
-                var z = Convert.ToDouble(ephZ.EditValue);
-                return new double[6] { x, y, z, 0, 0, 0 };
-            }
-            catch (Exception ex)
-            {
-                throw new Exception(ex.Message);
-            }
-
+            var x = Convert.ToDouble(ephX.EditValue);
+            var y = Convert.ToDouble(ephY.EditValue);
+            var z = Convert.ToDouble(ephZ.EditValue);
+            return new double[6] { x, y, z, 0, 0, 0 };
         }
 
         public int GetSatCode()

+ 20 - 44
XdCxRhDW.App/UserControl/UCEphXYZParam.Designer.cs

@@ -99,42 +99,30 @@
             this.ephX.Properties.Appearance.Options.UseForeColor = true;
             this.ephX.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)});
-            this.ephX.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephX.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephX.Properties.MaskSettings.Set("mask", "f4");
-            this.ephX.Properties.MaxLength = 10;
             this.ephX.Properties.UseMaskAsDisplayFormat = true;
-            this.ephX.Size = new System.Drawing.Size(169, 20);
+            this.ephX.Size = new System.Drawing.Size(153, 20);
             this.ephX.StyleController = this.layoutControl1;
             this.ephX.TabIndex = 4;
             // 
             // ephY
             // 
-            this.ephY.Location = new System.Drawing.Point(175, 19);
+            this.ephY.Location = new System.Drawing.Point(159, 19);
             this.ephY.Name = "ephY";
             this.ephY.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)});
-            this.ephY.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephY.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephY.Properties.MaskSettings.Set("mask", "f4");
-            this.ephY.Properties.MaxLength = 10;
             this.ephY.Properties.UseMaskAsDisplayFormat = true;
-            this.ephY.Size = new System.Drawing.Size(146, 20);
+            this.ephY.Size = new System.Drawing.Size(152, 20);
             this.ephY.StyleController = this.layoutControl1;
             this.ephY.TabIndex = 4;
             // 
             // ephZ
             // 
-            this.ephZ.Location = new System.Drawing.Point(325, 19);
+            this.ephZ.Location = new System.Drawing.Point(315, 19);
             this.ephZ.Name = "ephZ";
             this.ephZ.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)});
-            this.ephZ.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephZ.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephZ.Properties.MaskSettings.Set("mask", "f4");
-            this.ephZ.Properties.MaxLength = 10;
             this.ephZ.Properties.UseMaskAsDisplayFormat = true;
-            this.ephZ.Size = new System.Drawing.Size(143, 20);
+            this.ephZ.Size = new System.Drawing.Size(153, 20);
             this.ephZ.StyleController = this.layoutControl1;
             this.ephZ.TabIndex = 4;
             // 
@@ -145,44 +133,32 @@
             this.ephVX.Name = "ephVX";
             this.ephVX.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             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.ephVX.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephVX.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephVX.Properties.MaskSettings.Set("mask", "f4");
-            this.ephVX.Properties.MaxLength = 10;
             this.ephVX.Properties.UseMaskAsDisplayFormat = true;
-            this.ephVX.Size = new System.Drawing.Size(169, 20);
+            this.ephVX.Size = new System.Drawing.Size(153, 20);
             this.ephVX.StyleController = this.layoutControl1;
             this.ephVX.TabIndex = 4;
             // 
             // ephVY
             // 
-            this.ephVY.Location = new System.Drawing.Point(175, 64);
+            this.ephVY.Location = new System.Drawing.Point(159, 64);
             this.ephVY.MaximumSize = new System.Drawing.Size(0, 20);
             this.ephVY.Name = "ephVY";
             this.ephVY.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -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.ephVY.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephVY.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephVY.Properties.MaskSettings.Set("mask", "f4");
-            this.ephVY.Properties.MaxLength = 10;
             this.ephVY.Properties.UseMaskAsDisplayFormat = true;
-            this.ephVY.Size = new System.Drawing.Size(146, 20);
+            this.ephVY.Size = new System.Drawing.Size(152, 20);
             this.ephVY.StyleController = this.layoutControl1;
             this.ephVY.TabIndex = 4;
             // 
             // ephVZ
             // 
-            this.ephVZ.Location = new System.Drawing.Point(325, 64);
+            this.ephVZ.Location = new System.Drawing.Point(315, 64);
             this.ephVZ.MaximumSize = new System.Drawing.Size(0, 20);
             this.ephVZ.Name = "ephVZ";
             this.ephVZ.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)});
-            this.ephVZ.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.ephVZ.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
-            this.ephVZ.Properties.MaskSettings.Set("mask", "f4");
-            this.ephVZ.Properties.MaxLength = 10;
             this.ephVZ.Properties.UseMaskAsDisplayFormat = true;
-            this.ephVZ.Size = new System.Drawing.Size(143, 20);
+            this.ephVZ.Size = new System.Drawing.Size(153, 20);
             this.ephVZ.StyleController = this.layoutControl1;
             this.ephVZ.TabIndex = 4;
             // 
@@ -209,7 +185,7 @@
             this.layoutControlItemx.MaxSize = new System.Drawing.Size(0, 41);
             this.layoutControlItemx.MinSize = new System.Drawing.Size(54, 41);
             this.layoutControlItemx.Name = "layoutControlItemx";
-            this.layoutControlItemx.Size = new System.Drawing.Size(173, 41);
+            this.layoutControlItemx.Size = new System.Drawing.Size(157, 41);
             this.layoutControlItemx.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItemx.Text = "坐标X";
             this.layoutControlItemx.TextLocation = DevExpress.Utils.Locations.Top;
@@ -224,7 +200,7 @@
             this.layoutControlItemvx.MaxSize = new System.Drawing.Size(0, 41);
             this.layoutControlItemvx.MinSize = new System.Drawing.Size(62, 41);
             this.layoutControlItemvx.Name = "layoutControlItemvx";
-            this.layoutControlItemvx.Size = new System.Drawing.Size(173, 45);
+            this.layoutControlItemvx.Size = new System.Drawing.Size(157, 45);
             this.layoutControlItemvx.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItemvx.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 4, 0);
             this.layoutControlItemvx.Text = "坐标VX";
@@ -236,11 +212,11 @@
             this.layoutControlItemy.Control = this.ephY;
             this.layoutControlItemy.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItemy.CustomizationFormText = "坐标X";
-            this.layoutControlItemy.Location = new System.Drawing.Point(173, 0);
+            this.layoutControlItemy.Location = new System.Drawing.Point(157, 0);
             this.layoutControlItemy.MaxSize = new System.Drawing.Size(0, 41);
             this.layoutControlItemy.MinSize = new System.Drawing.Size(54, 41);
             this.layoutControlItemy.Name = "layoutControlItemy";
-            this.layoutControlItemy.Size = new System.Drawing.Size(150, 41);
+            this.layoutControlItemy.Size = new System.Drawing.Size(156, 41);
             this.layoutControlItemy.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItemy.Text = "坐标Y";
             this.layoutControlItemy.TextLocation = DevExpress.Utils.Locations.Top;
@@ -251,11 +227,11 @@
             this.layoutControlItemz.Control = this.ephZ;
             this.layoutControlItemz.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItemz.CustomizationFormText = "坐标X";
-            this.layoutControlItemz.Location = new System.Drawing.Point(323, 0);
+            this.layoutControlItemz.Location = new System.Drawing.Point(313, 0);
             this.layoutControlItemz.MaxSize = new System.Drawing.Size(0, 41);
             this.layoutControlItemz.MinSize = new System.Drawing.Size(54, 41);
             this.layoutControlItemz.Name = "layoutControlItemz";
-            this.layoutControlItemz.Size = new System.Drawing.Size(147, 41);
+            this.layoutControlItemz.Size = new System.Drawing.Size(157, 41);
             this.layoutControlItemz.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItemz.Text = "坐标Z";
             this.layoutControlItemz.TextLocation = DevExpress.Utils.Locations.Top;
@@ -266,11 +242,11 @@
             this.layoutControlItemvz.Control = this.ephVZ;
             this.layoutControlItemvz.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItemvz.CustomizationFormText = "坐标X";
-            this.layoutControlItemvz.Location = new System.Drawing.Point(323, 41);
+            this.layoutControlItemvz.Location = new System.Drawing.Point(313, 41);
             this.layoutControlItemvz.MaxSize = new System.Drawing.Size(0, 41);
             this.layoutControlItemvz.MinSize = new System.Drawing.Size(62, 41);
             this.layoutControlItemvz.Name = "layoutControlItemvz";
-            this.layoutControlItemvz.Size = new System.Drawing.Size(147, 45);
+            this.layoutControlItemvz.Size = new System.Drawing.Size(157, 45);
             this.layoutControlItemvz.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItemvz.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 4, 0);
             this.layoutControlItemvz.Text = "坐标VZ";
@@ -282,11 +258,11 @@
             this.layoutControlItemvy.Control = this.ephVY;
             this.layoutControlItemvy.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
             this.layoutControlItemvy.CustomizationFormText = "坐标X";
-            this.layoutControlItemvy.Location = new System.Drawing.Point(173, 41);
+            this.layoutControlItemvy.Location = new System.Drawing.Point(157, 41);
             this.layoutControlItemvy.MaxSize = new System.Drawing.Size(0, 41);
             this.layoutControlItemvy.MinSize = new System.Drawing.Size(62, 41);
             this.layoutControlItemvy.Name = "layoutControlItemvy";
-            this.layoutControlItemvy.Size = new System.Drawing.Size(150, 45);
+            this.layoutControlItemvy.Size = new System.Drawing.Size(156, 45);
             this.layoutControlItemvy.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItemvy.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 4, 0);
             this.layoutControlItemvy.Text = "坐标VY";

+ 19 - 28
XdCxRhDW.App/UserControl/UCEphXYZParam.cs

@@ -47,50 +47,41 @@ namespace XdCxRhDW.App.UserControl
 
         public (bool, string) ValidateParam()
         {
-            if (string.IsNullOrWhiteSpace(ephX.Text))
+            if (!double.TryParse(ephX.Text, out double _))
             {
-                return (false, $"{layoutControlItemx.Text}星历X不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历X格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephY.Text))
+            if (!double.TryParse(ephY.Text, out double _))
             {
-                return (false, $"{layoutControlItemy.Text}星历Y不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历Y格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephZ.Text))
+            if (!double.TryParse(ephZ.Text, out double _))
             {
-                return (false, $"{layoutControlItemz.Text}星历Z不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历Z格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephVX.Text))
+            if (!double.TryParse(ephVX.Text, out double _))
             {
-                return (false, $"{layoutControlItemvx.Text}星历VX不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历VX格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephVY.Text))
+            if (!double.TryParse(ephVY.Text, out double _))
             {
-                return (false, $"{layoutControlItemvy.Text}星历VY不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历VY格式错误!");
             }
-            if (string.IsNullOrWhiteSpace(ephVZ.Text))
+            if (!double.TryParse(ephVZ.Text, out double _))
             {
-                return (false, $"{layoutControlItemvz.Text}星历VZ不能为空!");
+                return (false, $"{layoutControlItemx.Text}星历VZ格式错误!");
             }
             return (true, string.Empty);
         }
         public double[] EphParam()
         {
-            try
-            {
-
-                var x = Convert.ToDouble(ephX.EditValue);
-                var y = Convert.ToDouble(ephY.EditValue);
-                var z = Convert.ToDouble(ephZ.EditValue);
-                var vx = Convert.ToDouble(ephVX.EditValue);
-                var vy = Convert.ToDouble(ephVY.EditValue);
-                var vz = Convert.ToDouble(ephVZ.EditValue);
-                return new double[6] { x, y, z, vx, vy, vz };
-            }
-            catch (Exception ex)
-            {
-                throw new Exception(ex.Message);
-            }
-
+            var x = Convert.ToDouble(ephX.EditValue);
+            var y = Convert.ToDouble(ephY.EditValue);
+            var z = Convert.ToDouble(ephZ.EditValue);
+            var vx = Convert.ToDouble(ephVX.EditValue);
+            var vy = Convert.ToDouble(ephVY.EditValue);
+            var vz = Convert.ToDouble(ephVZ.EditValue);
+            return new double[6] { x, y, z, vx, vy, vz };
         }
 
         public int GetSatCode()