CtrlDto.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using DevExpress.Utils.Drawing.Helpers;
  2. using DevExpress.Utils.Extensions;
  3. using DevExpress.XtraEditors;
  4. using DevExpress.XtraExport.Helpers;
  5. using DevExpress.XtraGrid.Views.Grid;
  6. using DevExpress.XtraMap;
  7. using DevExpress.XtraTreeList.Data;
  8. using DxHelper;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Data.Entity;
  14. using System.Drawing;
  15. using System.IO;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Threading;
  19. using System.Threading.Tasks;
  20. using System.Windows.Controls;
  21. using System.Windows.Documents;
  22. using System.Windows.Forms;
  23. using XzXdDw.App.Model;
  24. namespace CG.App.UserControl
  25. {
  26. /// <summary>
  27. /// 星地定位
  28. /// </summary>
  29. public partial class CtrlDto : DevExpress.XtraEditors.XtraUserControl
  30. {
  31. DtXDParam dtxdctrl = null;
  32. DtSXLParam dtsxlctrl = null;
  33. public CtrlDto()
  34. {
  35. InitializeComponent();
  36. }
  37. private async void CtrlDto_Load(object sender, EventArgs e)
  38. {
  39. try
  40. {
  41. mapControl1.UseDefalutOptions()
  42. .UseClearAll()
  43. .UseDistanceLine()
  44. .UseMarkDot()
  45. .UseDrawRect(rect =>
  46. {
  47. if (dtxdctrl != null)
  48. {
  49. dtxdctrl.rect = rect;
  50. }
  51. });
  52. mapControl1.AddRectMenu<XDPosRes>("星地时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
  53. {
  54. var rect = mapControl1.GetCurrentRect();
  55. if (dtxdctrl == null)
  56. {
  57. dtxdctrl = new DtXDParam();
  58. }
  59. dtxdctrl.rect = rect;
  60. PopupHelper.ShowPopup(dtxdctrl, mapControl1, mapControl1.Width / 4);
  61. })
  62. .AddRectMenu<XZPosRes>("低轨双星时差初值预估", SvgHelper.LoadFromFile("Image\\初值预估.svg"), items =>
  63. {
  64. var rect = mapControl1.GetCurrentRect();
  65. if (dtsxlctrl == null)
  66. {
  67. dtsxlctrl = new DtSXLParam();
  68. }
  69. dtsxlctrl.rect = rect;
  70. PopupHelper.ShowPopup(dtsxlctrl, mapControl1, mapControl1.Width / 4);
  71. });
  72. }
  73. catch (Exception ex)
  74. {
  75. Serilog.Log.Error("加载时差初值预估失败", ex);
  76. XtraMessageBox.Show("加载时差初值预估失败");
  77. }
  78. }
  79. }
  80. }