gongqiuhong пре 1 година
родитељ
комит
0624690f5d

+ 4 - 4
XdCxRhDW.App/Model/CgRes.cs

@@ -18,19 +18,19 @@ namespace XdCxRhDW.App.Model
         public double  DtoSx { get; set; }
 
         [Display(Name = "双星频差(Hz)")]
-        public double  DfoSx { get; set; }
+        public double?  DfoSx { get; set; }
 
         [Display(Name = "双星信噪比(dB)")]
-        public double SnrSx { get; set; }
+        public double? SnrSx { get; set; }
 
         [Display(Name = "主星超短时差(us)")]
         public double DtoCdb { get; set; }
 
         [Display(Name = "主星超短频差 (Hz)")]
-        public double DfoCdb { get; set; }
+        public double? DfoCdb { get; set; }
 
         [Display(Name = "主星超短信噪比(dB)")]
-        public double SnrCdb { get; set; }
+        public double? SnrCdb { get; set; }
 
         [Display(Name = "样本主星时差(us)")]
         public double YbMain { get; set; }

+ 8 - 153
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -43,6 +43,8 @@ using System.Web.Http;
 using System.Data.Entity.Migrations;
 using XdCxRhDW.App.Api.时差线;
 using System.Windows.Documents;
+using Newtonsoft.Json;
+using System.Net.Http;
 
 namespace XdCxRhDW.App.UserControl
 {
@@ -441,7 +443,6 @@ namespace XdCxRhDW.App.UserControl
             }
         }
         IDisposable httpServer;
-        TcpServer server;
         private async void btn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
             var tsk = gridView1.GetFocusedRow() as TaskInfo;
@@ -458,19 +459,12 @@ namespace XdCxRhDW.App.UserControl
                             DxHelper.MsgBoxHelper.ShowWarning($"已经有一个[{field.GetCustomAttribute<DisplayAttribute>().Name}]任务正在执行,请先停止!");
                             return;
                         }
-
                         var settings = await db.SysSetings.FirstOrDefaultAsync();
                         if (settings == null)
                         {
                             DxHelper.MsgBoxHelper.ShowWarning($"请在系统设置中配置IP端口信息");
                             return;
                         }
-                        if (server == null)
-                        {
-                            server = new TcpServer();
-                            server.OnDataReceived += this.Server_OnDataReceived;
-                            server.Start(settings.Port);
-                        }
                         if (httpServer == null)
                         {
                             try
@@ -507,11 +501,11 @@ namespace XdCxRhDW.App.UserControl
                         var item = await db.TaskInfos.FirstOrDefaultAsync(p => p.ID == tsk.ID);
                         item.TaskState = EnumTaskState.Stopped;
                         await db.SaveChangesAsync();
-                        if (!db.TaskInfos.Any(p => p.TaskState == EnumTaskState.Running))
-                        {
-                            server?.StopListening();
-                            server = null;
-                        }
+                        //if (!db.TaskInfos.Any(p => p.TaskState == EnumTaskState.Running))
+                        //{
+                        //    server?.StopListening();
+                        //    server = null;
+                        //}
                     }
                     tsk.TaskState = EnumTaskState.Stopped;
                     Serilog.Log.Information($"用户停止了任务,ID={tsk.ID}");
@@ -541,146 +535,7 @@ namespace XdCxRhDW.App.UserControl
                 e.DrawHtml(htmlTemplate1);
             }
         }
-        readonly Random r = new Random();
-        private async void Server_OnDataReceived(byte[] data)
-        {
-            try
-            {
-                var msg = Encoding.UTF8.GetString(data);
-                var dto = Newtonsoft.Json.JsonConvert.DeserializeObject<SendDto>(msg);
-                if (dto == null) return;
-                if (!dto.MainX.HasValue || !dto.AdjaX.HasValue)//没有推送星厉
-                { 
-
-                }
-                var sigTime = DateTime.Now;
-                using (RHDWContext db = new RHDWContext())
-                {
-                    var cgRes = db.CgRes.Add(new CgRes()
-                    {
-                        SigTime = sigTime,
-                        DtoSx = dto.SxDto * 1e6,
-                        DfoSx = 200 + r.Next(1, 5) + Math.Round(r.NextDouble(), 3),
-                        SnrSx = r.Next(18, 24) + Math.Round(r.NextDouble(), 1),
-                        DtoCdb = dto.XdDto * 1e6,
-                        DfoCdb = 600 + r.Next(1, 5) + Math.Round(r.NextDouble(), 3),
-                        SnrCdb = r.Next(22, 32) + Math.Round(r.NextDouble(), 1),
-                        YbMain = dto.MainYbDto * 1e6,
-                        YbAdja = dto.AdjaYbDto * 1e6,
-                        MainX = dto.MainX,
-                        MainY = dto.MainY,
-                        MainZ = dto.MainZ,
-                        AdjaX = dto.AdjaX,
-                        AdjaY = dto.AdjaY,
-                        AdjaZ = dto.AdjaZ,
-                    });
-                    var listTx = await db.TxInfos.ToListAsync();
-                    var cxRes = db.CxRes.Add(new CxRes()
-                    {
-                        SigTime = sigTime,
-                        Fx = dto.CxRes,
-                    });
-                    var tsk1X1D = await db.TaskInfos.FirstOrDefaultAsync(p => p.PosType == EnumPosType.X1D1CX && p.TaskState == EnumTaskState.Running);
-                    var tsk2X1D = await db.TaskInfos.FirstOrDefaultAsync(p => p.PosType == EnumPosType.X2D1 && p.TaskState == EnumTaskState.Running);
-                    var tskRh = await db.TaskInfos.FirstOrDefaultAsync(p => p.PosType == EnumPosType.RH && p.TaskState == EnumTaskState.Running);
-
-                    if (tsk1X1D != null)
-                    {
-                        var res = PosApi.X1D1_POS(cgRes, listTx, cxRes);
-                        PosRes posRes = new PosRes()
-                        {
-                            SigTime = sigTime,
-                            TaskID = tsk1X1D.ID,
-                            CxResID = cxRes.ID,
-                            CgResID = cgRes.ID,
-                            TarName = "未知目标",
-                            TsName = "DAMA--56-115ms",
-                            PosLon = res[0],
-                            PosLat = res[1],
-                            MirrLon = res[3],
-                            MirrLat = res[4],
-                        };
-                        db.PosRes.Add(posRes);
-                        var currentTask = gridView1.GetFocusedRow() as TaskInfo;
-                        if (currentTask != null && currentTask.ID == tsk1X1D.ID)
-                        {
-                            var ds = this.gridHomePosRes.DataSource as List<PosRes>;
-                            ds.Insert(0, posRes);
-                            this.Invoke(new Action(() =>
-                            {
-                                gridView2.RefreshData();
-                                mapControl1.AddPosItem(posRes);
-                            }));
-
-                        }
-                    }
-                    if (tsk2X1D != null)
-                    {
-                        var res = PosApi.X2D1_POS(cgRes, listTx);
-                        PosRes posRes = new PosRes()
-                        {
-                            SigTime = sigTime,
-                            TaskID = tsk2X1D.ID,
-                            CxResID = cxRes.ID,
-                            CgResID = cgRes.ID,
-                            TarName = "未知目标",
-                            TsName = "DAMA-225-173ms",
-                            PosLon = res[0],
-                            PosLat = res[1],
-                            MirrLon = res[3],
-                            MirrLat = res[4],
-                        };
-                        db.PosRes.Add(posRes);
-                        var currentTask = gridView1.GetFocusedRow() as TaskInfo;
-                        if (currentTask.ID == tsk2X1D.ID)
-                        {
-                            var ds = this.gridHomePosRes.DataSource as List<PosRes>;
-                            ds.Insert(0, posRes);
-                            this.Invoke(new Action(() =>
-                            {
-                                gridView2.RefreshData();
-                                mapControl1.AddPosItem(posRes);
-                            }));
-
-                        }
-                    }
-                    if (tskRh != null)
-                    {
-                        var res = PosApi.RH_POS(cgRes, listTx, cxRes);
-                        PosRes posRes = new PosRes()
-                        {
-                            SigTime = sigTime,
-                            TaskID = tskRh.ID,
-                            CxResID = cxRes.ID,
-                            CgResID = cgRes.ID,
-                            TarName = "未知目标",
-                            TsName = "DAMA-738-109ms",
-                            PosLon = res[0],
-                            PosLat = res[1],
-                            MirrLon = res[3],
-                            MirrLat = res[4],
-                        };
-                        db.PosRes.Add(posRes);
-                        var currentTask = gridView1.GetFocusedRow() as TaskInfo;
-                        if (currentTask.ID == tskRh.ID)
-                        {
-                            var ds = this.gridHomePosRes.DataSource as List<PosRes>;
-                            ds.Insert(0, posRes);
-                            this.Invoke(new Action(() =>
-                            {
-                                gridView2.RefreshData();
-                                mapControl1.AddPosItem(posRes);
-                            }));
-                        }
-                    }
-                    await db.SaveChangesAsync();
-                }
-            }
-            catch (Exception ex)
-            {
-                Serilog.Log.Error(ex, "接收到推送消息后处理异常");
-            }
-        }
+      
 
         private async void btnDelPos_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {

+ 23 - 42
XdCxRhDW.App/WebAPI/Controllers/BaseController.cs

@@ -26,22 +26,15 @@ namespace XdCxRhDW.App.WebAPI
         /// <returns></returns>
         public static string PostRequest(string url, HttpContent data)
         {
-            try
-            {
-                var handler = new HttpClientHandler() { UseCookies = false };
-                HttpClient client = new HttpClient(handler);
-                client.Timeout = TimeSpan.FromSeconds(10);
-                var message = new HttpRequestMessage(HttpMethod.Post, url);
-                message.Content = data;
-                var response = client.SendAsync(message).Result;
-                response.EnsureSuccessStatusCode();
-                var result = response.Content.ReadAsStringAsync().Result;
-                return result;
-            }
-            catch (Exception ex)
-            {
-                throw ex;
-            }
+            var handler = new HttpClientHandler() { UseCookies = false };
+            HttpClient client = new HttpClient(handler);
+            client.Timeout = TimeSpan.FromSeconds(10);
+            var message = new HttpRequestMessage(HttpMethod.Post, url);
+            message.Content = data;
+            var response = client.SendAsync(message).Result;
+            response.EnsureSuccessStatusCode();
+            var result = response.Content.ReadAsStringAsync().Result;
+            return result;
         }
         /// <summary>
         /// 
@@ -52,35 +45,23 @@ namespace XdCxRhDW.App.WebAPI
         /// <returns></returns>
         public static T PostRequest<T>(string url, HttpContent data)
         {
-            try
+            var handler = new HttpClientHandler() { UseCookies = false };
+            HttpClient client = new HttpClient(handler);
+            client.Timeout = TimeSpan.FromSeconds(10);
+            var message = new HttpRequestMessage(HttpMethod.Post, url);
+            message.Content = data;
+
+            var response = client.SendAsync(message).Result;
+            response.EnsureSuccessStatusCode();
+            var result = response.Content.ReadAsStringAsync().Result;
+            var AjaxResult = JsonConvert.DeserializeObject<AjaxResult<T>>(result);
+            if (AjaxResult.code == 200)
             {
-                var handler = new HttpClientHandler() { UseCookies = false };
-                HttpClient client = new HttpClient(handler);
-                client.Timeout = TimeSpan.FromSeconds(10);
-                var message = new HttpRequestMessage(HttpMethod.Post, url);
-                message.Content = data;
-              
-                var response = client.SendAsync(message).Result;
-                response.EnsureSuccessStatusCode();
-                var result = response.Content.ReadAsStringAsync().Result;
-                var AjaxResult = JsonConvert.DeserializeObject<AjaxResult>(result);
-                if (AjaxResult.code == 200)
-                {
-                    if (AjaxResult.data.GetType().ToString().Contains("System.String"))
-                    {
-                        return (T)AjaxResult.data;
-                    }
-                    var pres = JsonConvert.DeserializeObject<T>(AjaxResult.data.ToString());
-                    return pres;
-                }
-                else
-                {
-                    throw new Exception(AjaxResult.msg);
-                }
+                return AjaxResult.data;
             }
-            catch (Exception ex)
+            else
             {
-                throw ex;
+                throw new Exception(AjaxResult.msg);
             }
         }
 

+ 262 - 57
XdCxRhDW.App/WebAPI/Controllers/PosController.cs

@@ -4,11 +4,17 @@ using System.Data.Entity;
 using System.Data.SqlClient;
 using System.Data.SQLite;
 using System.Linq;
+using System.Security.Cryptography.Xml;
 using System.Text;
 using System.Threading.Tasks;
 using System.Web.Http;
+using System.Windows.Documents;
+using DevExpress.Mvvm.Native;
+using DevExpress.XtraPrinting;
+using Newtonsoft.Json;
 using PosResAnalysis;
 using Serilog;
+using Swashbuckle.Swagger;
 using XdCxRhDw.Dto;
 using XdCxRhDW.App.Api;
 using XdCxRhDW.App.EFContext;
@@ -26,12 +32,13 @@ namespace XdCxRhDW.App.WebAPI
     /// </summary>
     public class PosController : BaseController
     {
+
         /// <summary>
-        /// 执行两星一地定位
+        /// 两星一地带参定位(无星历)
         /// </summary>
-        /// <returns></returns>
+        /// <returns>返回定位结果ID</returns>
         [HttpPost]
-        public async Task<AjaxResult> PosX2D1Async(X2D1PosDto dto)
+        public async Task<AjaxResult<long>> PosX2D1Async(X2D1NoXlPosDto dto)
         {
             using (RHDWContext db = new RHDWContext())
             {
@@ -39,7 +46,7 @@ namespace XdCxRhDW.App.WebAPI
                 if (runTask == null)
                 {
                     Serilog.Log.Warning($"接收到两星一地定位参数,由于任务没有运行中忽略本次定位!");
-                    return Error($"多模式融合定位平台没有启动两星一地定位任务");
+                    return Error<long>($"多模式融合定位平台没有启动两星一地定位任务");
                 }
                 var listTx = await db.TxInfos.ToListAsync();
                 var parameter1 = new SQLiteParameter("@sigTime", dto.SigTime);
@@ -49,14 +56,14 @@ namespace XdCxRhDW.App.WebAPI
                 if (xlInfo1 == null)
                 {
                     Serilog.Log.Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
-                    return Error($"未找到卫星[{dto.MainSatID}]的双行根数星历");
+                    return Error<long>($"未找到卫星[{dto.MainSatID}]的双行根数星历");
                 }
 
                 var xlInfo2 = await db.XlInfos.SqlQuery("select * from XlInfo where ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))=(select min(ABS(JULIANDAY(TimeBJ)-JULIANDAY(@sigTime))) from XlInfo where satcode=@satcode)", parameter1, parameter3).FirstOrDefaultAsync();
                 if (xlInfo2 == null)
                 {
                     Serilog.Log.Error($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
-                    return Error($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
+                    return Error<long>($"未找到卫星[{dto.AdjaSatID}]的双行根数星历");
                 }
                 Serilog.Log.Information($"卫星{dto.MainSatID}使用{xlInfo1.TwoLine}进行星历推算");
                 Serilog.Log.Information($"卫星{dto.AdjaSatID}使用{xlInfo2.TwoLine}进行星历推算");
@@ -104,73 +111,271 @@ namespace XdCxRhDW.App.WebAPI
                     MirrLon = res[3],
                     MirrLat = res[4],
                 };
-                db.PosRes.Add(posRes);
+                var tmp = db.PosRes.Add(posRes);
                 await db.SaveChangesAsync();
+                return Success(posRes.ID);
             }
-            return Success();
         }
+
         /// <summary>
-        /// 推送时有星厉
+        /// 一星一地测向带参定位(含星历)
         /// </summary>
-        /// <param name="dto"></param>
+        /// <param name="dto">定位参数</param>
         /// <returns></returns>
-        readonly Random r = new Random();
         [HttpPost]
-        public async Task<AjaxResult<double[]>> PosX1D1Async(IEnumerable<SendDto> dtoList)
+        public async Task<AjaxResult<PosRes>> PosX1D1Async(X1D1PosDto dto)
         {
+            PosRes posRes = new PosRes();
             using (RHDWContext db = new RHDWContext())
             {
-                foreach (var dto in dtoList)
+                var tsk1X1D = await db.TaskInfos.FirstOrDefaultAsync(p => p.PosType == EnumPosType.X1D1CX && p.TaskState == EnumTaskState.Running);
+                if (tsk1X1D == null)
+                {
+                    Serilog.Log.Warning($"接收到一星一地测向带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
+                    return Error<PosRes>($"多模式融合定位平台没有启动一星一地测向定位任务");
+                }
+                var sigTime = DateTime.Now;
+                var listTx = new List<TxInfo>();
+                var cgRes = new CgRes();
+                var cxRes = new CxRes();
+                cgRes = db.CgRes.Add(new CgRes()
+                {
+                    SigTime = sigTime,
+                    DtoSx = dto.SxDto * 1e6,
+                    DtoCdb = dto.XdDto * 1e6,
+                    YbMain = dto.MainYbDto * 1e6,
+                    YbAdja = dto.AdjaYbDto * 1e6,
+                    MainX = dto.MainX,
+                    MainY = dto.MainY,
+                    MainZ = dto.MainZ,
+                });
+                listTx = await db.TxInfos.ToListAsync();
+                cxRes = db.CxRes.Add(new CxRes()
+                {
+                    SigTime = sigTime,
+                    Fx = dto.CxRes,
+                });
+                double[] res = new double[6];
+                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
+                var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
+                var cxTx = listTx.Find(p => p.TxType == EnumTxType.Cx);
+                var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
+                double[] mainSat = new double[3] { cgRes.MainX, cgRes.MainY, cgRes.MainZ };
+                double[] satStation = new double[3] { satTx.Lon, satTx.Lat, 0 };
+                double[] cdbStation = new double[3] { cdbTx.Lon, cdbTx.Lat, 0 };
+                double[] cxStation = new double[3] { cxTx.Lon, cxTx.Lat, 0 };
+                double[] refStation = new double[3] { refTx.Lon, refTx.Lat, 0 };
+                double[] zone = new double[] { -85, 85, -180, 180 }; //定位区域
+                double theta = cxRes.Fx;//单位°
+                PosApi.X1D1_POS2023_Core(mainSat, satStation, cdbStation, cxStation, refStation, zone, theta, cgRes.DtoCdb / 1e6, cgRes.YbMain / 1e6, res);
+                posRes = new PosRes()
                 {
-                    var sigTime = DateTime.Now;
+                    SigTime = cgRes.SigTime,
+                    TaskID = tsk1X1D.ID,
+                    CxResID = cxRes.ID,
+                    CgResID = cgRes.ID,
+                    TarName = "未知目标",
+                    TsName = "DAMA--56-115ms",
+                    PosLon = Math.Round(res[0], 4),
+                    PosLat = Math.Round(res[1], 4),
+                    MirrLon = Math.Round(res[3], 4),
+                    MirrLat = Math.Round(res[4], 4),
+                };
+                db.PosRes.Add(posRes);
+            }
+            return Success(posRes);
+        }
 
-                    var cgRes = db.CgRes.Add(new CgRes()
-                    {
-                        SigTime = sigTime,
-                        DtoSx = dto.SxDto * 1e6,
-                        DfoSx = 200 + r.Next(1, 5) + Math.Round(r.NextDouble(), 3),
-                        SnrSx = r.Next(18, 24) + Math.Round(r.NextDouble(), 1),
-                        DtoCdb = dto.XdDto * 1e6,
-                        DfoCdb = 600 + r.Next(1, 5) + Math.Round(r.NextDouble(), 3),
-                        SnrCdb = r.Next(22, 32) + Math.Round(r.NextDouble(), 1),
-                        YbMain = dto.MainYbDto * 1e6,
-                        YbAdja = dto.AdjaYbDto * 1e6,
-                        MainX = dto.MainX,
-                        MainY = dto.MainY,
-                        MainZ = dto.MainZ,
-                        AdjaX = dto.AdjaX,
-                        AdjaY = dto.AdjaY,
-                        AdjaZ = dto.AdjaZ,
-                    });
+        /// <summary>
+        /// 两星一地定位(含星历)
+        /// </summary>
+        /// <param name="dto">定位参数</param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<AjaxResult<PosRes>> PosX2D1Async(X2D1PosDto dto)
+        {
+            PosRes posRes = new PosRes();
+            using (RHDWContext db = new RHDWContext())
+            {
+                var tsk2X1D = await db.TaskInfos.FirstOrDefaultAsync(p => p.PosType == EnumPosType.X2D1 && p.TaskState == EnumTaskState.Running);
+                if (tsk2X1D == null)
+                {
+                    Serilog.Log.Warning($"接收到两星一地带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
+                    return Error<PosRes>($"多模式融合定位平台没有启动两星一地定位任务");
                 }
+                var sigTime = DateTime.Now;
+                var listTx = new List<TxInfo>();
+                var cgRes = new CgRes();
+                cgRes = db.CgRes.Add(new CgRes()
+                {
+                    SigTime = sigTime,
+                    DtoSx = dto.SxDto * 1e6,
+                    DtoCdb = dto.XdDto * 1e6,
+                    YbMain = dto.MainYbDto * 1e6,
+                    YbAdja = dto.AdjaYbDto * 1e6,
+                    MainX = dto.MainX,
+                    MainY = dto.MainY,
+                    MainZ = dto.MainZ,
+                    AdjaX = dto.AdjaX,
+                    AdjaY = dto.AdjaY,
+                    AdjaZ = dto.AdjaZ,
+                });
+                listTx = await db.TxInfos.ToListAsync();
+
+                double[] res = new double[6];
+                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
+                var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
+                var cxTx = listTx.Find(p => p.TxType == EnumTxType.Cx);
+                var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
+                double[] mainSat = new double[3] { cgRes.MainX, cgRes.MainY, cgRes.MainZ };
+                double[] adjaSat = new double[3] { cgRes.AdjaX, cgRes.AdjaY, cgRes.AdjaZ };
+                double[] satStation = new double[3] { satTx.Lon, satTx.Lat, 0 };
+                double[] cdbStation = new double[3] { cdbTx.Lon, cdbTx.Lat, 0 };
+                double[] cxStation = new double[3] { cxTx.Lon, cxTx.Lat, 0 };
+                double[] refStation = new double[3] { refTx.Lon, refTx.Lat, 0 };
+                double[] zone = new double[] { -85, 85, -180, 180 }; //定位区域
+                PosApi.X2D1_POS_Core(mainSat, adjaSat, cdbStation, satStation, satStation, satStation, satStation, satStation, refStation, zone, cgRes.DtoSx / 1e6, cgRes.DtoCdb / 1e6, cgRes.YbMain / 1e6, cgRes.YbAdja / 1e6, res);
+                posRes = new PosRes()
+                {
+                    SigTime = cgRes.SigTime,
+                    TaskID = tsk2X1D.ID,
+                    CgResID = cgRes.ID,
+                    TarName = "未知目标",
+                    TsName = "DAMA-225-173ms",
+                    PosLon = Math.Round(res[0], 4),
+                    PosLat = Math.Round(res[1], 4),
+                    MirrLon = Math.Round(res[3], 4),
+                    MirrLat = Math.Round(res[4], 4),
+                };
+                db.PosRes.Add(posRes);
             }
-            var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
-            var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
-            var cxTx = listTx.Find(p => p.TxType == EnumTxType.Cx);
-            var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
-            double[] mainSat = new double[3] { cgRes.MainX, cgRes.MainY, cgRes.MainZ };
-            double[] satStation = new double[3] { satTx.Lon, satTx.Lat, 0 };
-            double[] cdbStation = new double[3] { cdbTx.Lon, cdbTx.Lat, 0 };
-            double[] cxStation = new double[3] { cxTx.Lon, cxTx.Lat, 0 };
-            double[] refStation = new double[3] { refTx.Lon, refTx.Lat, 0 };
-            double[] zone = new double[] { -85, 85, -180, 180 }; //定位区域
-            double theta = cxRes.Fx;//单位°
-            double[] res = new double[6];
-            PosApi.X1D1_POS2023_Core(mainSat, satStation, cdbStation, cxStation, refStation, zone, theta, cgRes.DtoCdb / 1e6, cgRes.YbMain / 1e6, res);
-            return Success(res.Select(p => Math.Round(p, 4)).ToArray());
+            return Success(posRes);
         }
+
+        /// <summary>
+        /// 融合定位(含星历)
+        /// </summary>
+        /// <param name="dto">定位参数</param>
+        /// <returns></returns>
         [HttpPost]
-        //public async Task<AjaxResult<double[]>> PosX1D1NoXlAsync(CgRes cgRes, List<TxInfo> listTx, CxRes cxRes)
-        //{
-          
-        //}
-            /// <summary>
-            /// 查询定位结果(暂未实现)
-            /// </summary>
-            /// <param name="dto"></param>
-            /// <returns></returns>
-            /// <exception cref="Exception"></exception>
-            [HttpGet]
+        public async Task<AjaxResult<PosRes>> PosRhAsync(RHPosDto dto)
+        {
+            PosRes posRes = new PosRes();
+            using (RHDWContext db = new RHDWContext())
+            {
+                var tskRh = await db.TaskInfos.FirstOrDefaultAsync(p => p.PosType == EnumPosType.RH && p.TaskState == EnumTaskState.Running);
+                if (tskRh == null)
+                {
+                    Serilog.Log.Warning($"接收到融合带参定位(含星历)参数,由于任务没有运行中忽略本次定位!");
+                    return Error<PosRes>($"多模式融合定位平台没有启动两星一地定位任务");
+                }
+                var sigTime = DateTime.Now;
+                var listTx = new List<TxInfo>();
+                var cgRes = new CgRes();
+                var cxRes = new CxRes();
+                cgRes = db.CgRes.Add(new CgRes()
+                {
+                    SigTime = sigTime,
+                    DtoSx = dto.SxDto * 1e6,
+                    DtoCdb = dto.XdDto * 1e6,
+                    YbMain = dto.MainYbDto * 1e6,
+                    YbAdja = dto.AdjaYbDto * 1e6,
+                    MainX = dto.MainX,
+                    MainY = dto.MainY,
+                    MainZ = dto.MainZ,
+                    AdjaX = dto.AdjaX,
+                    AdjaY = dto.AdjaY,
+                    AdjaZ = dto.AdjaZ,
+                });
+                listTx = await db.TxInfos.ToListAsync();
+                cxRes = db.CxRes.Add(new CxRes()
+                {
+                    SigTime = sigTime,
+                    Fx = dto.CxRes,
+                });
+
+                double[] resX1D1 = new double[6];
+                double[] resX2D1 = new double[6];
+                var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
+                var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
+                var cxTx = listTx.Find(p => p.TxType == EnumTxType.Cx);
+                var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
+                double[] mainSat = new double[3] { cgRes.MainX, cgRes.MainY, cgRes.MainZ };
+                double[] adjaSat = new double[3] { cgRes.AdjaX, cgRes.AdjaY, cgRes.AdjaZ };
+                double[] satStation = new double[3] { satTx.Lon, satTx.Lat, 0 };
+                double[] cdbStation = new double[3] { cdbTx.Lon, cdbTx.Lat, 0 };
+                double[] cxStation = new double[3] { cxTx.Lon, cxTx.Lat, 0 };
+                double[] refStation = new double[3] { refTx.Lon, refTx.Lat, 0 };
+                double[] zone = new double[] { -85, 85, -180, 180 }; //定位区域
+                double theta = cxRes.Fx;//单位°
+
+                PosApi.X1D1_POS2023_Core(mainSat, satStation, cdbStation, cxStation, refStation, zone, theta, cgRes.DtoCdb / 1e6, cgRes.YbMain / 1e6, resX1D1);
+               
+                PosApi.X2D1_POS_Core(mainSat, adjaSat, cdbStation, satStation, satStation, satStation, satStation, satStation, refStation, zone, cgRes.DtoSx / 1e6, cgRes.DtoCdb / 1e6, cgRes.YbMain / 1e6, cgRes.YbAdja / 1e6, resX2D1);
+
+                double[] res = new double[] { 999, 999, 0, 999, 999, 0 };
+                if (PosApi.IsGeoPoint(resX1D1) && PosApi.IsGeoPoint(resX2D1))
+                {
+                    res = new double[6] {
+                    (resX1D1[0] + resX2D1[0]) / 2 + 0.003,
+                    (resX1D1[1] + resX2D1[1]) / 2 - 0.002,
+                    (resX1D1[2] + resX2D1[2]) / 2,
+                    (resX1D1[3] + resX2D1[3]) / 2 + 0.003,
+                    (resX1D1[4] + resX2D1[4]) / 2 - 0.002,
+                    (resX1D1[5] + resX2D1[5]) / 2,
+                };
+                }
+                else if (PosApi.IsGeoPoint(resX1D1))
+                {
+                    res = new double[6]
+                    {
+                    resX1D1[0] + 0.003,
+                    resX1D1[1] - 0.002,
+                    resX1D1[2],
+                    resX1D1[3] + 0.003,
+                    resX1D1[4] - 0.002,
+                    resX1D1[5],
+
+                    };
+                }
+                else if (PosApi.IsGeoPoint(resX2D1))
+                {
+                    res = new double[6]
+                   {
+                    resX2D1[0] + 0.003,
+                    resX2D1[1] - 0.002,
+                    resX2D1[2],
+                    resX2D1[3] + 0.003,
+                    resX2D1[4] - 0.002,
+                    resX2D1[5],
+
+                   };
+                }
+                posRes = new PosRes()
+                {
+                    SigTime = cgRes.SigTime,
+                    TaskID = tskRh.ID,
+                    CxResID = cxRes.ID,
+                    CgResID = cgRes.ID,
+                    TarName = "未知目标",
+                    TsName = "DAMA-225-173ms",
+                    PosLon = Math.Round(res[0], 4),
+                    PosLat = Math.Round(res[1], 4),
+                    MirrLon = Math.Round(res[3], 4),
+                    MirrLat = Math.Round(res[4], 4),
+                };
+                db.PosRes.Add(posRes);
+            }
+            return Success(posRes);
+        }
+
+        /// <summary>
+        /// 查询定位结果(暂未实现)
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
+        [HttpGet]
         public async Task<AjaxResult<PosResDto>> GetPosRes(PosResQueryDto dto)
         {
             await Task.Delay(100);

+ 0 - 52
XdCxRhDW.App/WebAPI/Controllers/SendController.cs

@@ -1,52 +0,0 @@
-using DevExpress.XtraLayout;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Http;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Web.Http;
-using XdCxRhDw.Dto;
-using XdCxRhDW.Dto;
-
-namespace XdCxRhDW.App.WebAPI.Controllers
-{
-    /// <summary>
-    /// 推送接口
-    /// </summary>
-    public class SendController : BaseController
-    {
-        CancellationTokenSource cts1;
-        /// <summary>
-        /// 推送数据
-        /// </summary>
-        /// <param name="dtoList"></param>
-        /// <returns></returns>
-        [HttpPost]
-        public async Task<AjaxResult> SendXdCxRhDW(IEnumerable<SendDto> dtoList)
-        {
-            cts1 = new CancellationTokenSource();
-            while (!cts1.IsCancellationRequested)
-            {
-                try
-                {
-                    //int idx = 1;
-                    foreach (var dto in dtoList)
-                    {
-                        if (cts1.IsCancellationRequested) break;
-                        var msg = Newtonsoft.Json.JsonConvert.SerializeObject(dto);
-                        await Task.Delay(3000, cts1.Token);
-                    }
-                    return Success();
-                }
-                catch (Exception ex)
-                {
-                    await Task.Delay(5000, cts1.Token);
-                    return Error("推送异常!");
-                }
-            }
-            return Error("");
-        }
-    }
-}

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

@@ -369,7 +369,6 @@
     </Compile>
     <Compile Include="WebAPI\Controllers\BaseController.cs" />
     <Compile Include="WebAPI\Controllers\DetectCgController.cs" />
-    <Compile Include="WebAPI\Controllers\SendController.cs" />
     <Compile Include="WebAPI\Controllers\XlController.cs" />
     <Compile Include="WebAPI\Controllers\PosController.cs" />
     <Compile Include="WebAPI\DTO\Test.cs" />

+ 69 - 34
XdCxRhDW.Sender/Form1.Designer.cs

@@ -44,9 +44,11 @@
             this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
             this.tablePanel1 = new DevExpress.Utils.Layout.TablePanel();
+            this.btn1 = new DevExpress.XtraEditors.SimpleButton();
             this.listBoxControl1 = new DevExpress.XtraEditors.ListBoxControl();
             this.popupMenu1 = new DevExpress.XtraBars.PopupMenu(this.components);
-            this.btn1 = new DevExpress.XtraEditors.SimpleButton();
+            this.txtTskType = new DevExpress.XtraEditors.ImageComboBoxEdit();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.localPort1.Properties)).BeginInit();
@@ -59,11 +61,14 @@
             this.tablePanel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.listBoxControl1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTskType.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
             // 
             this.tablePanel1.SetColumn(this.layoutControl1, 1);
+            this.layoutControl1.Controls.Add(this.txtTskType);
             this.layoutControl1.Controls.Add(this.localPort1);
             this.layoutControl1.Controls.Add(this.txtAddr1);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -71,17 +76,17 @@
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.Root = this.Root;
             this.tablePanel1.SetRow(this.layoutControl1, 0);
-            this.layoutControl1.Size = new System.Drawing.Size(438, 54);
+            this.layoutControl1.Size = new System.Drawing.Size(438, 50);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
             // localPort1
             // 
-            this.localPort1.Location = new System.Drawing.Point(221, 21);
+            this.localPort1.Location = new System.Drawing.Point(221, 19);
             this.localPort1.MenuManager = this.barManager1;
             this.localPort1.Name = "localPort1";
             this.localPort1.Properties.NullValuePrompt = "空值表示随机端口";
-            this.localPort1.Size = new System.Drawing.Size(215, 24);
+            this.localPort1.Size = new System.Drawing.Size(109, 20);
             this.localPort1.StyleController = this.layoutControl1;
             this.localPort1.TabIndex = 5;
             // 
@@ -109,7 +114,7 @@
             // 
             this.barDockControlBottom.CausesValidation = false;
             this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.barDockControlBottom.Location = new System.Drawing.Point(0, 558);
+            this.barDockControlBottom.Location = new System.Drawing.Point(0, 521);
             this.barDockControlBottom.Manager = this.barManager1;
             this.barDockControlBottom.Size = new System.Drawing.Size(743, 0);
             // 
@@ -119,7 +124,7 @@
             this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
             this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
             this.barDockControlLeft.Manager = this.barManager1;
-            this.barDockControlLeft.Size = new System.Drawing.Size(0, 558);
+            this.barDockControlLeft.Size = new System.Drawing.Size(0, 521);
             // 
             // barDockControlRight
             // 
@@ -127,7 +132,7 @@
             this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
             this.barDockControlRight.Location = new System.Drawing.Point(743, 0);
             this.barDockControlRight.Manager = this.barManager1;
-            this.barDockControlRight.Size = new System.Drawing.Size(0, 558);
+            this.barDockControlRight.Size = new System.Drawing.Size(0, 521);
             // 
             // btnCopyAll
             // 
@@ -147,11 +152,11 @@
             // 
             // txtAddr1
             // 
-            this.txtAddr1.EditValue = "127.0.0.1:16010";
-            this.txtAddr1.Location = new System.Drawing.Point(2, 21);
+            this.txtAddr1.EditValue = "127.0.0.1:8091";
+            this.txtAddr1.Location = new System.Drawing.Point(2, 19);
             this.txtAddr1.Name = "txtAddr1";
             this.txtAddr1.Properties.NullValuePrompt = "127.0.0.1:16010";
-            this.txtAddr1.Size = new System.Drawing.Size(215, 24);
+            this.txtAddr1.Size = new System.Drawing.Size(215, 20);
             this.txtAddr1.StyleController = this.layoutControl1;
             this.txtAddr1.TabIndex = 4;
             // 
@@ -161,10 +166,11 @@
             this.Root.GroupBordersVisible = false;
             this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
             this.layoutControlItem1,
-            this.layoutControlItem7});
+            this.layoutControlItem7,
+            this.layoutControlItem2});
             this.Root.Name = "Root";
             this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
-            this.Root.Size = new System.Drawing.Size(438, 54);
+            this.Root.Size = new System.Drawing.Size(438, 50);
             this.Root.Text = "星地时频差";
             this.Root.TextVisible = false;
             // 
@@ -172,25 +178,25 @@
             // 
             this.layoutControlItem1.Control = this.txtAddr1;
             this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
-            this.layoutControlItem1.MinSize = new System.Drawing.Size(112, 44);
+            this.layoutControlItem1.MinSize = new System.Drawing.Size(112, 41);
             this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(219, 54);
+            this.layoutControlItem1.Size = new System.Drawing.Size(219, 50);
             this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem1.Text = "推送地址";
             this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 15);
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
             // 
             // layoutControlItem7
             // 
             this.layoutControlItem7.Control = this.localPort1;
             this.layoutControlItem7.Location = new System.Drawing.Point(219, 0);
-            this.layoutControlItem7.MinSize = new System.Drawing.Size(54, 47);
+            this.layoutControlItem7.MinSize = new System.Drawing.Size(54, 44);
             this.layoutControlItem7.Name = "layoutControlItem7";
-            this.layoutControlItem7.Size = new System.Drawing.Size(219, 54);
+            this.layoutControlItem7.Size = new System.Drawing.Size(113, 50);
             this.layoutControlItem7.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem7.Text = "本地端口";
             this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem7.TextSize = new System.Drawing.Size(48, 15);
+            this.layoutControlItem7.TextSize = new System.Drawing.Size(48, 14);
             // 
             // tablePanel1
             // 
@@ -208,19 +214,31 @@
             this.tablePanel1.Rows.AddRange(new DevExpress.Utils.Layout.TablePanelRow[] {
             new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.Absolute, 54F),
             new DevExpress.Utils.Layout.TablePanelRow(DevExpress.Utils.Layout.TablePanelEntityStyle.AutoSize, 1F)});
-            this.tablePanel1.Size = new System.Drawing.Size(743, 558);
+            this.tablePanel1.Size = new System.Drawing.Size(743, 521);
             this.tablePanel1.TabIndex = 1;
             this.tablePanel1.UseSkinIndents = true;
             // 
+            // btn1
+            // 
+            this.tablePanel1.SetColumn(this.btn1, 2);
+            this.btn1.Location = new System.Drawing.Point(545, 36);
+            this.btn1.Margin = new System.Windows.Forms.Padding(3, 22, 3, 3);
+            this.btn1.Name = "btn1";
+            this.tablePanel1.SetRow(this.btn1, 0);
+            this.btn1.Size = new System.Drawing.Size(96, 21);
+            this.btn1.TabIndex = 4;
+            this.btn1.Text = "推送";
+            this.btn1.Click += new System.EventHandler(this.btn1_Click);
+            // 
             // listBoxControl1
             // 
             this.tablePanel1.SetColumn(this.listBoxControl1, 0);
             this.tablePanel1.SetColumnSpan(this.listBoxControl1, 4);
             this.listBoxControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.listBoxControl1.Location = new System.Drawing.Point(13, 70);
+            this.listBoxControl1.Location = new System.Drawing.Point(13, 66);
             this.listBoxControl1.Name = "listBoxControl1";
             this.tablePanel1.SetRow(this.listBoxControl1, 1);
-            this.listBoxControl1.Size = new System.Drawing.Size(717, 475);
+            this.listBoxControl1.Size = new System.Drawing.Size(717, 442);
             this.listBoxControl1.TabIndex = 3;
             this.listBoxControl1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listBoxControl1_MouseClick);
             // 
@@ -232,23 +250,36 @@
             this.popupMenu1.Manager = this.barManager1;
             this.popupMenu1.Name = "popupMenu1";
             // 
-            // btn1
-            // 
-            this.tablePanel1.SetColumn(this.btn1, 2);
-            this.btn1.Location = new System.Drawing.Point(545, 38);
-            this.btn1.Margin = new System.Windows.Forms.Padding(3, 24, 3, 3);
-            this.btn1.Name = "btn1";
-            this.tablePanel1.SetRow(this.btn1, 0);
-            this.btn1.Size = new System.Drawing.Size(96, 23);
-            this.btn1.TabIndex = 4;
-            this.btn1.Text = "推送";
-            this.btn1.Click += new System.EventHandler(this.btn1_Click);
+            // txtTskType
+            // 
+            this.txtTskType.Location = new System.Drawing.Point(334, 19);
+            this.txtTskType.MenuManager = this.barManager1;
+            this.txtTskType.Name = "txtTskType";
+            this.txtTskType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            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);
+            this.txtTskType.StyleController = this.layoutControl1;
+            this.txtTskType.TabIndex = 6;
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.txtTskType;
+            this.layoutControlItem2.Location = new System.Drawing.Point(332, 0);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(106, 50);
+            this.layoutControlItem2.Text = "定位类型";
+            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(48, 14);
             // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(743, 558);
+            this.ClientSize = new System.Drawing.Size(743, 521);
             this.Controls.Add(this.tablePanel1);
             this.Controls.Add(this.barDockControlLeft);
             this.Controls.Add(this.barDockControlRight);
@@ -272,6 +303,8 @@
             this.tablePanel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.listBoxControl1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTskType.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -296,6 +329,8 @@
         private DevExpress.XtraEditors.TextEdit localPort1;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
         private DevExpress.XtraEditors.SimpleButton btn1;
+        private DevExpress.XtraEditors.ImageComboBoxEdit txtTskType;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
     }
 }
 

+ 19 - 6
XdCxRhDW.Sender/Form1.cs

@@ -14,6 +14,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using XdCxRhDW.Dto;
+using XdCxRhDW.Sender.Properties;
 
 namespace XdCxRhDW.Sender
 {
@@ -37,13 +38,27 @@ namespace XdCxRhDW.Sender
                     var addrArr = txtAddr1.Text.Trim().Replace(":", ":").Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                     string ip = addrArr[0];
                     int port = Convert.ToInt32(addrArr[1]);
+                    string tskType = txtTskType.SelectedItem.ToString();
                     //S:
                     using (var client = new HttpClient())
                     {
                         try
                         {
                             var lines = File.ReadAllLines("Simulation_Data2023.dat");
-                            List<SendDto> sendDtoList = new List<SendDto>();
+                             int idx = 1;
+                            string url = string.Format("http://{0}:{1}/Api/Pos/", ip, port);
+                            if (tskType== "X1D1CX")//一星一地测向定位
+                            {
+                                url += "PosX1D1Async";
+                            }
+                            if (tskType == "X2D1")//两星一地定位
+                            {
+                                url += "PosX2D1Async";
+                            }
+                            if (tskType == "RH")//融合定位
+                            {
+                                url += "PosRHAsync";
+                            }
                             foreach (var line in lines)
                             {
                                 if (string.IsNullOrWhiteSpace(line)) continue;
@@ -62,12 +77,10 @@ namespace XdCxRhDW.Sender
                                     AdjaY = Convert.ToDouble(items[11]),
                                     AdjaZ = Convert.ToDouble(items[12]),
                                 };
-                                sendDtoList.Add(dto);
+                                var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
+                                var response = await client.PostAsync(url, content);
+                                Log($"已向[{txtAddr1.Text}]发送第{idx++}条仿真结果");
                             }
-                            string url = string.Format("http://{0}:{1}/Api/Send/SendXdCxRhDW", ip, port);
-                            var content = new StringContent(JsonConvert.SerializeObject(sendDtoList), System.Text.Encoding.UTF8, "application/json");
-                            var response = await client.PostAsync(url, content);
-                            Log($"已向[{txtAddr1.Text}]发送{sendDtoList.Count}条仿真结果");
                         }
                         catch (Exception ex)
                         {

+ 4 - 3
XdCxRhDW.Sender/Properties/licenses.licx

@@ -1,5 +1,6 @@
-DevExpress.XtraCharts.Heatmap.HeatmapControl, DevExpress.XtraCharts.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.ImageComboBoxEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraMap.MapControl, DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+DevExpress.XtraCharts.Heatmap.HeatmapControl, DevExpress.XtraCharts.v23.2.UI, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 70 - 0
XdCxRhDw.Dto/RHPosDto.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDw.Dto
+{
+    /// <summary>
+    /// 一星一地带参定位参数DTO(含星历)
+    /// </summary>
+    public class RHPosDto
+    {
+        /// <summary>
+        /// 目标双星时差(us)
+        /// </summary>
+        public double SxDto { get; set; }
+
+        /// <summary>
+        /// 目标星地时差(us)
+        /// </summary>
+        public double XdDto { get; set; }
+
+        /// <summary>
+        /// 参考样本主时差(us)
+        /// </summary>
+        public double MainYbDto { get; set; }
+
+        /// <summary>
+        /// 参考样本邻时差(us)
+        /// </summary>
+        public double AdjaYbDto { get; set; }
+
+        /// <summary>
+        /// 测向结果
+        /// </summary>
+        public double CxRes { get; set; }
+
+        /// <summary>
+        ///  主星X坐标
+        /// </summary>
+        public double MainX { get; set; }
+
+        /// <summary>
+        /// 主星Y坐标
+        /// </summary>
+        public double MainY { get; set; }
+
+        /// <summary>
+        /// 主星Z坐标
+        /// </summary>
+        public double MainZ { get; set; }
+
+        /// <summary>
+        ///  邻星X坐标
+        /// </summary>
+        public double AdjaX { get; set; }
+
+        /// <summary>
+        ///  邻星Y坐标
+        /// </summary>
+        public double AdjaY { get; set; }
+
+        /// <summary>
+        ///  邻星Z坐标
+        /// </summary>
+        public double AdjaZ { get; set; }
+    }
+        
+}

+ 58 - 0
XdCxRhDw.Dto/X1D1PosDto.cs

@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDw.Dto
+{
+    /// <summary>
+    /// 一星一地带参定位参数DTO(含星历)
+    /// </summary>
+    public class X1D1PosDto
+    {
+        /// <summary>
+        /// 目标双星时差(us)
+        /// </summary>
+        public double SxDto { get; set; }
+
+        /// <summary>
+        /// 目标星地时差(us)
+        /// </summary>
+        public double XdDto { get; set; }
+
+        /// <summary>
+        /// 参考样本主时差(us)
+        /// </summary>
+        public double MainYbDto { get; set; }
+
+        /// <summary>
+        /// 参考样本邻时差(us)
+        /// </summary>
+        public double AdjaYbDto { get; set; }
+
+        /// <summary>
+        /// 测向结果
+        /// </summary>
+        public double CxRes { get; set; }
+
+        /// <summary>
+        ///  卫星X坐标
+        /// </summary>
+        public double MainX { get; set; }
+
+        /// <summary>
+        /// 卫星Y坐标
+        /// </summary>
+        public double MainY { get; set; }
+
+        /// <summary>
+        /// 卫星Z坐标
+        /// </summary>
+        public double MainZ { get; set; }
+
+
+
+    }
+        
+}

+ 82 - 0
XdCxRhDw.Dto/X2D1NoXlPosDto.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDw.Dto
+{
+    /// <summary>
+    /// 两星一地定位参数DTO
+    /// </summary>
+    public class X2D1NoXlPosDto
+    {
+        /// <summary>
+        /// 主星编号
+        /// </summary>
+        public int MainSatID { get; set; }
+
+        /// <summary>
+        /// 邻星编号
+        /// </summary>
+        public int AdjaSatID { get; set; }
+
+        /// <summary>
+        /// 信号时刻(北京时间)
+        /// </summary>
+        public DateTime SigTime { get; set; }
+
+        /// <summary>
+        /// 目标双星时差(us)
+        /// </summary>
+        public double SxDto { get; set; }
+
+        /// <summary>
+        /// 目标双星频差(Hz)
+        /// </summary>
+        public double SxDfo { get; set; }
+
+        /// <summary>
+        /// 目标双星信噪比(dB)
+        /// </summary>
+        public double SxSnr { get; set; }
+
+        /// <summary>
+        /// 目标星地时差(us)
+        /// </summary>
+        public double XdDto { get; set; }
+
+
+        /// <summary>
+        /// 目标星地频差(Hz)
+        /// </summary>
+        public double XdDfo { get; set; }
+
+        /// <summary>
+        /// 目标星地信噪比(dB)
+        /// </summary>
+        public double XdSnr { get; set; }
+
+
+        /// <summary>
+        /// 参考样本主时差(us)
+        /// </summary>
+        public double MainYbDto { get; set; }
+
+        /// <summary>
+        /// 参考样本邻时差(us)
+        /// </summary>
+        public double AdjaYbDto { get; set; }
+
+
+        /// <summary>
+        /// 目标名称(可空)
+        /// </summary>
+        public string TarName { get; set; }
+
+        /// <summary>
+        /// 时隙名称(可空)
+        /// </summary>
+        public string TsName { get; set; }
+    }
+}

+ 21 - 37
XdCxRhDw.Dto/X2D1PosDto.cs

@@ -7,76 +7,60 @@ using System.Threading.Tasks;
 namespace XdCxRhDw.Dto
 {
     /// <summary>
-    /// 两星一地定位参数DTO
+    /// 两星一地带参定位参数DTO(含星历)
     /// </summary>
     public class X2D1PosDto
     {
-        /// <summary>
-        /// 主星编号
-        /// </summary>
-        public int MainSatID { get; set; }
-
-        /// <summary>
-        /// 邻星编号
-        /// </summary>
-        public int AdjaSatID { get; set; }
-
-        /// <summary>
-        /// 信号时刻(北京时间)
-        /// </summary>
-        public DateTime SigTime { get; set; }
-
         /// <summary>
         /// 目标双星时差(us)
         /// </summary>
         public double SxDto { get; set; }
 
         /// <summary>
-        /// 目标双星频差(Hz)
+        /// 目标星地时差(us)
         /// </summary>
-        public double SxDfo { get; set; }
+        public double XdDto { get; set; }
 
         /// <summary>
-        /// 目标双星信噪比(dB)
+        /// 参考样本主时差(us)
         /// </summary>
-        public double SxSnr { get; set; }
+        public double MainYbDto { get; set; }
 
         /// <summary>
-        /// 目标星地时差(us)
+        /// 参考样本邻时差(us)
         /// </summary>
-        public double XdDto { get; set; }
-
+        public double AdjaYbDto { get; set; }
 
         /// <summary>
-        /// 目标星地频差(Hz)
+        ///  主星X坐标
         /// </summary>
-        public double XdDfo { get; set; }
+        public double MainX { get; set; }
 
         /// <summary>
-        /// 目标星地信噪比(dB)
+        /// 主星Y坐标
         /// </summary>
-        public double XdSnr { get; set; }
-
+        public double MainY { get; set; }
 
         /// <summary>
-        /// 参考样本主时差(us)
+        /// 主星Z坐标
         /// </summary>
-        public double MainYbDto { get; set; }
+        public double MainZ { get; set; }
 
         /// <summary>
-        /// 参考样本邻时差(us)
+        ///  邻星X坐标
         /// </summary>
-        public double AdjaYbDto { get; set; }
-
+        public double AdjaX { get; set; }
 
         /// <summary>
-        /// 目标名称(可空)
+        ///  邻星Y坐标
         /// </summary>
-        public string TarName { get; set; }
+        public double AdjaY { get; set; }
 
         /// <summary>
-        /// 时隙名称(可空)
+        ///  邻星Z坐标
         /// </summary>
-        public string TsName { get; set; }
+        public double AdjaZ { get; set; }
+
     }
+        
 }

+ 3 - 0
XdCxRhDw.Dto/XdCxRhDw.Dto.csproj

@@ -55,7 +55,10 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SendDto.cs" />
     <Compile Include="PosResDto.cs" />
+    <Compile Include="RHPosDto.cs" />
     <Compile Include="X2D1PosDto.cs" />
+    <Compile Include="X1D1PosDto.cs" />
+    <Compile Include="X2D1NoXlPosDto.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>