wyq 1 рік тому
батько
коміт
7b540afa2b

+ 26 - 0
Common/ExtensionsDev/MapControlEx.cs

@@ -730,6 +730,32 @@ public static class MapControlEx
 
     }
 
+    /// <summary>
+    /// 定位图层数据源添加一个定位点
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    /// <param name="item"></param>
+    public static void AddHistoryPosItem<T>(this MapControl ctrl, T item) where T : PosData, new()
+    {
+        if (item.PosLon > 180) return;
+        var innerData = ctrl.Tag as InnerData;
+        var mapItem = new MapDot()
+        {
+            EnableHighlighting = DefaultBoolean.True,
+            EnableSelection = DefaultBoolean.False,
+            CanMove = false,
+            Visible = item.Visible,
+            IsHitTestVisible = true,
+            Fill = ColorHelper.IsHtmlColor(item.ColorKey) ? ColorTranslator.FromHtml(item.ColorKey) : ColorHelper.GetColor(item.ColorKey),
+            Size = _dotSize,
+            Tag = item,
+            ToolTipPattern = $"信号时刻:{item.SigTime:yyyy-MM-dd HH:mm:ss}\r\n 定位经度:{item.PosLon}\r\n 定位纬度:{item.PosLat}",
+            Location = new GeoPoint(item.PosLat, item.PosLon)
+        };
+        innerData.mMapStorage.Items.Add(mapItem);
+
+    }
+
     /// <summary>
     /// 定位图层数据源删除定位点
     /// </summary>

+ 25 - 0
XdDw.App/Image/history.svg

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
+<style type="text/css">
+	.Red{fill:#D11C1C;}
+	.Yellow{fill:#FFB115;}
+	.Blue{fill:#1177D7;}
+	.Green{fill:#039C23;}
+	.Black{fill:#727272;}
+	.White{fill:#FFFFFF;}
+	.st0{opacity:0.5;}
+	.st1{opacity:0.75;}
+	.st2{opacity:0.35;}
+	.st3{opacity:0.65;}
+</style>
+<g id="Spline">
+	<path class="Blue" d="M29,16c-1.7,0-3,1.3-3,3c0,0.7,0.3,1.4,0.7,1.9c-1.2,3.2-3,5.1-4.7,5.1c-2.5,0-5.2-4.1-5.8-10.2
+		c1.1-0.5,1.8-1.5,1.8-2.8c0-1.4-1-2.7-2.4-2.9C14.7,6.5,12.1,4,9,4s-5.7,2.5-6.6,6.1C1,10.3,0,11.6,0,13c0,1.7,1.3,3,3,3s3-1.3,3-3
+		c0-1.2-0.7-2.1-1.6-2.6C5.2,7.8,7,6,9,6s3.8,1.8,4.6,4.4c-1,0.5-1.6,1.5-1.6,2.6c0,1.4,0.9,2.5,2.2,2.9C14.9,22.8,18.1,28,22,28
+		c2.6,0,5-2.4,6.4-6.1c0.2,0,0.4,0.1,0.6,0.1c1.7,0,3-1.3,3-3S30.7,16,29,16z M3,14c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1s1,0.4,1,1
+		C4,13.6,3.6,14,3,14z M15,12c0.6,0,1,0.4,1,1c0,0.6-0.4,1-1,1s-1-0.4-1-1C14,12.4,14.4,12,15,12z M29,20c-0.6,0-1-0.4-1-1
+		c0-0.6,0.4-1,1-1s1,0.4,1,1C30,19.6,29.6,20,29,20z"/>
+</g>
+</svg>

+ 33 - 0
XdDw.App/UserControl/CtrlPosXd.cs

@@ -142,6 +142,7 @@ namespace XdDw.App.UserControl
                 //RectMenu为框选的区域上右键菜单
                 mapControl1.AddMapMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), (lon, lat) => LoadSimulationData())
                     .AddMapMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), (lon, lat) => stoped = true)
+                     .AddMapMenu("历史航迹", SvgHelper.LoadFromFile("Image\\history.svg"), (lon, lat) => LoadHistoryData())
                      .AddPosMenu<XDPosRes>("绘制时差线", SvgHelper.LoadFromFile("Image\\DrawLine.svg"), item =>
                      {
                          DrawDtoLine(item);
@@ -202,6 +203,38 @@ namespace XdDw.App.UserControl
             item.Selected = true;
             mapControl1.UpdatePosItem(item);
         }
+
+        private async void LoadHistoryData()
+        {
+            string hoistoryFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "historyXD.dat");
+            if (!File.Exists(hoistoryFile))
+            {
+                return;
+            }
+            var lines = File.ReadAllLines(hoistoryFile);
+            foreach (var item in lines)
+            {
+                if (stoped) break;
+                var items = item.Split(new string[] { " ", "\"" }, StringSplitOptions.RemoveEmptyEntries);
+                if (items.Length != 5) continue;
+                int index = 0;
+                string sigtimeStr = items[index++] + " " + items[index++];
+                var SigTime = DateTime.ParseExact(sigtimeStr, "yyyy-MM-dd HH:mm:ss", null);
+                XDPosRes posRes = new XDPosRes();
+                posRes.SigTime = SigTime;
+
+                posRes.TarName = items[index++];
+                posRes.PosLon = Convert.ToDouble(items[index++]);
+                posRes.PosLat = Convert.ToDouble(items[index++]);
+
+                this.Invoke(new Action(() =>
+                {
+                    mapControl1.AddHistoryPosItem(posRes);
+                }));
+                await Task.Delay(200);
+            }
+
+        }
         bool stoped = false;
         private async void LoadSimulationData()
         {

+ 6 - 0
XdDw.App/XdDw.App.csproj

@@ -318,6 +318,9 @@
       <DependentUpon>Settings.settings</DependentUpon>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
+    <None Include="historyXD.dat">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
     <None Include="Simulation_Data2023.dat">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
@@ -432,6 +435,9 @@
     <Content Include="Image\ErrorEllipse.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="Image\history.svg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="Image\Pos.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>

+ 19 - 0
XdDw.App/historyXD.dat

@@ -0,0 +1,19 @@
+"2021-06-11 13:44:14"   299.55     119.5939     22.1111
+"2021-06-11 13:44:49"   299.55     119.5798     22.0295
+"2021-06-11 13:46:13"   299.55     119.6047     21.8499
+"2021-06-11 13:46:59"   299.55     119.6109     21.7503
+"2021-06-11 13:47:43"   299.55     119.6486     21.67
+"2021-06-11 13:48:58"   299.55     119.78       21.5763
+"2021-06-11 13:49:44"   299.55     119.8575     21.5108
+"2021-06-11 13:50:59"   299.55     120.0038     21.4337
+"2021-06-11 13:51:43"   299.55     120.0856     21.3828
+"2021-06-11 13:52:26"   299.55     120.1577     21.3241
+"2021-06-11 13:54:28"   299.55     120.3856     21.1846
+"2021-06-11 13:55:14"   299.55     120.4655     21.1256
+"2021-06-11 13:56:29"   299.55     120.5959     21.0283
+"2022-08-25 14:18:53"   Η�ΛΉΒεΛΉ²΄Άϋ  127.141   30.004
+"2022-08-25 14:37:21"   Η�ΛΉΒεΛΉ²΄Άϋ  127.1986  30.5191
+"2022-08-25 14:42:19"   Η�ΛΉΒεΛΉ²΄Άϋ  127.2379  30.6107
+"2022-08-25 14:49:02"   Η�ΛΉΒεΛΉ²΄Άϋ  127.2471  30.7542
+"2022-08-25 15:05:50"   Η�ΛΉΒεΛΉ²΄Άϋ  127.3112  30.6918
+"2022-08-25 15:08:13"   Η�ΛΉΒεΛΉ²΄Άϋ  127.3445  30.7524

+ 2 - 0
XzDw.App/UserControl/DXGDOPParam.cs

@@ -68,6 +68,8 @@ namespace XdCxRhDW.App.UserControl
             }
             foreach (var errLins in data)//画GDOP
             {
+
+                errLins.ErrDistance = errLins.ErrDistance / 10;
                 foreach (var line in errLins.MapLines)
                 {
                     var newLine = SampleDots(line);

+ 2 - 0
XzDw.App/UserControl/XZGDOPParam .cs

@@ -80,8 +80,10 @@ namespace XdCxRhDW.App.UserControl
             }
             foreach (var errLins in data)//画GDOP
             {
+                errLins.ErrDistance = errLins.ErrDistance / 10;
                 foreach (var line in errLins.MapLines)
                 {
+                    
                     var newLine = SampleDots(line);
                     mapControl1.Invoke(new Action(() =>
                     {

+ 24 - 0
XzXdDw.App/ExtensionsDev/MapControlEx.cs

@@ -729,7 +729,31 @@ public static class MapControlEx
         innerData.posStorge.Items.Add(mapItem);
 
     }
+    /// <summary>
+    /// 定位图层数据源添加一个定位点
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    /// <param name="item"></param>
+    public static void AddHistoryPosItem<T>(this MapControl ctrl, T item) where T : PosData, new()
+    {
+        if (item.PosLon > 180) return;
+        var innerData = ctrl.Tag as InnerData;
+        var mapItem = new MapDot()
+        {
+            EnableHighlighting = DefaultBoolean.True,
+            EnableSelection = DefaultBoolean.False,
+            CanMove = false,
+            Visible = item.Visible,
+            IsHitTestVisible = true,
+            Fill = ColorHelper.IsHtmlColor(item.ColorKey) ? ColorTranslator.FromHtml(item.ColorKey) : ColorHelper.GetColor(item.ColorKey),
+            Size = _dotSize,
+            Tag = item,
+            ToolTipPattern = $"信号时刻:{item.SigTime:yyyy-MM-dd HH:mm:ss}\r\n 定位经度:{item.PosLon}\r\n 定位纬度:{item.PosLat}",
+            Location = new GeoPoint(item.PosLat, item.PosLon)
+        };
+        innerData.mMapStorage.Items.Add(mapItem);
 
+    }
     /// <summary>
     /// 定位图层数据源删除定位点
     /// </summary>

+ 25 - 0
XzXdDw.App/Image/history.svg

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
+<style type="text/css">
+	.Red{fill:#D11C1C;}
+	.Yellow{fill:#FFB115;}
+	.Blue{fill:#1177D7;}
+	.Green{fill:#039C23;}
+	.Black{fill:#727272;}
+	.White{fill:#FFFFFF;}
+	.st0{opacity:0.5;}
+	.st1{opacity:0.75;}
+	.st2{opacity:0.35;}
+	.st3{opacity:0.65;}
+</style>
+<g id="Spline">
+	<path class="Blue" d="M29,16c-1.7,0-3,1.3-3,3c0,0.7,0.3,1.4,0.7,1.9c-1.2,3.2-3,5.1-4.7,5.1c-2.5,0-5.2-4.1-5.8-10.2
+		c1.1-0.5,1.8-1.5,1.8-2.8c0-1.4-1-2.7-2.4-2.9C14.7,6.5,12.1,4,9,4s-5.7,2.5-6.6,6.1C1,10.3,0,11.6,0,13c0,1.7,1.3,3,3,3s3-1.3,3-3
+		c0-1.2-0.7-2.1-1.6-2.6C5.2,7.8,7,6,9,6s3.8,1.8,4.6,4.4c-1,0.5-1.6,1.5-1.6,2.6c0,1.4,0.9,2.5,2.2,2.9C14.9,22.8,18.1,28,22,28
+		c2.6,0,5-2.4,6.4-6.1c0.2,0,0.4,0.1,0.6,0.1c1.7,0,3-1.3,3-3S30.7,16,29,16z M3,14c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1s1,0.4,1,1
+		C4,13.6,3.6,14,3,14z M15,12c0.6,0,1,0.4,1,1c0,0.6-0.4,1-1,1s-1-0.4-1-1C14,12.4,14.4,12,15,12z M29,20c-0.6,0-1-0.4-1-1
+		c0-0.6,0.4-1,1-1s1,0.4,1,1C30,19.6,29.6,20,29,20z"/>
+</g>
+</svg>

+ 33 - 0
XzXdDw.App/UserControl/CtrlPosXd.cs

@@ -142,6 +142,7 @@ namespace XzXdDw.App.UserControl
                 //RectMenu为框选的区域上右键菜单
                 mapControl1.AddMapMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), (lon, lat) => LoadSimulationData())
                     .AddMapMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), (lon, lat) => stoped = true)
+                     .AddMapMenu("历史航迹", SvgHelper.LoadFromFile("Image\\history.svg"), (lon, lat) => LoadHistoryData())
                      .AddPosMenu<XDPosRes>("绘制时差线", SvgHelper.LoadFromFile("Image\\DrawLine.svg"), item =>
                      {
                          DrawDtoLine(item);
@@ -202,6 +203,38 @@ namespace XzXdDw.App.UserControl
             item.Selected = true;
             mapControl1.UpdatePosItem(item);
         }
+
+        private async void LoadHistoryData()
+        {
+            string hoistoryFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "historyXD.dat");
+            if (!File.Exists(hoistoryFile))
+            {
+                return;
+            }
+            var lines = File.ReadAllLines(hoistoryFile);
+            foreach (var item in lines)
+            {
+                if (stoped) break;
+                var items = item.Split(new string[] { " ", "\"" }, StringSplitOptions.RemoveEmptyEntries);
+                if (items.Length != 5) continue;
+                int index = 0;
+                string sigtimeStr = items[index++] + " " + items[index++];
+                var SigTime = DateTime.ParseExact(sigtimeStr, "yyyy-MM-dd HH:mm:ss", null);
+                XDPosRes posRes = new XDPosRes();
+                posRes.SigTime = SigTime;
+
+                posRes.TarName = items[index++];
+                posRes.PosLon = Convert.ToDouble(items[index++]);
+                posRes.PosLat = Convert.ToDouble(items[index++]);
+
+                this.Invoke(new Action(() =>
+                {
+                    mapControl1.AddHistoryPosItem(posRes);
+                }));
+                await Task.Delay(200);
+            }
+
+        }
         bool stoped = false;
         private async void LoadSimulationData()
         {

+ 2 - 0
XzXdDw.App/UserControl/DXGDOPParam.cs

@@ -68,6 +68,8 @@ namespace XdCxRhDW.App.UserControl
             }
             foreach (var errLins in data)//画GDOP
             {
+
+                errLins.ErrDistance = errLins.ErrDistance / 10;
                 foreach (var line in errLins.MapLines)
                 {
                     var newLine = SampleDots(line);

+ 2 - 0
XzXdDw.App/UserControl/XZGDOPParam .cs

@@ -80,8 +80,10 @@ namespace XdCxRhDW.App.UserControl
             }
             foreach (var errLins in data)//画GDOP
             {
+                errLins.ErrDistance = errLins.ErrDistance / 10;
                 foreach (var line in errLins.MapLines)
                 {
+                    
                     var newLine = SampleDots(line);
                     mapControl1.Invoke(new Action(() =>
                     {

+ 6 - 1
XzXdDw.App/XzXdDw.App.csproj

@@ -371,7 +371,6 @@
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="UserControl\CtrlPosSingle.resx">
       <DependentUpon>CtrlPosSingle.cs</DependentUpon>
     </EmbeddedResource>
@@ -417,6 +416,9 @@
     <None Include="data.gmdb">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="historyXD.dat">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
     <None Include="packages.config" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
@@ -605,6 +607,9 @@
     <Content Include="Image\ErrorEllipse.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="Image\history.svg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="Image\Pos.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>

+ 19 - 0
XzXdDw.App/historyXD.dat

@@ -0,0 +1,19 @@
+"2021-06-11 13:44:14"   299.55     119.5939     22.1111
+"2021-06-11 13:44:49"   299.55     119.5798     22.0295
+"2021-06-11 13:46:13"   299.55     119.6047     21.8499
+"2021-06-11 13:46:59"   299.55     119.6109     21.7503
+"2021-06-11 13:47:43"   299.55     119.6486     21.67
+"2021-06-11 13:48:58"   299.55     119.78       21.5763
+"2021-06-11 13:49:44"   299.55     119.8575     21.5108
+"2021-06-11 13:50:59"   299.55     120.0038     21.4337
+"2021-06-11 13:51:43"   299.55     120.0856     21.3828
+"2021-06-11 13:52:26"   299.55     120.1577     21.3241
+"2021-06-11 13:54:28"   299.55     120.3856     21.1846
+"2021-06-11 13:55:14"   299.55     120.4655     21.1256
+"2021-06-11 13:56:29"   299.55     120.5959     21.0283
+"2022-08-25 14:18:53"   Η�ΛΉΒεΛΉ²΄Άϋ  127.141   30.004
+"2022-08-25 14:37:21"   Η�ΛΉΒεΛΉ²΄Άϋ  127.1986  30.5191
+"2022-08-25 14:42:19"   Η�ΛΉΒεΛΉ²΄Άϋ  127.2379  30.6107
+"2022-08-25 14:49:02"   Η�ΛΉΒεΛΉ²΄Άϋ  127.2471  30.7542
+"2022-08-25 15:05:50"   Η�ΛΉΒεΛΉ²΄Άϋ  127.3112  30.6918
+"2022-08-25 15:08:13"   Η�ΛΉΒεΛΉ²΄Άϋ  127.3445  30.7524