wyq 1 年之前
父節點
當前提交
52c668e25c

+ 1 - 1
XdCxRhDW.App/App.config

@@ -29,7 +29,7 @@
 		<add key="UseNewPosX2D1NoRef" value="1" />
 
 
-		<!--GDOP使用最新的版本-->
+		<!--GDOP使用最新的版本  1:使用-->
 		<add key="UseNewGDOP" value="1" />
 
 	</appSettings>

+ 1 - 1
XdCxRhDW.App/EditForms/X1D1DTOParamEditor.cs

@@ -188,7 +188,7 @@ namespace XdCxRhDW.App.EditForms
                 List<MapPolyline> polylines = new List<MapPolyline>();
                 foreach (var dtoLine in xdDtoLine)
                 {
-                    var mapline = mapControl1.GetLine($"[{msat},超短{CDBAnt[0]}°]带参时差线", dtoLine.dtoLinePoints);
+                    var mapline = mapControl1.GetLine($"[{msat},超短{CDBAnt[0]}°]带参时差线", dtoLine.dtoLinePoints, true);
                     if (mapline == null)
                     {
                         continue;

+ 22 - 14
XdCxRhDW.App/EditForms/X2D1DTOParamEditor.cs

@@ -207,13 +207,11 @@ namespace XdCxRhDW.App.EditForms
                 if (string.IsNullOrWhiteSpace(msat)) msat = cg.MainCode.Value.ToString();
                 var nsat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat;
                 if (string.IsNullOrWhiteSpace(nsat)) nsat = cg.Adja1Code.Value.ToString();
+                string useNewGDOP = ConfigurationManager.AppSettings["UseNewGDOP"];
                 if (info.PosResType == EnumPosResType.X2D1)
                 {
                     //var xdDtoLine = DrawDtoLineHelper.DtoLineXd(dtoLineXd);
                     //mapControl1.DrawDtoLine($"[{msat},超短{CDBAnt[0]}°]时差线", xdDtoLine);
-
-
-                    string useNewGDOP = ConfigurationManager.AppSettings["UseNewGDOP"];
                     if (useNewGDOP == null || useNewGDOP == "0")
                     {
                         var xdDtoLine1 = DrawDtoLineHelper.DtoLineXdEx(dtoLineXd);
@@ -226,7 +224,7 @@ namespace XdCxRhDW.App.EditForms
                         List<MapPolyline> polylines = new List<MapPolyline>();
                         foreach (var dtoLine in xdDtoLine)
                         {
-                            var mapline = mapControl1.GetLine($"[{msat},超短{CDBAnt[0]}°]带参时差线", dtoLine.dtoLinePoints);
+                            var mapline = mapControl1.GetLine($"[{msat},超短{CDBAnt[0]}°]带参时差线", dtoLine.dtoLinePoints, true);
                             if (mapline == null)
                             {
                                 continue;
@@ -241,21 +239,31 @@ namespace XdCxRhDW.App.EditForms
                 }
                 else
                 {
-                    //var xdDtoLine = DrawDtoLineHelper.DtoLineXdNoRef(dtoLineXd);
-                    //mapControl1.DrawDtoLine($"[{msat},超短{CDBAnt[0]}°]时差线", xdDtoLine);
-
-                    var xdDtoLine1 = DrawDtoLineHelper.DtoLineXdNoRefEx(dtoLineXd);
-                    mapControl1.DrawDtoLineTwo($"[{msat},超短{CDBAnt[0]}°]无参时差线", xdDtoLine1);
-
-                    //var xdDtoLine2 = DrawDtoLineHelper.DtoLineXdNoRefZl(dtoLineXd);
-                    //mapControl1.DrawDtoLine($"[{msat},超短{CDBAnt[0]}°]无参时差线zl", xdDtoLine2);
+                    if (useNewGDOP == null || useNewGDOP == "0")
+                    {
+                        var xdDtoLine1 = DrawDtoLineHelper.DtoLineXdNoRefEx(dtoLineXd);
+                        mapControl1.DrawDtoLineTwo($"[{msat},超短{CDBAnt[0]}°]无参时差线", xdDtoLine1);
 
+                    }
+                    else
+                    {
+                        var xdDtoLine = DrawDtoLineHelper.DtoLineXdNoRefNew(dtoLineXd);
+                        List<MapPolyline> polylines = new List<MapPolyline>();
+                        foreach (var dtoLine in xdDtoLine)
+                        {
+                            var mapline = mapControl1.GetLine($"[{msat},超短{CDBAnt[0]}°]无参时差线", dtoLine.dtoLinePoints, true);
+                            if (mapline == null)
+                            {
+                                continue;
+                            }
+                            polylines.Add(mapline);
+                        }
+                        mapControl1.DrawDtoLine(polylines);
+                    }
 
                     var tsDtoLine = DrawDtoLineHelper.DtoLine2XNoRefStart(twoStartOption);
                     mapControl1.DrawDtoLine($"[{msat},{nsat}]无参时差线", tsDtoLine);
 
-                    //var tsDtoLine2 = DrawDtoLineHelper.DtoLine2XNoRefStartZl(twoStartOption);
-                    //mapControl1.DrawDtoLine($"[{msat},{nsat}]无参时差线zl", tsDtoLine2);
                 }
             }
             catch (Exception ex)

+ 44 - 12
XdCxRhDW.App/ExtensionsDev/MapControlEx.cs

@@ -1,9 +1,7 @@
 using DevExpress.Export.Xl;
-using DevExpress.Internal;
 using DevExpress.Map;
 using DevExpress.Map.Native;
 using DevExpress.Utils;
-using DevExpress.Utils.About;
 using DevExpress.Utils.Helpers;
 using DevExpress.Utils.Svg;
 using DevExpress.XtraBars;
@@ -17,24 +15,16 @@ using DxHelper;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.Configuration;
 using System.Data.Common;
-using System.Data.Entity.Core.Metadata.Edm;
 using System.Data.SQLite;
 using System.Drawing;
 using System.Drawing.Imaging;
 using System.IO;
 using System.Linq;
 using System.Reflection;
-using System.Security.Policy;
 using System.Text;
-using System.Threading;
-using System.Windows.Controls;
 using System.Windows.Forms;
-using System.Windows.Shapes;
-using XdCxRhDW.App;
 using XdCxRhDW.Entity;
-using XdCxRhDW.Repostory;
 
 public enum GoogleMapType
 {
@@ -1643,7 +1633,6 @@ public static class MapControlEx
     public static MapPolyline GetLine(this MapControl ctrl, string title, IEnumerable<(double lon, double lat)> lines)
     {
         if (lines == null || !lines.Any()) return null;
-        var innerData = ctrl.Tag as InnerData; 
         var polyLine = new MapPolyline()
         {
             EnableSelection = DefaultBoolean.False,
@@ -1662,7 +1651,6 @@ public static class MapControlEx
 
 
         };
-        polyLine.pr.
         bool isShowPattern = lines.Count() > 400;
         if (isShowPattern)
         {
@@ -1685,6 +1673,50 @@ public static class MapControlEx
         }
        
 
+    }
+
+    public static MapPolyline GetLine(this MapControl ctrl, string title, IEnumerable<(double lon, double lat)> lines,bool isShowPattern=false)
+    {
+        if (lines == null || !lines.Any()) return null;
+        var polyLine = new MapPolyline()
+        {
+            EnableSelection = DefaultBoolean.False,
+            EnableHighlighting = DefaultBoolean.True,
+            Stroke = ColorHelper.GetColor(title),
+            StrokeWidth = 2,
+            HighlightedStrokeWidth = 4,
+            IsGeodesic = true,
+            CanResize = false,
+            CanEdit = false,
+            CanRotate = false,
+            IsHitTestVisible = true,
+            CanMove = false,
+            Tag = $"DrawDtoLine_{title}",
+            ToolTipPattern = $"{title}",
+
+
+        };
+        if (isShowPattern)
+        {
+            polyLine.TitleOptions.Pattern = title;
+        }
+
+        foreach (var item in lines)
+        {
+            if (double.IsNaN(item.lat) || double.IsNaN(item.lon)) continue;
+            polyLine.Points.Add(new GeoPoint(item.lat, item.lon));
+
+        }
+        if (!polyLine.Points.Any())
+        {
+            return null;
+        }
+        else
+        {
+            return polyLine;
+        }
+
+
     }