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 CG.App.Api.时差粗值预测; using CG.App.Api.星历推算; using XzXdDw.App; namespace CG.App.UserControl { public partial class DtXDParam : DevExpress.XtraEditors.XtraUserControl { public (double starLon, double startLat, double centerLon, double centerLat, double endLon, double endLat, double lonRange, double latRange) rect { get; set; } public DtXDParam() { InitializeComponent(); } private void DtXDParam_Load(object sender, EventArgs e) { captime.UseDefault(); mainTle.Text = TestData.TleMain; adajTle.Text = TestData.TleAdja1; captime.DateTime = TestData.Time; stationpos.Text = TestData.RecLoc; mainrec.Text = TestData.Rec2Loc; adajrec.Text = TestData.Rec2Loc; } private void btnOk_Click(object sender, EventArgs e) { double[] mrec = new double[2]; double[] arec = new double[2]; mrec[0] = Convert.ToDouble(mainrec.Text.Replace(",", ",").Split(',')[0].Trim()); mrec[1] = Convert.ToDouble(mainrec.Text.Replace(",", ",").Split(',')[1].Trim()); arec[0] = Convert.ToDouble(mainrec.Text.Replace(",", ",").Split(',')[0].Trim()); arec[1] = Convert.ToDouble(mainrec.Text.Replace(",", ",").Split(',')[1].Trim()); double[] srec = new double[2]; srec[0] = Convert.ToDouble(stationpos.Text.Replace(",", ",").Split(',')[0].Trim()); srec[1] = Convert.ToDouble(stationpos.Text.Replace(",", ",").Split(',')[1].Trim()); double[] center = new double[3]; center[0] = rect.centerLon; center[1] = rect.centerLat; //1.计算星历 var geo1 = Tle2XYZ.GetXyz(mainTle.Text, captime.DateTime); var geo2 = Tle2XYZ.GetXyz(adajTle.Text, captime.DateTime); //输出 double[] resule = new double[2]; DtApi.GetGeoTime(mrec, arec, geo1, geo2, center, rect.lonRange, rect.latRange, resule); sxdtcetner.Text = $"{resule[0] * 1e6:F2}"; sxdtrange.Text = $"{resule[1] * 1e6:F2}"; DtApi.GetGEOLocalTime(srec, geo1, mrec, center, rect.lonRange, rect.latRange, resule); xddtcetner.Text = $"{resule[0] * 1e6:F2}"; xddtrange.Text = $"{resule[1] * 1e6:F2}"; } private void btnClose_Click(object sender, EventArgs e) { PopupHelper.HidePopup(this); } } }