zoulei 1 năm trước cách đây
mục cha
commit
bfe62f86e7

BIN
Service/CheckServer/AddIns/SignalProc.dll


+ 3 - 38
Service/ClearServiceData/Program.cs

@@ -7,47 +7,12 @@ using System.Threading.Tasks;
 
 namespace ClearServiceData
 {
-    public class AdFile
-    {
-        /// <summary>
-        /// 文件(含路径)
-        /// </summary>
-        public string File { get; set; }
-
-        /// <summary>
-        /// 采集时刻
-        /// </summary>
-        public DateTime AdTime { get; set; }
-
-        /// <summary>
-        /// 通道号
-        /// </summary>
-        public int ChNo { get; set; }
-    }
     internal class Program
     {
-        private static AdFile StringToAdFile(string file)
-        {
-            //20240409094240_ADC_ch02.dat
-            var name = Path.GetFileNameWithoutExtension(file).ToUpper();
-            var arr = name.Split(new string[] { "_", "CH" }, StringSplitOptions.RemoveEmptyEntries);
-            var time = DateTime.ParseExact(arr[0], "yyyyMMddHHmmss", null);
-            AdFile adFile = new AdFile()
-            {
-                File = file,
-                AdTime = time,
-                ChNo = Convert.ToInt32(arr[2]),
-            };
-            return adFile;
-        }
         static void Main(string[] args)
         {
-           var files= Directory.EnumerateFiles("F:\\", "*.dat", SearchOption.TopDirectoryOnly);
-            Console.WriteLine(files.Count());
-            Console.ReadLine();
-            return;
             Console.WriteLine("程序将删除平台及服务的日志文件、wwwroot中上传的临时文件,按Y继续");
-            var str= Console.ReadLine();
+            var str = Console.ReadLine();
             if (str.Trim().ToLower() != "y") return;
             try
             {
@@ -55,7 +20,7 @@ namespace ClearServiceData
                 Console.WriteLine("deleted Log.db");
             }
             catch
-            { 
+            {
             }
             var dir1 = Directory.GetDirectories(".\\Service\\", "*Logs", SearchOption.AllDirectories);
             var dir2 = Directory.GetDirectories(".\\Service\\", "*wwwroot", SearchOption.AllDirectories);
@@ -69,7 +34,7 @@ namespace ClearServiceData
             {
                 try
                 {
-                    Directory.Delete(dir,true);
+                    Directory.Delete(dir, true);
                     Console.WriteLine($"deleted {dir}");
                 }
                 catch

+ 54 - 0
XdCxRhDW.Api/AddIns/GDOP误差椭圆/ErrEllipseHepler.cs

@@ -71,6 +71,23 @@ namespace XdCxRhDW.Api
         private extern static IntPtr Error_Ellipse_3X_2DTO(double[] main_eph, double[] neigh_eph1, double[] neigh_eph2, double[] RefGeod, double[] Select_Point, double dto_err,
         double eph_err, double Pe, ref int LOP_Len);
 
+        /// <summary>
+        /// 三星无参误差椭圆(高轨和低轨是一样的)
+        /// </summary>
+        /// <param name="main_eph">主星位置 长度3</param>
+        /// <param name="neigh_eph1">邻星1位置 长度3</param>
+        /// <param name="neigh_eph2">邻星2位置 长度3</param>
+        /// <param name="refStation">参考站 长度3</param>
+        /// <param name="Select_Point">定位点 长度3</param>
+        /// <param name="dto_err">时差误差(s)</param>
+        /// <param name="eph_err">星历误差(m)</param>
+        /// <param name="Pe">0.5</param>
+        /// <param name="LOP_Len"></param>
+        /// <returns></returns>
+        [DllImport(ErrellipDll, EntryPoint = "Error_Ellipse_3X_2DTO", CallingConvention = CallingConvention.Cdecl)]
+        private extern static IntPtr Error_Ellipse_3X_2DTONoRef(double[] main_eph, double[] neigh_eph1, double[] neigh_eph2, double[] Select_Point, double dto_err,
+        double eph_err, double Pe, ref int LOP_Len);
+
         /// <summary>
         /// 两星一地带参误差椭圆
         /// </summary>
@@ -241,5 +258,42 @@ namespace XdCxRhDW.Api
             }
             return res;
         }
+
+        public static ErrEllipseResDto ErrorEllipseX3NoRef(double posLon, double posLat, double[] mainEph, double[] adja1Eph, double[] adja2Eph,
+            double dtoErrus, double ephErrm, bool outputErrPoint, double pe = 0.5)
+        {
+            int LOP_Len = 0;
+            IntPtr LOP_ValuePtr = Error_Ellipse_3X_2DTONoRef(
+                   mainEph,
+                   adja1Eph,
+                   adja2Eph,
+                    new double[3] { posLon, posLat, 0 },
+                    dtoErrus * 1e-6,
+                    ephErrm,
+                    pe, ref LOP_Len);
+            double[] LOP_Value = new double[LOP_Len];
+            if (LOP_Len > 0)
+            {
+                Marshal.Copy(LOP_ValuePtr, LOP_Value, 0, LOP_Value.Length);
+            }
+            ErrEllipseResDto res = new ErrEllipseResDto();
+            res.LongRadius = LOP_Value[LOP_Value.Length - 3];
+            res.ShortRadius = LOP_Value[LOP_Value.Length - 2];
+            res.DipAngle = LOP_Value[LOP_Value.Length - 1];
+            if (outputErrPoint)
+            {
+                int count = LOP_Value.Length - 3;
+
+                for (int i = 0; i < count; i += 2)
+                {
+                    res.GeoPoints.Add(new GeoPoint()
+                    {
+                        Lon = LOP_Value[i],
+                        Lat = LOP_Value[i + 1],
+                    });
+                }
+            }
+            return res;
+        }
     }
 }

+ 10 - 0
XdCxRhDW.App/Controllers/EllipseController.cs

@@ -142,6 +142,16 @@ namespace XdCxRhDW.App.Controllers
             {
                 return Error<ErrEllipseResDto>("三星双时差误差椭圆缺少无参的算法");
             });
+
+            //return await Task.Run(() =>
+            //{
+            //    double[] mainEcef = new double[3] { dto.MainX, dto.MainY, dto.MainZ };
+            //    double[] adja1Ecef = new double[3] { dto.Adja1X, dto.Adja1Y, dto.Adja1Z };
+            //    double[] adja2Ecef = new double[3] { dto.Adja2X, dto.Adja2Y, dto.Adja2Z };
+            //    var res = ErrEllipseHepler.ErrorEllipseX3NoRef(dto.PosLon, dto.PosLat, mainEcef, adja1Ecef, adja2Ecef,
+            //         dto.DtoErrus, dto.EphErr, dto.OutputErrPoint, dto.Pe);
+            //    return Success(res);
+            //});
         }
     }
 }