123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- using DevExpress.XtraEditors;
- using DevExpress.XtraMap;
- using DxHelper;
- using ExtensionsDev;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using XdCxRhDW.App.Api.星历推算;
- using XzXdDw.App;
- using XzXdDw.App.Api.低轨GDOP误差椭圆;
- using XzXdDw.App.EFContext;
- using XzXdDw.App.Model;
- namespace XdCxRhDW.App.UserControl
- {
- public partial class XZErrEllipseParam : DevExpress.XtraEditors.XtraUserControl
- {
- public MapControl mapControl1;
- public double lon;
- public double lat;
- public ErrEllipse星座协同接口 Model => new ErrEllipse星座协同接口()
- {
- TleMain = txtTleMain.Text.Trim(),
- TleAdja = txtTleAdja.Text.Trim(),
- CapTime = txtCapTime.DateTime,
- RefLon = Convert.ToDouble(txtRefLocation1.Text.Replace(",", ",").Split(',')[0].Trim()),
- RefLat = Convert.ToDouble(txtRefLocation1.Text.Replace(",", ",").Split(',')[1].Trim()),
- DtousErr = Convert.ToDouble(txtDtousErr1.Text),
- DfoErr= Convert.ToDouble(txtDfoErr1.Text),
- SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
- EphVelErr = Convert.ToDouble(txtEphVelErr1.Text),
- fu1 = Convert.ToDouble(txtFu1.Text) * 1e6,
- fu2 = Convert.ToDouble(txtFu2.Text) * 1e6,
- };
- public XZErrEllipseParam(TxInfo refTx, DateTime sigTime, double upfreqHz1, double upfreqHz2)
- {
- InitializeComponent();
- txtCapTime.UseDefault();
- txtTleMain.UseDoubleClickToSelectAll();
- txtTleAdja.UseDoubleClickToSelectAll();
- txtRefLocation1.UseDoubleClickToSelectAll();
- this.txtCapTime.DateTime = sigTime;
- this.txtRefLocation1.Text = $"{refTx.Lon},{refTx.Lat}";
- txtTleMain.UseDefault().SetStringData(TestData.AllTle).Text = TestData.tleleo1;
- txtTleAdja.UseDefault().SetStringData(TestData.AllTle).Text = TestData.tleleo2;
- this.txtDtousErr1.EditValue = TestData.DtousErr;
- this.txtDfoErr1.EditValue = TestData.DfoHzErr;
- this.txtSatLocErr1.EditValue = TestData.SatLocErr;
- this.txtEphVelErr1.EditValue = TestData.EphVelErr;
- this.txtFu1.EditValue = upfreqHz1 * 1e-6;
- this.txtFu2.EditValue = upfreqHz2 * 1e-6;
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- mapControl1.ClearMap();
- double[] main_sat = Tle2XYZ.GetXyz(Model.TleMain, Model.CapTime);
- double[] adja_sat = Tle2XYZ.GetXyz(Model.TleAdja, Model.CapTime);
- DrawErrorEllipseDTFO(lon, lat, main_sat, adja_sat, new double[] { Model.RefLon, Model.RefLat, 0 }, Model.DtousErr, Model.DfoErr, Model.SatLocErr, Model.EphVelErr, Model.fu1, Model.fu2);
- }
- private void DrawErrorEllipseDTFO(double posLon, double posLat, double[] main_sat, double[] neigh_sat, double[] Ref_Station_LLH, double DtoErr, double DfoErr, double EphPosErr, double EphVelErr, double fu1, double fu2)
- {
- try
- {
- ErrorEllipseDTFOTSOption twoStartOption = new ErrorEllipseDTFOTSOption();
- twoStartOption.MsEph = main_sat;
- twoStartOption.NsEph = neigh_sat;
- twoStartOption.RefGeod = Ref_Station_LLH;
- twoStartOption.SelectPoint = new double[3] { posLon, posLat, 0 };
- twoStartOption.DtoErr = DtoErr * 1e-6;
- twoStartOption.DfoErr = DfoErr;
- twoStartOption.EphPosErr = EphPosErr;
- twoStartOption.EphVelErr = EphVelErr;
- twoStartOption.fu1 = fu1;
- twoStartOption.fu2 = fu2;
- var points = ErrEllipseHelper.ErrorEllipseDTFOTwoStart(twoStartOption);
- mapControl1.DrawDtoPonit($"双星误差椭圆线", points);
- }
- catch (Exception ex)
- {
- Serilog.Log.Error("绘制误差椭圆线失败", ex);
- XtraMessageBox.Show($"绘制误差椭圆线失败,失败信息:{ex.Message}");
- }
- }
- private void btnClose_Click(object sender, EventArgs e)
- {
- PopupHelper.HidePopup(this);
- }
- }
- public class ErrEllipse星座协同接口
- {
- /// <summary>
- /// 主星星历(Tle)
- /// </summary>
- public string TleMain { get; set; }
- /// <summary>
- /// 邻星星历(Tle)
- /// </summary>
- public string TleAdja { get; set; }
- /// <summary>
- /// 采集时刻
- /// </summary>
- public DateTime CapTime { get; set; }
- /// <summary>
- /// 参考站位置经度
- /// </summary>
- public double RefLon { get; set; }
- /// <summary>
- /// 参考站位置纬度
- /// </summary>
- public double RefLat { get; set; }
- /// <summary>
- /// 时差误差(单位us)
- /// </summary>
- public double DtousErr { get; set; } = 1;
- /// <summary>
- /// 频差误差(Hz)
- /// </summary>
- public double DfoErr { get; set; }
- /// <summary>
- /// 星历位置误差(单位米)
- /// </summary>
- public double SatLocErr { get; set; } = 10000;
- /// <summary>
- ///星历速度误差
- /// </summary>
- public double EphVelErr { get; set; }
- /// <summary>
- /// 上行频点1(Hz)
- /// </summary>
- public double fu1 { get; set; }
- /// <summary>
- /// 上行频点2(Hz)
- /// </summary>
- public double fu2 { get; set; }
- }
- }
|