zoulei 1 year ago
parent
commit
ddc08322f2

BIN
Database.db


+ 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;

+ 61 - 0
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -243,6 +243,15 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Api\EphHelper.cs" />
+    <Compile Include="Api\GDOP误差椭圆\GdopConfig.cs" />
+    <Compile Include="Api\GDOP误差椭圆\GdopHelper.cs" />
+    <Compile Include="Api\GDOP误差椭圆\MapItem.cs" />
+    <Compile Include="Api\时差线\DrawDtoLineHelper.cs" />
+    <Compile Include="Api\时差线\DtoLineModel.cs" />
+    <Compile Include="Api\时差线\OutputHelper.cs" />
+    <Compile Include="Api\频差线\DrawDfoLineHelper.cs" />
+    <Compile Include="Api\频差线\DfoLineModel.cs" />
     <Compile Include="Basic\BaseVm.cs" />
     <Compile Include="Basic\BindingData.cs" />
     <Compile Include="Basic\ColorHelper.cs" />
@@ -528,6 +537,58 @@
     <EmbeddedResource Include="UserControl\X2D1GDOPParam.resx">
       <DependentUpon>X2D1GDOPParam.cs</DependentUpon>
     </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">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\GDOP误差椭圆\GDOP\GDOP_Draw.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\GDOP误差椭圆\GDOP\Tle2XYZ.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\GDOP误差椭圆\readme.txt" />
+    <Content Include="Api\时差线\DLL_LHDW32.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\时差线\msvcp100.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\时差线\msvcr100.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\时差线\Newtonsoft.Json.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\时差线\Positioning.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\时差线\Positioning.h">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\时差线\XingDiSCX.exe">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\频差线\locow.exe">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\频差线\msvcp100.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\频差线\msvcr100.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\频差线\Positioning.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\频差线\Positioning_calc.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Api\频差线\Positioning_dtf.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <None Include="DLL_11J.dll">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>

BIN
XdCxRhDW.Core/Api/GDOP误差椭圆/GDOP/DLL_GDOP_11J.dll


+ 131 - 12
XdCxRhDW.Core/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);
+
 	///
 	/// 释放
 	///

BIN
XdCxRhDW.Core/Api/GDOP误差椭圆/GDOP/GDOP_Draw_11.dll


+ 210 - 0
XdCxRhDW.Core/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.Core/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;
 

+ 12 - 7
XdCxRhDW.Sender/Form1.Designer.cs

@@ -82,7 +82,7 @@
             // 
             // txtTskType
             // 
-            this.txtTskType.Location = new System.Drawing.Point(334, 19);
+            this.txtTskType.Location = new System.Drawing.Point(334, 20);
             this.txtTskType.MenuManager = this.barManager1;
             this.txtTskType.Name = "txtTskType";
             this.txtTskType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
@@ -90,8 +90,13 @@
             this.txtTskType.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.ImageComboBoxItem[] {
             new DevExpress.XtraEditors.Controls.ImageComboBoxItem("一星一地测向定位", "X1D1CX", -1),
             new DevExpress.XtraEditors.Controls.ImageComboBoxItem("两星一地定位", "X2D1", -1),
-            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("融合定位", "RH", -1)});
-            this.txtTskType.Size = new System.Drawing.Size(102, 20);
+            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("两星一地无参定位", "X2D1NoPar", -1),
+            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("融合定位", "RH", -1),
+            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("三星双时差定位", "X3TwoDto", -1),
+            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("三星双时差无参定位", "X3TwoDtoNoPar", -1),
+            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("三星双频差定位", "X3TwoDfo", -1),
+            new DevExpress.XtraEditors.Controls.ImageComboBoxItem("双星时频差定位", "X2Dfo", -1)});
+            this.txtTskType.Size = new System.Drawing.Size(102, 22);
             this.txtTskType.StyleController = this.layoutControl1;
             this.txtTskType.TabIndex = 6;
             // 
@@ -157,21 +162,21 @@
             // 
             // localPort1
             // 
-            this.localPort1.Location = new System.Drawing.Point(221, 19);
+            this.localPort1.Location = new System.Drawing.Point(221, 20);
             this.localPort1.MenuManager = this.barManager1;
             this.localPort1.Name = "localPort1";
             this.localPort1.Properties.NullValuePrompt = "空值表示随机端口";
-            this.localPort1.Size = new System.Drawing.Size(109, 20);
+            this.localPort1.Size = new System.Drawing.Size(109, 22);
             this.localPort1.StyleController = this.layoutControl1;
             this.localPort1.TabIndex = 5;
             // 
             // txtAddr1
             // 
             this.txtAddr1.EditValue = "127.0.0.1:8092";
-            this.txtAddr1.Location = new System.Drawing.Point(2, 19);
+            this.txtAddr1.Location = new System.Drawing.Point(2, 20);
             this.txtAddr1.Name = "txtAddr1";
             this.txtAddr1.Properties.NullValuePrompt = "127.0.0.1:16010";
-            this.txtAddr1.Size = new System.Drawing.Size(215, 20);
+            this.txtAddr1.Size = new System.Drawing.Size(215, 22);
             this.txtAddr1.StyleController = this.layoutControl1;
             this.txtAddr1.TabIndex = 4;
             // 

+ 273 - 34
XdCxRhDW.Sender/Form1.cs

@@ -49,57 +49,147 @@ namespace XdCxRhDW.Sender
                     {
                         try
                         {
-                            var lines = File.ReadAllLines("Simulation_Data2023.dat");
-                            int idx = 1;
                             string url = string.Format("http://{0}:{1}/Api/Pos/", ip, port);
                             if (tskType == "X1D1CX")//一星一地测向定位
                             {
+                                var lines = File.ReadAllLines("Simulation_Data2023.dat");
+                                int idx = 1;
                                 url += "PosX1D1Async";
+                                foreach (var line in lines)
+                                {
+                                    if (string.IsNullOrWhiteSpace(line)) continue;
+                                    var items = line.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
+                                    X1D1PosDto dto = new X1D1PosDto()
+                                    {
+                                        SigTime = DateTime.Now,
+                                        XdDto = Convert.ToDouble(items[1]),
+                                        MainYbDto = Convert.ToDouble(items[2]),
+                                        CxRes = Convert.ToDouble(items[4]),
+                                        MainX = Convert.ToDouble(items[7]),
+                                        MainY = Convert.ToDouble(items[8]),
+                                        MainZ = Convert.ToDouble(items[9]),
+                                        SatTxLon = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lon"),
+                                        SatTxLat = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lat"),
+                                        CdbTxLon = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lon"),
+                                        CdbTxLat = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lat"),
+                                        CxLon = IniFiles.ReadValue<double>("Station_Data2023", "侧向站", "Lon"),
+                                        CxLat = IniFiles.ReadValue<double>("Station_Data2023", "侧向站", "Lat"),
+                                        RefLon = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lon"),
+                                        RefLat = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lat"),
+                                    };
+                                    var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
+                                    var response = await client.PostAsync(url, content);
+                                    Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                }
                             }
                             if (tskType == "X2D1")//两星一地定位
                             {
+                                var lines = File.ReadAllLines("Simulation_Data2023.dat");
+                                int idx = 1;
                                 url += "PosX2D1Async";
+                                foreach (var line in lines)
+                                {
+                                    if (string.IsNullOrWhiteSpace(line)) continue;
+                                    var items = line.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
+                                    X2D1PosDto X2D1PosDto = new X2D1PosDto();
+                                    X2D1PosDto.SigTime = DateTime.Now;
+                                    X2D1PosDto.SxDto = Convert.ToDouble(items[0]);
+                                    X2D1PosDto.XdDto = Convert.ToDouble(items[1]);
+                                    X2D1PosDto.MainYbDto = Convert.ToDouble(items[2]);
+                                    X2D1PosDto.AdjaYbDto = Convert.ToDouble(items[3]);
+                                    X2D1PosDto.MainX = Convert.ToDouble(items[7]);
+                                    X2D1PosDto.MainY = Convert.ToDouble(items[8]);
+                                    X2D1PosDto.MainZ = Convert.ToDouble(items[9]);
+                                    X2D1PosDto.AdjaX = Convert.ToDouble(items[10]);
+                                    X2D1PosDto.AdjaY = Convert.ToDouble(items[11]);
+                                    X2D1PosDto.AdjaZ = Convert.ToDouble(items[12]);
+                                    X2D1PosDto.SatTxLon = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lon");
+                                    X2D1PosDto.SatTxLat = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lat");
+                                    X2D1PosDto.CdbTxLon = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lon");
+                                    X2D1PosDto.CdbTxLat = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lat");
+                                    X2D1PosDto.RefLon = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lon");
+                                    X2D1PosDto.RefLat = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lat");
+                                    var content = new StringContent(JsonConvert.SerializeObject(X2D1PosDto), System.Text.Encoding.UTF8, "application/json");
+                                    var response = await client.PostAsync(url, content);
+                                    Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                }
+                            }
+                            if (tskType == "X2D1NoPar")//两星一地无参定位
+                            {
+                                url += "PosX2D1NoParAsync";
+                                var res = X2D1NoPar();
+                                var content = new StringContent(JsonConvert.SerializeObject(res), System.Text.Encoding.UTF8, "application/json");
+                                var response = await client.PostAsync(url, content);
+                                Log($"已向[{txtAddr1.Text}]发送两星一地无参定位仿真结果");
                             }
                             if (tskType == "RH")//融合定位
                             {
+                                var lines = File.ReadAllLines("Simulation_Data2023.dat");
+                                int idx = 1;
                                 url += "PosRHAsync";
+                                foreach (var line in lines)
+                                {
+                                    if (string.IsNullOrWhiteSpace(line)) continue;
+                                    var items = line.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
+                                    RHPosDto RHPosDto = new RHPosDto();
+                                    RHPosDto.SigTime = DateTime.Now;
+                                    RHPosDto.SxDto = Convert.ToDouble(items[0]);
+                                    RHPosDto.XdDto = Convert.ToDouble(items[1]);
+                                    RHPosDto.MainYbDto = Convert.ToDouble(items[2]);
+                                    RHPosDto.AdjaYbDto = Convert.ToDouble(items[3]);
+                                    RHPosDto.CxRes = Convert.ToDouble(items[4]);
+                                    RHPosDto.MainX = Convert.ToDouble(items[7]);
+                                    RHPosDto.MainY = Convert.ToDouble(items[8]);
+                                    RHPosDto.MainZ = Convert.ToDouble(items[9]);
+                                    RHPosDto.AdjaX = Convert.ToDouble(items[10]);
+                                    RHPosDto.AdjaY = Convert.ToDouble(items[11]);
+                                    RHPosDto.AdjaZ = Convert.ToDouble(items[12]);
+                                    RHPosDto.SatTxLon = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lon");
+                                    RHPosDto.SatTxLat = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lat");
+                                    RHPosDto.CdbTxLon = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lon");
+                                    RHPosDto.CdbTxLat = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lat");
+                                    RHPosDto.CxLon = IniFiles.ReadValue<double>("Station_Data2023", "侧向站", "Lon");
+                                    RHPosDto.CxLat = IniFiles.ReadValue<double>("Station_Data2023", "侧向站", "Lat");
+                                    RHPosDto.RefLon = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lon");
+                                    RHPosDto.RefLat = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lat");
+                                    var content = new StringContent(JsonConvert.SerializeObject(RHPosDto), System.Text.Encoding.UTF8, "application/json");
+                                    var response = await client.PostAsync(url, content);
+                                    Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                }
                             }
-
-                            var stationRes = new StationResDto()
+                            if (tskType == "X3TwoDto")//三星双时差定位
+                            {
+                                url += "PosX3TwoDtoAsync";
+                                var res = X3TwoDto();
+                                var content = new StringContent(JsonConvert.SerializeObject(res), System.Text.Encoding.UTF8, "application/json");
+                                var response = await client.PostAsync(url, content);
+                                Log($"已向[{txtAddr1.Text}]发送三星双时差定位仿真结果");
+                            }
+                            if (tskType == "X3TwoDtoNoPar")//三星双时差无参定位
+                            {
+                                url += "PosX3TwoDtoNoParAsync";
+                                var res = X3TwoDtoNoPar();
+                                var content = new StringContent(JsonConvert.SerializeObject(res), System.Text.Encoding.UTF8, "application/json");
+                                var response = await client.PostAsync(url, content);
+                                Log($"已向[{txtAddr1.Text}]发送三星双时差定位仿真结果");
+                            }
+                            if (tskType == "X3TwoDfo")//三星双频差定位
                             {
-                                SatTxLon = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lon"),
-                                SatTxLat = IniFiles.ReadValue<double>("Station_Data2023", "卫星接收天线", "Lat"),
-                                CdbTxLon = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lon"),
-                                CdbTxLat = IniFiles.ReadValue<double>("Station_Data2023", "超短波接收天线", "Lat"),
-                                CxLon = IniFiles.ReadValue<double>("Station_Data2023", "侧向站", "Lon"),
-                                CxLat = IniFiles.ReadValue<double>("Station_Data2023", "侧向站", "Lat"),
-                                RefLon = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lon"),
-                                RefLat = IniFiles.ReadValue<double>("Station_Data2023", "参考站", "Lat"),
-                            };
-                            foreach (var line in lines)
+                                url += "PosX3TwoDfoAsync";
+                                var res = X3TwoDfo();
+                                var content = new StringContent(JsonConvert.SerializeObject(res), System.Text.Encoding.UTF8, "application/json");
+                                var response = await client.PostAsync(url, content);
+                                Log($"已向[{txtAddr1.Text}]发送三星双频差定位仿真结果");
+                            }
+                            if (tskType == "X2Dfo")//双星时频差定位
                             {
-                                if (string.IsNullOrWhiteSpace(line)) continue;
-                                var items = line.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
-                                SendDto dto = new SendDto()
-                                {
-                                    SigTime = DateTime.Now,
-                                    SxDto = Convert.ToDouble(items[0]),
-                                    XdDto = Convert.ToDouble(items[1]),
-                                    MainYbDto = Convert.ToDouble(items[2]),
-                                    AdjaYbDto = Convert.ToDouble(items[3]),
-                                    CxRes = Convert.ToDouble(items[4]),
-                                    MainX = Convert.ToDouble(items[7]),
-                                    MainY = Convert.ToDouble(items[8]),
-                                    MainZ = Convert.ToDouble(items[9]),
-                                    AdjaX = Convert.ToDouble(items[10]),
-                                    AdjaY = Convert.ToDouble(items[11]),
-                                    AdjaZ = Convert.ToDouble(items[12]),
-                                    StationResInfo = stationRes
-                                };
-                                var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
+                                url += "PosX2DtoDfoAsync";
+                                var res = X2Dfo();
+                                var content = new StringContent(JsonConvert.SerializeObject(res), System.Text.Encoding.UTF8, "application/json");
                                 var response = await client.PostAsync(url, content);
-                                Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
+                                Log($"已向[{txtAddr1.Text}]发送双星时频差定位仿真结果");
                             }
+
                         }
                         catch (Exception ex)
                         {
@@ -124,7 +214,155 @@ namespace XdCxRhDW.Sender
                 cts1?.Cancel();
             }
         }
+        /// <summary>
+        /// 两星一地定位无参
+        /// </summary>
+        private X2D1PosDto X2D1NoPar()
+        {
+            X2D1PosDto X2D1PosDto = new X2D1PosDto();
+            X2D1PosDto.SigTime = DateTime.Now;
+            X2D1PosDto.SxDto = -0.002198485309353 * 1e6;
+            X2D1PosDto.XdDto = 0.245961726007262 * 1e6;
+            X2D1PosDto.MainX = -38209016;
+            X2D1PosDto.MainY = 17858458;
+            X2D1PosDto.MainZ = 13250;
+            X2D1PosDto.AdjaX = 4750323;
+            X2D1PosDto.AdjaY = 41902879;
+            X2D1PosDto.AdjaZ = 50515;
+            X2D1PosDto.SatTxLon = 118.8833;
+            X2D1PosDto.SatTxLat = 32.0667;
+            X2D1PosDto.CdbTxLon = 109.4082;
+            X2D1PosDto.CdbTxLat = 18.3878;
+            return X2D1PosDto;
+        }
+
+        /// <summary>
+        /// 三星双时差定位
+        /// </summary>
+        private X3TwoDtoPosDto X3TwoDto()
+        {
+            X3TwoDtoPosDto X3TwoDtoPosDto = new X3TwoDtoPosDto();
+            X3TwoDtoPosDto.SigTime = DateTime.Now;
+            X3TwoDtoPosDto.Dto1 = -0.0037683828 * 1e6;
+            X3TwoDtoPosDto.Dto2 = 0.00411476 * 1e6;
+            X3TwoDtoPosDto.YbMainDto = 0.253339246 * 1e6;
+            X3TwoDtoPosDto.YbAdja1Dto = 0.254082015 * 1e6;
+            X3TwoDtoPosDto.YbAdja2Dto = 0.247747625 * 1e6;
+            X3TwoDtoPosDto.MainX = -38209016;
+            X3TwoDtoPosDto.MainY = 17858458;
+            X3TwoDtoPosDto.MainZ = 13250;
+            X3TwoDtoPosDto.Adja1X = 4750323;
+            X3TwoDtoPosDto.Adja1Y = 41902879;
+            X3TwoDtoPosDto.Adja1Z = 50515;
+            X3TwoDtoPosDto.Adja2X = -30932433;
+            X3TwoDtoPosDto.Adja2Y = 28638701;
+            X3TwoDtoPosDto.Adja2Z = -582065;
+            X3TwoDtoPosDto.SatTxLon = 118.8833;
+            X3TwoDtoPosDto.SatTxLat = 32.0667;
+            X3TwoDtoPosDto.RefLon = 121.538;
+            X3TwoDtoPosDto.RefLat = 30.8385;
+            return X3TwoDtoPosDto;
+        }
 
+        /// <summary>
+        /// 三星双时差无参定位
+        /// </summary>
+        private X3TwoDtoNoParPosDto X3TwoDtoNoPar()
+        {
+            X3TwoDtoNoParPosDto X3TwoDtoNoParPosDto = new X3TwoDtoNoParPosDto();
+            X3TwoDtoNoParPosDto.SigTime = DateTime.Now;
+            X3TwoDtoNoParPosDto.Dto1 = -0.008361002956792 * 1e6;
+            X3TwoDtoNoParPosDto.Dto2 = 0.004191941221694 * 1e6;
+            X3TwoDtoNoParPosDto.MainX = -38214804;
+            X3TwoDtoNoParPosDto.MainY = 17780164;
+            X3TwoDtoNoParPosDto.MainZ = -6857;
+            X3TwoDtoNoParPosDto.Adja1X = 4824458;
+            X3TwoDtoNoParPosDto.Adja1Y = 41896265;
+            X3TwoDtoNoParPosDto.Adja1Z = -55899;
+            X3TwoDtoNoParPosDto.Adja2X = -27105105;
+            X3TwoDtoNoParPosDto.Adja2Y = 32302912;
+            X3TwoDtoNoParPosDto.Adja2Z = 11952;
+            X3TwoDtoNoParPosDto.SatTxLon = 121.3555;
+            X3TwoDtoNoParPosDto.SatTxLat = 31.3667;
+            return X3TwoDtoNoParPosDto;
+        }
+
+        /// <summary>
+        /// 三星双频差定位
+        /// </summary>
+        private X3TwoDfoPosDto X3TwoDfo()
+        {
+            X3TwoDfoPosDto X3TwoDfoPosDto = new X3TwoDfoPosDto();
+            X3TwoDfoPosDto.SigTime = DateTime.Now;
+            X3TwoDfoPosDto.Dfo1 = -17.601977254734404;
+            X3TwoDfoPosDto.Dfo2 = -36.885840020369514;
+            X3TwoDfoPosDto.YbMainDfo = 0;
+            X3TwoDfoPosDto.YbAdja1Dfo = 17.453698229247941;
+            X3TwoDfoPosDto.YbAdja2Dfo = 37.022577554138941;
+            X3TwoDfoPosDto.TarFreqUp = 3808 * 1e6 + 2225 * 1e6;
+            X3TwoDfoPosDto.TarFreqDown = 3808 * 1e6;
+            X3TwoDfoPosDto.RefFreqUp = 3796 * 1e6 + 2225 * 1e6;
+            X3TwoDfoPosDto.RefFreqDown = 3796 * 1e6;
+            X3TwoDfoPosDto.MainX = -18149981.873274;
+            X3TwoDfoPosDto.MainY = 38039767.675679;
+            X3TwoDfoPosDto.MainZ = -5662.335149;
+            X3TwoDfoPosDto.MainVx = -2.006064;
+            X3TwoDfoPosDto.MainVy = -1.4693;
+            X3TwoDfoPosDto.MainVz = 1.62569;
+            X3TwoDfoPosDto.Adja1X = -14770224.082665;
+            X3TwoDfoPosDto.Adja1Y = 39479299.786862;
+            X3TwoDfoPosDto.Adja1Z = -53188.063002;
+            X3TwoDfoPosDto.Adja1Vx = -1.764989;
+            X3TwoDfoPosDto.Adja1Vy = -0.528101;
+            X3TwoDfoPosDto.Adja1Vz = 1.808949;
+            X3TwoDfoPosDto.Adja2X = -33231255.13;
+            X3TwoDfoPosDto.Adja2Y = 25948042.76;
+            X3TwoDfoPosDto.Adja2Z = 27091.80;
+            X3TwoDfoPosDto.Adja2Vx = -0.607289;
+            X3TwoDfoPosDto.Adja2Vy = 0.089864;
+            X3TwoDfoPosDto.Adja2Vz = -0.069086;
+            X3TwoDfoPosDto.SatTxLon = 116.254567;
+            X3TwoDfoPosDto.SatTxLat = 39.65955;
+            X3TwoDfoPosDto.RefLon = 106.698;
+            X3TwoDfoPosDto.RefLat = 26.567;
+            return X3TwoDfoPosDto;
+        }
+
+        /// <summary>
+        /// 双星时频差定位
+        /// </summary>
+        private X2DtoDfoPosDto X2Dfo()
+        {
+            X2DtoDfoPosDto X2DtoDfoPosDto = new X2DtoDfoPosDto();
+            X2DtoDfoPosDto.SigTime = DateTime.Now;
+            X2DtoDfoPosDto.Dto = -3.587980198938979e-06 * 1e6;
+            X2DtoDfoPosDto.Dfo = -17.601977254734404;
+            X2DtoDfoPosDto.YbMainDto = 0;
+            X2DtoDfoPosDto.YbAdjaDto = 6.352805492137770e-05 * 1e6;
+            X2DtoDfoPosDto.YbMainDfo = 0;
+            X2DtoDfoPosDto.YbAdjaDfo = 17.453698229247941;
+            X2DtoDfoPosDto.TarFreqUp = 3808 * 1e6 + 2225 * 1e6;
+            X2DtoDfoPosDto.TarFreqDown = 3808 * 1e6;
+            X2DtoDfoPosDto.RefFreqUp = 3796 * 1e6 + 2225 * 1e6;
+            X2DtoDfoPosDto.RefFreqDown = 3796 * 1e6;
+            X2DtoDfoPosDto.MainX = -18149981.873274;
+            X2DtoDfoPosDto.MainY = 38039767.675679;
+            X2DtoDfoPosDto.MainZ = -5662.335149;
+            X2DtoDfoPosDto.MainVx = -2.006064;
+            X2DtoDfoPosDto.MainVy = -1.4693;
+            X2DtoDfoPosDto.MainVz = 1.62569;
+            X2DtoDfoPosDto.AdjaX = -14770224.082665;
+            X2DtoDfoPosDto.AdjaY = 39479299.786862;
+            X2DtoDfoPosDto.AdjaZ = -53188.063002;
+            X2DtoDfoPosDto.AdjaVx = -1.764989;
+            X2DtoDfoPosDto.AdjaVy = -0.528101;
+            X2DtoDfoPosDto.AdjaVz = 1.808949;
+            X2DtoDfoPosDto.SatTxLon = 116.254567;
+            X2DtoDfoPosDto.SatTxLat = 39.65955;
+            X2DtoDfoPosDto.RefLon = 106.698;
+            X2DtoDfoPosDto.RefLat = 26.567;
+            return X2DtoDfoPosDto;
+        }
 
         private void Log(string msg)
         {
@@ -152,6 +390,7 @@ namespace XdCxRhDW.Sender
             catch
             { }
         }
+
         private void Log(Exception ex)
         {
             try

+ 3 - 3
XdCxRhDw.Dto/PosDto/X3TwoDfoPosDto.cs

@@ -50,17 +50,17 @@ namespace XdCxRhDw.Dto
         /// <summary>
         /// 样本主星频差(Hz)
         /// </summary>
-        public double? YbMainDfo { get; set; }
+        public double YbMainDfo { get; set; }
 
         /// <summary>
         /// 样本邻星1频差(Hz)
         /// </summary>
-        public double? YbAdja1Dfo { get; set; }
+        public double YbAdja1Dfo { get; set; }
 
         /// <summary>
         /// 样本邻星1频差(Hz)
         /// </summary>
-        public double? YbAdja2Dfo { get; set; }
+        public double YbAdja2Dfo { get; set; }
 
         /// <summary>
         /// 目标上行频点(Hz)