zoulei 1 anno fa
parent
commit
38658f2980

+ 52 - 6
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -57,8 +57,23 @@ namespace XdCxRhDW.App.CorTools
                     gridView1.RefreshData();
                     foreach (var item in gridSource)
                     {
-                        var file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
-                        var file2 = await HttpHelper.UploadFileAsync(btnFile2.Text, baseUrl + "File/UploadFileAsync");
+                        string file1=null, file2=null;
+                        try
+                        {
+                            file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
+                            file2 = await HttpHelper.UploadFileAsync(btnFile2.Text, baseUrl + "File/UploadFileAsync");
+                        }
+                        catch (TaskCanceledException)
+                        {
+                            Serilog.Log.Warning($"文件[{btnFile1.Text}]上传超时");
+                            DxHelper.MsgBoxHelper.ShowInfo($"文件[{btnFile1.Text}]上传超时");
+                            break;
+                        }
+                        catch (Exception ex)
+                        {
+                            Serilog.Log.Error(ex, $"文件[{btnFile1.Text}]上传异常");
+                            break;
+                        }
                         XcorrStruct xItem = null;
                         try
                         {
@@ -108,6 +123,8 @@ namespace XdCxRhDW.App.CorTools
             {
                 if (fsHz > 0)
                     tefs.Text = (fsHz / 1e6).ToString();
+                else
+                    tefs.Text = "0.096";
 
             }).UseDoubleClickToSelectAll();
             this.btnFile2.UseChooseFile().UseDoubleClickToSelectAll();
@@ -148,7 +165,21 @@ namespace XdCxRhDW.App.CorTools
             gridSource.Clear();
             try
             {
-                dto.file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
+                try
+                {
+                    dto.file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
+                }
+                catch (TaskCanceledException)
+                {
+                    Serilog.Log.Warning($"文件[{btnFile1.Text}]上传超时");
+                    DxHelper.MsgBoxHelper.ShowInfo($"文件[{btnFile1.Text}]上传超时");
+                    return;
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, $"文件[{btnFile1.Text}]上传异常");
+                    return;
+                }
                 dto.fsHz = double.Parse(tefs.Text) * 1e6;
                 dto.band = double.Parse(txtBand.Text);
                 var dmcResult = await HttpHelper.PostRequestAsync<IEnumerable<DetectResDto>>(baseUrl + "DetectCg/DetectCalc", dto);
@@ -197,11 +228,28 @@ namespace XdCxRhDW.App.CorTools
             if (!ValidateFiles(btnFile1.Text, btnFile2.Text)) return;
             XcorrStruct xItem = new XcorrStruct();
             layoutControl1.Enabled = false;
-
             try
             {
                 xItem.file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
                 xItem.file2 = await HttpHelper.UploadFileAsync(btnFile2.Text, baseUrl + "File/UploadFileAsync");
+            }
+            catch (TaskCanceledException)
+            {
+                layoutControl1.Enabled = true;
+                Serilog.Log.Warning($"文件上传超时");
+                DxHelper.MsgBoxHelper.ShowInfo($"文件上传超时");
+                return;
+            }
+            catch (Exception ex)
+            {
+                layoutControl1.Enabled = true;
+                Serilog.Log.Error(ex, $"文件上传异常");
+                DxHelper.MsgBoxHelper.ShowError($"文件上传异常");
+                return;
+            }
+            try
+            {
+               
                 xItem.smpCount = long.Parse(teCount.Text);
                 xItem.samplingRate = Convert.ToInt32(double.Parse(tefs.Text) * 1e6);
                 xItem.dtCenter = int.Parse(teCenter.Text);
@@ -209,8 +257,6 @@ namespace XdCxRhDW.App.CorTools
                 xItem.dfRange = int.Parse(teDfRange.Text);
                 xItem.smpStart = long.Parse(tePos.Text);
                 xItem.snrThreshold = int.Parse(teSnr.Text);
-
-
             }
             catch (Exception ex)
             {

+ 21 - 20
XdCxRhDW.App/CorTools/DetectToolForm.designer.cs

@@ -28,11 +28,6 @@
         /// </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();
@@ -58,6 +53,11 @@
             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.txtFileTime = new DevExpress.XtraEditors.DateEdit();
             this.btnCalc = new DevExpress.XtraEditors.SimpleButton();
@@ -76,6 +76,7 @@
             this.file1 = new DevExpress.XtraGrid.Columns.GridColumn();
             this.file2 = new DevExpress.XtraGrid.Columns.GridColumn();
             this.modType = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.modRate = new DevExpress.XtraGrid.Columns.GridColumn();
             this.tePos = new DevExpress.XtraEditors.TextEdit();
             this.teCount = new DevExpress.XtraEditors.TextEdit();
             this.btnFile1 = new DevExpress.XtraEditors.ButtonEdit();
@@ -108,7 +109,6 @@
             this.layoutItemDrawImage = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
             this.itemBand = new DevExpress.XtraLayout.LayoutControlItem();
-            this.modRate = new DevExpress.XtraGrid.Columns.GridColumn();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtFileTime.Properties)).BeginInit();
@@ -376,6 +376,14 @@
             this.modType.Visible = true;
             this.modType.VisibleIndex = 10;
             // 
+            // modRate
+            // 
+            this.modRate.Caption = "调制速率";
+            this.modRate.FieldName = "ModRate";
+            this.modRate.Name = "modRate";
+            this.modRate.Visible = true;
+            this.modRate.VisibleIndex = 11;
+            // 
             // tePos
             // 
             this.tePos.EditValue = "0";
@@ -465,7 +473,7 @@
             this.tefs.Name = "tefs";
             this.tefs.Properties.AutoHeight = false;
             this.tefs.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions7, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject25, serializableAppearanceObject26, serializableAppearanceObject27, serializableAppearanceObject28, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -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.tefs.Size = new System.Drawing.Size(72, 20);
             this.tefs.StyleController = this.layoutControl1;
             this.tefs.TabIndex = 6;
@@ -478,7 +486,7 @@
             this.teCenter.Name = "teCenter";
             this.teCenter.Properties.AutoHeight = false;
             this.teCenter.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, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.teCenter.Size = new System.Drawing.Size(54, 20);
             this.teCenter.StyleController = this.layoutControl1;
             this.teCenter.TabIndex = 7;
@@ -491,7 +499,7 @@
             this.teRange.Name = "teRange";
             this.teRange.Properties.AutoHeight = false;
             this.teRange.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -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, "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.teRange.Size = new System.Drawing.Size(50, 20);
             this.teRange.StyleController = this.layoutControl1;
             this.teRange.TabIndex = 8;
@@ -504,7 +512,7 @@
             this.teDfRange.Name = "teDfRange";
             this.teDfRange.Properties.AutoHeight = false;
             this.teDfRange.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, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.teDfRange.Size = new System.Drawing.Size(51, 20);
             this.teDfRange.StyleController = this.layoutControl1;
             this.teDfRange.TabIndex = 11;
@@ -517,7 +525,7 @@
             this.teSnr.Name = "teSnr";
             this.teSnr.Properties.AutoHeight = false;
             this.teSnr.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "dB", -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, "dB", -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.teSnr.Size = new System.Drawing.Size(52, 20);
             this.teSnr.StyleController = this.layoutControl1;
             this.teSnr.TabIndex = 14;
@@ -530,7 +538,7 @@
             this.txtBand.Name = "txtBand";
             this.txtBand.Properties.AutoHeight = false;
             this.txtBand.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "KHz", -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, "KHz", -1, false, true, false, editorButtonImageOptions6, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject21, serializableAppearanceObject22, serializableAppearanceObject23, serializableAppearanceObject24, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtBand.Size = new System.Drawing.Size(61, 21);
             this.txtBand.StyleController = this.layoutControl1;
             this.txtBand.TabIndex = 6;
@@ -801,14 +809,7 @@
             this.itemBand.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
             this.itemBand.TextSize = new System.Drawing.Size(52, 14);
             this.itemBand.TextToControlDistance = 5;
-            // 
-            // modRate
-            // 
-            this.modRate.Caption = "调制速率";
-            this.modRate.FieldName = "ModRate";
-            this.modRate.Name = "modRate";
-            this.modRate.Visible = true;
-            this.modRate.VisibleIndex = 11;
+            this.itemBand.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
             // 
             // DetectToolForm
             // 

+ 19 - 6
XdCxRhDW.App/CorTools/GpuCalcForm.cs

@@ -42,7 +42,7 @@ namespace XdCxRhDW.App.CorTools
 
         private async void MainForm_Load(object sender, EventArgs e)
         {
-            this.gridCpuCg.Init<CafResult>().UseExportXlsx().UseRowNumber().UseFilter()
+            this.gridGpuCg.Init<CafResult>().UseExportXlsx().UseRowNumber().UseFilter()
                 .UseExportCsv()
                 .AddMenu("清除表格", SvgHelper.CreateClear(), () =>
                 {
@@ -53,6 +53,8 @@ namespace XdCxRhDW.App.CorTools
             {
                 if (fsHz > 0)
                     txtfs.Text = (fsHz / 1e6).ToString();
+                else
+                    txtfs.Text = "0.096";
 
             }).UseDoubleClickToSelectAll();
             this.btnFile2.UseChooseFile().UseDoubleClickToSelectAll();
@@ -72,12 +74,18 @@ namespace XdCxRhDW.App.CorTools
             if (!ValidateFiles(btnFile1.Text, btnFile2.Text)) return;
             if (!ValidateParams()) return;
             layoutControl1.Enabled = false;
-            string file1, file2;
+            string file1 = null, file2 = null;
             try
             {
                 file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
                 file2 = await HttpHelper.UploadFileAsync(btnFile2.Text, baseUrl + "File/UploadFileAsync");
             }
+            catch (TaskCanceledException)
+            {
+                layoutControl1.Enabled = true;
+                Serilog.Log.Warning($"文件[{btnFile1.Text}]上传超时");
+                DxHelper.MsgBoxHelper.ShowInfo($"文件[{btnFile1.Text}]上传超时");
+            }
             catch (Exception ex)
             {
                 layoutControl1.Enabled = true;
@@ -109,7 +117,7 @@ namespace XdCxRhDW.App.CorTools
 
             try
             {
-                var result = await HttpHelper.PostRequestAsync<List<GpuCgResponseDto>>(baseUrl + "DetectCg/GpuCgCalc", dto);
+                var result = await HttpHelper.PostRequestAsync<List<GpuCgResponseDto>>(baseUrl + "DetectCg/GpuCgCalc", dto, dto.TimeoutSeconds);
                 if (result.code == 200)
                 {
                     foreach (var item in result.data)
@@ -124,7 +132,7 @@ namespace XdCxRhDW.App.CorTools
                             tm = item.TimeMs,
                         });
                     }
-                    
+
                 }
                 else
                 {
@@ -132,10 +140,15 @@ namespace XdCxRhDW.App.CorTools
                     DxHelper.MsgBoxHelper.ShowError(result.msg);
                 }
             }
+            catch (TaskCanceledException)
+            {
+                Serilog.Log.Warning("GPU文件参估Http接口调用超时");
+                DxHelper.MsgBoxHelper.ShowInfo("GPU文件参估Http接口调用超时");
+            }
             catch (Exception ex)
             {
-                Serilog.Log.Error(ex, "CPU文件参估出错");
-                DxHelper.MsgBoxHelper.ShowError("CPU文件参估出错");
+                Serilog.Log.Error(ex, "GPU文件参估出错");
+                DxHelper.MsgBoxHelper.ShowError("GPU文件参估出错");
             }
             gridView1.RefreshData();
             layoutControl1.Enabled = true;

+ 16 - 16
XdCxRhDW.App/CorTools/GpuCalcForm.designer.cs

@@ -60,7 +60,7 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject24 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.btnCalc = new DevExpress.XtraEditors.SimpleButton();
-            this.gridCpuCg = new DevExpress.XtraGrid.GridControl();
+            this.gridGpuCg = new DevExpress.XtraGrid.GridControl();
             this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.dt = new DevExpress.XtraGrid.Columns.GridColumn();
             this.df = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -92,7 +92,7 @@
             this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.gridCpuCg)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridGpuCg)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtSmpCount.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.btnFile1.Properties)).BeginInit();
@@ -121,7 +121,7 @@
             // layoutControl1
             // 
             this.layoutControl1.Controls.Add(this.btnCalc);
-            this.layoutControl1.Controls.Add(this.gridCpuCg);
+            this.layoutControl1.Controls.Add(this.gridGpuCg);
             this.layoutControl1.Controls.Add(this.txtSmpCount);
             this.layoutControl1.Controls.Add(this.btnFile1);
             this.layoutControl1.Controls.Add(this.btnFile2);
@@ -151,16 +151,16 @@
             this.btnCalc.Text = "文件参估";
             this.btnCalc.Click += new System.EventHandler(this.btnCalc_Click);
             // 
-            // gridCpuCg
+            // gridGpuCg
             // 
-            this.gridCpuCg.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.gridCpuCg.Location = new System.Drawing.Point(5, 80);
-            this.gridCpuCg.MainView = this.gridView1;
-            this.gridCpuCg.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.gridCpuCg.Name = "gridCpuCg";
-            this.gridCpuCg.Size = new System.Drawing.Size(1090, 403);
-            this.gridCpuCg.TabIndex = 12;
-            this.gridCpuCg.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
+            this.gridGpuCg.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
+            this.gridGpuCg.Location = new System.Drawing.Point(5, 80);
+            this.gridGpuCg.MainView = this.gridView1;
+            this.gridGpuCg.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.gridGpuCg.Name = "gridGpuCg";
+            this.gridGpuCg.Size = new System.Drawing.Size(1090, 403);
+            this.gridGpuCg.TabIndex = 12;
+            this.gridGpuCg.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.gridView1});
             // 
             // gridView1
@@ -177,7 +177,7 @@
             this.file2});
             this.gridView1.DetailHeight = 169;
             this.gridView1.FooterPanelHeight = 0;
-            this.gridView1.GridControl = this.gridCpuCg;
+            this.gridView1.GridControl = this.gridGpuCg;
             this.gridView1.GroupRowHeight = 0;
             this.gridView1.Name = "gridView1";
             this.gridView1.OptionsBehavior.Editable = false;
@@ -394,7 +394,7 @@
             // 
             // layoutControlItem9
             // 
-            this.layoutControlItem9.Control = this.gridCpuCg;
+            this.layoutControlItem9.Control = this.gridGpuCg;
             this.layoutControlItem9.Location = new System.Drawing.Point(0, 75);
             this.layoutControlItem9.Name = "layoutControlItem9";
             this.layoutControlItem9.Size = new System.Drawing.Size(1094, 407);
@@ -532,7 +532,7 @@
             this.Load += new System.EventHandler(this.MainForm_Load);
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
             this.layoutControl1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.gridCpuCg)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridGpuCg)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtSmpCount.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.btnFile1.Properties)).EndInit();
@@ -574,7 +574,7 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
         private DevExpress.XtraLayout.LayoutControlItem lciSampleLength;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
-        private DevExpress.XtraGrid.GridControl gridCpuCg;
+        private DevExpress.XtraGrid.GridControl gridGpuCg;
         private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
         private DevExpress.XtraGrid.Columns.GridColumn dt;

+ 55 - 12
XdCxRhDW.App/CorTools/ResampleForm.Designer.cs

@@ -38,6 +38,11 @@
             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();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.txtOutFile = new DevExpress.XtraEditors.TextEdit();
             this.btnOk = new DevExpress.XtraEditors.SimpleButton();
@@ -55,6 +60,8 @@
             this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
             this.tablePanel1 = new DevExpress.Utils.Layout.TablePanel();
+            this.txtTimeout = new DevExpress.XtraEditors.ButtonEdit();
+            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtOutFile.Properties)).BeginInit();
@@ -73,6 +80,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).BeginInit();
             this.tablePanel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
@@ -84,20 +93,21 @@
             this.layoutControl1.Controls.Add(this.txtFile);
             this.layoutControl1.Controls.Add(this.txtFs);
             this.layoutControl1.Controls.Add(this.txtOutDir);
+            this.layoutControl1.Controls.Add(this.txtTimeout);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.layoutControl1.Location = new System.Drawing.Point(65, 70);
+            this.layoutControl1.Location = new System.Drawing.Point(65, 40);
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(831, 101, 650, 400);
             this.layoutControl1.Root = this.Root;
             this.tablePanel1.SetRow(this.layoutControl1, 1);
-            this.layoutControl1.Size = new System.Drawing.Size(496, 336);
+            this.layoutControl1.Size = new System.Drawing.Size(496, 396);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
             // txtOutFile
             // 
             this.txtOutFile.EditValue = "11111";
-            this.txtOutFile.Location = new System.Drawing.Point(12, 296);
+            this.txtOutFile.Location = new System.Drawing.Point(12, 358);
             this.txtOutFile.Name = "txtOutFile";
             this.txtOutFile.Properties.Appearance.Options.UseTextOptions = true;
             this.txtOutFile.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
@@ -110,7 +120,7 @@
             // 
             // btnOk
             // 
-            this.btnOk.Location = new System.Drawing.Point(187, 258);
+            this.btnOk.Location = new System.Drawing.Point(187, 320);
             this.btnOk.Name = "btnOk";
             this.btnOk.Size = new System.Drawing.Size(96, 26);
             this.btnOk.StyleController = this.layoutControl1;
@@ -178,9 +188,10 @@
             this.emptySpaceItem1,
             this.layoutControlItem2,
             this.emptySpaceItem2,
-            this.layoutControlItem3});
+            this.layoutControlItem3,
+            this.layoutControlItem4});
             this.Root.Name = "Root";
-            this.Root.Size = new System.Drawing.Size(496, 336);
+            this.Root.Size = new System.Drawing.Size(496, 396);
             this.Root.TextVisible = false;
             // 
             // layoutControlItem1
@@ -199,7 +210,7 @@
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.btnOk;
-            this.layoutControlItem5.Location = new System.Drawing.Point(175, 232);
+            this.layoutControlItem5.Location = new System.Drawing.Point(175, 294);
             this.layoutControlItem5.MaxSize = new System.Drawing.Size(100, 44);
             this.layoutControlItem5.MinSize = new System.Drawing.Size(100, 44);
             this.layoutControlItem5.Name = "layoutControlItem5";
@@ -244,7 +255,7 @@
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 232);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 294);
             this.emptySpaceItem1.MinSize = new System.Drawing.Size(1, 24);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
             this.emptySpaceItem1.Size = new System.Drawing.Size(175, 44);
@@ -270,7 +281,7 @@
             // emptySpaceItem2
             // 
             this.emptySpaceItem2.AllowHotTrack = false;
-            this.emptySpaceItem2.Location = new System.Drawing.Point(275, 232);
+            this.emptySpaceItem2.Location = new System.Drawing.Point(275, 294);
             this.emptySpaceItem2.Name = "emptySpaceItem2";
             this.emptySpaceItem2.Size = new System.Drawing.Size(201, 44);
             this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
@@ -278,10 +289,10 @@
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.txtOutFile;
-            this.layoutControlItem3.Location = new System.Drawing.Point(0, 276);
+            this.layoutControlItem3.Location = new System.Drawing.Point(0, 338);
             this.layoutControlItem3.Name = "layoutControlItem3";
             this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 10, 2);
-            this.layoutControlItem3.Size = new System.Drawing.Size(476, 40);
+            this.layoutControlItem3.Size = new System.Drawing.Size(476, 38);
             this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem3.TextVisible = false;
             // 
@@ -297,12 +308,40 @@
             this.tablePanel1.Name = "tablePanel1";
             this.tablePanel1.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] {
             new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 1F),
-            new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 340F),
+            new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 400F),
             new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 1F)});
             this.tablePanel1.Size = new System.Drawing.Size(626, 476);
             this.tablePanel1.TabIndex = 1;
             this.tablePanel1.UseSkinIndents = true;
             // 
+            // txtTimeout
+            // 
+            this.txtTimeout.EditValue = "120";
+            this.txtTimeout.Location = new System.Drawing.Point(12, 281);
+            this.txtTimeout.Name = "txtTimeout";
+            this.txtTimeout.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
+            this.txtTimeout.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "秒", -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.txtTimeout.Size = new System.Drawing.Size(472, 23);
+            this.txtTimeout.StyleController = this.layoutControl1;
+            this.txtTimeout.TabIndex = 6;
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.txtTimeout;
+            this.layoutControlItem4.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem4.CustomizationFormText = "轨道经度";
+            this.layoutControlItem4.Location = new System.Drawing.Point(0, 232);
+            this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 62);
+            this.layoutControlItem4.MinSize = new System.Drawing.Size(76, 62);
+            this.layoutControlItem4.Name = "layoutControlItem4";
+            this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 22, 2);
+            this.layoutControlItem4.Size = new System.Drawing.Size(476, 62);
+            this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem4.Text = "超时时间";
+            this.layoutControlItem4.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(72, 14);
+            // 
             // ResampleForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
@@ -330,6 +369,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).EndInit();
             this.tablePanel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -353,5 +394,7 @@
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
         private DevExpress.XtraEditors.TextEdit txtOutFile;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
+        private DevExpress.XtraEditors.ButtonEdit txtTimeout;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
     }
 }

+ 37 - 7
XdCxRhDW.App/CorTools/ResampleForm.cs

@@ -9,7 +9,6 @@ using System.Data.Entity;
 using System.Drawing;
 using System.IO;
 using System.Linq;
-using System.Runtime.Remoting.Metadata.W3cXsd2001;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Documents;
@@ -30,11 +29,13 @@ namespace XdCxRhDW.App.CorTools
         {
             InitializeComponent();
             txtOutFile.Text = "";
-            txtFile.UseChooseFile((file,fsHz) =>
+            txtFile.UseChooseFile((file, fsHz) =>
             {
                 this.txtOutDir.Text = Path.GetDirectoryName(file);
-                if(fsHz> 0)
-                txtFs.Text = (fsHz / 1e3).ToString();
+                if (fsHz > 0)
+                    txtFs.Text = (fsHz / 1e3).ToString();
+                else
+                    this.txtFs.Text = "";
             }).UseDoubleClickToSelectAll();
             txtOutDir.UseChooseDir().UseDoubleClickToSelectAll();
             this.txtOutFile.UseDoubleClickToSelectAll();
@@ -47,7 +48,7 @@ namespace XdCxRhDW.App.CorTools
         }
         private async void btnOk_ClickAsync(object sender, EventArgs e)
         {
-            double fsHz, outFsHz;
+            double fsHz, outFsHz, timeout;
 
             if (!double.TryParse(txtFs.Text, out fsHz))
             {
@@ -69,6 +70,12 @@ namespace XdCxRhDW.App.CorTools
                 DxHelper.MsgBoxHelper.ShowError($"输出目录[{txtOutDir.Text}]不存在");
                 return;
             }
+            if (!double.TryParse(txtTimeout.Text, out timeout))
+            {
+                DxHelper.MsgBoxHelper.ShowError($"超时时间非数字!");
+                return;
+            }
+            if (timeout <= 0) timeout = 120;
             txtOutFile.Text = "";
             fsHz *= 1e3;
             outFsHz *= 1e3;
@@ -92,15 +99,33 @@ namespace XdCxRhDW.App.CorTools
                     DxHelper.MsgBoxHelper.ShowWarning($"请在系统设置中配置Http端口");
                     return;
                 }
-                var file = await HttpHelper.UploadFileAsync(txtFile.Text, baseUrl + "Api/File/UploadFileAsync");
+                string file = null;
+                try
+                {
+                    file = await HttpHelper.UploadFileAsync(txtFile.Text, baseUrl + "Api/File/UploadFileAsync");
+                }
+                catch (TaskCanceledException)
+                {
+                    layoutControl1.Enabled = true;
+                    Serilog.Log.Warning($"文件[{txtFile.Text}]上传超时");
+                    DxHelper.MsgBoxHelper.ShowInfo($"文件[{txtFile.Text}]上传超时");
+                }
+                catch (Exception ex)
+                {
+                    layoutControl1.Enabled = true;
+                    Serilog.Log.Error(ex, $"文件[{txtFile.Text}]上传异常");
+                    return;
+                }
+
 
                 ResampleRequestDto dto = new ResampleRequestDto()
                 {
                     File = file,
                     FsHz = (int)fsHz,
                     OutFsHz = (int)outFsHz,
+                    TimeoutSeconds = (int)timeout,
                 };
-                var response = await HttpHelper.PostRequestAsync<ResampleResponseDto>(baseUrl + "Api/DetectCg/Resample", dto);
+                var response = await HttpHelper.PostRequestAsync<ResampleResponseDto>(baseUrl + "Api/DetectCg/Resample", dto, dto.TimeoutSeconds);
                 if (response.code == 200)
                 {
                     string outFile = Path.Combine(txtOutDir.Text, Path.GetFileNameWithoutExtension(txtFile.Text) + $"_Resample{txtOutFs.Text}K.dat");
@@ -117,6 +142,11 @@ namespace XdCxRhDW.App.CorTools
                     MsgBoxHelper.ShowError(response.msg);
                 }
             }
+            catch (TaskCanceledException)
+            {
+                Serilog.Log.Warning("变采样Http接口调用超时");
+                DxHelper.MsgBoxHelper.ShowInfo("变采样Http接口调用超时");
+            }
             catch (Exception ex)
             {
                 Serilog.Log.Error(ex, "变采样出错");

+ 102 - 28
XdCxRhDW.App/CorTools/XlCalculateForm.Designer.cs

@@ -33,6 +33,11 @@
             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.gridControl = new DevExpress.XtraGrid.GridControl();
             this.gridView = new DevExpress.XtraGrid.Views.Grid.GridView();
@@ -50,6 +55,9 @@
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.txtTimeout = new DevExpress.XtraEditors.ButtonEdit();
+            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.gridControl)).BeginInit();
@@ -69,6 +77,9 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
@@ -79,6 +90,7 @@
             this.layoutControl1.Controls.Add(this.txtEndTime);
             this.layoutControl1.Controls.Add(this.txtStartTime);
             this.layoutControl1.Controls.Add(this.txtTle);
+            this.layoutControl1.Controls.Add(this.txtTimeout);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Name = "layoutControl1";
@@ -89,10 +101,10 @@
             // 
             // gridControl
             // 
-            this.gridControl.Location = new System.Drawing.Point(12, 63);
+            this.gridControl.Location = new System.Drawing.Point(12, 64);
             this.gridControl.MainView = this.gridView;
             this.gridControl.Name = "gridControl";
-            this.gridControl.Size = new System.Drawing.Size(776, 375);
+            this.gridControl.Size = new System.Drawing.Size(776, 374);
             this.gridControl.TabIndex = 10;
             this.gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.gridView});
@@ -104,9 +116,9 @@
             // 
             // btnCalculate
             // 
-            this.btnCalculate.Location = new System.Drawing.Point(722, 36);
+            this.btnCalculate.Location = new System.Drawing.Point(692, 37);
             this.btnCalculate.Name = "btnCalculate";
-            this.btnCalculate.Size = new System.Drawing.Size(66, 23);
+            this.btnCalculate.Size = new System.Drawing.Size(96, 24);
             this.btnCalculate.StyleController = this.layoutControl1;
             this.btnCalculate.TabIndex = 9;
             this.btnCalculate.Text = "推算";
@@ -114,21 +126,23 @@
             // 
             // txtSpanSeconds
             // 
-            this.txtSpanSeconds.Location = new System.Drawing.Point(538, 36);
+            this.txtSpanSeconds.Location = new System.Drawing.Point(405, 38);
             this.txtSpanSeconds.Name = "txtSpanSeconds";
+            this.txtSpanSeconds.Properties.AutoHeight = false;
             this.txtSpanSeconds.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "秒", -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.txtSpanSeconds.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
             this.txtSpanSeconds.Properties.MaskSettings.Set("mask", "f0");
-            this.txtSpanSeconds.Size = new System.Drawing.Size(180, 23);
+            this.txtSpanSeconds.Size = new System.Drawing.Size(113, 22);
             this.txtSpanSeconds.StyleController = this.layoutControl1;
             this.txtSpanSeconds.TabIndex = 8;
             // 
             // txtEndTime
             // 
             this.txtEndTime.EditValue = null;
-            this.txtEndTime.Location = new System.Drawing.Point(302, 36);
+            this.txtEndTime.Location = new System.Drawing.Point(235, 38);
             this.txtEndTime.Name = "txtEndTime";
+            this.txtEndTime.Properties.AutoHeight = false;
             this.txtEndTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.txtEndTime.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -138,15 +152,16 @@
             this.txtEndTime.Properties.EditFormat.FormatString = "yyyy-MM-dd HH:mm:ss";
             this.txtEndTime.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
             this.txtEndTime.Properties.MaskSettings.Set("mask", "yyyy-MM-dd HH:mm:ss");
-            this.txtEndTime.Size = new System.Drawing.Size(179, 20);
+            this.txtEndTime.Size = new System.Drawing.Size(113, 22);
             this.txtEndTime.StyleController = this.layoutControl1;
             this.txtEndTime.TabIndex = 7;
             // 
             // txtStartTime
             // 
             this.txtStartTime.EditValue = null;
-            this.txtStartTime.Location = new System.Drawing.Point(65, 36);
+            this.txtStartTime.Location = new System.Drawing.Point(65, 38);
             this.txtStartTime.Name = "txtStartTime";
+            this.txtStartTime.Properties.AutoHeight = false;
             this.txtStartTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.txtStartTime.Properties.CalendarTimeProperties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -156,7 +171,7 @@
             this.txtStartTime.Properties.EditFormat.FormatString = "yyyy-MM-dd HH:mm:ss";
             this.txtStartTime.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
             this.txtStartTime.Properties.MaskSettings.Set("mask", "yyyy-MM-dd HH:mm:ss");
-            this.txtStartTime.Size = new System.Drawing.Size(180, 20);
+            this.txtStartTime.Size = new System.Drawing.Size(113, 22);
             this.txtStartTime.StyleController = this.layoutControl1;
             this.txtStartTime.TabIndex = 6;
             // 
@@ -164,10 +179,11 @@
             // 
             this.txtTle.Location = new System.Drawing.Point(65, 12);
             this.txtTle.Name = "txtTle";
+            this.txtTle.Properties.AutoHeight = false;
             this.txtTle.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.txtTle.Properties.PopupView = this.searchLookUpEdit1View;
-            this.txtTle.Size = new System.Drawing.Size(723, 20);
+            this.txtTle.Size = new System.Drawing.Size(723, 22);
             this.txtTle.StyleController = this.layoutControl1;
             this.txtTle.TabIndex = 5;
             this.txtTle.ToolTip = "填写卫星的双行根数";
@@ -196,8 +212,11 @@
             // 
             this.layoutControlItem2.Control = this.txtTle;
             this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem2.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Size = new System.Drawing.Size(780, 24);
+            this.layoutControlItem2.Size = new System.Drawing.Size(780, 26);
+            this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem2.Text = "双行根数";
             this.layoutControlItem2.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
             this.layoutControlItem2.TextSize = new System.Drawing.Size(48, 14);
@@ -206,11 +225,12 @@
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.btnCalculate;
-            this.layoutControlItem5.Location = new System.Drawing.Point(710, 24);
-            this.layoutControlItem5.MaxSize = new System.Drawing.Size(70, 70);
-            this.layoutControlItem5.MinSize = new System.Drawing.Size(70, 26);
+            this.layoutControlItem5.Location = new System.Drawing.Point(680, 26);
+            this.layoutControlItem5.MaxSize = new System.Drawing.Size(100, 26);
+            this.layoutControlItem5.MinSize = new System.Drawing.Size(100, 26);
             this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Size = new System.Drawing.Size(70, 27);
+            this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 1, 1);
+            this.layoutControlItem5.Size = new System.Drawing.Size(100, 26);
             this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem5.TextVisible = false;
@@ -218,9 +238,9 @@
             // layoutControlItem6
             // 
             this.layoutControlItem6.Control = this.gridControl;
-            this.layoutControlItem6.Location = new System.Drawing.Point(0, 51);
+            this.layoutControlItem6.Location = new System.Drawing.Point(0, 52);
             this.layoutControlItem6.Name = "layoutControlItem6";
-            this.layoutControlItem6.Size = new System.Drawing.Size(780, 379);
+            this.layoutControlItem6.Size = new System.Drawing.Size(780, 378);
             this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem6.TextVisible = false;
             // 
@@ -228,20 +248,21 @@
             // 
             this.layoutControlGroup1.GroupBordersVisible = false;
             this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
-            this.layoutControlItem1,
-            this.layoutControlItem3,
-            this.layoutControlItem4});
-            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 24);
+            this.layoutControlGroup2});
+            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 26);
             this.layoutControlGroup1.Name = "layoutControlGroup1";
             this.layoutControlGroup1.ShowInCustomizationForm = false;
-            this.layoutControlGroup1.Size = new System.Drawing.Size(710, 27);
+            this.layoutControlGroup1.Size = new System.Drawing.Size(680, 26);
             // 
             // layoutControlItem1
             // 
             this.layoutControlItem1.Control = this.txtStartTime;
             this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem1.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(237, 27);
+            this.layoutControlItem1.Size = new System.Drawing.Size(170, 26);
+            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem1.Text = "开始时间";
             this.layoutControlItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
             this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
@@ -250,9 +271,12 @@
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.txtEndTime;
-            this.layoutControlItem3.Location = new System.Drawing.Point(237, 0);
+            this.layoutControlItem3.Location = new System.Drawing.Point(170, 0);
+            this.layoutControlItem3.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem3.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem3.Name = "layoutControlItem3";
-            this.layoutControlItem3.Size = new System.Drawing.Size(236, 27);
+            this.layoutControlItem3.Size = new System.Drawing.Size(170, 26);
+            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem3.Text = "结束时间";
             this.layoutControlItem3.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
             this.layoutControlItem3.TextSize = new System.Drawing.Size(48, 14);
@@ -261,14 +285,58 @@
             // layoutControlItem4
             // 
             this.layoutControlItem4.Control = this.txtSpanSeconds;
-            this.layoutControlItem4.Location = new System.Drawing.Point(473, 0);
+            this.layoutControlItem4.Location = new System.Drawing.Point(340, 0);
+            this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem4.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(237, 27);
+            this.layoutControlItem4.Size = new System.Drawing.Size(170, 26);
+            this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem4.Text = "推算间隔";
             this.layoutControlItem4.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
             this.layoutControlItem4.TextSize = new System.Drawing.Size(48, 14);
             this.layoutControlItem4.TextToControlDistance = 5;
             // 
+            // txtTimeout
+            // 
+            this.txtTimeout.Location = new System.Drawing.Point(575, 38);
+            this.txtTimeout.Name = "txtTimeout";
+            this.txtTimeout.Properties.AutoHeight = false;
+            this.txtTimeout.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "秒", -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.txtTimeout.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
+            this.txtTimeout.Properties.MaskSettings.Set("mask", "f0");
+            this.txtTimeout.Size = new System.Drawing.Size(113, 22);
+            this.txtTimeout.StyleController = this.layoutControl1;
+            this.txtTimeout.TabIndex = 8;
+            // 
+            // layoutControlItem7
+            // 
+            this.layoutControlItem7.Control = this.txtTimeout;
+            this.layoutControlItem7.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem7.CustomizationFormText = "推算间隔";
+            this.layoutControlItem7.Location = new System.Drawing.Point(510, 0);
+            this.layoutControlItem7.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem7.MinSize = new System.Drawing.Size(107, 26);
+            this.layoutControlItem7.Name = "layoutControlItem7";
+            this.layoutControlItem7.Size = new System.Drawing.Size(170, 26);
+            this.layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem7.Text = "超时时间";
+            this.layoutControlItem7.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
+            this.layoutControlItem7.TextSize = new System.Drawing.Size(48, 14);
+            this.layoutControlItem7.TextToControlDistance = 5;
+            // 
+            // layoutControlGroup2
+            // 
+            this.layoutControlGroup2.GroupBordersVisible = false;
+            this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.layoutControlItem1,
+            this.layoutControlItem3,
+            this.layoutControlItem4,
+            this.layoutControlItem7});
+            this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlGroup2.Name = "layoutControlGroup2";
+            this.layoutControlGroup2.Size = new System.Drawing.Size(680, 26);
+            // 
             // XlCalculateForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
@@ -297,6 +365,9 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -320,5 +391,8 @@
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
         private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
+        private DevExpress.XtraEditors.ButtonEdit txtTimeout;
+        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
     }
 }

+ 29 - 6
XdCxRhDW.App/CorTools/XlCalculateForm.cs

@@ -40,7 +40,7 @@ namespace XdCxRhDW.App.CorTools
             gridControl.Init<SatEphDto>().UseSort().UseFilter().UseMultiSelect().UseRowNumber();
             gridControl.DataSource = listEph;
             txtTle.UseDoubleClickToSelectAll();
-            txtTle.UseDefault().SetStringData((await XlCache.GetAllAsync()).Select(p=>p.TwoLine));
+            txtTle.UseDefault().SetData(await XlCache.GetAllAsync(), nameof(XlInfo.TwoLine));
         }
 
 
@@ -71,6 +71,12 @@ namespace XdCxRhDW.App.CorTools
                     return;
                 }
             }
+            if (!double.TryParse(txtTimeout.Text, out double timeout))
+            {
+                DxHelper.MsgBoxHelper.ShowError("超时时间非数字");
+                return;
+            }
+            if (timeout <= 0) timeout = 30;
             listEph.Clear();
             var settings = new SysSetings();
             using (RHDWContext db = new RHDWContext())
@@ -84,8 +90,15 @@ namespace XdCxRhDW.App.CorTools
                     if (!string.IsNullOrEmpty(txtEndTime.Text) && !string.IsNullOrEmpty(txtSpanSeconds.Text))
                     {
                         string url = string.Format("http://{0}:{1}/Api/Xl/CalcMult", IpHelper.GetLocalIp(), settings.HttpPort);
-                        var XlCalcMultDto = new XlCalcMultDto() { tleStr = txtTle.Text, start = startTime, end = endTime, spanSeconds = (int)txtSpanSeconds.EditValue };
-                        var ephRes = await HttpHelper.PostRequestAsync<List<SatEphDto>>(url, XlCalcMultDto);
+                        var XlCalcMultDto = new XlCalcMultDto()
+                        {
+                            tleStr = txtTle.Text,
+                            start = startTime,
+                            end = endTime,
+                            spanSeconds = (int)txtSpanSeconds.EditValue,
+                            TimeoutSeconds = (int)timeout
+                        };
+                        var ephRes = await HttpHelper.PostRequestAsync<List<SatEphDto>>(url, XlCalcMultDto, (int)timeout);
                         if (ephRes.code == 200)
                         {
                             listEph.AddRange(ephRes.data);
@@ -95,7 +108,12 @@ namespace XdCxRhDW.App.CorTools
                     else
                     {
                         string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
-                        var XlCalcDto = new XlCalcDto() { tleStr = txtTle.Text, dt = Convert.ToDateTime(txtStartTime.EditValue) };
+                        var XlCalcDto = new XlCalcDto()
+                        {
+                            tleStr = txtTle.Text,
+                            dt = Convert.ToDateTime(txtStartTime.EditValue),
+                            TimeoutSeconds = (int)timeout
+                        };
                         var ephRes = await HttpHelper.PostRequestAsync<SatEphDto>(url, XlCalcDto);
                         if (ephRes.code == 200)
                         {
@@ -105,10 +123,15 @@ namespace XdCxRhDW.App.CorTools
 
                     }
                 }
+                catch (TaskCanceledException)
+                {
+                    Serilog.Log.Warning("星历推算Http接口调用超时");
+                    DxHelper.MsgBoxHelper.ShowInfo("星历推算Http接口调用超时");
+                }
                 catch (Exception ex)
                 {
-                    Serilog.Log.Error(ex, "请求星历推算Api出错");
-                    DxHelper.MsgBoxHelper.ShowError("星历推算错误");
+                    Serilog.Log.Error(ex, "星历推算异常");
+                    DxHelper.MsgBoxHelper.ShowError("星历推算异常");
                 }
             }
             Console.ReadLine();

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

@@ -38,7 +38,7 @@ namespace XdCxRhDW.App.EditForms
         private async void SatEditor_Load(object sender, EventArgs e)
         {
             var listXl = await XlCache.GetAllAsync();
-            this.searchLookUpEdit1.UseDefault().SetStringData(listXl.Select(p=>p.Sat)).UseDoubleClickToSelectAll();
+            this.searchLookUpEdit1.UseDefault().SetData(listXl,nameof(XlInfo.Sat)).UseDoubleClickToSelectAll();
             if (this.Text == "编辑卫星" && info != null)
             {
                 this.txtSatName.Text = info.SatName;

+ 11 - 11
XdCxRhDW.App/EditForms/X2D1PosParamEditor.cs

@@ -109,17 +109,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()

+ 8 - 2
XdCxRhDW.App/ExtensionsDev/SearchLookUpEditExtension.cs

@@ -65,12 +65,18 @@ namespace ExtensionsDev
             ctrl.Properties.DataSource = data;
             GridView view = ctrl.Properties.View;
             view.OptionsView.ShowColumnHeaders = true;
-            view.GridControl.Init<T>(searchLookUpEdit:ctrl);
+            view.GridControl.Init<T>(searchLookUpEdit: ctrl);
             ctrl.CustomDisplayText += (sender, e) =>
             {
                 if (e.Value == null) return;
-                if (string.IsNullOrWhiteSpace(displayField))
+                if (typeof(T) != e.Value.GetType())
+                {
                     e.DisplayText = e.Value.ToString();
+                }
+                else if (string.IsNullOrWhiteSpace(displayField))
+                {
+                    e.DisplayText = e.Value.ToString();
+                }
                 else
                 {
                     e.DisplayText = typeof(T).GetProperty(displayField).GetValue(e.Value).ToString();

+ 36 - 4
XdCxRhDW.App/UserControl/CtrlXl.cs

@@ -72,10 +72,42 @@ namespace XdCxRhDW.App.UserControl
                 this.layoutControl1.Enabled = true;
                 return;
             }
-            var file = await HttpHelper.UploadFileAsync(btnOpen.Text, baseUrl + "File/UploadFileAsync");
-            var result = await HttpHelper.PostRequestAsync<RecordRes>(baseUrl + "Xl/ImportTleAsync", file, 120);
-            DxHelper.MsgBoxHelper.ShowInfo($"星历导入成功.共导入{result.data.Count}条");
-            await LoadData();
+            string file = null;
+            try
+            {
+                 file = await HttpHelper.UploadFileAsync(btnOpen.Text, baseUrl + "File/UploadFileAsync");
+            }
+            catch (TaskCanceledException)
+            {
+                layoutControl1.Enabled = true;
+                Serilog.Log.Warning($"文件[{btnOpen.Text}]上传超时");
+                DxHelper.MsgBoxHelper.ShowInfo($"文件[{btnOpen.Text}]上传超时");
+                return;
+            }
+            catch (Exception ex)
+            {
+                layoutControl1.Enabled = true;
+                Serilog.Log.Error(ex, $"文件[{btnOpen.Text}]上传异常");
+                DxHelper.MsgBoxHelper.ShowError($"文件[{btnOpen.Text}]上传异常");
+                return;
+            }
+
+            try
+            {
+                var result = await HttpHelper.PostRequestAsync<RecordRes>(baseUrl + "Xl/ImportTleAsync", file, 120);
+                DxHelper.MsgBoxHelper.ShowInfo($"星历导入成功.共导入{result.data.Count}条");
+                await LoadData();
+            }
+            catch (TaskCanceledException)
+            {
+                Serilog.Log.Warning($"星历导入超时");
+                DxHelper.MsgBoxHelper.ShowInfo($"星历导入超时");
+                return;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex,"星历导入异常");
+            }
             this.layoutControl1.Enabled = true;
 
         }

+ 0 - 6
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -621,12 +621,6 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Xcorr\enc-test.dat" />
-    <None Include="星历推算\readme.txt">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="星历推算\Tle2XYZ.exe">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
     <EmbeddedResource Include="UserControl\X1D1GDOPParam.resx">
       <DependentUpon>X1D1GDOPParam.cs</DependentUpon>
     </EmbeddedResource>

BIN
XdCxRhDW.App/星历推算/Tle2XYZ.exe


+ 0 - 8
XdCxRhDW.App/星历推算/readme.txt

@@ -1,8 +0,0 @@
-Tle2XYZ输入及输出的时间戳都是UTC时间戳
--t 时间  相对于1970-1-1 8时的秒数
--a "line1" -b "line2" -t 1672718400
--p 周期
--c 次数
-
-
--a "1 23467U 95003A   22364.32362671 -.00000025  00000+0  00000+0 0  9992" -b "2 23467   9.8007  17.1777 0001795 205.8937 164.3833  1.00270390102276" -t 1672718400 -p 1 -c 1

+ 73 - 114
XdCxRhDW.Core/Api/EphHelper.cs

@@ -1,9 +1,11 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -15,18 +17,13 @@ namespace XdCxRhDW.Core.Api
     public static class EphHelper
     {
         private static readonly DateTime dtZero = new DateTime(1970, 1, 1, 0, 0, 0, 0);
-        private static string exePath= "星历推算";
-        private const string exeName = "Tle2XYZ.exe";
-        /// <summary>
-        /// 设置【Tle2XYZ.exe】文件所在路径,支持相对路径
-        /// </summary>
-        public static void SetExePath(string path)
-        {
-            if (string.IsNullOrWhiteSpace(path)) return;
-            if (path.StartsWith("\\"))//相对路径要么开头不带\,要么是 .\
-                path = path.Remove(0, 1);
-            exePath = path;
-        }
+        private const string dll = @"AddIns\Tle2XYZ.dll";//此dll已加密
+
+        #region cpp dll Interop 
+        [DllImport(dll, EntryPoint = "GenerateXYZByPeriod", CallingConvention = CallingConvention.Cdecl)]
+        private extern static void GenerateXYZByPeriod(string line1, string line2, long startTime, int period, int count, double[] res);
+        #endregion
+
         /// <summary>
         /// 推算双行星历
         /// </summary>
@@ -35,36 +32,36 @@ namespace XdCxRhDW.Core.Api
         /// <returns></returns>
         public static SatEphDto Calc(string tleStr, DateTime dt)
         {
-            if (string.IsNullOrWhiteSpace(exePath))
-                throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
-            if (!Directory.Exists(exePath))
-                throw new Exception($"路径[{exePath}]不存在");
-            var exeFile = Path.Combine(exePath, exeName);
-            if (!File.Exists(exeFile))
-                throw new Exception($"文件[{exeFile}]不存在");
-            tleStr = tleStr.Replace(";", ";");
-            if (tleStr.EndsWith(";"))
-                tleStr = tleStr.Substring(0, tleStr.Length - 1);
+            if (string.IsNullOrWhiteSpace(dll))
+                throw new Exception($"找不到{dll}");
             tleStr = tleStr.Replace(";", ";");
             var line1 = tleStr.Split(';')[0];
             var line2 = tleStr.Split(';')[1];
             var dtUtc = dt.AddHours(-8);
             var timeSpan = (long)(dtUtc - dtZero).TotalSeconds;
-            Process p = new Process();
-            p.StartInfo.WorkingDirectory = exePath;
-            p.StartInfo.FileName = exeFile;
-            p.StartInfo.Arguments = $"-a \"{line1}\" -b \"{line2}\" -t {timeSpan} -p 1 -c 1";
-            p.StartInfo.CreateNoWindow = true;
-            p.StartInfo.RedirectStandardError = true;
-            p.StartInfo.RedirectStandardOutput = true;
-            p.StartInfo.UseShellExecute = false;
-            p.Start();
-            var succeed = p.WaitForExit(10000);
-            if (!succeed)
+            double[] res = new double[6];
+            GenerateXYZByPeriod(line1, line2, timeSpan, 1, 1, res);
+            int satIdD = Convert.ToInt32(line2.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)[1]);
+            string timeStr = line1.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)[3];
+            //24078.27199282
+            int year = Convert.ToInt32("20" + timeStr.Substring(0, 2));
+            double days = Convert.ToDouble(timeStr.Substring(2));
+            DateTime tleTime = new DateTime(year, 1, 1, 8, 0, 0);
+            tleTime = tleTime.AddDays(days);
+            var dto= new SatEphDto()
             {
-                throw new Exception($"进程[{exeName}]超时未完成!");
-            }
-            return ParseOneResult(p.StandardOutput.ReadToEnd());
+                SatId = satIdD,
+                SatTime = dt,
+                TleTime = tleTime,
+                X = Math.Round(res[0], 4),
+                Y = Math.Round(res[1], 4),
+                Z = Math.Round(res[2], 4),
+                VX = Math.Round(res[3], 4),
+                VY = Math.Round(res[4], 4),
+                VZ = Math.Round(res[5], 4),
+            };
+            dto.Lon = Math.Round(PhysicsHelper.EcefToGeo((dto.X, dto.Y, dto.Z)).lon, 1);
+            return dto;
         }
 
         /// <summary>
@@ -77,13 +74,8 @@ namespace XdCxRhDW.Core.Api
         /// <returns></returns>
         public static List<SatEphDto> CalcMult(string tleStr, DateTime start, DateTime end, int spanSeconds)
         {
-            if (string.IsNullOrWhiteSpace(exePath))
-                throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
-            if (!Directory.Exists(exePath))
-                throw new Exception($"路径[{exePath}]不存在");
-            var exeFile = Path.Combine(exePath, exeName);
-            if (!File.Exists(exeFile))
-                throw new Exception($"文件[{exeFile}]不存在");
+            if (string.IsNullOrWhiteSpace(dll))
+                throw new Exception($"找不到{dll}");
             tleStr = tleStr.Replace(";", ";");
             if (tleStr.EndsWith(";"))
                 tleStr = tleStr.Substring(0, tleStr.Length - 1);
@@ -92,77 +84,35 @@ namespace XdCxRhDW.Core.Api
             var line2 = tleStr.Split(';')[1];
             var dtUtc = start.AddHours(-8);
             var timeSpan = (long)(dtUtc - dtZero).TotalSeconds;
-            var c = (end - start).TotalSeconds / spanSeconds;
-            Process p = new Process();
-            var binPath = AppDomain.CurrentDomain.BaseDirectory;
-            p.StartInfo.WorkingDirectory = exePath;
-            p.StartInfo.FileName = exeFile;
-            p.StartInfo.Arguments = $"-a \"{line1}\" -b \"{line2}\" -t {timeSpan} -p {spanSeconds} -c {c + 1}";
-            p.StartInfo.CreateNoWindow = true;
-            p.StartInfo.RedirectStandardError = true;
-            p.StartInfo.RedirectStandardOutput = true;
-            p.StartInfo.UseShellExecute = false;
-            StringBuilder sb = new StringBuilder();
-            p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
-            p.Start();
-            p.BeginOutputReadLine();
-            p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
-            return ParseResult(sb.ToString());
-        }
-        static List<SatEphDto> ParseResult(string result)
-        {
-            if (string.IsNullOrWhiteSpace(result))
-            {
-                throw new Exception("星历推算出现未知错误!");
-            }
-            var array = result.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-            List<SatEphDto> list = new List<SatEphDto>();
-            foreach (var item in array)
+            var c = (int)((end - start).TotalSeconds / spanSeconds + 1);
+            double[] res = new double[6 * c];
+            GenerateXYZByPeriod(line1, line2, timeSpan, spanSeconds, c, res);
+            int satIdD = Convert.ToInt32(line2.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)[1]);
+            string timeStr = line1.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)[3];
+            //24078.27199282
+            int year = Convert.ToInt32("20" + timeStr.Substring(0, 2));
+            double days = Convert.ToDouble(timeStr.Substring(2));
+            DateTime tleTime = new DateTime(year, 1, 1, 8, 0, 0);
+            tleTime = tleTime.AddDays(days);
+            var list = new List<SatEphDto>();
+            for (int i = 0; i < res.Length; i += 6)
             {
-                var arrayItem = item.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-                for (int i = 0; i < arrayItem.Length; i++)
+                var dto = new SatEphDto()
                 {
-                    var dto = new SatEphDto
-                    {
-                        SatId = Convert.ToInt32(arrayItem[i++]),
-                        TleTime = dtZero.AddSeconds(Convert.ToInt64(arrayItem[i++])).AddHours(16),//内部有BUG需要多加8h
-                        SatTime = dtZero.AddSeconds(Convert.ToInt64(arrayItem[i++])).AddHours(8),//utc to beijing
-                        X = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        Y = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        Z = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        VX = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        VY = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        VZ = Math.Round(Convert.ToDouble(arrayItem[i]), 3)
-                    };
-                    list.Add(dto);
-                }
+                    SatId = satIdD,
+                    SatTime = start.AddSeconds(i / 6 * spanSeconds),
+                    TleTime = tleTime,
+                    X = Math.Round(res[i], 4),
+                    Y = Math.Round(res[i + 1], 4),
+                    Z = Math.Round(res[i + 2], 4),
+                    VX = Math.Round(res[i + 3], 4),
+                    VY = Math.Round(res[i + 4], 4),
+                    VZ = Math.Round(res[i + 5], 4),
+                };
+                dto.Lon = Math.Round(PhysicsHelper.EcefToGeo((dto.X, dto.Y, dto.Z)).lon, 1);
+                list.Add(dto);
             }
             return list;
-
-        }
-        static SatEphDto ParseOneResult(string result)
-        {
-            if (string.IsNullOrWhiteSpace(result))
-            {
-                throw new Exception("星历推算出现未知错误!");
-            }
-            result = result.Replace(";", "");
-            var array = result.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-            int i = 0;
-            var dto = new SatEphDto
-            {
-                SatId = Convert.ToInt32(array[i++]),
-                TleTime = dtZero.AddSeconds(Convert.ToInt64(array[i++])).AddHours(16),//内部有BUG需要多加8h
-                SatTime = dtZero.AddSeconds(Convert.ToInt64(array[i++])).AddHours(8),//utc to beijing
-                X = Math.Round(Convert.ToDouble(array[i++]), 3),
-                Y = Math.Round(Convert.ToDouble(array[i++]), 3),
-                Z = Math.Round(Convert.ToDouble(array[i++]), 3),
-                VX = Math.Round(Convert.ToDouble(array[i++]), 3),
-                VY = Math.Round(Convert.ToDouble(array[i++]), 3),
-                VZ = Math.Round(Convert.ToDouble(array[i++]), 3)
-            };
-            return dto;
-
         }
     }
     public class SatEphDto
@@ -172,16 +122,25 @@ namespace XdCxRhDW.Core.Api
         /// </summary>
         [Display(Name = "卫星编号")]
         public int SatId { get; set; }
+
         /// <summary>
-        /// 卫星时刻(北京时间)
+        /// 时间(北京)
         /// </summary>
-        [Display(Name = "卫星时刻")]
+        [Display(Name = "时间(北京)")]
         public DateTime SatTime { get; set; }
+
         /// <summary>
-        /// 星历时刻(北京时间)
+        /// 星历发布时刻(北京时间)
         /// </summary>
-        [Display(Name = "星历时刻")]
+        [Display(Name = "星历发布时刻(北京)")]
         public DateTime TleTime { get; set; }
+
+        /// <summary>
+        /// 轨道经度
+        /// </summary>
+        [Display(Name = "轨道经度")]
+        public double Lon { get; set; }
+
         /// <summary>
         /// X坐标
         /// </summary>

+ 0 - 169
XdCxRhDW.Core/Api/EphHelper2.cs

@@ -1,169 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace XdCxRhDW.Core.Api
-{
-    /// <summary>
-    /// 星历推算帮助类.该类调用了Tle2XYZ.exe进程
-    /// </summary>
-    public static class EphHelper2
-    {
-        private static readonly DateTime dtZero = new DateTime(1970, 1, 1, 0, 0, 0, 0);
-        private const string dll = @"AddIns\Tle2XYZ.dll";//此dll已加密
-
-        #region cpp dll Interop 
-        [DllImport(dll, EntryPoint = "GenerateXYZByPeriod", CallingConvention = CallingConvention.Cdecl)]
-        private extern static void GenerateXYZByPeriod();
-
-        [DllImport(dll, EntryPoint = "GenerateXYZByPeriodWithOrbit", CallingConvention = CallingConvention.Cdecl)]
-        private extern static void GenerateXYZByPeriodWithOrbit();
-
-        [DllImport(dll, EntryPoint = "GenerateXYZByTimes", CallingConvention = CallingConvention.Cdecl)]
-        private extern static void GenerateXYZByTimes();
-        #endregion
-
-        /// <summary>
-        /// 推算双行星历
-        /// </summary>
-        /// <param name="tleStr">双行根数</param>
-        /// <param name="dt">指定时刻(北京时间)</param>
-        /// <returns></returns>
-        public static SatEphDto2 Calc(string tleStr, DateTime dt)
-        {
-            if (string.IsNullOrWhiteSpace(dll))
-                throw new Exception($"找不到{dll}");
-            return null;
-
-        }
-
-        /// <summary>
-        /// 批量推算双行星历
-        /// </summary>
-        /// <param name="tleStr">双行根数</param>
-        /// <param name="start">起始时刻(北京)</param>
-        /// <param name="end">结束(北京)</param>
-        /// <param name="spanSeconds">推算间隔(秒)</param>
-        /// <returns></returns>
-        public static List<SatEphDto2> CalcMult(string tleStr, DateTime start, DateTime end, int spanSeconds)
-        {
-            if (string.IsNullOrWhiteSpace(dll))
-                throw new Exception($"找不到{dll}");
-            return null;
-        }
-        static List<SatEphDto2> ParseResult(string result)
-        {
-            if (string.IsNullOrWhiteSpace(result))
-            {
-                throw new Exception("星历推算出现未知错误!");
-            }
-            var array = result.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-            List<SatEphDto2> list = new List<SatEphDto2>();
-            foreach (var item in array)
-            {
-                var arrayItem = item.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-                for (int i = 0; i < arrayItem.Length; i++)
-                {
-                    var dto = new SatEphDto2
-                    {
-                        SatId = Convert.ToInt32(arrayItem[i++]),
-                        TleTime = dtZero.AddSeconds(Convert.ToInt64(arrayItem[i++])).AddHours(16),//内部有BUG需要多加8h
-                        SatTime = dtZero.AddSeconds(Convert.ToInt64(arrayItem[i++])).AddHours(8),//utc to beijing
-                        X = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        Y = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        Z = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        VX = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        VY = Math.Round(Convert.ToDouble(arrayItem[i++]), 3),
-                        VZ = Math.Round(Convert.ToDouble(arrayItem[i]), 3)
-                    };
-                    list.Add(dto);
-                }
-            }
-            return list;
-
-        }
-        static SatEphDto2 ParseOneResult(string result)
-        {
-            if (string.IsNullOrWhiteSpace(result))
-            {
-                throw new Exception("星历推算出现未知错误!");
-            }
-            result = result.Replace(";", "");
-            var array = result.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-            int i = 0;
-            var dto = new SatEphDto2
-            {
-                SatId = Convert.ToInt32(array[i++]),
-                TleTime = dtZero.AddSeconds(Convert.ToInt64(array[i++])).AddHours(16),//内部有BUG需要多加8h
-                SatTime = dtZero.AddSeconds(Convert.ToInt64(array[i++])).AddHours(8),//utc to beijing
-                X = Math.Round(Convert.ToDouble(array[i++]), 3),
-                Y = Math.Round(Convert.ToDouble(array[i++]), 3),
-                Z = Math.Round(Convert.ToDouble(array[i++]), 3),
-                VX = Math.Round(Convert.ToDouble(array[i++]), 3),
-                VY = Math.Round(Convert.ToDouble(array[i++]), 3),
-                VZ = Math.Round(Convert.ToDouble(array[i++]), 3)
-            };
-            return dto;
-
-        }
-    }
-    public class SatEphDto2
-    {
-        /// <summary>
-        /// 卫星编号
-        /// </summary>
-        [Display(Name = "卫星编号")]
-        public int SatId { get; set; }
-        /// <summary>
-        /// 卫星时刻(北京时间)
-        /// </summary>
-        [Display(Name = "卫星时刻")]
-        public DateTime SatTime { get; set; }
-        /// <summary>
-        /// 星历时刻(北京时间)
-        /// </summary>
-        [Display(Name = "星历时刻")]
-        public DateTime TleTime { get; set; }
-        /// <summary>
-        /// X坐标
-        /// </summary>
-        [Display(Name = "X")]
-        public double X { get; set; }
-        /// <summary>
-        /// Y坐标
-        /// </summary>
-        [Display(Name = "Y")]
-        public double Y { get; set; }
-        /// <summary>
-        /// Z坐标
-        /// </summary>
-        [Display(Name = "Z")]
-        public double Z { get; set; }
-        /// <summary>
-        /// X方向速率
-        /// </summary>
-        [Display(Name = "VX")]
-        public double VX { get; set; }
-        /// <summary>
-        /// Y方向速率
-        /// </summary>
-        [Display(Name = "VY")]
-        public double VY { get; set; }
-        /// <summary>
-        /// Z方向速率
-        /// </summary>
-        [Display(Name = "VZ")]
-        public double VZ { get; set; }
-        public override string ToString()
-        {
-            return $"{X},{Y},{Z},{VX},{VY},{VZ}";
-        }
-
-    }
-}

+ 3 - 3
XdCxRhDW.Core/Api/变采样/ReSampleHelper.cs

@@ -34,7 +34,7 @@ namespace XdCxRhDW.Core.Api
         /// <param name="insertFactor">插入因子</param>
         /// <param name="extFactor">抽取因子</param>
         /// <returns>成功后返回文件,失败后返回null</returns>
-        public static string Resample(string inFile,string outFile,int insertFactor,int extFactor)
+        public static string Resample(string inFile, string outFile, int insertFactor, int extFactor, int timeoutSeconds = 30)
         {
             if (string.IsNullOrWhiteSpace(exePath))
                 throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
@@ -52,12 +52,12 @@ namespace XdCxRhDW.Core.Api
             p.StartInfo.RedirectStandardOutput = true;
             p.StartInfo.UseShellExecute = false;
             p.Start();
-            var succeed = p.WaitForExit(10000);
+            var succeed = p.WaitForExit(timeoutSeconds * 1000);
             if (!succeed)
             {
                 throw new Exception($"进程[{exeName}]超时未完成!");
             }
-            var res=p.StandardOutput.ReadToEnd();
+            var res = p.StandardOutput.ReadToEnd();
             if (res.StartsWith("1:"))
             {
                 return outFile;

+ 3 - 3
XdCxRhDW.Core/Api/检测Cpu参估/CafResult.cs

@@ -86,9 +86,9 @@ namespace XdCxRhDW.Core.Api
             {
                 flag = Convert.ToInt32(items[0]);
                 var res = items[1].Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-                dt = double.Parse(res[0]);
-                df = double.Parse(res[1]);
-                snr = double.Parse(res[2]);
+                dt = Math.Round(double.Parse(res[0]),3);
+                df = Math.Round(double.Parse(res[1]),3);
+                snr = Math.Round(double.Parse(res[2]),1);
             }
             else
             {

+ 3 - 1
XdCxRhDW.Core/XdCxRhDW.Core.csproj

@@ -48,6 +48,9 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="..\XdCxRhDW.App\Basic\PhysicsHelper.cs">
+      <Link>PhysicsHelper.cs</Link>
+    </Compile>
     <Compile Include="Api\GPU参估\GpuCafResult.cs" />
     <Compile Include="Api\GPU参估\GpuCgHelper.cs" />
     <Compile Include="Api\变采样\ReSampleHelper.cs" />
@@ -55,7 +58,6 @@
     <Compile Include="Api\检测Cpu参估\CafResult.cs" />
     <Compile Include="Api\检测Cpu参估\CorResult.cs" />
     <Compile Include="Api\检测Cpu参估\DmcResult.cs" />
-    <Compile Include="Api\EphHelper2.cs" />
     <Compile Include="Api\EphHelper.cs" />
     <Compile Include="Api\GDOP误差椭圆\GDOPAPi.cs" />
     <Compile Include="Api\GDOP误差椭圆\GdopConfig.cs" />

+ 5 - 5
XdCxRhDW.Sender/Form1.cs

@@ -515,8 +515,8 @@ namespace XdCxRhDW.Sender
             X2D1NoParPosDto X2D1PosDto = new X2D1NoParPosDto()
             {
                 SigTime = DateTime.Now,
-                MainCode = 23467,
-                AdjaCode = 39206,
+                MainCode = 25630,
+                AdjaCode = 33276,
                 SxDto = -0.002198485309353 * 1e6,
                 XdDto = 0.245961726007262 * 1e6,
                 MainX = -38209016,
@@ -717,9 +717,9 @@ namespace XdCxRhDW.Sender
         private X2D1NoXlNoParlPosDto X2D1NoParNoXL()
         {
             X2D1NoXlNoParlPosDto X2D1NoXlNoParlPosDto = new X2D1NoXlNoParlPosDto();
-            X2D1NoXlNoParlPosDto.SigTime = DateTime.Now;
-            X2D1NoXlNoParlPosDto.MainCode = 23467;
-            X2D1NoXlNoParlPosDto.AdjaCode = 39206;
+            X2D1NoXlNoParlPosDto.SigTime = new DateTime(2024, 3, 19, 23, 0, 0);
+            X2D1NoXlNoParlPosDto.MainCode = 25630;
+            X2D1NoXlNoParlPosDto.AdjaCode = 33276;
             X2D1NoXlNoParlPosDto.SxDto = -0.002198485309353 * 1e6;
             X2D1NoXlNoParlPosDto.XdDto = 0.245961726007262 * 1e6;
             X2D1NoXlNoParlPosDto.SatTxLon = 118.8833;

+ 2 - 2
XdCxRhDW.WebApi/Controllers/DetectCgController.cs

@@ -11,6 +11,7 @@ using XdCxRhDw.Dto;
 using XdCxRhDW.Core.Api;
 using XdCxRhDW.WebApi;
 using System.ComponentModel.DataAnnotations;
+using Newtonsoft.Json;
 
 namespace XdCxRhDW.WebApi.Controllers
 {
@@ -110,7 +111,6 @@ namespace XdCxRhDW.WebApi.Controllers
         {
             dto.file1 = GetLocalFile(dto.file1);
             dto.file2 = GetLocalFile(dto.file2);
-
             CpuCgResDto resDto = new CpuCgResDto();
             try
             {
@@ -197,7 +197,7 @@ namespace XdCxRhDW.WebApi.Controllers
                  var val = Gcd(dto.FsHz, dto.OutFsHz);//最大公约数
                  var insertFactor = dto.OutFsHz / val;
                  var extFactor = dto.FsHz / val;
-                 var outFile = ReSampleHelper.Resample(fileIn, fileOut, insertFactor, extFactor);
+                 var outFile = ReSampleHelper.Resample(fileIn, fileOut, insertFactor, extFactor,dto.TimeoutSeconds);
                  if (!string.IsNullOrWhiteSpace(outFile))
                  {
                      if (!File.Exists(outFile))

+ 2 - 0
XdCxRhDW.WebApi/Controllers/XlController.cs

@@ -110,6 +110,7 @@ namespace XdCxRhDW.WebApi.Controllers
                     SatId = p.SatId,
                     SatTime = p.SatTime,
                     TleTime = p.TleTime,
+                    Lon=p.Lon,
                     X = p.X,
                     Y = p.Y,
                     Z = p.Z,
@@ -140,6 +141,7 @@ namespace XdCxRhDW.WebApi.Controllers
                     SatId = p.SatId,
                     SatTime = p.SatTime,
                     TleTime = p.TleTime,
+                    Lon = p.Lon,
                     X = p.X,
                     Y = p.Y,
                     Z = p.Z,

+ 0 - 1
XdCxRhDW.WebApi/Startup.cs

@@ -118,7 +118,6 @@ namespace XdCxRhDW.WebApi
                 //单例模式注入Service
                 builder.RegisterTypes(serviceType).SingleInstance();
             }
-
             var container = builder.Build();
             config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
 

+ 7 - 2
XdCxRhDw.Dto/EphResDto.cs

@@ -18,15 +18,20 @@ namespace XdCxRhDw.Dto
         public int SatId { get; set; }
 
         /// <summary>
-        /// 卫星时刻(北京时间)
+        /// 时间(北京)
         /// </summary>
         public DateTime SatTime { get; set; }
 
         /// <summary>
-        /// 星历时刻(北京时间)
+        /// 星历发布时刻(北京)
         /// </summary>
         public DateTime TleTime { get; set; }
 
+        /// <summary>
+        /// 卫星轨道经度
+        /// </summary>
+        public double Lon { get; set; }
+
         /// <summary>
         /// X坐标
         /// </summary>

+ 5 - 0
XdCxRhDw.Dto/ResampleDto.cs

@@ -30,6 +30,11 @@ namespace XdCxRhDw.Dto
         [RangeInt(0, 100000000)]
         public int OutFsHz { get; set; } = 96000;
 
+        /// <summary>
+        /// 超时时间(单位秒,默认120秒)
+        /// </summary>
+        [RangeInt(10, 600, IncludeMin = true)]
+        public int TimeoutSeconds { get; set; } = 120;
     }
 
     /// <summary>

+ 7 - 0
XdCxRhDw.Dto/XlCalcDto/XlCalcDto.cs

@@ -22,5 +22,12 @@ namespace XdCxRhDw.Dto
         /// 信号时刻(北京时间)
         /// </summary>
         public DateTime dt { get; set; }
+
+        /// <summary>
+        /// 超时时间(单位秒,默认30秒)
+        /// </summary>
+        [RangeInt(10, 600, IncludeMin = true)]
+        public int TimeoutSeconds { get; set; } = 30;
+
     }
 }

+ 7 - 0
XdCxRhDw.Dto/XlCalcDto/XlCalcMultDto.cs

@@ -33,5 +33,12 @@ namespace XdCxRhDw.Dto
         /// </summary>
         [RangeInt(0,IncludeMin = true)]
         public int spanSeconds { get; set; }
+
+
+        /// <summary>
+        /// 超时时间(单位秒,默认30秒)
+        /// </summary>
+        [RangeInt(10, 600, IncludeMin = true)]
+        public int TimeoutSeconds { get; set; } = 30;
     }
 }