123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using DevExpress.Charts.Native;
- using DevExpress.Internal.WinApi.Windows.UI.Notifications;
- using DevExpress.XtraPrinting;
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- using XdCxRhDW.App.Api.时差线;
- using XdCxRhDW.App.DTO;
- using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
- namespace XzXdDw.App.Api.低轨GDOP误差椭圆
- {
- public class ErrorEllipseDTFOTSOption
- {
- /// <summary>
- /// 主星星历
- /// </summary>
- public double[] MsEph { get; set; }
- /// <summary>
- /// 邻星星历
- /// </summary>
- public double[] NsEph { get; set; }
- /// <summary>
- /// 参考站位置
- /// </summary>
- public double[] RefGeod { get; set; }
- /// <summary>
- /// 定位点
- /// </summary>
- public double[] SelectPoint { get; set; }
- /// <summary>
- /// 时差误差(Hz)
- /// </summary>
- public double DtoErr { get; set; }
- /// <summary>
- /// 频差误差(Hz)
- /// </summary>
- public double DfoErr { get; set; }
- /// <summary>
- /// 星历位置误差
- /// </summary>
- public double EphPosErr { get; set; }
- /// <summary>
- ///星历速度误差
- /// </summary>
- public double EphVelErr { get; set; }
- /// <summary>
- /// 上行频点(Hz)
- /// </summary>
- public double fu { get; set; }
- /// <summary>
- /// 概率 默认0.5
- /// </summary>
- public double Pe { get; set; } = 0.5;
- }
- public static class ErrEllipseHelper
- {
- public static IEnumerable<(double lon, double lat)> ErrorEllipseDTFOTwoStart(ErrorEllipseDTFOTSOption opt)
- {
- List<DtoLinePoint> list = new List<DtoLinePoint>();
- int LOP_Len = 0;
- IntPtr LOP_ValuePtr = GdopHelper.Error_Ellipse_DTFO(
- opt.MsEph,
- opt.NsEph,
- opt.RefGeod,
- opt.SelectPoint,
- opt.DtoErr,
- opt.DfoErr,
- opt.EphPosErr,
- opt.EphVelErr,
- opt.fu, opt.Pe, ref LOP_Len);
- double[] LOP_Value = new double[LOP_Len];
- if (LOP_Len > 0)
- {
- Marshal.Copy(LOP_ValuePtr, LOP_Value, 0, LOP_Value.Length);
- int len = LOP_Len / 2;
- for (int i = 0; i < len; i++)
- {
- int temp = i * 2;
- list.Add(new DtoLinePoint()
- {
- Lon = LOP_Value[temp],
- Lat = LOP_Value[temp + 1]
- });
- }
- }
- var Lines = list.Select(p => (p.Lon, p.Lat));
- return Lines;
- }
- }
- }
|