zoulei 1 year ago
parent
commit
9e707d1ca4
49 changed files with 453 additions and 239 deletions
  1. 35 0
      Service/CheckServer/MainForm.cs
  2. 36 0
      Service/CpuCgServer/MainForm.cs
  3. 36 0
      Service/GpuCgServer/MainForm.cs
  4. 6 5
      Service/X2D1NoRefTaskServer/Service/TaskService.cs
  5. 94 63
      XdCxRhDW.Api/AddIns/定位/PosApi.cs
  6. 10 10
      XdCxRhDW.Api/AddIns/星历推算/EphHelper.cs
  7. 36 16
      XdCxRhDW.App/Controllers/DetectCgController.cs
  8. 16 0
      XdCxRhDW.App/Controllers/PosController.cs
  9. 8 2
      XdCxRhDW.App/CorTools/CgImageForm.cs
  10. 9 33
      XdCxRhDW.App/CorTools/DetectToolForm.cs
  11. 6 6
      XdCxRhDW.App/EditForms/RHDTOParamEditor.cs
  12. 0 1
      XdCxRhDW.App/EditForms/SigEditor.Designer.cs
  13. 4 5
      XdCxRhDW.App/EditForms/X1D1DTOParamEditor.cs
  14. 7 7
      XdCxRhDW.App/EditForms/X2D1DTOParamEditor.cs
  15. 0 3
      XdCxRhDW.App/EditForms/X2DTOParamEditor.cs
  16. 10 6
      XdCxRhDW.App/EditForms/X3DTOParamEditor.cs
  17. 11 7
      XdCxRhDW.App/EditForms/X3DfoParamEditor.cs
  18. 33 0
      XdCxRhDW.App/MainForm.cs
  19. 9 0
      XdCxRhDW.App/UserControl/CtrlHome.cs
  20. 1 3
      XdCxRhDW.App/UserControl/X1D1GDOPParam.cs
  21. 2 4
      XdCxRhDW.App/UserControl/X2D1GDOPParam.cs
  22. 8 9
      XdCxRhDW.App/UserControl/X2DFGDOPParam.cs
  23. 10 12
      XdCxRhDW.App/UserControl/X3DFGDOPParam .cs
  24. 11 13
      XdCxRhDW.App/UserControl/X3GDOPParam.cs
  25. 9 3
      XdCxRhDW.Entity/CheckRes.cs
  26. 4 4
      XdCxRhDW.Framework/HttpHelper.cs
  27. 6 0
      XdCxRhDW.Sender/Form1.cs
  28. 0 21
      XdCxRhDW.WebApi/FileController.cs
  29. 5 0
      XdCxRhDw.Dto/DetectDto.cs
  30. 6 1
      XdCxRhDw.Dto/DetectResDto.cs
  31. 7 2
      XdCxRhDw.Dto/PosDto/CheckResDto.cs
  32. 1 0
      XdCxRhDw.Dto/PosDto/RHNoParPosDto.cs
  33. 1 1
      XdCxRhDw.Dto/PosDto/RHNoXlNoParPosDto.cs
  34. 1 0
      XdCxRhDw.Dto/PosDto/RHNoXlPosDto.cs
  35. 1 0
      XdCxRhDw.Dto/PosDto/RHPosDto.cs
  36. 1 0
      XdCxRhDw.Dto/PosDto/X1D1NoParPosDto.cs
  37. 1 0
      XdCxRhDw.Dto/PosDto/X1D1NoXlNoParPosDto.cs
  38. 1 0
      XdCxRhDw.Dto/PosDto/X1D1NoXlPosDto.cs
  39. 1 0
      XdCxRhDw.Dto/PosDto/X1D1PosDto.cs
  40. 1 0
      XdCxRhDw.Dto/PosDto/X2D1NoParPosDto.cs
  41. 1 0
      XdCxRhDw.Dto/PosDto/X2D1NoXlNoParlPosDto.cs
  42. 1 0
      XdCxRhDw.Dto/PosDto/X2DtoDfoNoXlPosDto.cs
  43. 1 0
      XdCxRhDw.Dto/PosDto/X2DtoDfoPosDto.cs
  44. 1 0
      XdCxRhDw.Dto/PosDto/X3TwoDfoNoXlPosDto.cs
  45. 1 0
      XdCxRhDw.Dto/PosDto/X3TwoDfoPosDto.cs
  46. 1 0
      XdCxRhDw.Dto/PosDto/X3TwoDtoNoParPosDto.cs
  47. 1 0
      XdCxRhDw.Dto/PosDto/X3TwoDtoNoXlNoParPosDto.cs
  48. 1 1
      XdCxRhDw.Dto/PosResDto.cs
  49. 1 1
      XdCxRhDw.Dto/XlCalcDto/XlCalcDto.cs

+ 35 - 0
Service/CheckServer/MainForm.cs

@@ -5,8 +5,10 @@ using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Diagnostics;
+using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using XdCxRhDW.Dto;
 using XdCxRhDW.WebApi;
@@ -65,6 +67,7 @@ namespace CheckServer
                 url = posPlatformAddr + "api/SvrReport/Report";
             else
                 url = posPlatformAddr + "/api/SvrReport/Report";
+            _=ClearLocalFile();
             bool preSucceed = false;
             while (!this.Disposing)
             {
@@ -128,5 +131,37 @@ namespace CheckServer
                 LogHelper.Error("状态上报异常", ex);
             }
         }
+
+        //清理10分钟之前的文件
+        private async Task ClearLocalFile()
+        {
+            while (true)
+            {
+                try
+                {
+                    var uploadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot");
+                    var files = Directory.EnumerateFiles(uploadFolder);
+                    foreach (var file in files)
+                    {
+                        FileInfo info = new FileInfo(file);
+                        if (info.CreationTime < DateTime.Now.AddMinutes(-10))
+                        {
+                            try
+                            {
+                                info.Delete();
+                            }
+                            catch
+                            {
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, "清理wwwroot历史文件异常");
+                }
+                await Task.Delay(3600 * 1000);
+            }
+        }
     }
 }

+ 36 - 0
Service/CpuCgServer/MainForm.cs

@@ -4,8 +4,10 @@ using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Diagnostics;
+using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using XdCxRhDW.Dto;
 using XdCxRhDW.WebApi;
@@ -66,6 +68,7 @@ namespace CpuCgServer
                 url = posPlatformAddr + "api/SvrReport/Report";
             else
                 url = posPlatformAddr + "/api/SvrReport/Report";
+            _ = ClearLocalFile();
             bool preSucceed = false;
             while (!this.Disposing)
             {
@@ -129,5 +132,38 @@ namespace CpuCgServer
                 LogHelper.Error("状态上报异常", ex);
             }
         }
+
+
+        //清理10分钟之前的文件
+        private async Task ClearLocalFile()
+        {
+            while (true)
+            {
+                try
+                {
+                    var uploadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot");
+                    var files = Directory.EnumerateFiles(uploadFolder);
+                    foreach (var file in files)
+                    {
+                        FileInfo info = new FileInfo(file);
+                        if (info.CreationTime < DateTime.Now.AddMinutes(-10))
+                        {
+                            try
+                            {
+                                info.Delete();
+                            }
+                            catch
+                            {
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, "清理wwwroot历史文件异常");
+                }
+                await Task.Delay(3600 * 1000);
+            }
+        }
     }
 }

+ 36 - 0
Service/GpuCgServer/MainForm.cs

@@ -4,8 +4,10 @@ using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Diagnostics;
+using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using XdCxRhDW.Dto;
 using XdCxRhDW.WebApi;
@@ -64,6 +66,7 @@ namespace GpuCgServer
                 url = posPlatformAddr + "api/SvrReport/Report";
             else
                 url = posPlatformAddr + "/api/SvrReport/Report";
+            _ = ClearLocalFile();
             bool preSucceed = false;
             while (!this.Disposing)
             {
@@ -127,5 +130,38 @@ namespace GpuCgServer
                 LogHelper.Error("状态上报异常", ex);
             }
         }
+
+
+        //清理10分钟之前的文件
+        private async Task ClearLocalFile()
+        {
+            while (true)
+            {
+                try
+                {
+                    var uploadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot");
+                    var files = Directory.EnumerateFiles(uploadFolder);
+                    foreach (var file in files)
+                    {
+                        FileInfo info = new FileInfo(file);
+                        if (info.CreationTime < DateTime.Now.AddMinutes(-10))
+                        {
+                            try
+                            {
+                                info.Delete();
+                            }
+                            catch
+                            {
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, "清理wwwroot历史文件异常");
+                }
+                await Task.Delay(3600 * 1000);
+            }
+        }
     }
 }

+ 6 - 5
Service/X2D1NoRefTaskServer/Service/TaskService.cs

@@ -172,6 +172,7 @@ namespace X2D1NoRefTaskServer.Service
                                         dmcType = taskSig.SigType,//上行信号检测目前的算法只能使用基于能量的KY或IBS检测
                                         fsHz = minfo.FsHz,
                                         mergeRes = true,
+                                        SigProc = true,
                                     };
                                     detectDto.dmcType = detectDto.dmcType & ~EnumSigCheckTypeDto.DAMA;//DAMA不支持上行信号检测,在这里移除掉
                                     if (detectDto.dmcType == EnumSigCheckTypeDto.DAMA)
@@ -221,7 +222,7 @@ namespace X2D1NoRefTaskServer.Service
                                         continue;
                                     }
                                     LogHelper.Info($"【任务{dto.ID}】信号{taskSig.FreqUp / 1e6:f3},{capTime:yyyyMMddHHmmss}时刻邻星超短CPU参估完成");
-                                    await HttpHelper.DeleteFileAsync(new string[] { mainFile, adjaFile, cdbFile }, baseUrl);
+                                    await HttpHelper.DeleteFileAsync(baseUrl, mainFile, adjaFile, cdbFile);
                                     var data1 = result1.data;
                                     var data2 = result2.data;
                                     if (data1.Count != data2.Count || data1.Count != deteResp.data.Count)
@@ -234,9 +235,6 @@ namespace X2D1NoRefTaskServer.Service
                                         try
                                         {
                                             if (cts.IsCancellationRequested) break;
-
-
-
                                             X2D1NoXlNoParlPosDto x2D1 = new X2D1NoXlNoParlPosDto()
                                             {
                                                 TaskID = dto.ID,
@@ -260,6 +258,7 @@ namespace X2D1NoRefTaskServer.Service
                                                     SmpStart = deteResp.data[i].Start,
                                                     UserName = deteResp.data[i].UserName,
                                                     PosCheckType = deteResp.data[i].DmcType.GetEnumByDisplayName<EnumPosCheckTypeDto>(),
+                                                    FfcHz = deteResp.data[i].FfcHz,
                                                 }
                                             };
                                             if (data1[i].Snr > 0 && data2[i].Snr > 0)
@@ -480,6 +479,8 @@ namespace X2D1NoRefTaskServer.Service
                                         file1 = cdbFile,//11局使用上行泄露信号进行检测
                                         dmcType = taskSig.SigType,//上行信号检测目前的算法只能使用基于能量的KY或IBS检测
                                         fsHz = minfo.FsHz,
+                                        mergeRes = true,
+                                        SigProc = true,
                                     };
                                     detectDto.dmcType = detectDto.dmcType & ~EnumSigCheckTypeDto.DAMA;//DAMA不支持上行信号检测,在这里移除掉
                                     if (detectDto.dmcType == EnumSigCheckTypeDto.DAMA)
@@ -529,7 +530,7 @@ namespace X2D1NoRefTaskServer.Service
                                         continue;
                                     }
                                     LogHelper.Info($"【任务{dto.ID}】信号{taskSig.FreqUp / 1e6:f3},{capTime:yyyyMMddHHmmss}时刻邻星超短CPU参估完成");
-                                    await HttpHelper.DeleteFileAsync(new string[] { mainFile, adjaFile, cdbFile }, baseUrl);
+                                    await HttpHelper.DeleteFileAsync(baseUrl,mainFile,adjaFile,cdbFile);
                                     var data1 = result1.data;
                                     var data2 = result2.data;
                                     if (data1.Count != data2.Count || data1.Count != deteResp.data.Count)

+ 94 - 63
XdCxRhDW.Api/AddIns/定位/PosApi.cs

@@ -15,7 +15,7 @@ namespace XdCxRhDW.Api
     public static class PosApi
     {
         //置信度统计次数
-        private static int confidenceCount = 100;
+        private static int confidenceCount = 10000;
 
         //置信度有效距离(m)
         private static int confidenceDistance = 10000;
@@ -125,7 +125,7 @@ namespace XdCxRhDW.Api
 
 
         /// <summary>
-        /// 两星一地解析定位(精度差速度快,主要用于置信度分析等需要多次调用的情况)
+        /// 两星一地带参解析定位(精度差速度快,主要用于置信度分析等需要多次调用的情况)
         /// </summary>
         /// <param name="cgRes"></param>
         /// <param name="sRes"></param>
@@ -149,6 +149,33 @@ namespace XdCxRhDW.Api
             DW_Analysis(mainSat, adjaSat, cdbStation, refStation, dto1, -dtoCdb, ybDto, -ybDto1, posRes, 1);
             return posRes;
         }
+        /// <summary>
+        /// 三星双时差带参解析定位(精度差速度快,主要用于置信度分析等需要多次调用的情况)
+        /// </summary>
+        /// <param name="cgRes"></param>
+        /// <param name="sRes"></param>
+        /// <returns></returns>
+        public static double[] X3Dto_GzPos(CgRes cgRes, StationRes sRes)
+        {
+            if (cgRes.Dto1.Value == 0 || cgRes.Dto2.Value == 0)
+            {
+                return new double[7] { 999, 999, 0, 999, 999, 0, 100 };
+            }
+            double[] mainSat = new double[3] { cgRes.MainX.Value, cgRes.MainY.Value, cgRes.MainZ.Value };
+            double[] adja1Sat = new double[3] { cgRes.Adja1X.Value, cgRes.Adja1Y.Value, cgRes.Adja1Z.Value };
+            double[] adja2Sat = new double[3] { cgRes.Adja2X.Value, cgRes.Adja2Y.Value, cgRes.Adja2Z.Value };
+            double[] refStation = new double[3] { sRes.RefLon.Value, sRes.RefLat.Value, 0 };
+            double dto1 = cgRes.Dto1.Value / 1e6;
+            double dto2 = cgRes.Dto2.Value / 1e6;
+            double ybDto1 = cgRes.YbMainDto.Value / 1e6;
+            double ybDto2 = cgRes.YbAdja1Dto.Value / 1e6;
+            double ybDto3 = cgRes.YbAdja2Dto.Value / 1e6;
+            double refDto1 = ybDto1 - ybDto2;
+            double refDto2 = ybDto1 - ybDto3;
+            double[] posRes = new double[3];
+            DW_Analysis(mainSat, adja1Sat, adja2Sat, refStation, dto1, dto2, refDto1, refDto2, posRes, 0);
+            return posRes;
+        }
 
         /// <summary>
         /// 两星一地带参,返回经度、纬度、高度、镜像点、置信度,数组长度为7
@@ -177,36 +204,42 @@ namespace XdCxRhDW.Api
             X2D1_Pos20240305_Core(mainSat, adjaSat, cdbStation, satStation, satStation, satStation, satStation, satStation, refStation, zone, dto1, dtoCdb, ybDto1, ybDto2, res);
             ConvertToGeoPoint(res);
             var posRes = ConvertToGeoPoint(res);//精确搜索值
-
-            var posResGz = X2D1_GzPos(cgRes, sRes);
-            if (IsGeoPoint2(posRes) && IsGeoPoint2(posResGz))
+            if (CalcConfidence&& IsGeoPoint2(posRes))
             {
-                int succeedCount = 0;
-                var cgResNew = cgRes.Clone();
-                for (int i = 0; i < confidenceCount; i++)
+                var posResGz = X2D1_GzPos(cgRes, sRes);
+                if (IsGeoPoint2(posResGz))
                 {
-                    cgResNew.MainX = cgRes.MainX + RandomHelper.Normal(0, 200);
-                    cgResNew.MainY = cgRes.MainY + RandomHelper.Normal(0, 200);
-                    cgResNew.MainZ = cgRes.MainZ + RandomHelper.Normal(0, 200);
-                    cgResNew.Adja1X = cgRes.Adja1X + RandomHelper.Normal(0, 200);
-                    cgResNew.Adja1Y = cgRes.Adja1Y + RandomHelper.Normal(0, 200);
-                    cgResNew.Adja1Z = cgRes.Adja1Z + RandomHelper.Normal(0, 200);
-                    cgResNew.Dto1 = (cgRes.Dto1 * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    cgResNew.DtoCdb = (cgRes.DtoCdb * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    cgResNew.YbMainDto = (cgRes.YbMainDto * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    cgResNew.YbAdja1Dto = (cgRes.YbAdja1Dto * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    res = X2D1_GzPos(cgResNew, sRes);
-                    var posResNew = ConvertToGeoPoint(res);
-                    if (IsGeoPoint2(posResNew))
+                    int succeedCount = 0;
+                    var cgResNew = cgRes.Clone();
+                    for (int i = 0; i < confidenceCount; i++)
                     {
-                        var distance = PhysicsHelper.DistanceGeo((posResGz[0], posResGz[1], 0), (posResNew[0], posResNew[1], 0));
-                        if (distance <= confidenceDistance)
+                        cgResNew.MainX = cgRes.MainX + RandomHelper.Normal(0, 500);
+                        cgResNew.MainY = cgRes.MainY + RandomHelper.Normal(0, 500);
+                        cgResNew.MainZ = cgRes.MainZ + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja1X = cgRes.Adja1X + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja1Y = cgRes.Adja1Y + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja1Z = cgRes.Adja1Z + RandomHelper.Normal(0, 500);
+                        cgResNew.Dto1 = (cgRes.Dto1 * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.DtoCdb = (cgRes.DtoCdb * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.YbMainDto = (cgRes.YbMainDto * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.YbAdja1Dto = (cgRes.YbAdja1Dto * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        res = X2D1_GzPos(cgResNew, sRes);
+                        var posResNew = ConvertToGeoPoint(res);
+                        if (IsGeoPoint2(posResNew))
                         {
-                            succeedCount++;
+                            var distance = PhysicsHelper.DistanceGeo((posResGz[0], posResGz[1], 0), (posResNew[0], posResNew[1], 0));
+                            if (distance <= confidenceDistance)
+                            {
+                                succeedCount++;
+                            }
                         }
                     }
+                    posRes[6] = (int)(succeedCount / (double)confidenceCount * 100);
+                }
+                else
+                {
+                    posRes[6] = 0;
                 }
-                posRes[6] = (int)(succeedCount / (double)confidenceCount * 100);
             }
             return posRes;
         }
@@ -368,49 +401,47 @@ namespace XdCxRhDW.Api
             double[] res = new double[6];
             X3_Pos20240305_Core(mainSat, adjaSat1, adjaSat2, satStation, satStation, satStation, satStation,
                 satStation, satStation, refStation, zone, tarDto1, tarDto2, refDto1, refDto2, res);
-            ConvertToGeoPoint(res);
-            var posRes = ConvertToGeoPoint(res);
+            var posRes = ConvertToGeoPoint(res);//精确搜索值
             if (CalcConfidence && IsGeoPoint2(posRes))
             {
-                int succeedCount = 0;
-                for (int i = 0; i < confidenceCount; i++)
+                var posResGz = X3Dto_GzPos(cgRes, sRes);
+                if (IsGeoPoint2(posResGz))
                 {
-                    var mainSatNew = new double[3]
-                    {
-                        cgRes.MainX.Value+RandomHelper.Normal(0,200),
-                        cgRes.MainY.Value+RandomHelper.Normal(0,200),
-                        cgRes.MainZ.Value+RandomHelper.Normal(0,200)
-
-                    };
-                    var adjaSat1New = new double[3]
-                    {
-                        cgRes.Adja1X.Value+RandomHelper.Normal(0,200),
-                        cgRes.Adja1Y.Value+RandomHelper.Normal(0,200),
-                        cgRes.Adja1Z.Value+RandomHelper.Normal(0,200)
-                    };
-                    var adjaSat2New = new double[3]
+                    int succeedCount = 0;
+                    var cgResNew = cgRes.Clone();
+                    for (int i = 0; i < confidenceCount; i++)
                     {
-                        cgRes.Adja2X.Value+RandomHelper.Normal(0,200),
-                        cgRes.Adja2Y.Value+RandomHelper.Normal(0,200),
-                        cgRes.Adja2Z.Value+RandomHelper.Normal(0,200)
-                    };
-                    var tarDto1New = (tarDto1 * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    var tarDto2New = (tarDto2 * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    var refDto1New = (refDto1 * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-                    var refDto2New = (refDto2 * 1e6 + RandomHelper.Normal(0, 1)) / 1e6;
-
-                    X3_Pos20240305_Core(mainSatNew, adjaSat1New, adjaSat2New, satStation, satStation, satStation, satStation, satStation, satStation, refStation, zone, tarDto1New, tarDto2New, refDto1New, refDto2New, res);
-                    var posResNew = ConvertToGeoPoint(res);
-                    if (IsGeoPoint2(posResNew))
-                    {
-                        var distance = PhysicsHelper.DistanceGeo((posRes[0], posRes[1], 0), (posResNew[0], posResNew[1], 0));
-                        if (distance <= confidenceDistance)
+                        cgResNew.MainX = cgRes.MainX + RandomHelper.Normal(0, 500);
+                        cgResNew.MainY = cgRes.MainY + RandomHelper.Normal(0, 500);
+                        cgResNew.MainZ = cgRes.MainZ + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja1X = cgRes.Adja1X + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja1Y = cgRes.Adja1Y + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja1Z = cgRes.Adja1Z + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja2X = cgRes.Adja2X + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja2Y = cgRes.Adja2Y + RandomHelper.Normal(0, 500);
+                        cgResNew.Adja2Z = cgRes.Adja2Z + RandomHelper.Normal(0, 500);
+                        cgResNew.Dto1 = (cgRes.Dto1 * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.Dto2 = (cgRes.Dto2 * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.YbMainDto = (cgRes.YbMainDto * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.YbAdja1Dto = (cgRes.YbAdja1Dto * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        cgResNew.YbAdja2Dto = (cgRes.YbAdja2Dto * 1e6 + RandomHelper.Normal(0, 4)) / 1e6;
+                        res = X3Dto_GzPos(cgResNew, sRes);
+                        var posResNew = ConvertToGeoPoint(res);
+                        if (IsGeoPoint2(posResNew))
                         {
-                            succeedCount++;
+                            var distance = PhysicsHelper.DistanceGeo((posResGz[0], posResGz[1], 0), (posResNew[0], posResNew[1], 0));
+                            if (distance <= confidenceDistance)
+                            {
+                                succeedCount++;
+                            }
                         }
                     }
+                    posRes[6] = (int)(succeedCount / (double)confidenceCount * 100);
                 }
-                posRes[6] = (int)(succeedCount / (double)confidenceCount * 100);
+                else
+                {
+                    posRes[6] = 0;
+                }    
             }
             return posRes;
         }
@@ -627,7 +658,7 @@ namespace XdCxRhDW.Api
         {
             if (res == null || res.Length == 0)
             {
-                return new double[7] { 999, 999, 0, 999, 999, 0, 100 };
+                return new double[7] { 999, 999, 0, 999, 999, 0, -1 };
             }
             else if (res.Length != 3 && res.Length != 6)
             {
@@ -637,7 +668,7 @@ namespace XdCxRhDW.Api
             var list = res.Select(p => Math.Round(p, 4)).ToArray();
             if (list.Length == 3)
             {
-                list = list.Concat(new double[4] { 999, 999, 0, 100 }).ToArray();
+                list = list.Concat(new double[4] { 999, 999, 0, -1 }).ToArray();
             }
             list[2] = list[5] = 0;//高度
 
@@ -668,7 +699,7 @@ namespace XdCxRhDW.Api
             if (list.Length == 6)
             {
                 var listNew = list.ToList();
-                listNew.Add(100);
+                listNew.Add(-1);
                 list = listNew.ToArray();
             }
             return list;

+ 10 - 10
XdCxRhDW.Api/AddIns/星历推算/EphHelper.cs

@@ -27,16 +27,16 @@ namespace XdCxRhDW.Api
         /// 推算双行星历
         /// </summary>
         /// <param name="tleStr">双行根数</param>
-        /// <param name="dt">指定时刻(UTC)</param>
+        /// <param name="utcTime">指定时刻(UTC)</param>
         /// <returns></returns>
-        public static SatEphCore Calc(string tleStr, DateTime dt)
+        public static SatEphCore Calc(string tleStr, DateTime utcTime)
         {
             if (string.IsNullOrWhiteSpace(dll))
                 throw new Exception($"找不到{dll}");
             tleStr = tleStr.Replace(";", ";");
             var line1 = tleStr.Split(';')[0];
             var line2 = tleStr.Split(';')[1];
-            var timeSpan = (long)(dt - dtZero).TotalSeconds;
+            var timeSpan = (long)(utcTime - dtZero).TotalSeconds;
             double[] res = new double[6];
             GenerateXYZByPeriod(line1, line2, timeSpan, 1, 1, res);
             int satIdD = Convert.ToInt32(line2.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)[1]);
@@ -49,7 +49,7 @@ namespace XdCxRhDW.Api
             var dto= new SatEphCore()
             {
                 SatId = satIdD,
-                SatTime = dt,
+                SatTime = utcTime,
                 TleTime = tleTime,
                 X = Math.Round(res[0], 4),
                 Y = Math.Round(res[1], 4),
@@ -66,11 +66,11 @@ namespace XdCxRhDW.Api
         /// 批量推算双行星历
         /// </summary>
         /// <param name="tleStr">双行根数</param>
-        /// <param name="start">起始时刻(UTC)</param>
-        /// <param name="end">结束(UTC)</param>
+        /// <param name="startUtc">起始时刻(UTC)</param>
+        /// <param name="endUtc">结束(UTC)</param>
         /// <param name="spanSeconds">推算间隔(秒)</param>
         /// <returns></returns>
-        public static List<SatEphCore> CalcMult(string tleStr, DateTime start, DateTime end, int spanSeconds)
+        public static List<SatEphCore> CalcMult(string tleStr, DateTime startUtc, DateTime endUtc, int spanSeconds)
         {
             if (string.IsNullOrWhiteSpace(dll))
                 throw new Exception($"找不到{dll}");
@@ -80,8 +80,8 @@ namespace XdCxRhDW.Api
             tleStr = tleStr.Replace(";", ";");
             var line1 = tleStr.Split(';')[0];
             var line2 = tleStr.Split(';')[1];
-            var timeSpan = (long)(start - dtZero).TotalSeconds;
-            var c = (int)((end - start).TotalSeconds / spanSeconds + 1);
+            var timeSpan = (long)(startUtc - dtZero).TotalSeconds;
+            var c = (int)((endUtc - startUtc).TotalSeconds / spanSeconds + 1);
             double[] res = new double[6 * c];
             GenerateXYZByPeriod(line1, line2, timeSpan, spanSeconds, c, res);
             int satIdD = Convert.ToInt32(line2.Split(" ".ToArray(), StringSplitOptions.RemoveEmptyEntries)[1]);
@@ -97,7 +97,7 @@ namespace XdCxRhDW.Api
                 var dto = new SatEphCore()
                 {
                     SatId = satIdD,
-                    SatTime = start.AddSeconds(i / 6 * spanSeconds),
+                    SatTime = startUtc.AddSeconds(i / 6 * spanSeconds),
                     TleTime = tleTime,
                     X = Math.Round(res[i], 4),
                     Y = Math.Round(res[i + 1], 4),

+ 36 - 16
XdCxRhDW.App/Controllers/DetectCgController.cs

@@ -27,9 +27,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, dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, 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, 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);
             return res;
         }
 
@@ -42,9 +42,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,dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr,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, 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);
             return res;
         }
 
@@ -56,8 +56,8 @@ 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, dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, dto.TimeoutSeconds);
+            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);
             return res;
         }
@@ -70,9 +70,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,dto.TimeoutSeconds);
-            dto.file2 = await HttpHelper.UploadFileAsync(GetLocalFile(dto.file2), svr.BaseHttpAddr, 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, 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);
             return res;
         }
 
@@ -85,8 +85,28 @@ 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, 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, timeoutSeconds: dto.TimeoutSeconds);
+            var res = await HttpHelper.PostRequestAsync<List<DetectResDto>>(svr.BaseHttpAddr + "Check/Calc", dto, dto.TimeoutSeconds);
+            if (dto.SigProc)
+            {
+                SignalProcDto procDto = new SignalProcDto()
+                {
+                    File = dto.file1,
+                    Fs = (long)dto.fsHz,
+                    Smps = res.data.Select(p => new SmpPosition() { smpStart = p.Start, smpCount = p.Length }).ToList(),
+                };
+                var procRes = await HttpHelper.PostRequestAsync<List<SignalProcResDto>>(svr.BaseHttpAddr + "Check/SignalProc", procDto);
+                if (res.data.Count != procRes.data.Count)
+                {
+                    throw new Exception("信号识别结果个数和检测结果个数不一致");
+                }
+                for (int i = 0; i < res.data.Count; i++)
+                {
+                    res.data[i].ModRate = procRes.data[i].Rate;
+                    res.data[i].ModType = procRes.data[i].ModType.GetEnumDisplayName();
+                    res.data[i].FfcHz = procRes.data[i].Ffc;
+                }
+            }
             return res;
         }
 
@@ -112,9 +132,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, 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, 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);
             return res;
         }
     }

+ 16 - 0
XdCxRhDW.App/Controllers/PosController.cs

@@ -79,6 +79,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz= dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -195,6 +196,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -302,6 +304,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 ckRes = db.CheckRes.Add(ckRes);
 
@@ -444,6 +447,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -555,6 +559,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -688,6 +693,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -803,6 +809,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -944,6 +951,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1062,6 +1070,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1220,6 +1229,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1338,6 +1348,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1490,6 +1501,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1609,6 +1621,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1769,6 +1782,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -1893,6 +1907,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 
@@ -2032,6 +2047,7 @@ namespace XdCxRhDW.App.Controllers
                     ModRate = dto.CheckRes?.ModRate,
                     ModType = dto.CheckRes?.ModType,
                     UserName = dto.CheckRes?.UserName,
+                    FfcHz = dto.CheckRes?.FfcHz,
                 };
                 db.CheckRes.Add(ckRes);
 

+ 8 - 2
XdCxRhDW.App/CorTools/CgImageForm.cs

@@ -50,6 +50,8 @@ namespace XdCxRhDW.App.CorTools
             (this.chartControl1.AnnotationRepository[1] as TextAnnotation).TextColor = Color.White;
             (this.chartControl1.AnnotationRepository[2] as TextAnnotation).BackColor = bgColor;
             (this.chartControl1.AnnotationRepository[2] as TextAnnotation).TextColor = Color.White;
+            (this.chartControl1.Diagram as XYDiagram).EnableAxisXZooming = true;
+            (this.chartControl1.Diagram as XYDiagram).EnableAxisYZooming = true;
             (this.chartControl1.Diagram as XYDiagram).AxisX.Color = Color.White;
             (this.chartControl1.Diagram as XYDiagram).AxisX.Label.TextColor = Color.White;
             (this.chartControl1.Diagram as XYDiagram).AxisY.Color = Color.White;
@@ -79,17 +81,21 @@ namespace XdCxRhDW.App.CorTools
         private void Test_Load(object sender, EventArgs e)
         {
             chartControl1.QueryCursor += ChartControl1_QueryCursor;
+            List<SeriesPoint> listPoints = new List<SeriesPoint>();
             foreach (var item in list)
             {
                 double xValue = (item.XValue + item.XFlag) * 1e6 / item.FsHz;//us
-                this.chartControl1.Series[0].Points.Add(new SeriesPoint()
+                var point = new SeriesPoint()
                 {
                     Argument = xValue.ToString(),
                     Values = new double[1] { item.YValue },
                     Color = item.GetColor(),
                     Tag = item.Snr.ToString("f1"),
-                });
+                };
+                listPoints.Add(point);
             }
+            this.chartControl1.Series[0].Points.AddRange(listPoints.ToArray());
+
         }
 
 

+ 9 - 33
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -129,6 +129,7 @@ namespace XdCxRhDW.App.CorTools
                         Serilog.Log.Error(ex, "CPU多时隙参估计算异常");
                         DxHelper.MsgBoxHelper.ShowError($"CPU多时隙参估计算异常");
                     }
+                    await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), file1, file2);
                     layoutControl1.Enabled = true;
                 }, false)
                 .AddContentMenu<CafResultDto>("信号识别", SvgHelper.CreateSigProc(), async data =>
@@ -173,12 +174,14 @@ namespace XdCxRhDW.App.CorTools
                         }
                         else
                         {
+                            Serilog.Log.Error(result.msg);
                             DxHelper.MsgBoxHelper.ShowError(result.msg);
                         }
+                        await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), file1);
                     }
-                    catch
+                    catch (Exception ex)
                     {
-                        throw;
+                        Serilog.Log.Error(ex, "信号识别异常");
                     }
                     layoutControl1.Enabled = true;
                 }, false)
@@ -233,16 +236,7 @@ namespace XdCxRhDW.App.CorTools
             gridSource.Clear();
             try
             {
-                try
-                {
-                    dto.file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, SysConfig.GetBaseUrl());
-                }
-                catch (Exception ex)
-                {
-                    Serilog.Log.Error(ex, ex.Message);
-                    DxHelper.MsgBoxHelper.ShowError(ex.Message);
-                    return;
-                }
+                dto.file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, SysConfig.GetBaseUrl());
                 dto.fsHz = double.Parse(tefs.Text) * 1e6;
                 dto.band = double.Parse(txtBand.Text);
                 dto.TimeoutSeconds = int.Parse(txtTimeout.Text);
@@ -289,6 +283,7 @@ namespace XdCxRhDW.App.CorTools
                 Serilog.Log.Error(ex, "信号检测出错");
                 DxHelper.MsgBoxHelper.ShowError($"信号检测出错");
             }
+            await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), dto.file1);
             gridView1.RefreshData();
             gridView1.BestFitColumns();
             layoutControl1.Enabled = true;
@@ -329,6 +324,7 @@ namespace XdCxRhDW.App.CorTools
                 DxHelper.MsgBoxHelper.ShowError($"CPU文件参估参数错误");
                 return;
             }
+            await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), xItem.file1, xItem.file2);
             WriteIni();
             gridSource.Clear();
 
@@ -395,8 +391,8 @@ 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);
+                await HttpHelper.DeleteFileAsync(SysConfig.GetBaseUrl(), par.file1, par.file2);
                 if (resp.code != 200)
                 {
                     Serilog.Log.Error(resp.msg);
@@ -438,20 +434,6 @@ namespace XdCxRhDW.App.CorTools
             btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
             btnDrawImage.Enabled = btnCalc.Enabled;
             btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
-            if (chkDama.Checked)
-            {
-                //ckIBS.Checked = false;
-                //ckKY.Checked = false;
-                UserName.Visible = true;
-                modType.Visible = true;
-                modRate.Visible = true;
-            }
-            else
-            {
-                UserName.Visible = false;
-                modType.Visible = false;
-                modRate.Visible = false;
-            }
             layoutControl1.BestFit();
         }
         private void ckIBS_CheckedChanged(object sender, EventArgs e)
@@ -459,7 +441,6 @@ namespace XdCxRhDW.App.CorTools
             lciStartPos.Visibility = lciSampleLength.Visibility = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? LayoutVisibility.Never : LayoutVisibility.Always;
             btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
             btnDrawImage.Enabled = btnCalc.Enabled;
-
             btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
             if (ckIBS.Checked)
             {
@@ -481,11 +462,6 @@ namespace XdCxRhDW.App.CorTools
             btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
             btnDrawImage.Enabled = btnCalc.Enabled;
             btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
-            //if (ckKY.Checked)
-            //{
-            //    ckIBS.Checked = false;
-            //    chkDama.Checked = false;
-            //}
             layoutControl1.BestFit();
         }
 

+ 6 - 6
XdCxRhDW.App/EditForms/RHDTOParamEditor.cs

@@ -244,9 +244,9 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.MainCode.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var maineph = EphHelper.Calc(mainxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZMain.SetXYZ("主星", cg.MainCode.Value, (maineph.X, maineph.Y, maineph.Z), Color.Red);
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZMain.SetXYZ("主星", cg.MainCode.Value, (maineph.data.X, maineph.data.Y, maineph.data.Z), Color.Red);
 
                 var adjaxlInfo = await XlRepository.GetLatestAsync(cg.Adja1Code.Value, sigTime);
                 if (adjaxlInfo == null)
@@ -254,9 +254,9 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.Adja1Code.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adjaeph = EphHelper.Calc(adjaxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdaj.SetXYZ("邻星", cg.Adja1Code.Value, (adjaeph.X, adjaeph.Y, adjaeph.Z), Color.Red);
+                XlCalcDto = new XlCalcDto() { tleStr = adjaxlInfo.TwoLine, SigTime = sigTime };
+                var adjaeph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdaj.SetXYZ("邻星", cg.Adja1Code.Value, (adjaeph.data.X, adjaeph.data.Y, adjaeph.data.Z), Color.Red);
             }
             catch (Exception ex)
             {

+ 0 - 1
XdCxRhDW.App/EditForms/SigEditor.Designer.cs

@@ -302,7 +302,6 @@
         private DevExpress.XtraEditors.ButtonEdit txtFreqDown;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
         private DevExpress.XtraEditors.ButtonEdit txtFreqUp;
-        private DevExpress.XtraGrid.GridControl gridControl1;
         private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider;
         private DevExpress.XtraEditors.CheckedListBoxControl txtSigType;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;

+ 4 - 5
XdCxRhDW.App/EditForms/X1D1DTOParamEditor.cs

@@ -12,6 +12,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using XdCxRhDW.Api;
+using XdCxRhDW.Dto;
 using XdCxRhDW.Entity;
 using XdCxRhDW.Repostory;
 
@@ -202,17 +203,15 @@ namespace XdCxRhDW.App.EditForms
             try
             {
                 var mainCode = ucEphXYZMain.GetSatCode();
-
                 var mainxlInfo = await XlRepository.GetLatestAsync(mainCode, sigTime);
                 if (mainxlInfo == null)
                 {
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var maineph = EphHelper.Calc(mainxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZMain.SetXYZ("主星", mainCode, (maineph.X, maineph.Y, maineph.Z), Color.Red);
-
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZMain.SetXYZ("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z), Color.Red);
             }
             catch (Exception ex)
             {

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

@@ -89,7 +89,7 @@ namespace XdCxRhDW.App.EditForms
             //var dto2 = (dt1 - dt3) * 1e6;
         }
 
-      
+
         public bool CheckParam()
         {
             dxErrorProvider.ClearErrors();
@@ -218,9 +218,9 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.MainCode.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var maineph = EphHelper.Calc(mainxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZMain.SetXYZ("主星", cg.MainCode.Value, (maineph.X, maineph.Y, maineph.Z), Color.Red);
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZMain.SetXYZ("主星", cg.MainCode.Value, (maineph.data.X, maineph.data.Y, maineph.data.Z), Color.Red);
 
                 var adjaxlInfo = await XlRepository.GetLatestAsync(cg.Adja1Code.Value, sigTime);
                 if (adjaxlInfo == null)
@@ -228,9 +228,9 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.Adja1Code.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adjaeph = EphHelper.Calc(adjaxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdaj.SetXYZ("邻星", cg.Adja1Code.Value, (adjaeph.X, adjaeph.Y, adjaeph.Z), Color.Red);
+                XlCalcDto = new XlCalcDto() { tleStr = adjaxlInfo.TwoLine, SigTime = sigTime };
+                var adjaeph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdaj.SetXYZ("邻星", cg.Adja1Code.Value, (adjaeph.data.X, adjaeph.data.Y, adjaeph.data.Z), Color.Red);
             }
             catch (Exception ex)
             {

+ 0 - 3
XdCxRhDW.App/EditForms/X2DTOParamEditor.cs

@@ -347,13 +347,10 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.MainCode.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-
                 var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
                 var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
                 ucEphXYZMain.SetParam("主星", cg.MainCode.Value, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
 
-
-
                 var adjaxlInfo = await XlRepository.GetLatestAsync(cg.Adja1Code.Value, sigTime);
                 if (adjaxlInfo == null)
                 {

+ 10 - 6
XdCxRhDW.App/EditForms/X3DTOParamEditor.cs

@@ -6,6 +6,7 @@ using System.Data.Entity;
 using System.Drawing;
 using System.Linq;
 using XdCxRhDW.Api;
+using XdCxRhDW.Dto;
 using XdCxRhDW.Entity;
 using XdCxRhDW.Repostory;
 
@@ -220,17 +221,20 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.Adja2Code.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var mEph = EphHelper.Calc(xlInfo.TwoLine, sigTime.ToUtc());
-                var nEph1 = EphHelper.Calc(xlInfo1.TwoLine, sigTime.ToUtc());
-                var nEph2 = EphHelper.Calc(xlInfo2.TwoLine, sigTime.ToUtc());
+                var XlCalcDto = new XlCalcDto() { tleStr = xlInfo.TwoLine, SigTime = sigTime};
+                var mEph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                XlCalcDto.tleStr = xlInfo1.TwoLine;
+                var nEph1 = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                XlCalcDto.tleStr = xlInfo2.TwoLine;
+                var nEph2 = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
 
-                var mainEph = (mEph.X, mEph.Y, mEph.Z);
+                var mainEph = (mEph.data.X, mEph.data.Y, mEph.data.Z);
                 ucEphXYZMain.SetXYZ($"主星", cg.MainCode, mainEph, Color.Red);
 
-                var adja1Eph = (nEph1.X, nEph1.Y, nEph1.Z);
+                var adja1Eph = (nEph1.data.X, nEph1.data.Y, nEph1.data.Z);
                 ucEphXYZAdja1.SetXYZ($"邻星1", cg.Adja1Code, adja1Eph, Color.Red);
 
-                var adja2Eph = (nEph2.X, nEph2.Y, nEph2.Z);
+                var adja2Eph = (nEph2.data.X, nEph2.data.Y, nEph2.data.Z);
                 ucEphXYZAdja2.SetXYZ($"邻星2", cg.Adja2Code, adja2Eph, Color.Red);
             }
             catch (Exception ex)

+ 11 - 7
XdCxRhDW.App/EditForms/X3DfoParamEditor.cs

@@ -6,6 +6,7 @@ using System.Data.Entity;
 using System.Drawing;
 using System.Linq;
 using XdCxRhDW.Api;
+using XdCxRhDW.Dto;
 using XdCxRhDW.Entity;
 using XdCxRhDW.Repostory;
 
@@ -299,17 +300,20 @@ namespace XdCxRhDW.App.EditForms
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.Adja2Code.Value}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var mEph = EphHelper.Calc(xlInfo.TwoLine, sigTime.ToUtc());
-                var nEph1 = EphHelper.Calc(xlInfo1.TwoLine, sigTime.ToUtc());
-                var nEph2 = EphHelper.Calc(xlInfo2.TwoLine, sigTime.ToUtc());
-
-                var mainEph = (mEph.X, mEph.Y, mEph.Z, mEph.VX, mEph.VY, mEph.VZ);
+                var XlCalcDto = new XlCalcDto() { tleStr = xlInfo.TwoLine, SigTime = sigTime };
+                var mEph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                XlCalcDto.tleStr = xlInfo1.TwoLine;
+                var nEph1 = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                XlCalcDto.tleStr = xlInfo2.TwoLine;
+                var nEph2 = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+
+                var mainEph = (mEph.data.X, mEph.data.Y, mEph.data.Z, mEph.data.VX, mEph.data.VY, mEph.data.VZ);
                 ucEphXYZMain.SetParam($"主星", cg.MainCode, mainEph, Color.Red);
 
-                var adja1Eph = (nEph1.X, nEph1.Y, nEph1.Z, nEph1.VX, nEph1.VY, nEph1.VZ);
+                var adja1Eph = (nEph1.data.X, nEph1.data.Y, nEph1.data.Z, nEph1.data.VX, nEph1.data.VY, nEph1.data.VZ);
                 ucEphXYZAdja1.SetParam($"邻星1", cg.Adja1Code, adja1Eph, Color.Red);
 
-                var adja2Eph = (nEph2.X, nEph2.Y, nEph2.Z, nEph2.VX, nEph2.VY, nEph2.VZ);
+                var adja2Eph = (nEph2.data.X, nEph2.data.Y, nEph2.data.Z, nEph2.data.VX, nEph2.data.VY, nEph2.data.VZ);
                 ucEphXYZAdja2.SetParam($"邻星2", cg.Adja2Code, adja2Eph, Color.Red);
             }
             catch (Exception ex)

+ 33 - 0
XdCxRhDW.App/MainForm.cs

@@ -89,6 +89,7 @@ namespace XdCxRhDW
             StartProcess();
             _ = XlScan();
             _ = XlClear();
+            _ = ClearLocalFile();
             await XlLonCalc();
         }
         private void StartWebApi()
@@ -251,6 +252,38 @@ namespace XdCxRhDW
             }
         }
 
+        //清理10分钟之前的文件
+        private async Task ClearLocalFile()
+        {
+            while (true)
+            {
+                try
+                {
+                    var uploadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot");
+                    var files = Directory.EnumerateFiles(uploadFolder);
+                    foreach (var file in files)
+                    {
+                        FileInfo info = new FileInfo(file);
+                        if (info.CreationTime < DateTime.Now.AddMinutes(-10))
+                        {
+                            try
+                            {
+                                info.Delete();
+                            }
+                            catch
+                            {
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, "清理wwwroot历史文件异常");
+                }
+                await Task.Delay(3600 * 1000);
+            }
+        }
+
         private void btn_ItemClick(object sender, ItemClickEventArgs e)
         {
             var btnTxt = e?.Item?.Caption?.Trim() ?? "任务管理";

+ 9 - 0
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -86,6 +86,15 @@ namespace XdCxRhDW.App.UserControl
                 .AddContentMenu<ModelPosRes>("重新定位", SvgHelper.CreateRepos(), Repos, true)
                 .UseDeleteAsync<ModelPosRes>(DelPos, "删除记录")
                 .SetDisplayText(nameof(ModelPosRes.FreqUpHz), val => (Convert.ToInt64(val) / 1e6).ToString("f3"))
+                .SetDisplayText(nameof(ModelPosRes.Confidence), val =>
+                {
+                    if (val == null)
+                        return "--";
+                    else if (Convert.ToInt32(val) < 0)
+                        return "--";
+                    else
+                        return val.ToString();
+                })
                 .MountRowMenuToMapPos<ModelPosRes>(mapControl1)//将表格单行元素菜单挂载到定位点上(实验)
                 .MountMultRowMenuToMapRegion(mapControl1); //将表格多行元素菜单挂载到地图区域菜单上(该功能暂未实现)
 

+ 1 - 3
XdCxRhDW.App/UserControl/X1D1GDOPParam.cs

@@ -145,11 +145,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime};
                 var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
-
                 ucEphXYZMain.SetParam("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
-
             }
             catch (Exception ex)
             {

+ 2 - 4
XdCxRhDW.App/UserControl/X2D1GDOPParam.cs

@@ -148,19 +148,17 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime.ToUtc() };
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
                 var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
                 ucEphXYZMain.SetParam("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
 
-
-
                 var adjaxlInfo = await XlRepository.GetLatestAsync(adjaCode, sigTime);
                 if (adjaxlInfo == null)
                 {
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adjaCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                XlCalcDto = new XlCalcDto() { tleStr = adjaxlInfo.TwoLine, SigTime = sigTime.ToUtc() };
+                XlCalcDto = new XlCalcDto() { tleStr = adjaxlInfo.TwoLine, SigTime = sigTime };
                 var adjaeph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
                 ucEphXYZAdja.SetParam("邻星", adjaCode, (adjaeph.data.X, adjaeph.data.Y, adjaeph.data.Z, adjaeph.data.VX, adjaeph.data.VY, adjaeph.data.VZ), Color.Red);
             }

+ 8 - 9
XdCxRhDW.App/UserControl/X2DFGDOPParam.cs

@@ -9,6 +9,7 @@ using System.Data;
 using System.Drawing;
 using System.Linq;
 using XdCxRhDW.Api;
+using XdCxRhDW.Dto;
 using XdCxRhDW.Entity;
 using XdCxRhDW.Repostory;
 namespace XdCxRhDW.App.UserControl
@@ -21,7 +22,7 @@ namespace XdCxRhDW.App.UserControl
             EphMain = ucEphXYZMain.EphParam(),
             EphAdja = ucEphXYZAdja.EphParam(),
             CapTime = txtCapTime.DateTime,
-            RefStation =txtRefLocation1.GetLonLat(),
+            RefStation = txtRefLocation1.GetLonLat(),
             DfoErr = Convert.ToDouble(txtDfoErr1.Text),
             DtousErr = Convert.ToDouble(txtDtousErr1.Text),
             SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
@@ -159,11 +160,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var maineph = EphHelper.Calc(mainxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZMain.SetParam("主星", mainCode, (maineph.X, maineph.Y, maineph.Z, maineph.VX, maineph.VY, maineph.VZ), Color.Red);
-
-
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZMain.SetParam("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
 
                 var adjaxlInfo = await XlRepository.GetLatestAsync(adjaCode, sigTime);
                 if (adjaxlInfo == null)
@@ -171,9 +170,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adjaCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adjaeph = EphHelper.Calc(adjaxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdja.SetParam("邻星", adjaCode, (adjaeph.X, adjaeph.Y, adjaeph.Z, adjaeph.VX, adjaeph.VY, adjaeph.VZ), Color.Red);
+                XlCalcDto = new XlCalcDto() { tleStr = adjaxlInfo.TwoLine, SigTime = sigTime };
+                var adjaeph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdja.SetParam("邻星", adjaCode, (adjaeph.data.X, adjaeph.data.Y, adjaeph.data.Z, adjaeph.data.VX, adjaeph.data.VY, adjaeph.data.VZ), Color.Red);
             }
             catch (Exception ex)
             {

+ 10 - 12
XdCxRhDW.App/UserControl/X3DFGDOPParam .cs

@@ -7,6 +7,7 @@ using System.Data;
 using System.Drawing;
 using System.Linq;
 using XdCxRhDW.Api;
+using XdCxRhDW.Dto;
 using XdCxRhDW.Entity;
 using XdCxRhDW.Repostory;
 
@@ -154,11 +155,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var maineph = EphHelper.Calc(mainxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZMain.SetParam("主星", mainCode, (maineph.X, maineph.Y, maineph.Z, maineph.VX, maineph.VY, maineph.VZ), Color.Red);
-
-
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZMain.SetParam("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
 
                 var adja1xlInfo = await XlRepository.GetLatestAsync(adja1Code, sigTime);
                 if (adja1xlInfo == null)
@@ -166,10 +165,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adja1Code}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adja1eph = EphHelper.Calc(adja1xlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdja1.SetParam("邻星1", adja1Code, (adja1eph.X, adja1eph.Y, adja1eph.Z, adja1eph.VX, adja1eph.VY, adja1eph.VZ), Color.Red);
-
+                XlCalcDto = new XlCalcDto() { tleStr = adja1xlInfo.TwoLine, SigTime = sigTime };
+                var adja1eph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdja1.SetParam("邻星1", adja1Code, (adja1eph.data.X, adja1eph.data.Y, adja1eph.data.Z, adja1eph.data.VX, adja1eph.data.VY, adja1eph.data.VZ), Color.Red);
 
                 var adja2xlInfo = await XlRepository.GetLatestAsync(adja2Code, sigTime);
                 if (adja2xlInfo == null)
@@ -177,9 +175,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adja2Code}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adja2eph = EphHelper.Calc(adja2xlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdja2.SetParam("邻星2", adja2Code, (adja2eph.X, adja2eph.Y, adja2eph.Z, adja2eph.VX, adja2eph.VY, adja2eph.VZ), Color.Red);
+                XlCalcDto = new XlCalcDto() { tleStr = adja2xlInfo.TwoLine, SigTime = sigTime };
+                var adja2eph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdja2.SetParam("邻星2", adja2Code, (adja2eph.data.X, adja2eph.data.Y, adja2eph.data.Z, adja2eph.data.VX, adja2eph.data.VY, adja2eph.data.VZ), Color.Red);
             }
             catch (Exception ex)
             {

+ 11 - 13
XdCxRhDW.App/UserControl/X3GDOPParam.cs

@@ -10,6 +10,7 @@ using XdCxRhDW.Entity;
 using XdCxRhDW.Api;
 using System.Drawing;
 using DevExpress.XtraEditors.DXErrorProvider;
+using XdCxRhDW.Dto;
 namespace XdCxRhDW.App.UserControl
 {
     public partial class X3GDOPParam : DevExpress.XtraEditors.XtraUserControl
@@ -21,7 +22,7 @@ namespace XdCxRhDW.App.UserControl
             EphAdja1 = ucEphXYZAdja1.EphParam(),
             EphAdja2 = ucEphXYZAdja2.EphParam(),
             CapTime = txtCapTime.DateTime,
-            RefStation = PosResType == EnumPosResType.X3NoRef ? new double[3] { 0,0,0} : txtRefLocation1.GetLonLat(),
+            RefStation = PosResType == EnumPosResType.X3NoRef ? new double[3] { 0, 0, 0 } : txtRefLocation1.GetLonLat(),
             DtousErr = Convert.ToDouble(txtDtousErr1.Text),
             SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
         };
@@ -141,11 +142,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var maineph = EphHelper.Calc(mainxlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZMain.SetParam("主星", mainCode, (maineph.X, maineph.Y, maineph.Z, maineph.VX, maineph.VY, maineph.VZ), Color.Red);
-
-
+                var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, SigTime = sigTime };
+                var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZMain.SetParam("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
 
                 var adja1xlInfo = await XlRepository.GetLatestAsync(adja1Code, sigTime);
                 if (adja1xlInfo == null)
@@ -153,10 +152,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adja1Code}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adja1eph = EphHelper.Calc(adja1xlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdja1.SetParam("邻星1", adja1Code, (adja1eph.X, adja1eph.Y, adja1eph.Z, adja1eph.VX, adja1eph.VY, adja1eph.VZ), Color.Red);
-
+                XlCalcDto = new XlCalcDto() { tleStr = adja1xlInfo.TwoLine, SigTime = sigTime };
+                var adja1eph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdja1.SetParam("邻星1", adja1Code, (adja1eph.data.X, adja1eph.data.Y, adja1eph.data.Z, adja1eph.data.VX, adja1eph.data.VY, adja1eph.data.VZ), Color.Red);
 
                 var adja2xlInfo = await XlRepository.GetLatestAsync(adja2Code, sigTime);
                 if (adja2xlInfo == null)
@@ -164,9 +162,9 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adja2Code}未找到对应的星历信息,请导入星历");
                     return;
                 }
-                var adja2eph = EphHelper.Calc(adja2xlInfo.TwoLine, sigTime.ToUtc());
-
-                ucEphXYZAdja2.SetParam("邻星2", adja2Code, (adja2eph.X, adja2eph.Y, adja2eph.Z, adja2eph.VX, adja2eph.VY, adja2eph.VZ), Color.Red);
+                XlCalcDto = new XlCalcDto() { tleStr = adja2xlInfo.TwoLine, SigTime = sigTime };
+                var adja2eph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
+                ucEphXYZAdja2.SetParam("邻星2", adja2Code, (adja2eph.data.X, adja2eph.data.Y, adja2eph.data.Z, adja2eph.data.VX, adja2eph.data.VY, adja2eph.data.VZ), Color.Red);
             }
             catch (Exception ex)
             {

+ 9 - 3
XdCxRhDW.Entity/CheckRes.cs

@@ -33,7 +33,7 @@ namespace XdCxRhDW.Entity
         /// 样点长度
         /// </summary>
         [Display(Name = "样点长度")]
-        public long? SmpCount{ get; set; }
+        public long? SmpCount { get; set; }
 
         /// <summary>
         /// 用户名(只有DAMA有)
@@ -43,16 +43,22 @@ namespace XdCxRhDW.Entity
 
 
         /// <summary>
-        /// 调制类型(只有DAMA有)
+        /// 调制类型
         /// </summary>
         [Display(Name = "调制类型")]
         public string ModType { get; set; }
 
         /// <summary>
-        /// 调制速率(只有DAMA有)
+        /// 调制速率
         /// </summary>
         [Display(Name = "调制速率")]
         public double? ModRate { get; set; }
 
+        /// <summary>
+        /// 频偏(Hz)
+        /// </summary>
+        [Display(Name = "频偏")]
+        public double? FfcHz { get; set; }
+
     }
 }

+ 4 - 4
XdCxRhDW.Framework/HttpHelper.cs

@@ -144,7 +144,6 @@ 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);
@@ -181,11 +180,11 @@ public class HttpHelper
     /// <param name="files">要删除的文件</param>
     /// <param name="baseUrl">baseUrl</param>
     /// <returns></returns>
-    public static async Task<int> DeleteFileAsync(List<string> files, string baseUrl)
+    public static async Task<int> DeleteFileAsync(string[] files, string baseUrl)
     {
         FileDeleteDto dto = new FileDeleteDto()
         {
-            Files = files
+            Files = files.ToList()
         };
         var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
         var handler = new HttpClientHandler() { UseCookies = false };
@@ -200,13 +199,14 @@ public class HttpHelper
         var AjaxResult = JsonConvert.DeserializeObject<AjaxResult<int>>(result);
         return AjaxResult.data;
     }
+
     /// <summary>
     /// 删除文件
     /// </summary>
     /// <param name="files">要删除的文件</param>
     /// <param name="baseUrl">baseUrl</param>
     /// <returns></returns>
-    public static async Task<int> DeleteFileAsync(string[] files, string baseUrl)
+    public static async Task<int> DeleteFileAsync(string baseUrl, params string[] files)
     {
         FileDeleteDto dto = new FileDeleteDto()
         {

+ 6 - 0
XdCxRhDW.Sender/Form1.cs

@@ -152,6 +152,8 @@ namespace XdCxRhDW.Sender
                                             CdbTxLat = IniFiles.ReadValue<double>("Station_Data2023.ini", "超短波接收天线", "Lat"),
                                             RefLon = IniFiles.ReadValue<double>("Station_Data2023.ini", "参考站", "Lon"),
                                             RefLat = IniFiles.ReadValue<double>("Station_Data2023.ini", "参考站", "Lat"),
+                                            CalcConfidence = true,
+                                            TheoryDfoCalc = true,
                                         };
 
                                         var result = await HttpHelper.PostRequestAsync<PosResDto>(url, X2D1PosDto);
@@ -347,6 +349,8 @@ namespace XdCxRhDW.Sender
                                             XdSnr = 25,//For Api Test
                                             SxDfo = 1024,//For Api Test
                                             SxSnr = 25,//For Api Test
+                                            CalcConfidence = true,
+                                            TheoryDfoCalc = true,
                                         };
 
                                         var result = await HttpHelper.PostRequestAsync<PosResDto>(url, X2D1NoXlPosDto);
@@ -596,6 +600,7 @@ namespace XdCxRhDW.Sender
                 Snr1 = 27.1,//For Api Test
                 Dfo2 = 1025,//For Api Test
                 Snr2 = 27.4,//For Api Test
+                CalcConfidence = true,
             };
 
             return X3TwoDtoPosDto;
@@ -765,6 +770,7 @@ namespace XdCxRhDW.Sender
                 Snr1 = 27.1,//For Api Test
                 Dfo2 = 1025,//For Api Test
                 Snr2 = 27.4,//For Api Test
+                CalcConfidence = true,
             };
             return X3TwoDtoNoXlPosDto;
         }

+ 0 - 21
XdCxRhDW.WebApi/FileController.cs

@@ -51,27 +51,6 @@ namespace XdCxRhDW.WebApi
             {
                 await fileStream.WriteAsync(fileData, 0, fileData.Length);
             }
-
-            //清除1个小时之前的文件
-            _ = Task.Run(() =>
-            {
-
-                var files = Directory.EnumerateFiles(uploadFolder);
-                foreach (var file in files)
-                {
-                    FileInfo info = new FileInfo(file);
-                    if (info.CreationTime < DateTime.Now.AddHours(-1))
-                    {
-                        try
-                        {
-                            info.Delete();
-                        }
-                        catch
-                        {
-                        }
-                    }
-                }
-            });
             return Success(fileName);
         }
 

+ 5 - 0
XdCxRhDw.Dto/DetectDto.cs

@@ -42,6 +42,11 @@ namespace XdCxRhDW.Dto
         [RangeDouble(0, 100)]
         public double? band { get; set; } = 25;
 
+        /// <summary>
+        /// 是否对信号进行识别(获取调制类型、速率、频偏等)
+        /// </summary>
+        public bool SigProc { get; set; } = false;
+
         /// <summary>
         /// 超时时间(单位秒,默认30秒)
         /// </summary>

+ 6 - 1
XdCxRhDw.Dto/DetectResDto.cs

@@ -59,10 +59,15 @@ namespace XdCxRhDW.Dto
         public string ModType { get; set; }
 
         /// <summary>
-        /// 调制速率
+        /// 调制速率(bps)
         /// </summary>
         public double? ModRate { get; set; }
 
+        /// <summary>
+        /// 频偏(Hz)
+        /// </summary>
+        public double? FfcHz { get; set; }
+
         /// <summary>
         /// 耗时(ms)
         /// </summary>

+ 7 - 2
XdCxRhDw.Dto/PosDto/CheckResDto.cs

@@ -11,7 +11,7 @@ namespace XdCxRhDW.Dto
     /// <summary>
     /// 检测结果模型
     /// </summary>
-    public class CheckResDto 
+    public class CheckResDto
     {
         /// <summary>
         /// 检测文件名称
@@ -44,8 +44,13 @@ namespace XdCxRhDW.Dto
         public string ModType { get; set; }
 
         /// <summary>
-        /// 调制速率(可空)
+        /// 调制速率bps(可空)
         /// </summary>
         public double? ModRate { get; set; }
+
+        /// <summary>
+        /// 频偏Hz(可空)
+        /// </summary>
+        public double? FfcHz { get; set; }
     }
 }

+ 1 - 0
XdCxRhDw.Dto/PosDto/RHNoParPosDto.cs

@@ -130,6 +130,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 1
XdCxRhDw.Dto/PosDto/RHNoXlNoParPosDto.cs

@@ -74,7 +74,6 @@ namespace XdCxRhDW.Dto
         /// </summary>
         public double CxRes { get; set; }
 
-        /// <summary>
         /// <summary>
         /// 目标上行频点Hz
         /// </summary>
@@ -106,6 +105,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 0
XdCxRhDw.Dto/PosDto/RHNoXlPosDto.cs

@@ -155,6 +155,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 }

+ 1 - 0
XdCxRhDw.Dto/PosDto/RHPosDto.cs

@@ -185,6 +185,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 0
XdCxRhDw.Dto/PosDto/X1D1NoParPosDto.cs

@@ -119,6 +119,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
 
     }

+ 1 - 0
XdCxRhDw.Dto/PosDto/X1D1NoXlNoParPosDto.cs

@@ -103,6 +103,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 }

+ 1 - 0
XdCxRhDw.Dto/PosDto/X1D1NoXlPosDto.cs

@@ -122,6 +122,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 }

+ 1 - 0
XdCxRhDw.Dto/PosDto/X1D1PosDto.cs

@@ -136,6 +136,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 0
XdCxRhDw.Dto/PosDto/X2D1NoParPosDto.cs

@@ -176,6 +176,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 0
XdCxRhDw.Dto/PosDto/X2D1NoXlNoParlPosDto.cs

@@ -116,6 +116,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
 
     }

+ 1 - 0
XdCxRhDw.Dto/PosDto/X2DtoDfoNoXlPosDto.cs

@@ -135,6 +135,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 0
XdCxRhDw.Dto/PosDto/X2DtoDfoPosDto.cs

@@ -194,6 +194,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
 
     }

+ 1 - 0
XdCxRhDw.Dto/PosDto/X3TwoDfoNoXlPosDto.cs

@@ -151,6 +151,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
 
     }

+ 1 - 0
XdCxRhDw.Dto/PosDto/X3TwoDfoPosDto.cs

@@ -239,6 +239,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

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

@@ -201,6 +201,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 0
XdCxRhDw.Dto/PosDto/X3TwoDtoNoXlNoParPosDto.cs

@@ -111,6 +111,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 是否计算置信度
         /// </summary>
+        [Obsolete]
         public bool CalcConfidence { get; set; } = false;
     }
 

+ 1 - 1
XdCxRhDw.Dto/PosResDto.cs

@@ -74,7 +74,7 @@ namespace XdCxRhDW.Dto
         public EnumTargetStateDto TargetState { get; set; }
 
         /// <summary>
-        /// 置信度
+        /// 置信度(范围[-1,100],负数表示没有计算置信度)
         /// </summary>
         public int Confidence { get; set; }
 

+ 1 - 1
XdCxRhDw.Dto/XlCalcDto/XlCalcDto.cs

@@ -16,7 +16,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 双行根数(line1和line2用分号拼到一起)
         /// </summary>
-        [TleStrAttribute]
+        [TleStr]
         public string tleStr { get; set; }
 
         /// <summary>