/// <summary> /// 生成所有可能的三角形,然后根据不同时段提取网络,计算闭合差 /// </summary> /// <returns></returns> public AsyncTriguilarNetQualitiyManager BuildAsyncTriangularClosureQualies(GnssReveiverNominalAccuracy GnssReveiverNominalAccuracy, int differPeriodCount) { //获取所有基线 var lineNames = this.BaseLineManager.GetLineNamesWithEstValue(); //由所有基线生成可能的三角网组合 var triNetNames = TriangularNetName.BuildTriangularNetNames(lineNames, SiteManager.SiteNames); var differs = TimePeriod.GetDifferPeriods(this.BaseLineManager.Keys, differPeriodCount); //保存结果 var CurrentQualityManager = new AsyncTriguilarNetQualitiyManager(); foreach (var triNetName in triNetNames) { List <BaseLineNet> subNets = this.GetAsyncTriguilarNet(triNetName, differs); if (subNets == null || subNets.Count == 0) { continue; } List <QualityOfTriAngleClosureError> list = new List <QualityOfTriAngleClosureError>(); foreach (var subNet in subNets) { var qulity = new QualityOfTriAngleClosureError(subNet, GnssReveiverNominalAccuracy); list.Add(qulity); } CurrentQualityManager.Add(triNetName, list); } return(CurrentQualityManager); }
/// <summary> /// 查找所有的三角回路 /// </summary> /// <param name="lineNames"></param> /// <param name="siteNames"></param> /// <returns></returns> public static List <TriangularNetName> BuildTriangularNetNames(List <GnssBaseLineName> lineNames, List <string> siteNames) { var length = lineNames.Count; List <TriangularNetName> list = new List <TriangularNetName>(); foreach (var line in lineNames) { foreach (var site in siteNames) { if (line.Contains(site)) { continue; } var lineA = new GnssBaseLineName(line.RefName, site); var lineB = new GnssBaseLineName(line.RovName, site); if (GnssBaseLineName.ContainsOrReversedContains(lineNames, lineA) && GnssBaseLineName.ContainsOrReversedContains(lineNames, lineB) ) { var net = new TriangularNetName(line, site); list.Add(net); } } } var result = list.Distinct().ToList(); return(result); }
/// <summary> /// 异步环闭合差 /// </summary> /// <param name="triNetName"></param> /// <param name="differs">算法量很大,因此用参数表示</param> /// <returns></returns> public List <BaseLineNet> GetAsyncTriguilarNet(TriangularNetName triNetName, List <List <TimePeriod> > differs) { List <BaseLineNet> result = new List <BaseLineNet>(); foreach (var periods in differs) { var nets = GetAsyncTriguilarNet(triNetName, periods); result.AddRange(nets); } return(result); }
/// <summary> /// 创建所有三角形名称 /// </summary> /// <param name="siteNames"></param> /// <returns></returns> public static List <TriangularNetName> BuildTriangularNetNames(List <string> siteNames) { var length = siteNames.Count; List <TriangularNetName> list = new List <TriangularNetName>(); for (int i = 0; i < length; i++) { var a = siteNames[i]; for (int j = i + 1; j < length; j++) { var b = siteNames[j]; for (int k = j + 1; k < length; k++) { var c = siteNames[k]; var net = new TriangularNetName(a, b, c); list.Add(net); } } } return(list); }
/// <summary> /// 获取所有可能的异步环网络 /// </summary> /// <param name="timePeriods">不超过3时段</param> /// <param name="triNetName"></param> /// <returns></returns> public List <BaseLineNet> GetAsyncTriguilarNet(TriangularNetName triNetName, List <TimePeriod> timePeriods) { List <BaseLineNet> result = new List <BaseLineNet>(); if (timePeriods.Count <= 1) { return(result); } if (timePeriods.Count == 2) { var lineA = triNetName.LineA; var lineB = triNetName.LineB; var lineC = triNetName.LineC; var period1 = timePeriods[0]; var period2 = timePeriods[1]; var period1Lines = this.BaseLineManager.Get(period1); var period2Lines = this.BaseLineManager.Get(period2); //6种组合 var p1LineA = period1Lines.GetOrReversed(lineA); var p2LineA = period2Lines.GetOrReversed(lineA); var p1LineB = period1Lines.GetOrReversed(lineB); var p2LineB = period2Lines.GetOrReversed(lineB); var p1LineC = period1Lines.GetOrReversed(lineC); var p2LineC = period2Lines.GetOrReversed(lineC); BaseLineNet net1 = new BaseLineNet(new List <SiteObsBaseline>() { p1LineA, p1LineB, p2LineC }); BaseLineNet net2 = new BaseLineNet(new List <SiteObsBaseline>() { p1LineA, p2LineB, p2LineC }); BaseLineNet net3 = new BaseLineNet(new List <SiteObsBaseline>() { p1LineA, p2LineB, p1LineC }); BaseLineNet net4 = new BaseLineNet(new List <SiteObsBaseline>() { p2LineA, p1LineB, p1LineC }); BaseLineNet net5 = new BaseLineNet(new List <SiteObsBaseline>() { p2LineA, p2LineB, p1LineC }); BaseLineNet net6 = new BaseLineNet(new List <SiteObsBaseline>() { p2LineA, p1LineB, p2LineC }); var all = new List <BaseLineNet> { net1, net2, net3, net4, net5, net6 }; foreach (var item in all) { if (item.Count < 3) { continue; } result.Add(item); } return(result); } else { //3个时段 var lineA = triNetName.LineA; var lineB = triNetName.LineB; var lineC = triNetName.LineC; var period1 = timePeriods[0]; var period2 = timePeriods[1]; var period3 = timePeriods[2]; var period1Lines = this.BaseLineManager.Get(period1); var period2Lines = this.BaseLineManager.Get(period2); var period3Lines = this.BaseLineManager.Get(period3); var p1LineA = period1Lines.GetOrReversed(lineA); var p2LineA = period2Lines.GetOrReversed(lineA); var p3LineA = period3Lines.GetOrReversed(lineA); var p1LineB = period1Lines.GetOrReversed(lineB); var p2LineB = period2Lines.GetOrReversed(lineB); var p3LineB = period3Lines.GetOrReversed(lineB); var p1LineC = period1Lines.GetOrReversed(lineC); var p2LineC = period2Lines.GetOrReversed(lineC); var p3LineC = period3Lines.GetOrReversed(lineC); //6种组合 BaseLineNet net1 = new BaseLineNet(new List <SiteObsBaseline>() { p1LineA, p2LineB, p3LineC }); BaseLineNet net2 = new BaseLineNet(new List <SiteObsBaseline>() { p1LineA, p3LineB, p2LineC }); BaseLineNet net3 = new BaseLineNet(new List <SiteObsBaseline>() { p2LineA, p1LineB, p3LineC }); BaseLineNet net4 = new BaseLineNet(new List <SiteObsBaseline>() { p2LineA, p3LineB, p1LineC }); BaseLineNet net5 = new BaseLineNet(new List <SiteObsBaseline>() { p3LineA, p2LineB, p1LineC }); BaseLineNet net6 = new BaseLineNet(new List <SiteObsBaseline>() { p3LineA, p1LineB, p2LineC }); var all = new List <BaseLineNet> { net1, net2, net3, net4, net5, net6 }; foreach (var item in all) { if (item.Count < 3) { continue; } result.Add(item); } return(result); } }