|
@@ -16,8 +16,10 @@ using System.Data.Entity;
|
|
|
using System.Data.Entity.Migrations;
|
|
using System.Data.Entity.Migrations;
|
|
|
using System.Diagnostics;
|
|
using System.Diagnostics;
|
|
|
using System.Drawing;
|
|
using System.Drawing;
|
|
|
|
|
+using System.IO;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
using System.Net;
|
|
using System.Net;
|
|
|
|
|
+using System.Security.Cryptography;
|
|
|
using System.Security.Policy;
|
|
using System.Security.Policy;
|
|
|
using System.Threading;
|
|
using System.Threading;
|
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
@@ -164,8 +166,50 @@ namespace XdCxRhDW.App.UserControl
|
|
|
mapControl1.AddRectMenu<ModelPosRes>("删除定位点", SvgHelper.CreateClose(), async items => await DeletePosRes(items.ToList()))
|
|
mapControl1.AddRectMenu<ModelPosRes>("删除定位点", SvgHelper.CreateClose(), async items => await DeletePosRes(items.ToList()))
|
|
|
.AddRectMenu<ModelPosRes>("使用镜像点", SvgHelper.CreateUseMirr(), async items => await UseMirr(items.ToList()))
|
|
.AddRectMenu<ModelPosRes>("使用镜像点", SvgHelper.CreateUseMirr(), async items => await UseMirr(items.ToList()))
|
|
|
.AddRectMenu<ModelPosRes>("编辑目标", SvgHelper.CreateEdit(), async items => await EditTarget(items.ToList()))
|
|
.AddRectMenu<ModelPosRes>("编辑目标", SvgHelper.CreateEdit(), async items => await EditTarget(items.ToList()))
|
|
|
- .AddRectMenu<ModelPosRes>("转到列表", SvgHelper.CreateGoto(),
|
|
|
|
|
- items => ToPosList(items.ToList()));
|
|
|
|
|
|
|
+ .AddRectMenu<ModelPosRes>("转到列表", SvgHelper.CreateGoto(), items => ToPosList(items.ToList()))
|
|
|
|
|
+ .AddRectMenu<ModelPosRes>("误差统计", SvgHelper.CreateDistanceLine(), data =>
|
|
|
|
|
+ {
|
|
|
|
|
+ OpenFileDialog dialog = new OpenFileDialog();
|
|
|
|
|
+ if (dialog.ShowDialog() == DialogResult.OK)
|
|
|
|
|
+ {
|
|
|
|
|
+ string csv = dialog.FileName;
|
|
|
|
|
+ var lines = File.ReadAllLines(csv).Skip(1).ToList();
|
|
|
|
|
+ List<string> wlines = new List<string>();
|
|
|
|
|
+ List<double> listDis = new List<double>();
|
|
|
|
|
+ foreach (var item in data)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (item.CsvFileIndex == null) continue;
|
|
|
|
|
+ var line = lines[item.CsvFileIndex.Value + 1];
|
|
|
|
|
+ var arr = line.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
+ var lonStr = arr[3];
|
|
|
|
|
+ var latStr = arr[4];
|
|
|
|
|
+ var lon = GetLonLat(lonStr);
|
|
|
|
|
+ var lat = GetLonLat(latStr);
|
|
|
|
|
+ var dis1 = (int)PhysicsHelper.DistanceGeo((lon, lat, 0), (item.PosLon, item.PosLat, 0));
|
|
|
|
|
+
|
|
|
|
|
+ var lonStr2 = arr[5];
|
|
|
|
|
+ var latStr2 = arr[6];
|
|
|
|
|
+ var lon2 = GetLonLat(lonStr2);
|
|
|
|
|
+ var lat2 = GetLonLat(latStr2);
|
|
|
|
|
+ var dis2 = (int)PhysicsHelper.DistanceGeo((lon2, lat2, 0), (item.PosLon, item.PosLat, 0));
|
|
|
|
|
+ if (dis1 < dis2)
|
|
|
|
|
+ {
|
|
|
|
|
+ string wline = $"{item.SigTime.Year}\t{item.SigTime.Month:D2}\t{item.SigTime.Day:D2}\t{item.SigTime.Hour:D2}\t{item.SigTime.Minute:D2}\t{item.SigTime.Second:D2}\t{item.SigTime.Millisecond:D3}\t{GetLonLat(lon)}\t{GetLonLat(lat)}\t{GetLonLat(item.PosLon)}\t{GetLonLat(item.PosLat)}\t{dis1:D5}\t";
|
|
|
|
|
+ listDis.Add(dis1);
|
|
|
|
|
+ wlines.Add(wline);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ string wline = $"{item.SigTime.Year}\t{item.SigTime.Month:D2}\t{item.SigTime.Day:D2}\t{item.SigTime.Hour:D2}\t{item.SigTime.Minute:D2}\t{item.SigTime.Second:D2}\t{item.SigTime.Millisecond:D3}\t{GetLonLat(lon2)}\t{GetLonLat(lat2)}\t{GetLonLat(item.PosLon)}\t{GetLonLat(item.PosLat)}\t{dis2:D5}\t";
|
|
|
|
|
+ listDis.Add(dis2);
|
|
|
|
|
+ wlines.Add(wline);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ File.WriteAllLines("误差统计.txt", wlines);
|
|
|
|
|
+ DxHelper.MsgBoxHelper.ShowInfo($"最大误差:{listDis.Max():f0}m\r\n平均误差:{listDis.Average():f0}m\r\n详情请查看误差统计.txt文件");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
@@ -185,7 +229,34 @@ namespace XdCxRhDW.App.UserControl
|
|
|
txtTimeCho_SelectedIndexChanged(null, null);
|
|
txtTimeCho_SelectedIndexChanged(null, null);
|
|
|
WaitHelper.CloseForm();
|
|
WaitHelper.CloseForm();
|
|
|
}
|
|
}
|
|
|
|
|
+ private string GetLonLat(double lon)
|
|
|
|
|
+ {
|
|
|
|
|
+ var tmp = lon * 1e6;
|
|
|
|
|
+ long val = (long)tmp;
|
|
|
|
|
+ return val.ToString("D10");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ private double GetLonLat(string lonLatStr)
|
|
|
|
|
+ {
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ var lonD = lonLatStr.Split("°".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0];
|
|
|
|
|
+ var tmp = lonLatStr.Replace(lonD + "°", "");
|
|
|
|
|
+ var lonF = tmp.Split("′".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0];
|
|
|
|
|
+ tmp = tmp.Replace(lonF + "′", "");
|
|
|
|
|
+ var lonM = tmp.Split("″".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0];
|
|
|
|
|
+
|
|
|
|
|
+ var dLonD = Convert.ToDouble(lonD);
|
|
|
|
|
+ var dLonF = Convert.ToDouble(lonF);
|
|
|
|
|
+ var dLonM = Convert.ToDouble(lonM);
|
|
|
|
|
+ var val = dLonD + dLonF / 60d + dLonM / 3600d;
|
|
|
|
|
+ return val;
|
|
|
|
|
+ }
|
|
|
|
|
+ catch
|
|
|
|
|
+ {
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
private void OnSysSetingsChanged(SysSetings settings)
|
|
private void OnSysSetingsChanged(SysSetings settings)
|
|
|
{
|
|
{
|
|
|
if (settings.MapType == 0)
|
|
if (settings.MapType == 0)
|
|
@@ -1710,7 +1781,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- XdCxRhDW.Framework.LogHelper.Error( "使用镜像点失败!", ex);
|
|
|
|
|
|
|
+ XdCxRhDW.Framework.LogHelper.Error("使用镜像点失败!", ex);
|
|
|
MsgBoxHelper.ShowError("使用镜像点失败!");
|
|
MsgBoxHelper.ShowError("使用镜像点失败!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1747,7 +1818,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- XdCxRhDW.Framework.LogHelper.Error( "删除定位点失败", ex);
|
|
|
|
|
|
|
+ XdCxRhDW.Framework.LogHelper.Error("删除定位点失败", ex);
|
|
|
MsgBoxHelper.ShowError("删除定位点失败!");
|
|
MsgBoxHelper.ShowError("删除定位点失败!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|