Browse Source

修复Http本地端口未释放

zoule 9 months ago
parent
commit
9de327344c
47 changed files with 552 additions and 405 deletions
  1. BIN
      Database.db
  2. 3 3
      Service/CgDbScan/LogHelper.cs
  3. 1 1
      Service/CgDbScan/MainForm.cs
  4. 6 19
      Service/CheckServer/Controllers/CheckController.cs
  5. 3 3
      Service/CheckServer/LogHelper.cs
  6. 1 1
      Service/CheckServer/MainForm.cs
  7. 3 3
      Service/CpuCgServer/LogHelper.cs
  8. 1 1
      Service/CpuCgServer/MainForm.cs
  9. 3 3
      Service/GpuCgServer/LogHelper.cs
  10. 1 1
      Service/GpuCgServer/MainForm.cs
  11. 3 3
      Service/X1LeoTaskServer54/LogHelper.cs
  12. 1 1
      Service/X1LeoTaskServer54/MainForm.cs
  13. 3 3
      Service/X2D1TaskServer/LogHelper.cs
  14. 1 1
      Service/X2D1TaskServer/MainForm.cs
  15. 3 3
      Service/X2D1TaskServer54/LogHelper.cs
  16. 1 1
      Service/X2D1TaskServer54/MainForm.cs
  17. 3 3
      Service/X2LeoTaskServer54/LogHelper.cs
  18. 1 1
      Service/X2LeoTaskServer54/MainForm.cs
  19. 3 3
      Service/X3Leo1TaskServer54/LogHelper.cs
  20. 1 1
      Service/X3Leo1TaskServer54/MainForm.cs
  21. 3 3
      Service/X3LeoTaskServer54/LogHelper.cs
  22. 1 1
      Service/X3LeoTaskServer54/MainForm.cs
  23. 3 3
      Service/X3RefTaskServer54/LogHelper.cs
  24. 1 1
      Service/X3RefTaskServer54/MainForm.cs
  25. 3 3
      Service/X3TaskServer54/LogHelper.cs
  26. 1 1
      Service/X3TaskServer54/MainForm.cs
  27. 17 17
      XdCxRhDW.App/Controllers/DetectCgController.cs
  28. 1 1
      XdCxRhDW.App/Controllers/XlController.cs
  29. 4 4
      XdCxRhDW.App/CorTools/DetectToolForm.cs
  30. 1 1
      XdCxRhDW.App/CorTools/GpuCalcForm.cs
  31. 1 1
      XdCxRhDW.App/CorTools/ResampleForm.cs
  32. 77 81
      XdCxRhDW.App/CorTools/XlCalculateForm.Designer.cs
  33. 71 29
      XdCxRhDW.App/CorTools/XlCalculateForm.cs
  34. 15 0
      XdCxRhDW.App/DxHelper/SvgHelper.cs
  35. 1 1
      XdCxRhDW.App/EditForms/TarDfoLeoX1Calc.cs
  36. 1 1
      XdCxRhDW.App/EditForms/TarDfoLeoX2Calc.cs
  37. 2 2
      XdCxRhDW.App/EditForms/X2D1EllipesEditor.cs
  38. 1 1
      XdCxRhDW.App/MainForm.Designer.cs
  39. 161 72
      XdCxRhDW.App/MainForm.cs
  40. 1 1
      XdCxRhDW.App/ServerContext.cs
  41. 40 35
      XdCxRhDW.App/UserControl/CtrlXl.Designer.cs
  42. 59 8
      XdCxRhDW.App/UserControl/CtrlXl.cs
  43. 3 0
      XdCxRhDW.Entity/XlInfo.cs
  44. 37 81
      XdCxRhDW.Framework/HttpHelper.cs
  45. 1 1
      XdCxRhDW.Repostory/XlRepository.cs
  46. 1 1
      XdCxRhDW.WebApi/AutofacUtil.cs
  47. 3 0
      XdCxRhDw.Dto/PosDto/X3TwoDtoNoParPosDto.cs

BIN
Database.db


+ 3 - 3
Service/CgDbScan/LogHelper.cs

@@ -53,7 +53,7 @@ namespace CheckServer
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace CheckServer
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace CheckServer
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/CgDbScan/MainForm.cs

@@ -67,7 +67,7 @@ namespace CheckServer
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 6 - 19
Service/CheckServer/Controllers/CheckController.cs

@@ -52,28 +52,15 @@ namespace CheckServer.Controllers
                 List<DmcResult> kyResults = new List<DmcResult>();
                 if (dto.dmcType.HasFlag(EnumSigCheckTypeDto.DAMA))
                 {
-                    //var damaVersion = AppConfigHelper.Get("DamaVersion");
-                    //if (string.IsNullOrWhiteSpace(damaVersion) || damaVersion.Trim() == "1")
+                    //var dmcResult = await CheckHelper.DmcCheckAsync(dto.file1, dto.fsHz, EnumSigCheckTypeDto.DAMA, dto.band);
+                    //foreach (var item in dmcResult)
                     //{
-                    //    var dmcResult = await CheckHelper.DmcCheckAsync(dto.file1, dto.fsHz, EnumSigCheckTypeDto.DAMA, dto.band);
-                    //    dmcResults.AddRange(dmcResult);
-                    //}
-                    //else if (damaVersion.Trim() == "2")
-                    //{
-                    //    var dmcResult = await CheckHelper.DAMACheckAsync(dto.file1, dto.fsHz, EnumSigCheckTypeDto.DAMA, dto.band);
-                    //    dmcResults.AddRange(dmcResult);
-                    //}
-                    //else
-                    //{
-                    var dmcResult = await CheckHelper.DmcCheckAsync(dto.file1, dto.fsHz, EnumSigCheckTypeDto.DAMA, dto.band);
-                    dmcResults.AddRange(dmcResult);
-                    if (dmcResult == null || !dmcResult.Any())
-                    {
-                        var dmcResult2 = await CheckHelper.DAMACheckAsync(dto.file1, dto.fsHz, EnumSigCheckTypeDto.DAMA, dto.band);
-                        dmcResults.AddRange(dmcResult);
-                    }
+                    //    item.UserName = "";
                     //}
+                    //dmcResults.AddRange(dmcResult);
 
+                    var dmcResult2 = await CheckHelper.DAMACheckAsync(dto.file1, dto.fsHz, EnumSigCheckTypeDto.DAMA, dto.band);
+                    dmcResults.AddRange(dmcResult2);
                 }
                 if (dto.dmcType.HasFlag(EnumSigCheckTypeDto.IBS))
                 {

+ 3 - 3
Service/CheckServer/LogHelper.cs

@@ -53,7 +53,7 @@ namespace CheckServer
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace CheckServer
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace CheckServer
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/CheckServer/MainForm.cs

@@ -69,7 +69,7 @@ namespace CheckServer
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/CpuCgServer/LogHelper.cs

@@ -53,7 +53,7 @@ namespace CpuCgServer
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace CpuCgServer
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace CpuCgServer
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/CpuCgServer/MainForm.cs

@@ -100,7 +100,7 @@ namespace CpuCgServer
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/GpuCgServer/LogHelper.cs

@@ -53,7 +53,7 @@ namespace GpuCgServer
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace GpuCgServer
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace GpuCgServer
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/GpuCgServer/MainForm.cs

@@ -100,7 +100,7 @@ namespace GpuCgServer
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X1LeoTaskServer54/LogHelper.cs

@@ -53,7 +53,7 @@ namespace X1LeoTaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace X1LeoTaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace X1LeoTaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X1LeoTaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X1LeoTaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X2D1TaskServer/LogHelper.cs

@@ -52,7 +52,7 @@ namespace X2D1TaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -72,7 +72,7 @@ namespace X2D1TaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -98,7 +98,7 @@ namespace X2D1TaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X2D1TaskServer/MainForm.cs

@@ -69,7 +69,7 @@ namespace X2D1TaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X2D1TaskServer54/LogHelper.cs

@@ -53,7 +53,7 @@ namespace X2D1NoRefTaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace X2D1NoRefTaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace X2D1NoRefTaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X2D1TaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X2D1NoRefTaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X2LeoTaskServer54/LogHelper.cs

@@ -53,7 +53,7 @@ namespace X2LeoTaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace X2LeoTaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace X2LeoTaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X2LeoTaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X2LeoTaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X3Leo1TaskServer54/LogHelper.cs

@@ -52,7 +52,7 @@ namespace X3Leo1TaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -72,7 +72,7 @@ namespace X3Leo1TaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -98,7 +98,7 @@ namespace X3Leo1TaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X3Leo1TaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X3Leo1TaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X3LeoTaskServer54/LogHelper.cs

@@ -53,7 +53,7 @@ namespace X3LeoTaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace X3LeoTaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace X3LeoTaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X3LeoTaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X3LeoTaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X3RefTaskServer54/LogHelper.cs

@@ -52,7 +52,7 @@ namespace X3RefTaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -72,7 +72,7 @@ namespace X3RefTaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -98,7 +98,7 @@ namespace X3RefTaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X3RefTaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X3RefTaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 3 - 3
Service/X3TaskServer54/LogHelper.cs

@@ -53,7 +53,7 @@ namespace X3TaskServer54
                     LogType = EnumLogTypeDto.Info,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -73,7 +73,7 @@ namespace X3TaskServer54
                     LogType = EnumLogTypeDto.Warning,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {
@@ -99,7 +99,7 @@ namespace X3TaskServer54
                     LogType = EnumLogTypeDto.Error,
                     Module = pro.ProcessName,
                     Msg = msg
-                }, 5);
+                });
             }
             catch
             {

+ 1 - 1
Service/X3TaskServer54/MainForm.cs

@@ -69,7 +69,7 @@ namespace X3TaskServer54
             {
                 try
                 {
-                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl);
                     if (rsp.code == 0)
                     {
                         await LogHelper.Error(rsp.msg);

+ 17 - 17
XdCxRhDW.App/Controllers/DetectCgController.cs

@@ -28,9 +28,9 @@ namespace XdCxRhDW.App.Controllers
         public async Task<AjaxResult<CpuCgResDto>> CpuCgCalc(CpuCgDto dto)
         {
             var svr = ServerContext.Instance.GetRandomOne(EnumSvrType.CpuCgSvr);
-            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            var res = await HttpHelper.PostRequestAsync<CpuCgResDto>(svr.BaseHttpAddr + "CpuCg/Calc", dto, dto.TimeoutSeconds);
+            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr);
+            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr);
+            var res = await HttpHelper.PostRequestAsync<CpuCgResDto>(svr.BaseHttpAddr + "CpuCg/Calc", dto);
             return res;
         }
 
@@ -43,9 +43,9 @@ namespace XdCxRhDW.App.Controllers
         public async Task<AjaxResult<List<CpuCgResDto>>> CpuCgMultiCalc(CpuCgMultiDto dto)
         {
             var svr = ServerContext.Instance.GetRandomOne(EnumSvrType.CpuCgSvr);
-            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            var res = await HttpHelper.PostRequestAsync<List<CpuCgResDto>>(svr.BaseHttpAddr + "CpuCg/MultiCalc", dto, dto.TimeoutSeconds);
+            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr);
+            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr);
+            var res = await HttpHelper.PostRequestAsync<List<CpuCgResDto>>(svr.BaseHttpAddr + "CpuCg/MultiCalc", dto);
             return res;
         }
 
@@ -57,9 +57,9 @@ namespace XdCxRhDW.App.Controllers
         public async Task<AjaxResult<List<ImageResultDto>>> DrawImage(CpuCgDto dto)
         {
             var svr = ServerContext.Instance.GetRandomOne(EnumSvrType.CpuCgSvr);
-            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            var res = await HttpHelper.PostRequestAsync<List<ImageResultDto>>(svr.BaseHttpAddr + "CpuCg/DrawImage", dto, dto.TimeoutSeconds);
+            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr);
+            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr);
+            var res = await HttpHelper.PostRequestAsync<List<ImageResultDto>>(svr.BaseHttpAddr + "CpuCg/DrawImage", dto);
             return res;
         }
         /// <summary>
@@ -71,9 +71,9 @@ namespace XdCxRhDW.App.Controllers
         public async Task<AjaxResult<List<GpuCgResponseDto>>> GpuCgCalc(GpuCgRequestDto dto)
         {
             var svr = ServerContext.Instance.GetRandomOne(EnumSvrType.GpuCgSvr);
-            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            var res = await HttpHelper.PostRequestAsync<List<GpuCgResponseDto>>(svr.BaseHttpAddr + "GpuCg/Calc", dto, dto.TimeoutSeconds);
+            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr);
+            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr);
+            var res = await HttpHelper.PostRequestAsync<List<GpuCgResponseDto>>(svr.BaseHttpAddr + "GpuCg/Calc", dto);
             return res;
         }
 
@@ -86,8 +86,8 @@ namespace XdCxRhDW.App.Controllers
         public async Task<AjaxResult<List<DetectResDto>>> DetectCalc(DetectDto dto)
         {
             var svr = ServerContext.Instance.GetRandomOne(EnumSvrType.CheckSvr);
-            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            var res = await HttpHelper.PostRequestAsync<List<DetectResDto>>(svr.BaseHttpAddr + "Check/Calc", dto, dto.TimeoutSeconds);
+            dto.file1 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file1), svr.BaseHttpAddr);
+            var res = await HttpHelper.PostRequestAsync<List<DetectResDto>>(svr.BaseHttpAddr + "Check/Calc", dto);
             if (dto.SigProc && res.data.Any())
             {
                 SignalProcDto procDto = new SignalProcDto()
@@ -134,9 +134,9 @@ namespace XdCxRhDW.App.Controllers
         public async Task<AjaxResult<ResampleResponseDto>> Resample(ResampleRequestDto dto)
         {
             var svr = ServerContext.Instance.GetRandomOne(EnumSvrType.CheckSvr);
-            dto.File = await HttpHelper.UploadFileAsync(GetLocalFile(dto.File), svr.BaseHttpAddr, timeoutSeconds: dto.TimeoutSeconds);
-            var res = await HttpHelper.PostRequestAsync<ResampleResponseDto>(svr.BaseHttpAddr + "Check/Resample", dto, dto.TimeoutSeconds);
-            await HttpHelper.DownloadFileAsync(svr.BaseHttpAddr, res.data.File, GetLocalFile(res.data.File), dto.TimeoutSeconds);
+            dto.File = await HttpHelper.UploadFileAsync(GetLocalFile(dto.File), svr.BaseHttpAddr);
+            var res = await HttpHelper.PostRequestAsync<ResampleResponseDto>(svr.BaseHttpAddr + "Check/Resample", dto);
+            await HttpHelper.DownloadFileAsync(svr.BaseHttpAddr, res.data.File, GetLocalFile(res.data.File));
             return res;
         }
        

+ 1 - 1
XdCxRhDW.App/Controllers/XlController.cs

@@ -60,7 +60,7 @@ namespace XdCxRhDW.App.Controllers
                          var day = Convert.ToDouble(dayStr);
                          var year = 2000 + Convert.ToInt32(yearStr);
                          DateTime dt = new DateTime(year, 1, 1, 0, 0, 0);
-                         dt = dt.AddDays(day);
+                         dt = dt.AddDays(day-1);
                          xl.TimeUTC = dt;
                          tmp.Add(xl);
                      }

+ 4 - 4
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -101,7 +101,7 @@ namespace XdCxRhDW.App.CorTools
                     }
                     try
                     {
-                        var result = await HttpHelper.PostRequestAsync<List<CpuCgResDto>>(SysConfig.GetUrl("DetectCg/CpuCgMultiCalc"), dto, dto.TimeoutSeconds);
+                        var result = await HttpHelper.PostRequestAsync<List<CpuCgResDto>>(SysConfig.GetUrl("DetectCg/CpuCgMultiCalc"), dto);
                         if (result.code == 200)
                         {
                             for (int i = 0; i < result.data.Count; i++)
@@ -241,7 +241,7 @@ namespace XdCxRhDW.App.CorTools
                 dto.fsHz = double.Parse(tefs.Text) * 1e6;
                 dto.band = double.Parse(txtBand.Text);
                 dto.TimeoutSeconds = int.Parse(txtTimeout.Text);
-                var dmcResult = await HttpHelper.PostRequestAsync<IEnumerable<DetectResDto>>(SysConfig.GetUrl("DetectCg/DetectCalc"), dto, dto.TimeoutSeconds);
+                var dmcResult = await HttpHelper.PostRequestAsync<IEnumerable<DetectResDto>>(SysConfig.GetUrl("DetectCg/DetectCalc"), dto);
                 if (dmcResult.code == 200)
                 {
                     foreach (var dmcItem in dmcResult.data)
@@ -330,7 +330,7 @@ namespace XdCxRhDW.App.CorTools
             gridSource.Clear();
             try
             {
-                var result = await HttpHelper.PostRequestAsync<CpuCgResDto>(SysConfig.GetUrl("DetectCg/CpuCgCalc"), xItem, xItem.TimeoutSeconds);
+                var result = await HttpHelper.PostRequestAsync<CpuCgResDto>(SysConfig.GetUrl("DetectCg/CpuCgCalc"), xItem);
                 if (result.code == 200)
                 {
                     DateTime? sigTime = null;
@@ -392,7 +392,7 @@ namespace XdCxRhDW.App.CorTools
                 };
                 par.file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, SysConfig.GetBaseUrl());
                 par.file2 = await HttpHelper.UploadFileAsync(btnFile2.Text, SysConfig.GetBaseUrl());
-                var resp = await HttpHelper.PostRequestAsync<List<ImageResultDto>>(SysConfig.GetUrl("DetectCg/DrawImage"), par, par.TimeoutSeconds);
+                var resp = await HttpHelper.PostRequestAsync<List<ImageResultDto>>(SysConfig.GetUrl("DetectCg/DrawImage"), par);
                 await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), par.file1, par.file2);
                 if (resp.code != 200)
                 {

+ 1 - 1
XdCxRhDW.App/CorTools/GpuCalcForm.cs

@@ -93,7 +93,7 @@ namespace XdCxRhDW.App.CorTools
 
             try
             {
-                var result = await HttpHelper.PostRequestAsync<List<GpuCgResponseDto>>(SysConfig.GetUrl("DetectCg/GpuCgCalc"), dto, dto.TimeoutSeconds);
+                var result = await HttpHelper.PostRequestAsync<List<GpuCgResponseDto>>(SysConfig.GetUrl("DetectCg/GpuCgCalc"), dto);
                 if (result.code == 200)
                 {
                     foreach (var item in result.data)

+ 1 - 1
XdCxRhDW.App/CorTools/ResampleForm.cs

@@ -108,7 +108,7 @@ namespace XdCxRhDW.App.CorTools
                     OutFsHz = (int)outFsHz,
                     TimeoutSeconds = (int)timeout,
                 };
-                var response = await HttpHelper.PostRequestAsync<ResampleResponseDto>(SysConfig.GetUrl("DetectCg/Resample"), dto, dto.TimeoutSeconds);
+                var response = await HttpHelper.PostRequestAsync<ResampleResponseDto>(SysConfig.GetUrl("DetectCg/Resample"), dto);
                 if (response.code == 200)
                 {
                     string outFile = Path.Combine(txtOutDir.Text, Path.GetFileNameWithoutExtension(txtFile.Text) + $"_Resample{txtOutFs.Text}K.dat");

+ 77 - 81
XdCxRhDW.App/CorTools/XlCalculateForm.Designer.cs

@@ -33,11 +33,6 @@
             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();
@@ -45,11 +40,11 @@
             this.txtSpanSeconds = new DevExpress.XtraEditors.ButtonEdit();
             this.txtEndTime = new DevExpress.XtraEditors.DateEdit();
             this.txtStartTime = new DevExpress.XtraEditors.DateEdit();
-            this.txtTle = new DevExpress.XtraEditors.SearchLookUpEdit();
-            this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
-            this.txtTimeout = new DevExpress.XtraEditors.ButtonEdit();
+            this.txtSat = new DevExpress.XtraEditors.SearchLookUpEdit();
+            this.searchLookUpEdit1View1 = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.txtTle = new DevExpress.XtraEditors.TextEdit();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
-            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.itemTle = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
@@ -57,7 +52,7 @@
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.itemSat = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.gridControl)).BeginInit();
@@ -67,11 +62,11 @@
             ((System.ComponentModel.ISupportInitialize)(this.txtEndTime.Properties.CalendarTimeProperties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties.CalendarTimeProperties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtTle.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.itemTle)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
@@ -79,7 +74,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.itemSat)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
@@ -89,8 +84,8 @@
             this.layoutControl1.Controls.Add(this.txtSpanSeconds);
             this.layoutControl1.Controls.Add(this.txtEndTime);
             this.layoutControl1.Controls.Add(this.txtStartTime);
+            this.layoutControl1.Controls.Add(this.txtSat);
             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";
@@ -126,7 +121,8 @@
             // 
             // txtSpanSeconds
             // 
-            this.txtSpanSeconds.Location = new System.Drawing.Point(405, 38);
+            this.txtSpanSeconds.EditValue = "60";
+            this.txtSpanSeconds.Location = new System.Drawing.Point(575, 38);
             this.txtSpanSeconds.Name = "txtSpanSeconds";
             this.txtSpanSeconds.Properties.AutoHeight = false;
             this.txtSpanSeconds.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -138,7 +134,7 @@
             // txtEndTime
             // 
             this.txtEndTime.EditValue = null;
-            this.txtEndTime.Location = new System.Drawing.Point(235, 38);
+            this.txtEndTime.Location = new System.Drawing.Point(405, 38);
             this.txtEndTime.Name = "txtEndTime";
             this.txtEndTime.Properties.AutoHeight = false;
             this.txtEndTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -157,7 +153,7 @@
             // txtStartTime
             // 
             this.txtStartTime.EditValue = null;
-            this.txtStartTime.Location = new System.Drawing.Point(65, 38);
+            this.txtStartTime.Location = new System.Drawing.Point(235, 38);
             this.txtStartTime.Name = "txtStartTime";
             this.txtStartTime.Properties.AutoHeight = false;
             this.txtStartTime.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -173,44 +169,43 @@
             this.txtStartTime.StyleController = this.layoutControl1;
             this.txtStartTime.TabIndex = 6;
             // 
+            // txtSat
+            // 
+            this.txtSat.Location = new System.Drawing.Point(41, 38);
+            this.txtSat.Name = "txtSat";
+            this.txtSat.Properties.AutoHeight = false;
+            this.txtSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.txtSat.Properties.PopupView = this.searchLookUpEdit1View1;
+            this.txtSat.Size = new System.Drawing.Size(137, 22);
+            this.txtSat.StyleController = this.layoutControl1;
+            this.txtSat.TabIndex = 5;
+            this.txtSat.ToolTip = "填写卫星的双行根数";
+            // 
+            // searchLookUpEdit1View1
+            // 
+            this.searchLookUpEdit1View1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            this.searchLookUpEdit1View1.Name = "searchLookUpEdit1View1";
+            this.searchLookUpEdit1View1.OptionsSelection.EnableAppearanceFocusedCell = false;
+            this.searchLookUpEdit1View1.OptionsView.ShowGroupPanel = false;
+            // 
             // txtTle
             // 
             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.Properties.NullText = "[EditValue is null]";
             this.txtTle.Size = new System.Drawing.Size(723, 22);
             this.txtTle.StyleController = this.layoutControl1;
             this.txtTle.TabIndex = 5;
             this.txtTle.ToolTip = "填写卫星的双行根数";
             // 
-            // searchLookUpEdit1View
-            // 
-            this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
-            this.searchLookUpEdit1View.Name = "searchLookUpEdit1View";
-            this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
-            this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
-            // 
-            // txtTimeout
-            // 
-            this.txtTimeout.EditValue = "30";
-            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.Size = new System.Drawing.Size(113, 22);
-            this.txtTimeout.StyleController = this.layoutControl1;
-            this.txtTimeout.TabIndex = 8;
-            // 
             // Root
             // 
             this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
             this.Root.GroupBordersVisible = false;
             this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
-            this.layoutControlItem2,
+            this.itemTle,
             this.layoutControlItem5,
             this.layoutControlItem6,
             this.layoutControlGroup1});
@@ -218,19 +213,19 @@
             this.Root.Size = new System.Drawing.Size(800, 450);
             this.Root.TextVisible = false;
             // 
-            // layoutControlItem2
+            // itemTle
             // 
-            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, 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);
-            this.layoutControlItem2.TextToControlDistance = 5;
+            this.itemTle.Control = this.txtTle;
+            this.itemTle.Location = new System.Drawing.Point(0, 0);
+            this.itemTle.MaxSize = new System.Drawing.Size(0, 26);
+            this.itemTle.MinSize = new System.Drawing.Size(107, 26);
+            this.itemTle.Name = "itemTle";
+            this.itemTle.Size = new System.Drawing.Size(780, 26);
+            this.itemTle.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.itemTle.Text = "双行根数";
+            this.itemTle.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
+            this.itemTle.TextSize = new System.Drawing.Size(48, 14);
+            this.itemTle.TextToControlDistance = 5;
             // 
             // layoutControlItem5
             // 
@@ -271,7 +266,7 @@
             this.layoutControlItem1,
             this.layoutControlItem3,
             this.layoutControlItem4,
-            this.layoutControlItem7});
+            this.itemSat});
             this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
             this.layoutControlGroup2.Name = "layoutControlGroup2";
             this.layoutControlGroup2.Size = new System.Drawing.Size(680, 26);
@@ -279,7 +274,7 @@
             // layoutControlItem1
             // 
             this.layoutControlItem1.Control = this.txtStartTime;
-            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.Location = new System.Drawing.Point(170, 0);
             this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 26);
             this.layoutControlItem1.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem1.Name = "layoutControlItem1";
@@ -293,7 +288,7 @@
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.txtEndTime;
-            this.layoutControlItem3.Location = new System.Drawing.Point(170, 0);
+            this.layoutControlItem3.Location = new System.Drawing.Point(340, 0);
             this.layoutControlItem3.MaxSize = new System.Drawing.Size(0, 26);
             this.layoutControlItem3.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem3.Name = "layoutControlItem3";
@@ -307,7 +302,7 @@
             // layoutControlItem4
             // 
             this.layoutControlItem4.Control = this.txtSpanSeconds;
-            this.layoutControlItem4.Location = new System.Drawing.Point(340, 0);
+            this.layoutControlItem4.Location = new System.Drawing.Point(510, 0);
             this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 26);
             this.layoutControlItem4.MinSize = new System.Drawing.Size(107, 26);
             this.layoutControlItem4.Name = "layoutControlItem4";
@@ -318,21 +313,21 @@
             this.layoutControlItem4.TextSize = new System.Drawing.Size(48, 14);
             this.layoutControlItem4.TextToControlDistance = 5;
             // 
-            // 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;
+            // itemSat
+            // 
+            this.itemSat.Control = this.txtSat;
+            this.itemSat.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.itemSat.CustomizationFormText = "卫星";
+            this.itemSat.Location = new System.Drawing.Point(0, 0);
+            this.itemSat.MaxSize = new System.Drawing.Size(0, 26);
+            this.itemSat.MinSize = new System.Drawing.Size(107, 26);
+            this.itemSat.Name = "itemSat";
+            this.itemSat.Size = new System.Drawing.Size(170, 26);
+            this.itemSat.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.itemSat.Text = "卫星";
+            this.itemSat.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
+            this.itemSat.TextSize = new System.Drawing.Size(24, 14);
+            this.itemSat.TextToControlDistance = 5;
             // 
             // XlCalculateForm
             // 
@@ -342,6 +337,7 @@
             this.Controls.Add(this.layoutControl1);
             this.Name = "XlCalculateForm";
             this.Text = "XlCalculate";
+            this.Load += new System.EventHandler(this.XlCalculateForm_Load);
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
             this.layoutControl1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.gridControl)).EndInit();
@@ -351,11 +347,11 @@
             ((System.ComponentModel.ISupportInitialize)(this.txtEndTime.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties.CalendarTimeProperties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtStartTime.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtSat.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtTle.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.itemTle)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
@@ -363,7 +359,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.itemSat)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -378,17 +374,17 @@
         private DevExpress.XtraEditors.ButtonEdit txtSpanSeconds;
         private DevExpress.XtraEditors.DateEdit txtEndTime;
         private DevExpress.XtraEditors.DateEdit txtStartTime;
-        private DevExpress.XtraEditors.SearchLookUpEdit txtTle;
-        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraLayout.LayoutControlItem itemTle;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
         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;
+        private DevExpress.XtraEditors.SearchLookUpEdit txtSat;
+        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View1;
+        private DevExpress.XtraLayout.LayoutControlItem itemSat;
+        private DevExpress.XtraEditors.TextEdit txtTle;
     }
 }

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

@@ -23,35 +23,69 @@ namespace XdCxRhDW.App.CorTools
     public partial class XlCalculateForm : DevExpress.XtraEditors.XtraForm
     {
         List<ModelSatEphRes> listEph = new List<ModelSatEphRes>();
-        public XlCalculateForm(List<XlInfo> xlInfos)
+
+        //选择卫星执行星历推算
+        public XlCalculateForm()
         {
             InitializeComponent();
-            this.Text = "星历推算";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            gridControl.UseDefault(listEph).UseMultiSelect().UseRowNumber();
-            txtStartTime.UseDefault();
-            txtEndTime.UseDefault();
-            txtTle.UseDoubleClickToSelectAll();
-            txtTle.UseDefault().SetData(xlInfos, nameof(XlInfo.TwoLine));
-            if (xlInfos.Count > 0)
+            this.itemTle.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
+            List<SatInfo> list1 = new List<SatInfo>();//配置的卫星
+            using (RHDWContext db = new RHDWContext())
             {
-                var xlinfo = xlInfos.First();
-                this.txtTle.EditValue = xlinfo.TwoLine;
-                this.txtStartTime.EditValue = xlinfo.TimeUTC;
-                this.txtEndTime.EditValue = xlinfo.TimeUTC.AddDays(1);
+                list1 = db.SatInfos.OrderBy(p=>p.SatCode).ToList();
             }
+
+            var list2 = XlRepository.GetAllSat().Result;//所有卫星
+            list2.RemoveAll(p => list1.Select(t => t.SatCode).Contains(p.SatCode));
+            list2.InsertRange(0, list1);
+            this.txtSat.UseDefault().SetData(list2, nameof(SatInfo.Sat)).UseDoubleClickToSelectAll();
         }
-       
 
+        //选择TLE执行星历推算
+        public XlCalculateForm(string tle)
+            : this()
+        {
+            this.Text = "星历推算";
+            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.IconOptions.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.txtTle.Text = tle;
+            this.itemTle.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
+            this.itemSat.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
+        }
+
+        private void XlCalculateForm_Load(object sender, EventArgs e)
+        {
+            gridControl.UseDefault(listEph).UseMultiSelect().UseRowNumber();
+            txtStartTime.UseDefault().UseDoubleClickToSelectAll();
+            txtEndTime.UseDefault().UseDoubleClickToSelectAll();
+            layoutControl1.BestFit();
+        }
 
         private async void btnCalculate_Click(object sender, EventArgs e)
         {
+            if (itemSat.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Always)
+            {
+                if (txtSat.EditValue == null)
+                {
+                    DxHelper.MsgBoxHelper.ShowError("请选择卫星");
+                    return;
+                }
+            }
+            else
+            {
+                if (string.IsNullOrWhiteSpace(txtTle.Text))
+                {
+                    DxHelper.MsgBoxHelper.ShowError("请选择双行根数");
+                    return;
+                }
+            }
             if (string.IsNullOrWhiteSpace(txtStartTime.Text))
             {
                 DxHelper.MsgBoxHelper.ShowError("请填写开始时间");
                 return;
             }
-            int timeout, spanSeconds = 1;
+            int spanSeconds = 1;
             if (txtEndTime.DateTime != txtStartTime.DateTime)
             {
                 if (!string.IsNullOrEmpty(txtEndTime.Text) && !int.TryParse(txtSpanSeconds.Text, out spanSeconds))
@@ -60,12 +94,6 @@ namespace XdCxRhDW.App.CorTools
                     return;
                 }
             }
-            if (!int.TryParse(txtTimeout.Text, out timeout))
-            {
-                DxHelper.MsgBoxHelper.ShowError("超时时间非数字");
-                return;
-            }
-
             var startTime = Convert.ToDateTime(txtStartTime.EditValue);
             var endTime = Convert.ToDateTime(txtEndTime.EditValue);
             if (!string.IsNullOrEmpty(txtStartTime.Text) && !string.IsNullOrEmpty(txtEndTime.Text))
@@ -81,7 +109,6 @@ namespace XdCxRhDW.App.CorTools
                     return;
                 }
             }
-            if (timeout <= 0) timeout = 30;
             listEph.Clear();
             try
             {
@@ -89,13 +116,21 @@ namespace XdCxRhDW.App.CorTools
                 {
                     var XlCalcMultDto = new XlCalcMultDto()
                     {
-                        tleStr = txtTle.Text,
                         startTime = startTime,
                         endTime = endTime,
                         spanSeconds = spanSeconds,
-                        TimeoutSeconds = timeout
                     };
-                    var ephRes = await HttpHelper.PostRequestAsync<List<ModelSatEphRes>>(SysConfig.GetUrl("Xl/CalcMult"), XlCalcMultDto, timeout);
+                    if (itemTle.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Always)
+                    {
+                        XlCalcMultDto.tleStr = txtTle.Text.Trim();
+                    }
+                    else
+                    {
+                        var sat = txtSat.EditValue as SatInfo;
+                        var xlInfo = await XlRepository.GetLatestAsync(sat.SatCode, startTime);
+                        XlCalcMultDto.tleStr = xlInfo.TwoLine;
+                    }
+                    var ephRes = await HttpHelper.PostRequestAsync<List<ModelSatEphRes>>(SysConfig.GetUrl("Xl/CalcMult"), XlCalcMultDto);
                     if (ephRes.code == 200)
                     {
                         listEph.AddRange(ephRes.data);
@@ -110,11 +145,19 @@ namespace XdCxRhDW.App.CorTools
                 {
                     var XlCalcDto = new XlCalcDto()
                     {
-                        tleStr = txtTle.Text,
                         SigTime = txtStartTime.DateTime,
-                        TimeoutSeconds = timeout
                     };
-                    var ephRes = await HttpHelper.PostRequestAsync<ModelSatEphRes>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto, timeout);
+                    if (itemTle.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Always)
+                    {
+                        XlCalcDto.tleStr = txtTle.Text;
+                    }
+                    else
+                    {
+                        var sat = txtSat.EditValue as SatInfo;
+                        var xlInfo = await XlRepository.GetLatestAsync(sat.SatCode, XlCalcDto.SigTime);
+                        XlCalcDto.tleStr = xlInfo.TwoLine;
+                    }
+                    var ephRes = await HttpHelper.PostRequestAsync<ModelSatEphRes>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
                     if (ephRes.code == 200)
                     {
                         listEph.Add(ephRes.data);
@@ -136,7 +179,6 @@ namespace XdCxRhDW.App.CorTools
                 Serilog.Log.Error(ex, "星历推算异常");
                 DxHelper.MsgBoxHelper.ShowError("星历推算异常");
             }
-            Console.ReadLine();
         }
     }
 }

+ 15 - 0
XdCxRhDW.App/DxHelper/SvgHelper.cs

@@ -624,5 +624,20 @@ namespace DxHelper
             ms.Dispose();
             return svg;
         }
+        /// <summary>
+        /// Error
+        /// </summary>
+        /// <returns></returns>
+        public static SvgImage CreateRefresh(string color = "#039C23", int width = 24, int height = 24)
+        {
+            string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
+                + $"<path fill='{color}' d='M24.5,7.5C22.3,5.3,19.3,4,16,4C10.1,4,5.1,8.3,4.2,14h4.1c0.9-3.4,4-6,7.7-6c2.2,0,4.2,0.9,5.6,2.4L18,14h5.7h4.1H28V4L24.5,7.5z'/>"
+                + $"<path fill='{color}' d='M16.2,24c-2.2,0-4.2-0.9-5.6-2.4l3.6-3.6H8.4H4.4H4.2v10l3.5-3.5c2.2,2.2,5.2,3.5,8.5,3.5C22.1,28,27,23.7,28,18h-4.1C23,21.4,19.9,24,16.2,24z'/>"
+                + "</svg>";
+            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
+            var svg = SvgLoader.LoadFromStream(ms);
+            ms.Dispose();
+            return svg;
+        }
     }
 }

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

@@ -90,7 +90,7 @@ namespace XdCxRhDW.App.EditForms
                 {
                     return;
                 }
-                var rsp = await HttpHelper.GetRequestAsync<LeoSat1AppSettingDto>($"{svtItem.BaseHttpAddr}LeoSat1TaskProcessing/GetAppSetting", 10);
+                var rsp = await HttpHelper.GetRequestAsync<LeoSat1AppSettingDto>($"{svtItem.BaseHttpAddr}LeoSat1TaskProcessing/GetAppSetting");
                 if (rsp.code == 200)
                 {
                     time1SatInfo = rsp.data.Time1SatInfo;

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

@@ -113,7 +113,7 @@ namespace XdCxRhDW.App.EditForms
                 {
                     return;
                 }
-                var rsp = await HttpHelper.GetRequestAsync<LeoSat2AppSettingDto>($"{svtItem.BaseHttpAddr}LeoSat2TaskProcessing/GetAppSetting", 10);
+                var rsp = await HttpHelper.GetRequestAsync<LeoSat2AppSettingDto>($"{svtItem.BaseHttpAddr}LeoSat2TaskProcessing/GetAppSetting");
                 if (rsp.code == 200)
                 {
                     mainSatInfo = rsp.data.MainSatInfo;

+ 2 - 2
XdCxRhDW.App/EditForms/X2D1EllipesEditor.cs

@@ -123,11 +123,11 @@ namespace XdCxRhDW.App.EditForms
                 if (info.PosResType != EnumPosResType.X2D1)
                 {
                     dto = dto.WithRef(112, 11);
-                    rsp = await HttpHelper.PostRequestAsync<ErrEllipseResDto>(SysConfig.GetUrl("Ellipse/X2D1"), dto, 30);
+                    rsp = await HttpHelper.PostRequestAsync<ErrEllipseResDto>(SysConfig.GetUrl("Ellipse/X2D1"), dto);
                 }
                 else
                 {
-                    rsp = await HttpHelper.PostRequestAsync<ErrEllipseResDto>(SysConfig.GetUrl("Ellipse/X2D1NoRef"), dto, 30);
+                    rsp = await HttpHelper.PostRequestAsync<ErrEllipseResDto>(SysConfig.GetUrl("Ellipse/X2D1NoRef"), dto);
                 }
                 if (rsp.code != 200)
                 {

+ 1 - 1
XdCxRhDW.App/MainForm.Designer.cs

@@ -28,7 +28,6 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
             DevExpress.Utils.SuperToolTip superToolTip3 = new DevExpress.Utils.SuperToolTip();
@@ -292,6 +291,7 @@
             this.ribbonPageGroup3.ItemLinks.Add(this.barButtonItem1);
             this.ribbonPageGroup3.ItemLinks.Add(this.btnCocTool);
             this.ribbonPageGroup3.ItemLinks.Add(this.btnDetectTool);
+            this.ribbonPageGroup3.ItemLinks.Add(this.btnXlCalculate);
             this.ribbonPageGroup3.ItemLinks.Add(this.btnSignalEmulation);
             this.ribbonPageGroup3.Name = "ribbonPageGroup3";
             this.ribbonPageGroup3.Text = "手动工具";

+ 161 - 72
XdCxRhDW.App/MainForm.cs

@@ -60,14 +60,10 @@ namespace XdCxRhDW
             ctrlTypes.Add("变采样", typeof(ResampleForm));
             ctrlTypes.Add("GPU参估", typeof(GpuCalcForm));
             ctrlTypes.Add("检测参估", typeof(DetectToolForm));
-            //ctrlTypes.Add("星历推算", typeof(XlCalculateForm));
+            ctrlTypes.Add("星历推算", typeof(XlCalculateForm));
             ctrlTypes.Add("信号仿真", typeof(SignalEmulation));
             ctrlTypes.Add("服务状态", typeof(CtrlSvrs));
             ctrlTypes.Add("服务日志", typeof(CtrlSvrLog));
-            using (RHDWLogContext db = new RHDWLogContext())
-            {
-                var qq = db.LogRes.ToList();
-            }
             using (RHDWContext db = new RHDWContext())
             {
                 SysConfig.Config = db.SysSetings.FirstOrDefault();
@@ -78,6 +74,8 @@ namespace XdCxRhDW
             }
             btn_ItemClick(null, null);
             ServerContext.Instance.Init();
+            DxHelper.WaitHelper.UpdateSplashMessage("正在检查数据库环境...");
+            CheckDb();
         }
         private string text;
         private async void MainForm_Load(object sender, EventArgs e)
@@ -149,7 +147,7 @@ namespace XdCxRhDW
                         ModuleType = EnumModuleType.Port,
                         ModuleState = EnumModuleState.Error,
                     };
-                    AutofacUtil.GetService<FileWriterService>().WriteStateRes(dto);
+                    AutofacUtil.GetService<FileWriterService>()?.WriteStateRes(dto);
                 }
                 catch (Exception ex)
                 {
@@ -198,39 +196,54 @@ namespace XdCxRhDW
                     catch (Exception ex)
                     {
                         Serilog.Log.Error(ex, $"星历文件[{file}]自动导入失败");
+                        await Task.Delay(10000);
+                    }
+                    finally
+                    {
+                        await Task.Delay(5000);
                     }
                 }
 
             }
         }
 
-        //清理180天之前导入的星历
+        //清理1之前导入的星历
         private async Task XlClear()
         {
             while (true)
             {
                 try
                 {
+                    List<XlInfo> clearData = new List<XlInfo>();
                     using (RHDWContext db = new RHDWContext())
                     {
-                        DateTime dt = DateTime.Now.AddDays(-180);
-                        var clearData = await db.XlInfos.Where(p => p.UpdateTime < dt).Take(1000).ToListAsync();
-                        if (clearData.Any())
+                        DateTime dt = DateTime.Now.AddYears(-1);
+                        clearData = await db.XlInfos.Where(p => p.UpdateTime < dt).Take(1000).ToListAsync();
+                    }
+                    if (!clearData.Any())
+                    {
+                        await Task.Delay(60 * 1000);
+                    }
+                    else
+                    {
+                        using (RHDWContext db = new RHDWContext())
                         {
                             db.XlInfos.RemoveRange(clearData);
                             await db.SaveChangesAsync();
-                            await Task.Delay(2 * 1000);
-                        }
-                        else
-                        {
-                            await Task.Delay(3600 * 1000);
                         }
+
                     }
+
                 }
                 catch (Exception ex)
                 {
                     await LogHelper.Error("清理过期星历异常", ex);
                 }
+                finally
+                {
+                    await Task.Delay(2000);
+                }
+
             }
         }
 
@@ -241,59 +254,81 @@ namespace XdCxRhDW
             {
                 try
                 {
+                    List<XlInfo> calcItems = null;
+                    List<SatInfo> satInfo = null;
                     using (RHDWContext db = new RHDWContext())
                     {
-                        var calcItems = await db.XlInfos.Where(p => p.Lon == null).OrderByDescending(p => p.SatCode).ToListAsync();
-                        if (calcItems.Any())
+                        calcItems = await db.XlInfos.Where(p => p.Lon == null).OrderByDescending(p => p.SatCode).Take(100).ToListAsync();
+                        satInfo = await db.SatInfos.ToListAsync();
+                    }
+                    if (calcItems != null && calcItems.Any())
+                    {
+                        var firstUpdateItems = calcItems.Where(p => satInfo.Any(t => t.SatCode == p.SatCode)).ToList();
+
+                        await Task.Run(() =>
                         {
-                            var satInfo = await db.SatInfos.ToListAsync();
-                            var firstUpdateItems = calcItems.Where(p => satInfo.Any(t => t.SatCode == p.SatCode)).ToList();
-                            await Task.Run(() =>
+                            List<XlInfo> Level1 = new List<XlInfo>();
+                            foreach (var item in firstUpdateItems)
                             {
-                                foreach (var item in firstUpdateItems)
+                                try
                                 {
-                                    try
-                                    {
-                                        var eph = EphHelper.Calc(item.TwoLine, item.TimeUTC);
-                                        item.Lon = Math.Round(PhysicsHelper.EcefToGeo((eph.X, eph.Y, eph.Z)).lon, 1);
-
-                                    }
-                                    catch (Exception ex)
-                                    {
-                                        item.Lon = -999;
-                                        LogHelper.Error($"[{item.TwoLine}]推算XYZ星历出错!", ex).Wait(5000);
-                                    }
-                                    db.XlInfos.AddOrUpdate(item);
-                                    db.SaveChangesAsync();
+                                    var eph = EphHelper.Calc(item.TwoLine, item.TimeUTC);
+                                    item.Lon = Math.Round(PhysicsHelper.EcefToGeo((eph.X, eph.Y, eph.Z)).lon, 1);
+                                    Level1.Add(item);
                                     calcItems.Remove(item);
                                 }
-
-                                foreach (var item in calcItems)
+                                catch (Exception ex)
                                 {
-                                    try
-                                    {
-                                        var eph = EphHelper.Calc(item.TwoLine, item.TimeUTC);
-                                        item.Lon = Math.Round(PhysicsHelper.EcefToGeo((eph.X, eph.Y, eph.Z)).lon, 1);
-
-                                    }
-                                    catch (Exception ex)
-                                    {
-                                        item.Lon = -999;
-                                        LogHelper.Error($"[{item.TwoLine}]推算XYZ星历出错!", ex).Wait(5000);
-                                    }
-                                    db.XlInfos.AddOrUpdate(item);
-                                    db.SaveChangesAsync();
+                                    item.Lon = -999;
+                                    LogHelper.Error($"[{item.TwoLine}]推算XYZ星历出错!", ex).Wait(5000);
                                 }
-                            });
-
-                        }
+                            }
+                            if (Level1.Any())
+                            {
+                                using (RHDWContext db = new RHDWContext())
+                                {
+                                    db.XlInfos.AddOrUpdate(Level1.ToArray());
+                                    db.SaveChanges();
+                                }
+                            }
+                            List<XlInfo> Level2 = new List<XlInfo>();
+                            foreach (var item in calcItems)
+                            {
+                                try
+                                {
+                                    var eph = EphHelper.Calc(item.TwoLine, item.TimeUTC);
+                                    item.Lon = Math.Round(PhysicsHelper.EcefToGeo((eph.X, eph.Y, eph.Z)).lon, 1);
+                                    Level2.Add(item);
+                                }
+                                catch (Exception ex)
+                                {
+                                    item.Lon = -999;
+                                    LogHelper.Error($"[{item.TwoLine}]推算XYZ星历出错!", ex).Wait(5000);
+                                }
+                            }
+                            if (Level2.Any())
+                            {
+                                using (RHDWContext db = new RHDWContext())
+                                {
+                                    db.XlInfos.AddOrUpdate(Level2.ToArray());
+                                    db.SaveChanges();
+                                }
+                            }
+                        });
+                    }
+                    else
+                    {
+                        await Task.Delay(60 * 1000);
                     }
                 }
                 catch (Exception ex)
                 {
                     LogHelper.Error($"推算XYZ星历出错!", ex).Wait(5000);
                 }
-                await Task.Delay(60 * 1000);
+                finally
+                {
+                    await Task.Delay(5000);
+                }
             }
         }
 
@@ -306,14 +341,14 @@ namespace XdCxRhDW
                 ModuleType = EnumModuleType.Soft,
                 ModuleState = EnumModuleState.正常,
             };
-            AutofacUtil.GetService<FileWriterService>().WriteStateRes(dto);
+            AutofacUtil.GetService<FileWriterService>()?.WriteStateRes(dto);
             await Task.Run(async () =>
              {
                  while (true)
                  {
                      try
                      {
-                        
+
 
                          var pro = Process.GetCurrentProcess();
                          if ((pro.PrivateMemorySize64 >> 20) > 8192)//程序内存大于8个GB
@@ -325,7 +360,7 @@ namespace XdCxRhDW
                                  ModuleType = EnumModuleType.Memory,
                                  ModuleState = EnumModuleState.Error,
                              };
-                             AutofacUtil.GetService<FileWriterService>().WriteStateRes(dto2);
+                             AutofacUtil.GetService<FileWriterService>()?.WriteStateRes(dto2);
                          }
                      }
                      catch (Exception ex)
@@ -356,7 +391,7 @@ namespace XdCxRhDW
                             {
                                 info.Delete();
                             }
-                            catch(Exception ex)
+                            catch (Exception ex)
                             {
                                 await LogHelper.Error("清理wwwroot历史文件异常", ex);
                             }
@@ -373,25 +408,36 @@ namespace XdCxRhDW
 
         private async Task ClearLog()
         {
-            using (RHDWLogContext db = new RHDWLogContext())
+            while (true)
             {
-                try
+                using (RHDWLogContext db = new RHDWLogContext())
                 {
-                    var time1 = DateTime.Today.AddDays(-7);
-                    var time2 = DateTime.Today.AddDays(-30);
-                    var delItems = await db.LogRes.Where(p => p.LogTime < time1 && p.LogType != EnumLogType.Error).ToListAsync();
-                    db.LogRes.RemoveRange(delItems);
+                    try
+                    {
+                        var time1 = DateTime.Today.AddDays(-7);
+                        var time2 = DateTime.Today.AddDays(-30);
+                        var delItems = await db.LogRes.Where(p => p.LogTime < time1 && p.LogType != EnumLogType.Error).Take(500).ToListAsync();
+                        db.LogRes.RemoveRange(delItems);
 
-                    var delItems2 = await db.LogRes.Where(p => p.LogTime < time2 && p.LogType == EnumLogType.Error).ToListAsync();
-                    db.LogRes.RemoveRange(delItems2);
-                    await db.SaveChangesAsync();
-                }
-                catch (Exception ex)
-                {
-                    Serilog.Log.Error(ex, "清理日志信息异常!");
+                        var delItems2 = await db.LogRes.Where(p => p.LogTime < time2 && p.LogType == EnumLogType.Error).Take(500).ToListAsync();
+                        db.LogRes.RemoveRange(delItems2);
+                        await db.SaveChangesAsync();
+                        if (!delItems.Any() && !delItems2.Any())
+                        {
+                            break;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        await LogHelper.Error("清理日志信息异常", ex);
+                        await Task.Delay(10000);
+                    }
+                    finally
+                    {
+                        await Task.Delay(5000);
+                    }
                 }
             }
-            await Task.Delay(3600 * 1000);
         }
 
         private void btn_ItemClick(object sender, ItemClickEventArgs e)
@@ -426,7 +472,7 @@ namespace XdCxRhDW
                     return;
                 }
             }
-            AutofacUtil.GetService<FileWriterService>().WriteStateRes(new SvrStateReportDto()
+            AutofacUtil.GetService<FileWriterService>()?.WriteStateRes(new SvrStateReportDto()
             {
                 SvrType = EnumSvrType.PosPlatform,
                 DevId = ConfigurationManager.AppSettings["DevID"].Trim(),
@@ -512,5 +558,48 @@ namespace XdCxRhDW
             catch
             { }
         }
+
+        private void CheckDb()
+        {
+            try
+            {
+                using (RHDWContext db = new RHDWContext())
+                {
+                    if (File.Exists(db.DbFile))
+                    {
+                        FileInfo fInfo = new FileInfo(db.DbFile);
+                        if (fInfo.IsReadOnly)
+                        {
+                            fInfo.IsReadOnly = false;
+                        }
+
+                    }
+
+                }
+                using (RHDWLogContext db = new RHDWLogContext())
+                {
+                    if (File.Exists(db.DbFile))
+                    {
+                        FileInfo fInfo = new FileInfo(db.DbFile);
+                        if (fInfo.IsReadOnly)
+                        {
+                            fInfo.IsReadOnly = false;
+                        }
+                    }
+                }
+                using (RHDWContext db = new RHDWContext())
+                {
+                    db.SyncDb();
+                }
+                using (RHDWLogContext db = new RHDWLogContext())
+                {
+                    db.SyncDb();
+                }
+            }
+            catch (Exception ex)
+            {
+                LogHelper.Error("同步数据库结构异常", ex).Wait(5000);
+            }
+        }
     }
 }

+ 1 - 1
XdCxRhDW.App/ServerContext.cs

@@ -124,7 +124,7 @@ namespace XdCxRhDW.App
                                 foreach (var item in tmp)
                                 {
                                     list.Remove(item);
-                                    AutofacUtil.GetService<FileWriterService>().WriteStateRes(new SvrStateReportDto()
+                                    AutofacUtil.GetService<FileWriterService>()?.WriteStateRes(new SvrStateReportDto()
                                     {
                                         SvrID = item.SvrID,
                                         SvrType = item.SvrType,

+ 40 - 35
XdCxRhDW.App/UserControl/CtrlXl.Designer.cs

@@ -96,12 +96,12 @@
             // 
             // txtSat
             // 
-            this.txtSat.Location = new System.Drawing.Point(69, 40);
+            this.txtSat.Location = new System.Drawing.Point(61, 32);
             this.txtSat.Name = "txtSat";
             this.txtSat.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
             this.txtSat.Properties.PopupView = this.searchLookUpEdit1View;
-            this.txtSat.Size = new System.Drawing.Size(566, 20);
+            this.txtSat.Size = new System.Drawing.Size(582, 20);
             this.txtSat.StyleController = this.layoutControl1;
             this.txtSat.TabIndex = 12;
             this.txtSat.EditValueChanged += new System.EventHandler(this.TxtSat_EditValueChanged);
@@ -117,9 +117,9 @@
             // 
             this.btnGo.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnGo.ImageOptions.SvgImage")));
             this.btnGo.ImageOptions.SvgImageSize = new System.Drawing.Size(16, 16);
-            this.btnGo.Location = new System.Drawing.Point(615, 440);
+            this.btnGo.Location = new System.Drawing.Point(623, 448);
             this.btnGo.Name = "btnGo";
-            this.btnGo.Size = new System.Drawing.Size(20, 20);
+            this.btnGo.Size = new System.Drawing.Size(20, 17);
             this.btnGo.StyleController = this.layoutControl1;
             this.btnGo.TabIndex = 11;
             this.btnGo.ToolTip = "跳转";
@@ -127,10 +127,10 @@
             // 
             // txtGoPage
             // 
-            this.txtGoPage.Location = new System.Drawing.Point(535, 440);
+            this.txtGoPage.Location = new System.Drawing.Point(543, 448);
             this.txtGoPage.Name = "txtGoPage";
             this.txtGoPage.Properties.AutoHeight = false;
-            this.txtGoPage.Size = new System.Drawing.Size(76, 20);
+            this.txtGoPage.Size = new System.Drawing.Size(76, 17);
             this.txtGoPage.StyleController = this.layoutControl1;
             this.txtGoPage.TabIndex = 9;
             // 
@@ -142,9 +142,9 @@
             this.dataNavigator1.Buttons.Next.Visible = false;
             this.dataNavigator1.Buttons.Prev.Visible = false;
             this.dataNavigator1.Buttons.Remove.Visible = false;
-            this.dataNavigator1.Location = new System.Drawing.Point(160, 440);
+            this.dataNavigator1.Location = new System.Drawing.Point(152, 448);
             this.dataNavigator1.Name = "dataNavigator1";
-            this.dataNavigator1.Size = new System.Drawing.Size(152, 21);
+            this.dataNavigator1.Size = new System.Drawing.Size(152, 20);
             this.dataNavigator1.StyleController = this.layoutControl1;
             this.dataNavigator1.TabIndex = 8;
             this.dataNavigator1.Text = "dataNavigator1";
@@ -155,7 +155,7 @@
             // btnImp
             // 
             this.btnImp.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnImp.ImageOptions.SvgImage")));
-            this.btnImp.Location = new System.Drawing.Point(539, 12);
+            this.btnImp.Location = new System.Drawing.Point(547, 4);
             this.btnImp.Name = "btnImp";
             this.btnImp.Size = new System.Drawing.Size(96, 24);
             this.btnImp.StyleController = this.layoutControl1;
@@ -174,10 +174,10 @@
             this.gridXl.EmbeddedNavigator.Buttons.Remove.Visible = false;
             this.gridXl.EmbeddedNavigator.TextLocation = DevExpress.XtraEditors.NavigatorButtonsTextLocation.Begin;
             this.gridXl.EmbeddedNavigator.TextStringFormat = "第{0}页/共{1}页";
-            this.gridXl.Location = new System.Drawing.Point(10, 62);
+            this.gridXl.Location = new System.Drawing.Point(2, 54);
             this.gridXl.MainView = this.gridView1;
             this.gridXl.Name = "gridXl";
-            this.gridXl.Size = new System.Drawing.Size(627, 376);
+            this.gridXl.Size = new System.Drawing.Size(643, 389);
             this.gridXl.TabIndex = 5;
             this.gridXl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.gridView1});
@@ -189,19 +189,19 @@
             // 
             // btnOpen
             // 
-            this.btnOpen.Location = new System.Drawing.Point(69, 12);
+            this.btnOpen.Location = new System.Drawing.Point(61, 4);
             this.btnOpen.Name = "btnOpen";
             this.btnOpen.Properties.AutoHeight = false;
             this.btnOpen.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton()});
-            this.btnOpen.Size = new System.Drawing.Size(466, 24);
+            this.btnOpen.Size = new System.Drawing.Size(482, 24);
             this.btnOpen.StyleController = this.layoutControl1;
             this.btnOpen.TabIndex = 4;
             // 
             // txtCountPerPage
             // 
             this.txtCountPerPage.EditValue = "5000";
-            this.txtCountPerPage.Location = new System.Drawing.Point(42, 440);
+            this.txtCountPerPage.Location = new System.Drawing.Point(34, 448);
             this.txtCountPerPage.Name = "txtCountPerPage";
             this.txtCountPerPage.Properties.AutoHeight = false;
             this.txtCountPerPage.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -213,7 +213,7 @@
             "2000",
             "5000",
             "10000"});
-            this.txtCountPerPage.Size = new System.Drawing.Size(76, 21);
+            this.txtCountPerPage.Size = new System.Drawing.Size(76, 18);
             this.txtCountPerPage.StyleController = this.layoutControl1;
             this.txtCountPerPage.TabIndex = 10;
             this.txtCountPerPage.EditValueChanged += new System.EventHandler(this.txtCountPerPage_EditValueChanged);
@@ -235,6 +235,7 @@
             this.emptySpaceItem1,
             this.layoutControlItem4});
             this.Root.Name = "Root";
+            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 2, 2);
             this.Root.Size = new System.Drawing.Size(647, 473);
             this.Root.TextVisible = false;
             // 
@@ -245,7 +246,7 @@
             this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 28);
             this.layoutControlItem1.MinSize = new System.Drawing.Size(118, 28);
             this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(527, 28);
+            this.layoutControlItem1.Size = new System.Drawing.Size(543, 28);
             this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem1.Text = "星历文件";
             this.layoutControlItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.CustomSize;
@@ -258,14 +259,14 @@
             this.layoutControlItem2.Location = new System.Drawing.Point(0, 52);
             this.layoutControlItem2.Name = "layoutControlItem2";
             this.layoutControlItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
-            this.layoutControlItem2.Size = new System.Drawing.Size(627, 376);
+            this.layoutControlItem2.Size = new System.Drawing.Size(643, 389);
             this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem2.TextVisible = false;
             // 
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.btnImp;
-            this.layoutControlItem3.Location = new System.Drawing.Point(527, 0);
+            this.layoutControlItem3.Location = new System.Drawing.Point(543, 0);
             this.layoutControlItem3.MaxSize = new System.Drawing.Size(100, 28);
             this.layoutControlItem3.MinSize = new System.Drawing.Size(100, 28);
             this.layoutControlItem3.Name = "layoutControlItem3";
@@ -277,11 +278,12 @@
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.dataNavigator1;
-            this.layoutControlItem5.Location = new System.Drawing.Point(148, 428);
+            this.layoutControlItem5.Location = new System.Drawing.Point(148, 441);
             this.layoutControlItem5.MaxSize = new System.Drawing.Size(156, 25);
             this.layoutControlItem5.MinSize = new System.Drawing.Size(156, 25);
             this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Size = new System.Drawing.Size(156, 25);
+            this.layoutControlItem5.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
+            this.layoutControlItem5.Size = new System.Drawing.Size(156, 28);
             this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem5.TextVisible = false;
@@ -289,11 +291,12 @@
             // layoutControlItem6
             // 
             this.layoutControlItem6.Control = this.txtGoPage;
-            this.layoutControlItem6.Location = new System.Drawing.Point(523, 428);
+            this.layoutControlItem6.Location = new System.Drawing.Point(539, 441);
             this.layoutControlItem6.MaxSize = new System.Drawing.Size(80, 24);
             this.layoutControlItem6.MinSize = new System.Drawing.Size(80, 24);
             this.layoutControlItem6.Name = "layoutControlItem6";
-            this.layoutControlItem6.Size = new System.Drawing.Size(80, 25);
+            this.layoutControlItem6.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
+            this.layoutControlItem6.Size = new System.Drawing.Size(80, 28);
             this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem6.TextVisible = false;
@@ -301,11 +304,12 @@
             // layoutControlItem7
             // 
             this.layoutControlItem7.Control = this.txtCountPerPage;
-            this.layoutControlItem7.Location = new System.Drawing.Point(30, 428);
+            this.layoutControlItem7.Location = new System.Drawing.Point(30, 441);
             this.layoutControlItem7.MaxSize = new System.Drawing.Size(80, 25);
             this.layoutControlItem7.MinSize = new System.Drawing.Size(80, 25);
             this.layoutControlItem7.Name = "layoutControlItem7";
-            this.layoutControlItem7.Size = new System.Drawing.Size(80, 25);
+            this.layoutControlItem7.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
+            this.layoutControlItem7.Size = new System.Drawing.Size(80, 28);
             this.layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem7.TextVisible = false;
@@ -313,11 +317,11 @@
             // simpleLabelItem1
             // 
             this.simpleLabelItem1.AllowHotTrack = false;
-            this.simpleLabelItem1.Location = new System.Drawing.Point(0, 428);
-            this.simpleLabelItem1.MaxSize = new System.Drawing.Size(30, 25);
-            this.simpleLabelItem1.MinSize = new System.Drawing.Size(30, 25);
+            this.simpleLabelItem1.Location = new System.Drawing.Point(0, 441);
+            this.simpleLabelItem1.MaxSize = new System.Drawing.Size(30, 28);
+            this.simpleLabelItem1.MinSize = new System.Drawing.Size(30, 28);
             this.simpleLabelItem1.Name = "simpleLabelItem1";
-            this.simpleLabelItem1.Size = new System.Drawing.Size(30, 25);
+            this.simpleLabelItem1.Size = new System.Drawing.Size(30, 28);
             this.simpleLabelItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.simpleLabelItem1.Text = "每页";
             this.simpleLabelItem1.TextSize = new System.Drawing.Size(24, 14);
@@ -325,12 +329,12 @@
             // simpleLabelItem2
             // 
             this.simpleLabelItem2.AllowHotTrack = false;
-            this.simpleLabelItem2.Location = new System.Drawing.Point(110, 428);
+            this.simpleLabelItem2.Location = new System.Drawing.Point(110, 441);
             this.simpleLabelItem2.MaxSize = new System.Drawing.Size(38, 25);
             this.simpleLabelItem2.MinSize = new System.Drawing.Size(38, 25);
             this.simpleLabelItem2.Name = "simpleLabelItem2";
             this.simpleLabelItem2.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 20, 2, 2);
-            this.simpleLabelItem2.Size = new System.Drawing.Size(38, 25);
+            this.simpleLabelItem2.Size = new System.Drawing.Size(38, 28);
             this.simpleLabelItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.simpleLabelItem2.Text = "条";
             this.simpleLabelItem2.TextSize = new System.Drawing.Size(24, 14);
@@ -338,11 +342,12 @@
             // layoutControlItem8
             // 
             this.layoutControlItem8.Control = this.btnGo;
-            this.layoutControlItem8.Location = new System.Drawing.Point(603, 428);
+            this.layoutControlItem8.Location = new System.Drawing.Point(619, 441);
             this.layoutControlItem8.MaxSize = new System.Drawing.Size(24, 24);
             this.layoutControlItem8.MinSize = new System.Drawing.Size(24, 24);
             this.layoutControlItem8.Name = "layoutControlItem8";
-            this.layoutControlItem8.Size = new System.Drawing.Size(24, 25);
+            this.layoutControlItem8.Padding = new DevExpress.XtraLayout.Utils.Padding(2, 2, 5, 2);
+            this.layoutControlItem8.Size = new System.Drawing.Size(24, 28);
             this.layoutControlItem8.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem8.TextVisible = false;
@@ -350,9 +355,9 @@
             // emptySpaceItem1
             // 
             this.emptySpaceItem1.AllowHotTrack = false;
-            this.emptySpaceItem1.Location = new System.Drawing.Point(304, 428);
+            this.emptySpaceItem1.Location = new System.Drawing.Point(304, 441);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(219, 25);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(235, 28);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
             // layoutControlItem4
@@ -360,7 +365,7 @@
             this.layoutControlItem4.Control = this.txtSat;
             this.layoutControlItem4.Location = new System.Drawing.Point(0, 28);
             this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(627, 24);
+            this.layoutControlItem4.Size = new System.Drawing.Size(643, 24);
             this.layoutControlItem4.Text = "卫星";
             this.layoutControlItem4.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.CustomSize;
             this.layoutControlItem4.TextSize = new System.Drawing.Size(50, 20);

+ 59 - 8
XdCxRhDW.App/UserControl/CtrlXl.cs

@@ -49,7 +49,8 @@ namespace XdCxRhDW.App.UserControl
 
         private async void CtrlXl_Load(object sender, EventArgs e)
         {
-            gridXl.UseDefault(list).UseRowNumber().UseDeleteAsync<XlInfo>(Del).UseExportXlsx()
+            gridXl.UseDefault(list).UseRowNumber().UseDeleteAsync<XlInfo>(Del)
+                .UseClearAsync<XlInfo>(Clear).UseExportXlsx()
             .AddMenu("星历推算", SvgHelper.LoadFromFile("Image\\XlCalc.svg"), () =>
             {
                 var ids = gridView1.GetSelectedRows();
@@ -59,12 +60,18 @@ namespace XdCxRhDW.App.UserControl
                     return;
                 }
                 var item = gridView1.GetRow(ids[0]) as XlInfo;
-
-                List<XlInfo> xlInfos = new List<XlInfo>();
-                xlInfos.Add(item);
-
-                XlCalculateForm form = new XlCalculateForm(xlInfos);
+                XlCalculateForm form = new XlCalculateForm(item.TwoLine);
                 form.ShowDialog();
+            })
+            .AddMenu("刷新数据", SvgHelper.CreateRefresh(), async () =>
+            {
+                currentPage = 1;
+                dataNavigator1.Buttons.First.Enabled = false;
+                dataNavigator1.Buttons.PrevPage.Enabled = false;
+                dataNavigator1.Buttons.Last.Enabled = true;
+                dataNavigator1.Buttons.NextPage.Enabled = true;
+                dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
+                await LoadPageData(currentPage);
             });
             await LoadData(1);
             dataNavigator1.TextStringFormat = $"第{currentPage}页/共{maxPage}页";
@@ -95,6 +102,14 @@ namespace XdCxRhDW.App.UserControl
             list.Clear();
             list.AddRange(dtResult);
             gridView1.RefreshData();
+            if (maxPage == 1)
+            {
+                dataNavigator1.Buttons.First.Enabled = false;
+                dataNavigator1.Buttons.PrevPage.Enabled = false;
+                dataNavigator1.Buttons.Last.Enabled = false;
+                dataNavigator1.Buttons.NextPage.Enabled = false;
+            }
+
         }
         private async void btnImp_Click(object sender, EventArgs e)
         {
@@ -121,7 +136,7 @@ namespace XdCxRhDW.App.UserControl
             try
             {
                 XlImportDto dto = new XlImportDto() { File = file };
-                var result = await HttpHelper.PostRequestAsync<RecordRes>(SysConfig.GetUrl("Xl/ImportTleAsync"), dto, 120);
+                var result = await HttpHelper.PostRequestAsync<RecordRes>(SysConfig.GetUrl("Xl/ImportTleAsync"), dto);
                 if (result.code == 200)
                 {
                     DxHelper.MsgBoxHelper.ShowInfo($"星历导入成功.共导入{result.data.Count}条");
@@ -174,7 +189,38 @@ namespace XdCxRhDW.App.UserControl
                 this.Enabled = true;
             }
         }
+        private async Task<bool> Clear(List<XlInfo> list)
+        {
 
+            try
+            {
+                this.Enabled = false;
+                using (RHDWContext db = new RHDWContext())
+                {
+                    if (satCode == null)
+                    {
+                        db.XlInfos.RemoveRange(db.XlInfos);
+                    }
+                    else
+                    {
+                        db.XlInfos.RemoveRange(db.XlInfos.Where(p => p.SatCode == satCode.Value));
+                    }
+                    await db.SaveChangesAsync();
+                }
+                await LoadData(1);
+                return true;
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "清空星历时异常");
+                DxHelper.MsgBoxHelper.ShowError("清空星历时异常");
+                return false;
+            }
+            finally
+            {
+                this.Enabled = true;
+            }
+        }
         private async void dataNavigator1_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
         {
             if (e.Button.ButtonType == NavigatorButtonType.First)
@@ -199,11 +245,16 @@ namespace XdCxRhDW.App.UserControl
                 currentPage++;
                 dataNavigator1.Buttons.First.Enabled = true;
                 dataNavigator1.Buttons.PrevPage.Enabled = true;
-                if (currentPage == maxPage)
+                if (currentPage >= maxPage)
                 {
                     dataNavigator1.Buttons.Last.Enabled = false;
                     dataNavigator1.Buttons.NextPage.Enabled = false;
                 }
+                else
+                {
+                    dataNavigator1.Buttons.Last.Enabled = true;
+                    dataNavigator1.Buttons.NextPage.Enabled = true;
+                }
             }
             else if (e.Button.ButtonType == NavigatorButtonType.PrevPage)
             {

+ 3 - 0
XdCxRhDW.Entity/XlInfo.cs

@@ -12,6 +12,7 @@ namespace XdCxRhDW.Entity
     public class XlInfo : BaseEntity
     {
         [Display(Name = "卫星编号",AutoGenerateField = false)]
+        [Index]
         public int SatCode { get; set; }
         [Display(Name = "卫星名称",AutoGenerateField = false)]
 
@@ -21,9 +22,11 @@ namespace XdCxRhDW.Entity
         public string Sat => $"{SatName}({SatCode})";
 
         [Display(Name = "发布时间(UTC)")]
+        [Index]
         public DateTime TimeUTC { get; set; }
 
         [Display(Name = "轨道经度")]
+        [Index]
         public double? Lon { get; set; }
 
         [Display(Name = "双行根数1")]

+ 37 - 81
XdCxRhDW.Framework/HttpHelper.cs

@@ -24,60 +24,59 @@ public class HttpHelper
         /// </summary>
         public List<string> Files { get; set; }
     }
-    /// <summary>
-    /// 
-    /// </summary>
-    /// <typeparam name="T"></typeparam>
-    /// <param name="url"></param>
-    /// <param name="dto"></param>
-    /// <param name="timeoutSeconds"></param>
-    /// <param name="token"></param>
-    /// <returns></returns>
-    public static async Task<AjaxResult<T>> PostRequestAsync<T>(string url, object dto, int timeoutSeconds = 60, CancellationToken token = default)
+    static HttpHelper()
+    {
+        client = new HttpClient(new HttpClientHandler()
+        {
+            UseCookies = false,
+            UseDefaultCredentials = false,
+            UseProxy = false,
+            AllowAutoRedirect = false,
+        });
+        client.Timeout = TimeSpan.FromSeconds(60);
+        //client.MaxResponseContentBufferSize //该值默认为2GB
+
+        downLoadClient = new HttpClient(new HttpClientHandler()
+        {
+            UseCookies = false,
+            UseDefaultCredentials = false,
+            UseProxy = false,
+            AllowAutoRedirect = false,
+        });
+        downLoadClient.Timeout = TimeSpan.FromSeconds(180);
+    }
+
+    private static HttpClient client;
+    private static HttpClient downLoadClient;
+
+    public static async Task<AjaxResult<T>> PostRequestAsync<T>(string url, object dto, CancellationToken token = default)
     {
         var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
-        var handler = new HttpClientHandler() { UseCookies = false };
-        HttpClient client = new HttpClient(handler);
-        client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);
         var message = new HttpRequestMessage(HttpMethod.Post, url);
         message.Content = content;
-
         var response = await client.SendAsync(message, token);
+        message.Dispose();//http1.1没啥用,http2有用
         response.EnsureSuccessStatusCode();
         var result = await response.Content.ReadAsStringAsync();
         var AjaxResult = JsonConvert.DeserializeObject<AjaxResult<T>>(result);
         return AjaxResult;
     }
 
-    /// <summary>
-    /// 
-    /// </summary>
-    /// <param name="url"></param>
-    /// <param name="dto"></param>
-    /// <param name="token"></param>
-    /// <param name="timeoutSeconds"></param>
-    /// <returns></returns>
-    public static async Task<AjaxResult> PostRequestAsync(string url, object dto, int timeoutSeconds = 60, CancellationToken token = default)
+    public static async Task<AjaxResult> PostRequestAsync(string url, object dto, CancellationToken token = default)
     {
         var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
-        var handler = new HttpClientHandler() { UseCookies = false };
-        HttpClient client = new HttpClient(handler);
-        client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);
         var message = new HttpRequestMessage(HttpMethod.Post, url);
         message.Content = content;
-
         var response = await client.SendAsync(message, token);
+        message.Dispose();//http1.1没啥用,http2有用
         response.EnsureSuccessStatusCode();
         var result = await response.Content.ReadAsStringAsync();
         var AjaxResult = JsonConvert.DeserializeObject<AjaxResult>(result);
         return AjaxResult;
     }
 
-    public static async Task<AjaxResult<T>> GetRequestAsync<T>(string url, int timeoutSeconds = 60)
+    public static async Task<AjaxResult<T>> GetRequestAsync<T>(string url)
     {
-        var handler = new HttpClientHandler() { UseCookies = false };
-        HttpClient client = new HttpClient(handler);
-        client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);
         var response = await client.GetAsync(url);
         response.EnsureSuccessStatusCode();
         var result = await response.Content.ReadAsStringAsync();
@@ -85,23 +84,13 @@ public class HttpHelper
         return AjaxResult;
     }
 
-    /// <summary>
-    /// 
-    /// </summary>
-    /// <param name="baseUrl"></param>
-    /// <param name="remoteFileName"></param>
-    /// <param name="localFile"></param>
-    /// <param name="timeoutSeconds"></param>
-    /// <returns></returns>
-    public static async Task<bool> DownloadFileAsync(string baseUrl, string remoteFileName, string localFile, int timeoutSeconds = 30)
+    public static async Task<bool> DownloadFileAsync(string baseUrl, string remoteFileName, string localFile)
     {
         baseUrl = baseUrl.Replace("/api", "");
         if (!baseUrl.EndsWith("/"))
             baseUrl += "/";
         var server = new Uri(baseUrl + $"wwwroot/{remoteFileName}");
-        var httpClient = new HttpClient();
-        httpClient.Timeout = TimeSpan.FromSeconds(timeoutSeconds);
-        var responseMessage = await httpClient.GetAsync(server);
+        var responseMessage = await downLoadClient.GetAsync(server);
         if (responseMessage.IsSuccessStatusCode)
         {
             using (var fs = File.Create(localFile))
@@ -115,6 +104,7 @@ public class HttpHelper
         else
             return false;
 
+
     }
 
     /// <summary>
@@ -122,10 +112,9 @@ public class HttpHelper
     /// </summary>
     /// <param name="localFile"></param>
     /// <param name="baseUrl"></param>
-    /// <param name="timeoutSeconds"></param>
     /// <param name="token"></param>
     /// <returns></returns>
-    public static async Task<string> UploadFileAsync(string localFile, string baseUrl, int timeoutSeconds = 30, CancellationToken token = default)
+    public static async Task<string> UploadFileAsync(string localFile, string baseUrl, CancellationToken token = default)
     {
         string uploadUrl = baseUrl;
         if (baseUrl.EndsWith("/"))
@@ -145,13 +134,10 @@ public class HttpHelper
             MultipartFormDataContent content = new MultipartFormDataContent();
             ByteArrayContent fileContent = new ByteArrayContent(fileBytes);
             content.Add(fileContent, "file", Path.GetFileName(localFile));
-            var handler = new HttpClientHandler() { UseCookies = false };
-            HttpClient client = new HttpClient(handler);
-            client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);
             var message = new HttpRequestMessage(HttpMethod.Post, uploadUrl);
             message.Content = content;
-
-            var response = await client.SendAsync(message, token);
+            var response = await downLoadClient.SendAsync(message, token);
+            message.Dispose();
             response.EnsureSuccessStatusCode();
             var result = await response.Content.ReadAsStringAsync();
             var AjaxResult = JsonConvert.DeserializeObject<AjaxResult<string>>(result);
@@ -178,33 +164,6 @@ public class HttpHelper
         }
     }
 
-
-    /// <summary>
-    /// 删除文件
-    /// </summary>
-    /// <param name="files">要删除的文件</param>
-    /// <param name="baseUrl">baseUrl</param>
-    /// <returns></returns>
-    public static async Task<int> DeleteFileAsync(string[] files, string baseUrl)
-    {
-        FileDeleteDto dto = new FileDeleteDto()
-        {
-            Files = files.ToList()
-        };
-        var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
-        var handler = new HttpClientHandler() { UseCookies = false };
-        HttpClient client = new HttpClient(handler);
-        client.Timeout = TimeSpan.FromSeconds(30);
-        var message = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/File/DeleteFiles");
-        message.Content = content;
-
-        var response = await client.SendAsync(message);
-        response.EnsureSuccessStatusCode();
-        var result = await response.Content.ReadAsStringAsync();
-        var AjaxResult = JsonConvert.DeserializeObject<AjaxResult<int>>(result);
-        return AjaxResult.data;
-    }
-
     /// <summary>
     /// 删除文件
     /// </summary>
@@ -218,13 +177,10 @@ public class HttpHelper
             Files = files.ToList()
         };
         var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
-        var handler = new HttpClientHandler() { UseCookies = false };
-        HttpClient client = new HttpClient(handler);
-        client.Timeout = TimeSpan.FromSeconds(30);
         var message = new HttpRequestMessage(HttpMethod.Post, baseUrl + "/File/DeleteFiles");
         message.Content = content;
-
         var response = await client.SendAsync(message);
+        message.Dispose();
         response.EnsureSuccessStatusCode();
         var result = await response.Content.ReadAsStringAsync();
         var AjaxResult = JsonConvert.DeserializeObject<AjaxResult<int>>(result);

+ 1 - 1
XdCxRhDW.Repostory/XlRepository.cs

@@ -51,7 +51,7 @@ namespace XdCxRhDW.Repostory
         {
             using (RHDWContext db = new RHDWContext())
             {
-                string sql = "select * from XlInfo where id in (select max(id) maxid from xlinfo GROUP BY SatCode )";
+                string sql = "select * from XlInfo where id in (select max(id) maxid from xlinfo group by satcode) order by satcode";
                 var data = await db.Database.SqlQuery<XlInfo>(sql).ToListAsync();
                 var sats = data.Select(p => new SatInfo()
                 {

+ 1 - 1
XdCxRhDW.WebApi/AutofacUtil.cs

@@ -17,6 +17,6 @@ public class AutofacUtil
     /// <returns></returns>
     public static T GetService<T>() where T : class
     {
-        return Container.Resolve<T>();
+        return Container?.Resolve<T>();
     }
 }

+ 3 - 0
XdCxRhDw.Dto/PosDto/X3TwoDtoNoParPosDto.cs

@@ -41,6 +41,9 @@ namespace XdCxRhDW.Dto
         [RangeInt(0, 100000)]
         public int Adja2Code { get; set; }
 
+        /// <summary>
+        /// 主邻1时差
+        /// </summary>
         public double Dto1 { get; set; }
 
         /// <summary>