ErrEllipseHelper.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. using DevExpress.Charts.Native;
  2. using DevExpress.Internal.WinApi.Windows.UI.Notifications;
  3. using DevExpress.XtraPrinting;
  4. using Newtonsoft.Json;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Diagnostics;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using XdCxRhDW.App.DTO;
  13. using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
  14. namespace XzXdDw.App.Api.低轨GDOP误差椭圆
  15. {
  16. /// <summary>
  17. /// 误差椭圆计算帮助类.该类调用了GdopCore.exe进程
  18. /// 每种误差椭圆算法提供了两个接口,这两种接口是完全等价的,一种传入双行根,一种直接传入卫星状态x、y、z等
  19. /// </summary>
  20. public static class ErrEllipseHelper
  21. {
  22. private static string exePath = "Api\\低轨GDOP误差椭圆\\GDOP";
  23. private const string exeName = "GdopCore.exe";
  24. /// <summary>
  25. /// 三星双时差误差椭圆带参
  26. /// </summary>
  27. /// <param name="mainSatTle">主星双行根数</param>
  28. /// <param name="adja1SatTle">邻1星双行根数</param>
  29. /// <param name="adja2SatTle">邻2星双行根数</param>
  30. /// <param name="time">采集时刻</param>
  31. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  32. /// <param name="refLonLat">参考站经纬度,数组长度=2</param>
  33. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  34. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  35. /// <param name="dtousErr">时差误差(单位us)</param>
  36. /// <param name="satLocErr">星历位置误差(单位米)</param>
  37. /// <param name="errProb">误差概率百分比(0-100,默认50)</param>
  38. /// <returns></returns>
  39. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse3Sat2DtoRef(string mainSatTle, string adja1SatTle, string adja2SatTle, DateTime time, double[] posLonLat, double[] refLonLat, out double R1, out double R2, double dtousErr = 1, double satLocErr = 10000, double errProb = 50)
  40. {
  41. if (string.IsNullOrWhiteSpace(exePath))
  42. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  43. if (!Directory.Exists(exePath))
  44. throw new Exception($"路径[{exePath}]不存在");
  45. var exeFile = Path.Combine(exePath, exeName);
  46. if (!File.Exists(exeFile))
  47. throw new Exception($"文件[{exeFile}]不存在");
  48. Process p = new Process();
  49. p.StartInfo.WorkingDirectory = exePath;
  50. p.StartInfo.FileName = exeFile;
  51. p.StartInfo.Arguments = $"50 \"{mainSatTle}\" \"{adja1SatTle}\" \"{adja2SatTle}\" \"{time:yyyy-MM-dd HH:mm:ss.000000}\" {string.Join(" ", posLonLat)} {string.Join(" ", refLonLat)} {dtousErr} {satLocErr} {errProb}";
  52. p.StartInfo.CreateNoWindow = true;
  53. p.StartInfo.RedirectStandardError = true;
  54. p.StartInfo.RedirectStandardOutput = true;
  55. p.StartInfo.UseShellExecute = false;
  56. StringBuilder sb = new StringBuilder();
  57. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  58. p.Start();
  59. p.BeginOutputReadLine();
  60. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  61. return ParseResult(3, sb.ToString(), out R1, out R2);
  62. }
  63. /// <summary>
  64. /// 三星双时差误差椭圆带参
  65. /// </summary>
  66. /// <param name="mainSatEph">主星xyz星历,数组长度=3</param>
  67. /// <param name="adja1SatEph">邻1星xyz星历,数组长度=3</param>
  68. /// <param name="adja2SatEph">邻2星xyz星历,数组长度=3</param>
  69. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  70. /// <param name="refLonLat">参考站经纬度,数组长度=2</param>
  71. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  72. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  73. /// <param name="dtousErr">时差误差(单位us)</param>
  74. /// <param name="satLocErr">星历位置误差(单位米)</param>
  75. /// <param name="errProb">误差概率百分比(0-100,默认50)</param>
  76. /// <returns></returns>
  77. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse3Sat2DtoRef(double[] mainSatEph, double[] adja1SatEph, double[] adja2SatEph, double[] posLonLat, double[] refLonLat, out double R1, out double R2, double dtousErr = 1, double satLocErr = 10000, double errProb = 50)
  78. {
  79. if (string.IsNullOrWhiteSpace(exePath))
  80. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  81. if (!Directory.Exists(exePath))
  82. throw new Exception($"路径[{exePath}]不存在");
  83. var exeFile = Path.Combine(exePath, exeName);
  84. if (!File.Exists(exeFile))
  85. throw new Exception($"文件[{exeFile}]不存在");
  86. Process p = new Process();
  87. p.StartInfo.WorkingDirectory = exePath;
  88. p.StartInfo.FileName = exeFile;
  89. p.StartInfo.Arguments = $"51 {string.Join(" ", mainSatEph)} {string.Join(" ", adja1SatEph)} {string.Join(" ", adja2SatEph)} {string.Join(" ", posLonLat)} {string.Join(" ", refLonLat)} {dtousErr} {satLocErr} {errProb}";
  90. p.StartInfo.CreateNoWindow = true;
  91. p.StartInfo.RedirectStandardError = true;
  92. p.StartInfo.RedirectStandardOutput = true;
  93. p.StartInfo.UseShellExecute = false;
  94. StringBuilder sb = new StringBuilder();
  95. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  96. p.Start();
  97. p.BeginOutputReadLine();
  98. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  99. return ParseResult(3, sb.ToString(), out R1, out R2);
  100. }
  101. /// <summary>
  102. /// 三星双时差误差椭圆无参
  103. /// </summary>
  104. /// <param name="mainSatTle">主星双行根数</param>
  105. /// <param name="adja1SatTle">邻1星双行根数</param>
  106. /// <param name="adja2SatTle">邻2星双行根数</param>
  107. /// <param name="time">采集时刻</param>
  108. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  109. /// <param name="recLonLat">接收站经纬度,数组长度=2</param>
  110. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  111. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  112. /// <param name="dtousErr">时差误差(单位us)</param>
  113. /// <param name="satLocErr">星历位置误差(单位米)</param>
  114. /// <param name="errProb">误差概率百分比(0-100,默认50)</param>
  115. /// <returns></returns>
  116. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse3Sat2Dto(string mainSatTle, string adja1SatTle, string adja2SatTle, DateTime time, double[] posLonLat, double[] recLonLat, out double R1, out double R2, double dtousErr = 1, double satLocErr = 10000, double errProb = 50)
  117. {
  118. if (string.IsNullOrWhiteSpace(exePath))
  119. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  120. if (!Directory.Exists(exePath))
  121. throw new Exception($"路径[{exePath}]不存在");
  122. var exeFile = Path.Combine(exePath, exeName);
  123. if (!File.Exists(exeFile))
  124. throw new Exception($"文件[{exeFile}]不存在");
  125. Process p = new Process();
  126. p.StartInfo.WorkingDirectory = exePath;
  127. p.StartInfo.FileName = exeFile;
  128. p.StartInfo.Arguments = $"52 \"{mainSatTle}\" \"{adja1SatTle}\" \"{adja2SatTle}\" \"{time:yyyy-MM-dd HH:mm:ss.000000}\" {string.Join(" ", posLonLat)} {string.Join(" ", recLonLat)} {dtousErr} {satLocErr} {errProb}";
  129. p.StartInfo.CreateNoWindow = true;
  130. p.StartInfo.RedirectStandardError = true;
  131. p.StartInfo.RedirectStandardOutput = true;
  132. p.StartInfo.UseShellExecute = false;
  133. StringBuilder sb = new StringBuilder();
  134. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  135. p.Start();
  136. p.BeginOutputReadLine();
  137. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  138. return ParseResult(3, sb.ToString(), out R1, out R2);
  139. }
  140. /// <summary>
  141. /// 三星双时差误差椭圆无参
  142. /// </summary>
  143. /// <param name="mainSatEph">主星xyz星历,数组长度=3</param>
  144. /// <param name="adja1SatEph">邻1星xyz星历,数组长度=3</param>
  145. /// <param name="adja2SatEph">邻2星xyz星历,数组长度=3</param>
  146. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  147. /// <param name="recLonLat">接收站经纬度,数组长度=2</param>
  148. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  149. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  150. /// <param name="dtousErr">时差误差(单位us)</param>
  151. /// <param name="satLocErr">星历位置误差(单位米)</param>
  152. /// <param name="errProb">误差概率百分比(0-100,默认50)</param>
  153. /// <returns></returns>
  154. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse3Sat2Dto(double[] mainSatEph, double[] adja1SatEph, double[] adja2SatEph, double[] posLonLat, double[] recLonLat, out double R1, out double R2, double dtousErr = 1, double satLocErr = 10000, double errProb = 50)
  155. {
  156. if (string.IsNullOrWhiteSpace(exePath))
  157. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  158. if (!Directory.Exists(exePath))
  159. throw new Exception($"路径[{exePath}]不存在");
  160. var exeFile = Path.Combine(exePath, exeName);
  161. if (!File.Exists(exeFile))
  162. throw new Exception($"文件[{exeFile}]不存在");
  163. Process p = new Process();
  164. p.StartInfo.WorkingDirectory = exePath;
  165. p.StartInfo.FileName = exeFile;
  166. p.StartInfo.Arguments = $"51 {string.Join(" ", mainSatEph)} {string.Join(" ", adja1SatEph)} {string.Join(" ", adja2SatEph)} {string.Join(" ", posLonLat)} {string.Join(" ", recLonLat)} {dtousErr} {satLocErr} {errProb}";
  167. p.StartInfo.CreateNoWindow = true;
  168. p.StartInfo.RedirectStandardError = true;
  169. p.StartInfo.RedirectStandardOutput = true;
  170. p.StartInfo.UseShellExecute = false;
  171. StringBuilder sb = new StringBuilder();
  172. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  173. p.Start();
  174. p.BeginOutputReadLine();
  175. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  176. return ParseResult(3, sb.ToString(), out R1, out R2);
  177. }
  178. /// <summary>
  179. /// 双星时频差误差椭圆带参
  180. /// </summary>
  181. /// <param name="mainTle">主星双行根数</param>
  182. /// <param name="adjaTle">邻星双行根数</param>
  183. /// <param name="time">采集时刻</param>
  184. /// <param name="tarFreqUpMHz">目标上行频点MHz</param>
  185. /// <param name="refFreqUpMHz">参考上行频点MHz</param>
  186. /// <param name="mainSatTransMHz">主星转发器本振MHz</param>
  187. /// <param name="adjaSatTransMHz">邻星转发器本振MHz</param>
  188. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  189. /// <param name="refLonLat">参考站经纬度,数组长度=2</param>
  190. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  191. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  192. /// <returns></returns>
  193. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse2SatDtoDfoRef(string mainTle, string adjaTle, DateTime time, double tarFreqUpMHz, double refFreqUpMHz, double mainSatTransMHz, double adjaSatTransMHz, double[] posLonLat, double[] refLonLat, out double R1, out double R2)
  194. {
  195. if (string.IsNullOrWhiteSpace(exePath))
  196. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  197. if (!Directory.Exists(exePath))
  198. throw new Exception($"路径[{exePath}]不存在");
  199. var exeFile = Path.Combine(exePath, exeName);
  200. if (!File.Exists(exeFile))
  201. throw new Exception($"文件[{exeFile}]不存在");
  202. Process p = new Process();
  203. p.StartInfo.WorkingDirectory = exePath;
  204. p.StartInfo.FileName = exeFile;
  205. p.StartInfo.Arguments = $"54 \"{mainTle}\" \"{adjaTle}\" \"{time:yyyy-MM-dd HH:mm:ss.000000}\" {tarFreqUpMHz} {refFreqUpMHz} {mainSatTransMHz} {adjaSatTransMHz} {string.Join(" ", posLonLat)} {string.Join(" ", refLonLat)} ";
  206. p.StartInfo.CreateNoWindow = true;
  207. p.StartInfo.RedirectStandardError = true;
  208. p.StartInfo.RedirectStandardOutput = true;
  209. p.StartInfo.UseShellExecute = false;
  210. StringBuilder sb = new StringBuilder();
  211. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  212. p.Start();
  213. p.BeginOutputReadLine();
  214. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  215. return ParseResult(2, sb.ToString(), out R1, out R2);
  216. }
  217. /// <summary>
  218. /// 双星时频差误差椭圆带参
  219. /// </summary>
  220. /// <param name="mainSatEph">主星星历xyz vx vy vz,数组长度=6</param>
  221. /// <param name="adjaSatEph">邻星星历xyz vx vy vz,数组长度=6</param>
  222. /// <param name="tarFreqUpMHz">目标上行频点MHz</param>
  223. /// <param name="refFreqUpMHz">参考上行频点MHz</param>
  224. /// <param name="mainSatTransMHz">主星转发器本振MHz</param>
  225. /// <param name="adjaSatTransMHz">邻星转发器本振MHz</param>
  226. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  227. /// <param name="refLonLat">参考站经纬度,数组长度=2</param>
  228. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  229. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  230. /// <returns></returns>
  231. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse2SatDtoDfoRef(double[] mainSatEph, double[] adjaSatEph, double tarFreqUpMHz, double refFreqUpMHz, double mainSatTransMHz, double adjaSatTransMHz, double[] posLonLat, double[] refLonLat, out double R1, out double R2)
  232. {
  233. if (string.IsNullOrWhiteSpace(exePath))
  234. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  235. if (!Directory.Exists(exePath))
  236. throw new Exception($"路径[{exePath}]不存在");
  237. var exeFile = Path.Combine(exePath, exeName);
  238. if (!File.Exists(exeFile))
  239. throw new Exception($"文件[{exeFile}]不存在");
  240. Process p = new Process();
  241. p.StartInfo.WorkingDirectory = exePath;
  242. p.StartInfo.FileName = exeFile;
  243. p.StartInfo.Arguments = $"55 {string.Join(" ", mainSatEph)} {string.Join(" ", adjaSatEph)} {tarFreqUpMHz} {refFreqUpMHz} {mainSatTransMHz} {adjaSatTransMHz} {string.Join(" ", posLonLat)} {string.Join(" ", refLonLat)}";
  244. p.StartInfo.CreateNoWindow = true;
  245. p.StartInfo.RedirectStandardError = true;
  246. p.StartInfo.RedirectStandardOutput = true;
  247. p.StartInfo.UseShellExecute = false;
  248. StringBuilder sb = new StringBuilder();
  249. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  250. p.Start();
  251. p.BeginOutputReadLine();
  252. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  253. return ParseResult(2, sb.ToString(), out R1, out R2);
  254. }
  255. /// <summary>
  256. /// 双星时频差误差椭圆无参
  257. /// </summary>
  258. /// <param name="mainTle">主星双行根数</param>
  259. /// <param name="adjaTle">邻星双行根数</param>
  260. /// <param name="time">采集时刻</param>
  261. /// <param name="tarFreqUpMHz">目标上行频点MHz</param>
  262. /// <param name="mainSatTransMHz">主星转发器本振MHz</param>
  263. /// <param name="adjaSatTransMHz">邻星转发器本振MHz</param>
  264. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  265. /// <param name="recLonLat">接收站经纬度,数组长度=2</param>
  266. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  267. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  268. /// <returns></returns>
  269. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse2SatDtoDfo(string mainTle, string adjaTle, DateTime time, double tarFreqUpMHz, double mainSatTransMHz, double adjaSatTransMHz, double[] posLonLat, double[] recLonLat, out double R1, out double R2)
  270. {
  271. if (string.IsNullOrWhiteSpace(exePath))
  272. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  273. if (!Directory.Exists(exePath))
  274. throw new Exception($"路径[{exePath}]不存在");
  275. var exeFile = Path.Combine(exePath, exeName);
  276. if (!File.Exists(exeFile))
  277. throw new Exception($"文件[{exeFile}]不存在");
  278. Process p = new Process();
  279. p.StartInfo.WorkingDirectory = exePath;
  280. p.StartInfo.FileName = exeFile;
  281. p.StartInfo.Arguments = $"56 \"{mainTle}\" \"{adjaTle}\" \"{time:yyyy-MM-dd HH:mm:ss.000000}\" {tarFreqUpMHz} {mainSatTransMHz} {adjaSatTransMHz} {string.Join(" ", posLonLat)} {string.Join(" ", recLonLat)}";
  282. p.StartInfo.CreateNoWindow = true;
  283. p.StartInfo.RedirectStandardError = true;
  284. p.StartInfo.RedirectStandardOutput = true;
  285. p.StartInfo.UseShellExecute = false;
  286. StringBuilder sb = new StringBuilder();
  287. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  288. p.Start();
  289. p.BeginOutputReadLine();
  290. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  291. return ParseResult(2, sb.ToString(), out R1, out R2);
  292. }
  293. /// <summary>
  294. /// 双星时频差误差椭圆无参
  295. /// </summary>
  296. /// <param name="mainSatEph">主星星历xyz vx vy vz,数组长度=6</param>
  297. /// <param name="adjaSatEph">邻星星历xyz vx vy vz,数组长度=6</param>
  298. /// <param name="tarFreqUpMHz">目标上行频点MHz</param>
  299. /// <param name="mainSatTransMHz">主星转发器本振MHz</param>
  300. /// <param name="adjaSatTransMHz">邻星转发器本振MHz</param>
  301. /// <param name="posLonLat">定位点经纬度,数组长度=2</param>
  302. /// <param name="recLonLat">接收站经纬度,数组长度=2</param>
  303. /// <param name="R1">输出参数:椭圆长轴(km)</param>
  304. /// <param name="R2">输出参数:椭圆短轴(km)</param>
  305. /// <returns></returns>
  306. public static (List<SatInfo>, List<ErrDistanceMapLines>) ErrEllipse2SatDtoDfo(double[] mainSatEph, double[] adjaSatEph, double tarFreqUpMHz, double mainSatTransMHz, double adjaSatTransMHz, double[] posLonLat, double[] recLonLat, out double R1, out double R2)
  307. {
  308. if (string.IsNullOrWhiteSpace(exePath))
  309. throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
  310. if (!Directory.Exists(exePath))
  311. throw new Exception($"路径[{exePath}]不存在");
  312. var exeFile = Path.Combine(exePath, exeName);
  313. if (!File.Exists(exeFile))
  314. throw new Exception($"文件[{exeFile}]不存在");
  315. Process p = new Process();
  316. p.StartInfo.WorkingDirectory = exePath;
  317. p.StartInfo.FileName = exeFile;
  318. p.StartInfo.Arguments = $"57 {string.Join(" ", mainSatEph)} {string.Join(" ", adjaSatEph)} {tarFreqUpMHz} {mainSatTransMHz} {adjaSatTransMHz} {string.Join(" ", posLonLat)} {string.Join(" ", recLonLat)}";
  319. p.StartInfo.CreateNoWindow = true;
  320. p.StartInfo.RedirectStandardError = true;
  321. p.StartInfo.RedirectStandardOutput = true;
  322. p.StartInfo.UseShellExecute = false;
  323. StringBuilder sb = new StringBuilder();
  324. p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
  325. p.Start();
  326. p.BeginOutputReadLine();
  327. p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
  328. return ParseResult(2, sb.ToString(), out R1, out R2);
  329. }
  330. private static (List<SatInfo>, List<ErrDistanceMapLines>) ParseResult(int satCount, string txt, out double errR1, out double errR2)
  331. {
  332. if (string.IsNullOrWhiteSpace(txt))
  333. {
  334. throw new Exception("误差椭圆计算出现未知错误!");
  335. }
  336. if (txt.StartsWith("1 "))
  337. {
  338. throw new Exception(txt.Remove(0, 2));
  339. }
  340. var arr = txt.Split(' ');
  341. List<SatInfo> list = new List<SatInfo>();
  342. for (int i = 0; i < satCount; i++)
  343. {
  344. SatInfo satInfo = new SatInfo();
  345. var satCode = Convert.ToInt32(arr[3 * i + 1]);
  346. if (satCode > 0)
  347. satInfo.SatCode = satCode;
  348. satInfo.SatLon = Convert.ToDouble(arr[3 * i + 2]);
  349. satInfo.SatLat = Convert.ToDouble(arr[3 * i + 3]);
  350. list.Add(satInfo);
  351. }
  352. errR1 = Convert.ToDouble(arr[1 + satCount * 3]);//椭圆长轴
  353. errR2 = Convert.ToDouble(arr[2 + satCount * 3]);//椭圆短轴
  354. var jsonStr = arr[3 + satCount * 3];
  355. var res = JsonConvert.DeserializeObject<List<ErrDistanceMapLines>>(jsonStr);
  356. return (list, res);
  357. }
  358. }
  359. }