DtSXLParam.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using DxHelper;
  2. using ExtensionsDev;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using CG.App.Api.时差粗值预测;
  13. using CG.App.Api.星历推算;
  14. using XzXdDw.App;
  15. namespace CG.App.UserControl
  16. {
  17. public partial class DtSXLParam : DevExpress.XtraEditors.XtraUserControl
  18. {
  19. public (double starLon, double startLat, double centerLon, double centerLat, double endLon, double endLat, double lonRange, double latRange) rect
  20. { get; set; }
  21. public DtSXLParam()
  22. {
  23. InitializeComponent();
  24. }
  25. private void DtXDParam_Load(object sender, EventArgs e)
  26. {
  27. captime.UseDefault();
  28. mainTle.Text = TestData.tleleo1;
  29. adajTle.Text = TestData.tleleo2;
  30. captime.DateTime = TestData.leoTime;
  31. }
  32. private void btnOk_Click(object sender, EventArgs e)
  33. {
  34. double[] center = new double[3];
  35. center[0] = rect.centerLon;
  36. center[1] = rect.centerLat;
  37. //1.计算星历
  38. var geo1 = Tle2XYZ.GetXyz(mainTle.Text, captime.DateTime);
  39. var geo2 = Tle2XYZ.GetXyz(adajTle.Text, captime.DateTime);
  40. //输出
  41. double[] resule = new double[2];
  42. DtApi.GetLEOTime(geo1, geo2, center, rect.lonRange, rect.latRange, resule);
  43. sxdtcetner.Text = $"{resule[0] * 1e6:F2}";
  44. sxdtrange.Text = $"{resule[1] * 1e6:F2}";
  45. }
  46. private void btnClose_Click(object sender, EventArgs e)
  47. {
  48. PopupHelper.HidePopup(this);
  49. }
  50. }
  51. }