浏览代码

Merge branch 'master' of http://139.155.15.221:3000/zoulei/XdCxRhDW

gongqiuhong 1 年之前
父节点
当前提交
8fca7ffed9

二进制
XdCxRhDW.App/Api/GDOP误差椭圆/GDOP/DLL_GDOP_11J.dll


+ 131 - 12
XdCxRhDW.App/Api/GDOP误差椭圆/GDOP/GDOP.h

@@ -12,6 +12,45 @@
 
 extern "C"
 {
+	///
+	/// 获取三星双时差GDOP  带参考
+	/// mainLines :主星历双行
+	/// adaj1Lines :邻星历双行 
+	/// adaj2Lines :邻星历双行 
+	/// captime:信号时间
+	/// refPos: 参考经度,纬度
+	/// dtousErr: 时差误差
+	/// ephLocErr: 星历位置误差
+	/// level: gdop输出等级
+	/// levlen:level 长度
+	/// resCount:每一级的数据个数
+	/// res :数据
+	/// satllh :卫星位置
+	/// 返回值:0 成功
+	///
+	GDOP_EXPORT int Gdop3SatRef(char *mainLines, char *adaj1Lines, char *adaj2Lines, long long captime, double *refPos
+		, double dtousErr, double ephLocErr
+		, double *level, int levlen, int *resCount, double **res, double *satllh);
+
+	///
+	/// 获取三星双时差GDOP  无参考
+	/// mainLines :主星历双行
+	/// adaj1Lines :邻星历双行 
+	/// adaj2Lines :邻星历双行 
+	/// captime:信号时间
+	/// dtousErr: 时差误差
+	/// ephLocErr: 星历位置误差
+	/// level: gdop输出等级
+	/// levlen:level 长度
+	/// resCount:每一级的数据个数
+	/// res :数据
+	/// satllh :卫星位置
+	/// 返回值:0 成功
+	///
+	GDOP_EXPORT int Gdop3SatNoRef(char *mainLines, char *adaj1Lines, char *adaj2Lines, long long captime
+		, double dtousErr, double ephLocErr
+		, double *level, int levlen, int *resCount, double **res, double *satllh);
+
 	///
 	/// 获取低轨双星GDOP
 	/// mainLines :主星历双行
@@ -36,28 +75,30 @@ extern "C"
 		, double *level, int levlen, int *resCount, double **res, double *satllh);
 
 	///
-	/// 获取低轨单星GDOP
+	/// 获取三星双频差GDOP
 	/// mainLines :主星历双行
-	/// captime1:信号时间
-	/// captime2:信号时间
-	/// captime3:信号时间
-	/// fuHz: 上行
-	/// dfoHzErr: 频差误差
-	/// ephLocErr: 星历位置误差
-	/// ephVLocErr: 星历速度误差
+	/// adaj1Lines :邻星历双行 
+	/// adaj2Lines :邻星历双行 
+	/// captime:信号时间
+	/// refPos: 参考经度,纬度
+	/// fuHz1: 主上行
+	/// fuHz2: 邻上行
+	/// dfo_err: 频差误差
+	/// eph_pos_err: 星历位置误差
+	/// eph_vel_err: 星历速度误差
 	/// level: gdop输出等级
 	/// levlen:level 长度
 	/// resCount:每一级的数据个数
 	/// res :数据
-	/// satllh :卫星位置  长度3
+	/// satllh :卫星位置
 	/// 返回值:0 成功
 	///
-	GDOP_EXPORT int GdopSingleSatD(char *mainLines, long long captime1, long long captime2, long long captime3
-		, double fuHz, double dfoHzErr, double ephLocErr, double ephVLocErr
+	GDOP_EXPORT int Gdop3SatDF(char *mainLines, char *adaj1Lines, char *adaj2Lines, long long captime, double *refPos
+		, double fuHz1, double fuHz2, double dfo_err, double eph_pos_err, double eph_vel_err
 		, double *level, int levlen, int *resCount, double **res, double *satllh);
 
 	///
-	/// 获取低轨双星GDOP
+	/// 获取2X1D GDOP
 	/// mainLines :主星历双行
 	/// adajLines :邻星历双行 
 	/// captime:信号时间
@@ -77,6 +118,84 @@ extern "C"
 		, double *level, int levlen, int *resCount, double **res, double *satllh);
 
 
+	///
+	/// 获取2X1D no ref GDOP
+	/// mainLines :主星历双行
+	/// adajLines :邻星历双行 
+	/// captime:信号时间
+	/// cdbPos: 地面站经度,纬度
+	/// dtousErr: 时差误差
+	/// ephLocErr: 星历位置误差
+	/// level: gdop输出等级
+	/// levlen:level 长度
+	/// resCount:每一级的数据个数
+	/// res :数据
+	/// satllh :卫星位置  长度6
+	/// 返回值:0 成功
+	///
+	GDOP_EXPORT int Gdop2Sat1DNoRef(char *mainLines, char *adajLines, long long captime, double *cdbPos
+		, double dtousErr, double ephLocErr
+		, double *level, int levlen, int *resCount, double **res, double *satllh);
+
+	///
+	/// 获取XD_CX ref GDOP
+	/// mainLines :主星历双行
+	/// captime:信号时间
+	/// cdbPos: 地面站经度,纬度
+	/// cxPos: 侧向站经度,纬度
+	/// refPos: 参考经度,纬度
+	/// dto_err: 时差误差
+	/// doa_err: 侧向误差
+	/// eph_err: 星历位置误差
+	/// level: gdop输出等级
+	/// levlen:level 长度
+	/// resCount:每一级的数据个数
+	/// res :数据
+	/// satllh :卫星位置  长度6
+	/// 返回值:0 成功
+	///
+	GDOP_EXPORT int GdopXDCXRef(char *mainLines, long long captime, double *cdbPos, double *cxPos, double *refPos
+		, double dto_err, double doa_err, double eph_err
+		, double *level, int levlen, int *resCount, double **res, double *satllh);
+
+	///
+	/// 获取XD_CX no ref GDOP
+	/// mainLines :主星历双行
+	/// captime:信号时间
+	/// cdbPos: 地面站经度,纬度
+	/// cxPos: 侧向站经度,纬度
+	/// refPos: 参考经度,纬度
+	/// dto_err: 时差误差
+	/// doa_err: 侧向误差
+	/// eph_err: 星历位置误差
+	/// level: gdop输出等级
+	/// levlen:level 长度
+	/// resCount:每一级的数据个数
+	/// res :数据
+	/// satllh :卫星位置  长度6
+	/// 返回值:0 成功
+	///
+	GDOP_EXPORT int GdopXDCXNoRef(char *mainLines, long long captime, double *cdbPos, double *cxPos
+		, double dto_err, double doa_err, double eph_err
+		, double *level, int levlen, int *resCount, double **res, double *satllh);
+
+	///
+	/// 获取XD_CX no ref GDOP
+	/// cx1Pos: 侧向站经度,纬度
+	/// cx2Pos: 侧向站经度,纬度
+	/// doa_err1: 侧向1误差
+	/// doa_err2: 侧向2误差
+	/// level: gdop输出等级
+	/// levlen:level 长度
+	/// resCount:每一级的数据个数
+	/// res :数据
+	/// satllh :卫星位置  长度6
+	/// 返回值:0 成功
+	///
+	GDOP_EXPORT int Gdop2CX(double *cx1Pos, double *cx2Pos
+		, double doa_err1, double doa_err2
+		, double *level, int levlen, int *resCount, double **res);
+
 	///
 	/// 释放
 	///

二进制
XdCxRhDW.App/Api/GDOP误差椭圆/GDOP/GDOP_Analysis.dll


二进制
XdCxRhDW.App/Api/GDOP误差椭圆/GDOP/GDOP_Draw.dll


二进制
XdCxRhDW.App/Api/GDOP误差椭圆/GDOP/GDOP_Draw_11.dll


+ 210 - 0
XdCxRhDW.App/Api/GDOP误差椭圆/GDOPAPi.cs

@@ -0,0 +1,210 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDW.App.Api.GDOP误差椭圆
+{
+    public static class GDOPApi
+    {
+        private const string GDOPDll = @"Api\GDOP误差椭圆\GDOP\GDOP_Draw_11.dll";
+
+        ///
+        /// 获取三星双时差GDOP  带参考
+        /// mainLines :主星历双行
+        /// adaj1Lines :邻星历双行 
+        /// adaj2Lines :邻星历双行 
+        /// captime:信号时间
+        /// refPos: 参考经度,纬度
+        /// dtousErr: 时差误差
+        /// ephLocErr: 星历位置误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int Gdop3SatRef(string mainLines, string adajLines, string adaj2Lines, Int64 captime, double[] refPos
+            , double dtousErr, double ephLocErr
+            , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+        ///
+        /// 获取三星双时差GDOP  无参考
+        /// mainLines :主星历双行
+        /// adaj1Lines :邻星历双行 
+        /// adaj2Lines :邻星历双行 
+        /// captime:信号时间
+        /// dtousErr: 时差误差
+        /// ephLocErr: 星历位置误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int Gdop3SatNoRef(string mainLines, string adajLines, string adaj2Lines, Int64 captime
+            , double dtousErr, double ephLocErr
+            , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+        ///
+        /// 获取低轨双星GDOP
+        /// mainLines :主星历双行
+        /// adajLines :邻星历双行 
+        /// captime:信号时间
+        /// refPos: 参考经度,纬度
+        /// fuHz1: 主上行
+        /// fuHz2: 邻上行
+        /// dtousErr: 时差误差
+        /// dfoHzErr: 频差误差
+        /// ephLocErr: 星历位置误差
+        /// ephVLocErr: 星历速度误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GdopLeoTowSatDRef(string mainLines, string adajLines, Int64 captime, double[] refPos
+            , double fuHz1, double fuHz2, double dtousErr, double dfoHzErr, double ephLocErr, double ephVLocErr
+           , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+        ///
+        /// 获取三星双频差GDOP
+        /// mainLines :主星历双行
+        /// adaj1Lines :邻星历双行 
+        /// adaj2Lines :邻星历双行 
+        /// captime:信号时间
+        /// refPos: 参考经度,纬度
+        /// fuHz1: 主上行
+        /// fuHz2: 邻上行
+        /// dfo_err: 频差误差
+        /// eph_pos_err: 星历位置误差
+        /// eph_vel_err: 星历速度误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int Gdop3SatDF(string mainLines, string adajLines, string adaj2Lines, Int64 captime, double[] refPos
+            , double fuHz1, double fuHz2, double dfo_err, double eph_pos_err, double eph_vel_err
+            , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+        /// <returns></returns>
+        ///
+        /// 获取2X1D GDOP
+        /// mainLines :主星历双行
+        /// adajLines :邻星历双行 
+        /// captime:信号时间
+        /// cdbPos: 地面站经度,纬度
+        /// refPos: 参考经度,纬度
+        /// dtousErr: 时差误差
+        /// ephLocErr: 星历位置误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置  长度6
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int Gdop2Sat1DRef(string mainLines, string adajLines, Int64 captime, double[] cdbPos
+        , double[] refPos, double dtousErr, double ephLocErr
+        , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+
+        ///
+        /// 获取2X1D no ref GDOP
+        /// mainLines :主星历双行
+        /// adajLines :邻星历双行 
+        /// captime:信号时间
+        /// cdbPos: 地面站经度,纬度
+        /// dtousErr: 时差误差
+        /// ephLocErr: 星历位置误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置  长度6
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int Gdop2Sat1DNoRef(string mainLines, string adajLines, Int64 captime, double[] cdbPos,
+            double dtousErr, double ephLocErr
+        , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+        ///
+        /// 获取XD_CX ref GDOP
+        /// mainLines :主星历双行
+        /// captime:信号时间
+        /// cdbPos: 地面站经度,纬度
+        /// cxPos: 侧向站经度,纬度
+        /// refPos: 参考经度,纬度
+        /// dto_err: 时差误差
+        /// doa_err: 侧向误差
+        /// eph_err: 星历位置误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置  长度6
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GdopXDCXRef(string mainLines, Int64 captime, double[] cdbPos, double[] cxPos, double[] refPos
+            , double dtoErr, double doaErr, double ephLocErr
+            , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+        ///
+        /// 获取XD_CX no ref GDOP
+        /// mainLines :主星历双行
+        /// captime:信号时间
+        /// cdbPos: 地面站经度,纬度
+        /// cxPos: 侧向站经度,纬度
+        /// refPos: 参考经度,纬度
+        /// dto_err: 时差误差
+        /// doa_err: 侧向误差
+        /// eph_err: 星历位置误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置  长度6
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GdopXDCXNoRef(string mainLines, Int64 captime, double[] cdbPos, double[] cxPos
+            , double dtousErr, double doaErr, double ephLocErr, double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+
+        ///
+        /// 获取XD_CX no ref GDOP
+        /// cx1Pos: 侧向站经度,纬度
+        /// cx2Pos: 侧向站经度,纬度
+        /// doa_err1: 侧向1误差
+        /// doa_err2: 侧向2误差
+        /// level: gdop输出等级
+        /// levlen:level 长度
+        /// resCount:每一级的数据个数
+        /// res :数据
+        /// satllh :卫星位置  长度6
+        /// 返回值:0 成功
+        ///
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int Gdop2CX(double[] cx1Pos, double[] cx2Pos
+            , double doaErr1, double doaErr2, double[] level, int levlen, int[] resCount, out IntPtr res);
+
+
+        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void FreeGDOPBuf(IntPtr val);
+
+    }
+}

+ 162 - 15
XdCxRhDW.App/Api/GDOP误差椭圆/GdopHelper.cs

@@ -1,4 +1,5 @@
 
+using DevExpress.XtraBars.Docking.Helpers;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,22 +10,122 @@ namespace XdCxRhDW.App.Api.GDOP误差椭圆
     public static class GdopHelper
     {
 
-        private const string GDOPDll = @"Api\GDOP误差椭圆\GDOP\GDOP_Draw.dll";
-
         static readonly DateTime dtZero = new DateTime(1970, 1, 1, 8, 0, 0, 0);
+
+        /// <summary>
+        /// 两星一地GDOP 无参时参考位置不赋值
+        /// </summary>
+        /// <param name="mainLines">主星星历</param>
+        /// <param name="adajLines">邻星星历</param>
+        /// <param name="captime">信号时间</param>
+        /// <param name="cdbPos">超短波位置 3</param>
+        /// <param name="refPos">参考站位置 3</param>
+        /// <param name="dtousErr">时差误差</param>
+        /// <param name="ephLocErr">星历误差</param>
+        /// <returns></returns>
+        public static (List<SatInfo>, List<ErrDistanceMapPoints>) Gdop2Sat1D(string mainLines, string adajLines, DateTime captime, double[] cdbPos, double dtousErr, double ephLocErr, double[] refPos = null)
+        {
+            int satCount = 2;
+            //该值和points 一一对应
+            double[] level = GdopParam.误差配置.误差距离m;
+            double[] satllh = new double[satCount * 3];
+
+            var timeSpan = (long)(captime - dtZero).TotalSeconds;
+            IntPtr res = IntPtr.Zero;
+            int[] resCount = new int[level.Length];
+            if (refPos == null || refPos.Length == 0)
+            {
+                GDOPApi.Gdop2Sat1DNoRef(mainLines, adajLines, timeSpan, cdbPos, dtousErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+
+            }
+            else
+            {
+                GDOPApi.Gdop2Sat1DRef(mainLines, adajLines, timeSpan, cdbPos, refPos, dtousErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+
+            }
+
+
+            IntPtr tmp = res;
+
+            //用于绘制的数据
+            List<double[]> points = new List<double[]>();
+            for (int idx = 0; idx < level.Length; ++idx)
+            {
+                double[] levelval = new double[resCount[idx]];
+                Marshal.Copy(tmp, levelval, 0, resCount[idx]);
+                tmp += (resCount[idx] * sizeof(double));
+                points.Add(levelval);
+            }
+            GDOPApi.FreeGDOPBuf(res);
+            List<SatInfo> satInfos = ParseResult(satCount, satllh, mainLines, adajLines);
+            List<ErrDistanceMapPoints> errs = new List<ErrDistanceMapPoints>();
+            for (int i = 0; i < points.Count; i++)
+            {
+                if (!points[i].Any()) continue;
+                ErrDistanceMapPoints errDistanceMap = new ErrDistanceMapPoints();
+                errDistanceMap.ErrDistance = level[i];
+                errDistanceMap.MapDots.AddRange(ParseResult(points[i]));
+                errs.Add(errDistanceMap);
+            }
+            return (satInfos, errs);
+        }
+        /// <summary>
+        /// 一星一地GDOP 
+        /// </summary>
+        /// <param name="mainLines">主星星历</param>
+        /// <param name="captime">信号时间</param>
+        /// <param name="cdbPos">超短波位置 3</param>
+        /// <param name="cxPos">测向站位置 3</param>
+        /// <param name="dtousErr">时差误差</param>
+        /// <param name="doaErr">测向误差</param>
+        /// <param name="ephLocErr">星历误差</param>
+        /// <param name="refPos">参考站位置 3</param>
         /// <returns></returns>
-        
-        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
-        public static extern int Gdop2Sat1DRef(string mainLines, string adajLines, Int64 captime, double[] cdbPos
-        , double[] refPos, double dtousErr, double ephLocErr
-        , double[] level, int levlen, int[] resCount, out IntPtr res, double[] satllh);
+        public static (List<SatInfo>, List<ErrDistanceMapPoints>) Gdop1Sat1D(string mainLines, DateTime captime, double[] cdbPos, double[] cxPos, double dtousErr, double doaErr, double ephLocErr, double[] refPos = null)
+        {
+            int satCount = 2;
+            //该值和points 一一对应
+            double[] level = GdopParam.误差配置.误差距离m;
+            double[] satllh = new double[satCount * 3];
 
-        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void FreeGDOPBuf(IntPtr val);
+            var timeSpan = (long)(captime - dtZero).TotalSeconds;
+            IntPtr res = IntPtr.Zero;
+            int[] resCount = new int[level.Length];
+            if (refPos == null || refPos.Length == 0)
+            {
+                GDOPApi.GdopXDCXNoRef(mainLines, timeSpan, cdbPos, cxPos, dtousErr, doaErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+            }
+            else
+            {
+                GDOPApi.GdopXDCXRef(mainLines, timeSpan, cdbPos, cxPos, refPos, dtousErr, doaErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+            }
+            IntPtr tmp = res;
 
-       
+            //用于绘制的数据
+            List<double[]> points = new List<double[]>();
+            for (int idx = 0; idx < level.Length; ++idx)
+            {
+                double[] levelval = new double[resCount[idx]];
+                Marshal.Copy(tmp, levelval, 0, resCount[idx]);
+                tmp += (resCount[idx] * sizeof(double));
+                points.Add(levelval);
+            }
+            GDOPApi.FreeGDOPBuf(res);
+            List<SatInfo> satInfos = ParseResult(satCount, satllh, mainLines);
+            List<ErrDistanceMapPoints> errs = new List<ErrDistanceMapPoints>();
+            for (int i = 0; i < points.Count; i++)
+            {
+                if (!points[i].Any()) continue;
+                ErrDistanceMapPoints errDistanceMap = new ErrDistanceMapPoints();
+                errDistanceMap.ErrDistance = level[i];
+                errDistanceMap.MapDots.AddRange(ParseResult(points[i]));
+                errs.Add(errDistanceMap);
+            }
+            return (satInfos, errs);
+        }
 
-        public static (List<SatInfo>, List<ErrDistanceMapPoints>) Gdop2Sat1DRef(string mainLines, string adajLines, DateTime captime, double[] cdbPos, double[] refPos, double dtousErr, double ephLocErr)
+        private static (List<SatInfo>, List<ErrDistanceMapPoints>) Gdop3Sat(string mainLines, string adajLines, string adajLines2,
+            DateTime captime, double dtousErr, double ephLocErr, double[] refPos = null)
         {
             int satCount = 2;
             //该值和points 一一对应
@@ -34,7 +135,17 @@ namespace XdCxRhDW.App.Api.GDOP误差椭圆
             var timeSpan = (long)(captime - dtZero).TotalSeconds;
             IntPtr res = IntPtr.Zero;
             int[] resCount = new int[level.Length];
-            Gdop2Sat1DRef(mainLines, adajLines, timeSpan, cdbPos, refPos, dtousErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+            if (refPos == null || refPos.Length == 0)
+            {
+                GDOPApi.Gdop3SatNoRef(mainLines, adajLines, adajLines2, timeSpan, dtousErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+
+            }
+            else
+            {
+                GDOPApi.Gdop3SatRef(mainLines, adajLines, adajLines2, timeSpan, refPos, dtousErr, ephLocErr, level, level.Length, resCount, out res, satllh);
+
+            }
+
 
             IntPtr tmp = res;
 
@@ -47,8 +158,8 @@ namespace XdCxRhDW.App.Api.GDOP误差椭圆
                 tmp += (resCount[idx] * sizeof(double));
                 points.Add(levelval);
             }
-            FreeGDOPBuf(res);
-            List<SatInfo> satInfos = ParseResult(satCount, satllh, mainLines, adajLines);
+            GDOPApi.FreeGDOPBuf(res);
+            List<SatInfo> satInfos = ParseResult(satCount, satllh, mainLines, adajLines, adajLines2);
             List<ErrDistanceMapPoints> errs = new List<ErrDistanceMapPoints>();
             for (int i = 0; i < points.Count; i++)
             {
@@ -61,7 +172,43 @@ namespace XdCxRhDW.App.Api.GDOP误差椭圆
             return (satInfos, errs);
         }
 
+        private static (List<SatInfo>, List<ErrDistanceMapPoints>) Gdop3SatDF(string mainLines, string adajLines, string adajLines2,
+          DateTime captime, double fuHz1, double fuHz2, double dfoErr, double ephLocErr, double ephVErr, double[] refPos)
+        {
+            int satCount = 2;
+            //该值和points 一一对应
+            double[] level = GdopParam.误差配置.误差距离m;
+            double[] satllh = new double[satCount * 3];
+
+            var timeSpan = (long)(captime - dtZero).TotalSeconds;
+            IntPtr res = IntPtr.Zero;
+            int[] resCount = new int[level.Length];
+            GDOPApi.Gdop3SatDF(mainLines, adajLines, adajLines2, timeSpan, refPos,fuHz1,fuHz2,dfoErr, ephLocErr,ephVErr, level, level.Length, resCount, out res, satllh);
+
+            IntPtr tmp = res;
 
+            //用于绘制的数据
+            List<double[]> points = new List<double[]>();
+            for (int idx = 0; idx < level.Length; ++idx)
+            {
+                double[] levelval = new double[resCount[idx]];
+                Marshal.Copy(tmp, levelval, 0, resCount[idx]);
+                tmp += (resCount[idx] * sizeof(double));
+                points.Add(levelval);
+            }
+            GDOPApi.FreeGDOPBuf(res);
+            List<SatInfo> satInfos = ParseResult(satCount, satllh, mainLines, adajLines, adajLines2);
+            List<ErrDistanceMapPoints> errs = new List<ErrDistanceMapPoints>();
+            for (int i = 0; i < points.Count; i++)
+            {
+                if (!points[i].Any()) continue;
+                ErrDistanceMapPoints errDistanceMap = new ErrDistanceMapPoints();
+                errDistanceMap.ErrDistance = level[i];
+                errDistanceMap.MapDots.AddRange(ParseResult(points[i]));
+                errs.Add(errDistanceMap);
+            }
+            return (satInfos, errs);
+        }
         private static List<MapDot> ParseResult(double[] ponits)
         {
             List<MapDot> mapDots = new List<MapDot>();
@@ -72,7 +219,7 @@ namespace XdCxRhDW.App.Api.GDOP误差椭圆
                 mapDot.Lat = ponits[count * i + 1];
                 mapDot.Lon = ponits[count * i];
                 mapDots.Add(mapDot);
-               
+
             }
             return mapDots;
 

+ 4 - 4
XdCxRhDW.App/UserControl/GDOPParam.cs

@@ -81,8 +81,8 @@ namespace XdCxRhDW.App.UserControl
         private void btnX1D1_Click(object sender, EventArgs e)
         {
             mapControl1.ClearMap();
-            var (listSat, data) = GdopHelper.Gdop2Sat1DRef(Model.TleMain, Model.TleAdja, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 },
-                              new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.SatLocErr);
+            var (listSat, data) = GdopHelper.Gdop2Sat1D(Model.TleMain, Model.TleAdja, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 }
+                              , Model.DtousErr, Model.SatLocErr, new double[] { Model.RefLon, Model.RefLat, 0 });
             if (data == null)
             {
                 return;
@@ -97,8 +97,8 @@ namespace XdCxRhDW.App.UserControl
         private void btnX1D2_Click(object sender, EventArgs e)
         {
             mapControl1.ClearMap();
-            var (listSat, data) = GdopHelper.Gdop2Sat1DRef(Model.TleMain, Model.TleAdja, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 },
-                              new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.SatLocErr);
+            var (listSat, data) = GdopHelper.Gdop2Sat1D(Model.TleMain, Model.TleAdja, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 }
+                              ,Model.DtousErr, Model.SatLocErr, new double[] { Model.RefLon, Model.RefLat, 0 });
             if (data == null)
             {
                 return;

+ 12 - 12
XdCxRhDW.App/UserControl/X1D1GDOPParam.cs

@@ -70,18 +70,18 @@ namespace XdCxRhDW.App.UserControl
 
         private void btnOK_Click(object sender, EventArgs e)
         {
-            mapControl1.ClearMap();
-            var (listSat, data) = GdopHelper.Gdop2Sat1DRef(Model.TleMain,"", Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 },
-                              new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.SatLocErr);
-            if (data == null)
-            {
-                return;
-            }
-            foreach (var errLins in data)//画GDOP
-            {
-                var mapDots = errLins.MapDots.Select(p => p).Select(p => (p.Lon, p.Lat));
-                mapControl1.DrawGdopLineTwo(errLins.ErrDistanceKm, mapDots, 1);
-            }
+            //mapControl1.ClearMap();
+            //var (listSat, data) = GdopHelper.Gdop1Sat1D(Model.TleMain, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 },
+            //                 Model.DtousErr, Model.SatLocErr, new double[] { Model.RefLon, Model.RefLat, 0 });
+            //if (data == null)
+            //{
+            //    return;
+            //}
+            //foreach (var errLins in data)//画GDOP
+            //{
+            //    var mapDots = errLins.MapDots.Select(p => p).Select(p => (p.Lon, p.Lat));
+            //    mapControl1.DrawGdopLineTwo(errLins.ErrDistanceKm, mapDots, 1);
+            //}
         }
         private void btnClose_Click(object sender, EventArgs e)
         {

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

@@ -83,8 +83,8 @@ namespace XdCxRhDW.App.UserControl
         private void btnOK_Click(object sender, EventArgs e)
         {
             mapControl1.ClearMap();
-            var (listSat, data) = GdopHelper.Gdop2Sat1DRef(Model.TleMain, Model.TleAdja, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 },
-                              new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.SatLocErr);
+            var (listSat, data) = GdopHelper.Gdop2Sat1D(Model.TleMain, Model.TleAdja, Model.CapTime, new double[] { Model.StationLon, Model.StationLat, 0 }
+                             , Model.DtousErr, Model.SatLocErr, new double[] { Model.RefLon, Model.RefLat, 0 });
             if (data == null)
             {
                 return;

+ 4 - 3
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -198,6 +198,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Api\EphHelper.cs" />
+    <Compile Include="Api\GDOP误差椭圆\GDOPApi.cs" />
     <Compile Include="Api\GDOP误差椭圆\GdopConfig.cs" />
     <Compile Include="Api\GDOP误差椭圆\GdopHelper.cs" />
     <Compile Include="Api\GDOP误差椭圆\MapItem.cs" />
@@ -511,11 +512,11 @@
     </EmbeddedResource>
     <EmbeddedResource Include="WebAPI\Swagger.js" />
     <Content Include="Api\GDOP误差椭圆\GDOP\args.txt" />
-    <Content Include="Api\GDOP误差椭圆\GDOP\GDOP.h" />
-    <Content Include="Api\GDOP误差椭圆\GDOP\GDOP_Analysis.dll">
+    <Content Include="Api\GDOP误差椭圆\GDOP\DLL_GDOP_11J.dll">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
-    <Content Include="Api\GDOP误差椭圆\GDOP\GDOP_Draw.dll">
+    <Content Include="Api\GDOP误差椭圆\GDOP\GDOP.h" />
+    <Content Include="Api\GDOP误差椭圆\GDOP\GDOP_Draw_11.dll">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <Content Include="Api\GDOP误差椭圆\GDOP\Tle2XYZ.dll">