wyq 1 жил өмнө
parent
commit
1a0f6a00db

+ 17 - 26
XdCxRhDW.App/ExtensionsDev/MapControlEx.cs

@@ -1,12 +1,18 @@
-using DevExpress.Map.Native;
+using DevExpress.Export.Xl;
+using DevExpress.Map;
+using DevExpress.Map.Native;
 using DevExpress.Utils;
-using DevExpress.Utils.Design;
 using DevExpress.Utils.Svg;
 using DevExpress.XtraBars;
+using DevExpress.XtraGrid;
+using DevExpress.XtraGrid.Columns;
+using DevExpress.XtraGrid.Views.Grid;
 using DevExpress.XtraMap;
+using DevExpress.XtraMap.ItemEditor;
+using DevExpress.XtraPrinting;
+using DxHelper;
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 using System.Data.Common;
 using System.Data.SQLite;
@@ -14,25 +20,9 @@ using System.Drawing;
 using System.Drawing.Imaging;
 using System.IO;
 using System.Linq;
-using System.Linq.Expressions;
 using System.Reflection;
 using System.Text;
-using System.Threading.Tasks;
 using System.Windows.Forms;
-using DevExpress.XtraMap.ItemEditor;
-using DxHelper;
-using System.Runtime.CompilerServices;
-using DevExpress.XtraPrinting;
-using DevExpress.Export.Xl;
-using DevExpress.XtraEditors;
-using DevExpress.Map.Dashboard;
-using DevExpress.XtraGrid;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Columns;
-using DevExpress.Map;
-using System.Threading;
-using System.ComponentModel.DataAnnotations.Schema;
-using XdCxRhDW.Repostory.Model;
 using XdCxRhDW.Repostory;
 
 public enum GoogleMapType
@@ -1571,14 +1561,15 @@ public static class MapControlEx
 
         return (c_lng, c_lat);  //方向上的另一点坐标
     }
-    /**
-    * 求B点经纬度
-    * @param A 已知点的经纬度,
-    * @param distance   AB两地的距离  单位km
-    * @param angle  AB连线与正北方向的夹角(0~360)
-    * @return  B点的经纬度
+    
+/**
+* 求B点经纬度
+* @param A 已知点的经纬度,
+* @param distance   AB两地的距离  单位km
+* @param angle  AB连线与正北方向的夹角(0~360)
+* @return  B点的经纬度
 */
-    private static MyLatLng getMyLatLng(MyLatLng A, double distance, double angle)
+private static MyLatLng getMyLatLng(MyLatLng A, double distance, double angle)
     {
         double dx = distance * 1000 * Math.Sin(DegreesToRadians(angle));
         double dy = distance * 1000 * Math.Cos(DegreesToRadians(angle));

+ 2 - 13
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -599,16 +599,6 @@ namespace XdCxRhDW.App.UserControl
             var item = gridView2.GetRow(ids[0]) as PosRes;
             return item;
         }
-        private EnumPosType GetPosRes(PosRes posRes, string msg)
-        {
-            var taskInfo = list.Find(m => m.ID == posRes.TaskInfoID);
-            if (taskInfo == null)
-            {
-                DxHelper.MsgBoxHelper.ShowWarning($"{msg}未找到任务[{posRes.TaskInfoID}]!");
-                return default;
-            }
-            return taskInfo.PosType;
-        }
 
         private void btnDrawDfo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
@@ -951,15 +941,14 @@ namespace XdCxRhDW.App.UserControl
                     DxHelper.MsgBoxHelper.ShowWarning($"测向站信息为空!");
                     return;
                 }
-                double startdeg = 360;
-                double deg = startdeg - cx.Fx;//向北顺时针方向为夹角
+                double deg = cx.Fx;//向北顺时针方向为夹角
                 //计算测向站到定位点之间的距离
                 var km = MapControlEx.CalcLineKm(station.CxLon.Value, station.CxLat.Value, item.PosLon, item.PosLat);
                 var endpoint = MapControlEx.CalcSituation(station.CxLon.Value, station.CxLat.Value, deg, (km + 100) * 1000);
                 List<(double, double)> points = new List<(double, double)>();
                 points.Add((station.CxLon.Value, station.CxLat.Value));
                 points.Add((endpoint.Item1, endpoint.Item2));
-                mapControl1.DrawCXLine($"测向线角度:{cx.Fx}°\t\n", points);
+                mapControl1.DrawCXLine($"测向线角度:{cx.Fx}°\t\n", points, true);
             }
             catch (Exception ex)
             {