|
@@ -54,10 +54,15 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
|
|
|
///星历速度误差
|
|
|
/// </summary>
|
|
|
public double EphVelErr { get; set; }
|
|
|
+
|
|
|
/// <summary>
|
|
|
- /// 上行频点(Hz)
|
|
|
+ /// 上行频点1(Hz)
|
|
|
/// </summary>
|
|
|
- public double fu { get; set; }
|
|
|
+ public double fu1 { get; set; }
|
|
|
+ /// <summary>
|
|
|
+ /// 上行频点2(Hz)
|
|
|
+ /// </summary>
|
|
|
+ public double fu2 { get; set; }
|
|
|
/// <summary>
|
|
|
/// 概率 默认0.5
|
|
|
/// </summary>
|
|
@@ -154,13 +159,76 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
|
|
|
}
|
|
|
public static class ErrEllipseHelper
|
|
|
{
|
|
|
+ private const string GDOPDll = @"Api\低轨GDOP误差椭圆\GDOP\DLL_GDOP_Analysis.dll";
|
|
|
+ /// <summary>
|
|
|
+ /// 低轨双星误差椭圆
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="main_eph">主星位置 长度6</param>
|
|
|
+ /// <param name="neigh_eph">邻星位置 长度6</param>
|
|
|
+ /// <param name="ref_pos">参考位置 长度3</param>
|
|
|
+ /// <param name="Select_Point">定位点长度3</param>
|
|
|
+ /// <param name="dto_err">时差误差(s)</param>
|
|
|
+ /// <param name="dfo_err">频差误差(Hz)</param>
|
|
|
+ /// <param name="eph_pos_err"></param>
|
|
|
+ /// <param name="eph_vel_err"></param>
|
|
|
+ /// <param name="fu"></param>
|
|
|
+ /// <param name="Pe">0.5</param>
|
|
|
+ /// <param name="LOP_Len"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [DllImport(GDOPDll, EntryPoint = "Error_Ellipse_DTFO", CallingConvention = CallingConvention.Cdecl)]
|
|
|
+ public extern static IntPtr Error_Ellipse_DTFO(double[] main_eph, double[] neigh_eph, double[] ref_pos, double[] Select_Point, double dto_err, double dfo_err,
|
|
|
+ double eph_pos_err, double eph_vel_err, double fu1, double fu2, double Pe, ref int LOP_Len);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 两星一地误差椭圆
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="main_eph">主星位置 长度6</param>
|
|
|
+ /// <param name="neigh_eph">邻星位置 长度6</param>
|
|
|
+ /// <param name="cdbAnt">超短波 长度3</param>
|
|
|
+ /// <param name="refStation">参考站 长度3</param>
|
|
|
+ /// <param name="Select_Point">定位点 长度3</param>
|
|
|
+ /// <param name="dto_err">时差误差(s)</param>
|
|
|
+ /// <param name="eph_err"></param>
|
|
|
+ /// <param name="Pe">0.5</param>
|
|
|
+ /// <param name="LOP_Len"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [DllImport(GDOPDll, EntryPoint = "Error_Ellipse_2X1D", CallingConvention = CallingConvention.Cdecl)]
|
|
|
+ public extern static IntPtr Error_Ellipse_2X1D(double[] main_eph, double[] neigh_eph, double[] cdbAnt, double[] refStation, double[] Select_Point, double dto_err,
|
|
|
+ double eph_err, double Pe, ref int LOP_Len);
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 单星误差椭圆
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="main_eph"></param>
|
|
|
+ /// <param name="neigh_eph1"></param>
|
|
|
+ /// <param name="neigh_eph2"></param>
|
|
|
+ /// <param name="Select_Point"></param>
|
|
|
+ /// <param name="dfo_err"></param>
|
|
|
+ /// <param name="eph_pos_err"></param>
|
|
|
+ /// <param name="eph_vel_err"></param>
|
|
|
+ /// <param name="fu"></param>
|
|
|
+ /// <param name="Pe"></param>
|
|
|
+ /// <param name="LOP_Len"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [DllImport(GDOPDll, EntryPoint = "Error_Ellipse_2DFO", CallingConvention = CallingConvention.Cdecl)]
|
|
|
+ public extern static IntPtr Error_Ellipse_2DFO(double[] main_eph, double[] neigh_eph1, double[] neigh_eph2, double[] Select_Point, double dfo_err, double eph_pos_err, double eph_vel_err, double fu, double Pe,
|
|
|
+ ref int LOP_Len);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
|
|
|
+ public static extern void freeBuff(IntPtr buf);
|
|
|
+
|
|
|
public static IEnumerable<(double lon, double lat)> ErrorEllipseDTFOTwoStart(ErrorEllipseDTFOTSOption opt)
|
|
|
{
|
|
|
|
|
|
List<DtoLinePoint> list = new List<DtoLinePoint>();
|
|
|
|
|
|
int LOP_Len = 0;
|
|
|
- IntPtr LOP_ValuePtr = GdopHelper.Error_Ellipse_DTFO(
|
|
|
+ IntPtr LOP_ValuePtr = Error_Ellipse_DTFO(
|
|
|
opt.MsEph,
|
|
|
opt.NsEph,
|
|
|
opt.RefGeod,
|
|
@@ -169,25 +237,8 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
|
|
|
opt.DfoErr,
|
|
|
opt.EphPosErr,
|
|
|
opt.EphVelErr,
|
|
|
- opt.fu, opt.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);
|
|
|
-
|
|
|
- int len = LOP_Len / 2;
|
|
|
- for (int i = 0; i < len; i++)
|
|
|
- {
|
|
|
- int temp = i * 2;
|
|
|
- list.Add(new DtoLinePoint()
|
|
|
- {
|
|
|
- Lon = LOP_Value[temp],
|
|
|
- Lat = LOP_Value[temp + 1]
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- var Lines = list.Select(p => (p.Lon, p.Lat));
|
|
|
- return Lines;
|
|
|
+ opt.fu1, opt.fu2, opt.Pe, ref LOP_Len);
|
|
|
+ return ParseResult(LOP_ValuePtr, LOP_Len);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -197,7 +248,7 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
|
|
|
List<DtoLinePoint> list = new List<DtoLinePoint>();
|
|
|
|
|
|
int LOP_Len = 0;
|
|
|
- IntPtr LOP_ValuePtr = GdopHelper.Error_Ellipse_2X1D(
|
|
|
+ IntPtr LOP_ValuePtr = Error_Ellipse_2X1D(
|
|
|
opt.MsEph,
|
|
|
opt.NsEph,
|
|
|
opt.CDBAnt,
|
|
@@ -206,34 +257,14 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
|
|
|
opt.DtoErr,
|
|
|
opt.EphErr,
|
|
|
opt.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);
|
|
|
-
|
|
|
- int len = LOP_Len / 2;
|
|
|
- for (int i = 0; i < len; i++)
|
|
|
- {
|
|
|
- int temp = i * 2;
|
|
|
- list.Add(new DtoLinePoint()
|
|
|
- {
|
|
|
- Lon = LOP_Value[temp],
|
|
|
- Lat = LOP_Value[temp + 1]
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- var Lines = list.Select(p => (p.Lon, p.Lat));
|
|
|
- return Lines;
|
|
|
+ return ParseResult(LOP_ValuePtr, LOP_Len);
|
|
|
}
|
|
|
|
|
|
|
|
|
public static IEnumerable<(double lon, double lat)> ErrorEllipseSingleX(ErrorEllipseDTO1XOption opt)
|
|
|
{
|
|
|
-
|
|
|
- List<DtoLinePoint> list = new List<DtoLinePoint>();
|
|
|
-
|
|
|
int LOP_Len = 0;
|
|
|
- IntPtr LOP_ValuePtr = GdopHelper.Error_Ellipse_2DFO(
|
|
|
+ IntPtr LOP_ValuePtr = Error_Ellipse_2DFO(
|
|
|
opt.MsEph,
|
|
|
opt.NsEph1,
|
|
|
opt.NsEph2,
|
|
@@ -242,6 +273,12 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
|
|
|
opt.EphPosErr,
|
|
|
opt.EphVelErr,
|
|
|
opt.fu, opt.Pe, ref LOP_Len);
|
|
|
+ return ParseResult(LOP_ValuePtr, LOP_Len);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static IEnumerable<(double lon, double lat)> ParseResult(IntPtr LOP_ValuePtr, int LOP_Len)
|
|
|
+ {
|
|
|
+ List<DtoLinePoint> list = new List<DtoLinePoint>();
|
|
|
double[] LOP_Value = new double[LOP_Len];
|
|
|
if (LOP_Len > 0)
|
|
|
{
|