gongqiuhong 1 年之前
父节点
当前提交
0516d3ffa3
共有 3 个文件被更改,包括 30 次插入26 次删除
  1. 9 8
      XdCxRhDW.Core/Api/PosApi.cs
  2. 0 3
      XdCxRhDW.Repostory/Model/CgRes.cs
  3. 21 15
      XdCxRhDW.WebApi/Controllers/PosController.cs

+ 9 - 8
XdCxRhDW.Core/Api/PosApi.cs

@@ -304,6 +304,14 @@ namespace XdCxRhDW.Core.Api
                 list = list.Concat(new double[3] { 999, 999, 0 }).ToArray();
             }
             list[2] = list[5] = 0;//高度
+            if (double.IsNaN(list[3]) || double.IsNaN(list[4]))
+            {
+                list[3] = list[4] = 999;
+            }
+            if (double.IsNaN(list[0]) || double.IsNaN(list[1]))
+            {
+                list[0] = list[1] = 999;
+            }
             if (list[0] < -180 || list[0] > 180)
             {
                 list[0] = list[1] = 999;
@@ -320,14 +328,7 @@ namespace XdCxRhDW.Core.Api
             {
                 list[3] = list[4] = 999;
             }
-            else if (double.IsNaN(list[3]) || double.IsNaN(list[4]))
-            {
-                list[3] = list[4] = 999;
-            }
-            else if (double.IsNaN(list[0]) || double.IsNaN(list[1]))
-            {
-                list[0] = list[1] = 999;
-            }
+            
             return list;
         }
 

+ 0 - 3
XdCxRhDW.Repostory/Model/CgRes.cs

@@ -116,7 +116,6 @@ namespace XdCxRhDW.Repostory.Model
         [Display(Name = "样本邻星1频差(Hz)")]
         public double? YbAdja1Dfo { get; set; }
 
-
         /// <summary>
         /// 样本邻星1信噪比(dB)
         /// </summary>
@@ -129,14 +128,12 @@ namespace XdCxRhDW.Repostory.Model
         [Display(Name = "样本邻星2时差(us)")]
         public double? YbAdja2Dto { get; set; }
 
-
         /// <summary>
         /// 样本邻星1频差(Hz)
         /// </summary>
         [Display(Name = "样本邻星1频差(Hz)")]
         public double? YbAdja2Dfo { get; set; }
 
-
         /// <summary>
         /// 样本邻星2信噪比(dB)
         /// </summary>

+ 21 - 15
XdCxRhDW.WebApi/Controllers/PosController.cs

@@ -99,21 +99,7 @@ namespace XdCxRhDW.App.WebAPI
                 return Success(Map(posRes));
             }
         }
-        private PosResDto Map(PosRes res)
-        {
-            return new PosResDto()
-            {
-                ID = res.ID,
-                SigTime = res.SigTime,
-                TaskInfoID = res.TaskInfoID,
-                TarName = string.IsNullOrWhiteSpace(res.TarName) ? "未知目标" : res.TarName,
-                PosLon = res.PosLon,
-                PosLat = res.PosLat,
-                MirrLon = res.MirrLon,
-                MirrLat = res.MirrLat,
-                PosResType = (EnumPosResTypeDto)((int)res.PosResType)
-            };
-        }
+     
         /// <summary>
         /// 一星一地测向带参定位(无星历)
         /// </summary>
@@ -151,6 +137,10 @@ namespace XdCxRhDW.App.WebAPI
                 var content = await response.Content.ReadAsStringAsync();
                 var ephMain = JsonConvert.DeserializeObject<AjaxResult<SatEphDto>>(content).data;
 
+                //string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
+                //var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
+                //var dmcResult = HttpHelper.PostRequest<IEnumerable<DetectResDto>>(uploadUri, content);
+
                 var StationRes = db.StationRes.Add(new StationRes()
                 {
                     SatTxLon = dto.SatTxLon,
@@ -1569,6 +1559,22 @@ namespace XdCxRhDW.App.WebAPI
         }
         #endregion
 
+        private PosResDto Map(PosRes res)
+        {
+            return new PosResDto()
+            {
+                ID = res.ID,
+                SigTime = res.SigTime,
+                TaskInfoID = res.TaskInfoID,
+                TarName = string.IsNullOrWhiteSpace(res.TarName) ? "未知目标" : res.TarName,
+                PosLon = res.PosLon,
+                PosLat = res.PosLat,
+                MirrLon = res.MirrLon,
+                MirrLat = res.MirrLat,
+                PosResType = (EnumPosResTypeDto)((int)res.PosResType)
+            };
+        }
+
         /// <summary>
         /// 查询定位结果(暂未实现)
         /// </summary>