| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 | 
							- using DevExpress.Mvvm.ModuleInjection.Native;
 
- using DevExpress.XtraEditors;
 
- using DevExpress.XtraEditors.DXErrorProvider;
 
- using DevExpress.XtraLayout;
 
- using DevExpress.XtraMap;
 
- using DevExpress.XtraTreeList.Data;
 
- using DxHelper;
 
- using ExtensionsDev;
 
- using System;
 
- using System.CodeDom;
 
- using System.Collections.Generic;
 
- using System.ComponentModel;
 
- using System.Data;
 
- using System.Data.Entity;
 
- using System.Data.Entity.Migrations;
 
- using System.Drawing;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- using System.Windows.Documents;
 
- using System.Windows.Forms;
 
- using XdCxRhDW.Core.Api;
 
- using XdCxRhDW.Repostory.EFContext;
 
- using XdCxRhDW.Repostory.Model;
 
- namespace XdCxRhDW.App.EditForms
 
- {
 
-     public partial class X2DTOParamEditor : DevExpress.XtraEditors.XtraForm
 
-     {
 
-         private MapControl mapControl1;
 
-         private PosRes info;
 
-         private CgRes cg;
 
-         private List<SatInfo> listSat;
 
-         public X2DTOParamEditor(PosRes info, MapControl mapControl)
 
-         {
 
-             InitializeComponent();
 
-             this.Text = $"{info.PosResType.GetEnumDisplayName()}时差参数";
 
-             this.info = info;
 
-             this.listSat = new List<SatInfo>();
 
-             this.mapControl1 = mapControl;
 
-             this.StartPosition = FormStartPosition.CenterParent;
 
-             txtsatStation.EditValueChanged += TxtsatStation_EditValueChanged;
 
-             txtRefLocation.EditValueChanged += TxtRefLocation_EditValueChanged;
 
-         }
 
-         private void TxtRefLocation_EditValueChanged(object sender, EventArgs e)
 
-         {
 
-             txtRefLocation.CheckLonLat(dxErrorProvider, "参考站");
 
-         }
 
-         private void TxtsatStation_EditValueChanged(object sender, EventArgs e)
 
-         {
 
-             txtsatStation.CheckLonLat(dxErrorProvider, "接收站");
 
-         }
 
-         private async void X2DTOParamEditor_Load(object sender, EventArgs e)
 
-         {
 
-             StationRes station;
 
-             using (RHDWContext db = new RHDWContext())
 
-             {
 
-                 listSat = await db.SatInfos.ToListAsync();
 
-             }
 
-             using (RHDWPartContext db = RHDWPartContext.GetContext(info.SigTime))
 
-             {
 
-                 cg = await db.CgRes.Where(m => m.ID == info.CgResID).FirstOrDefaultAsync();
 
-                 station = await db.StationRes.Where(m => m.ID == info.StationResID).FirstOrDefaultAsync();
 
-             }
 
-             if (cg != null)
 
-             {
 
-                 this.txtDtoSx.Text = $"{cg.Dto1.Value}";
 
-                 this.txtYbMain.Text = $"{cg.YbMainDto.Value}";
 
-                 this.txtYbAdja.Text = $"{cg.YbAdja1Dto.Value}";
 
-                 this.sigTime.EditValue = info.SigTime;
 
-                 this.txtMainX.Text = $"{cg.MainX.Value}";
 
-                 this.txtMainY.Text = $"{cg.MainY.Value}";
 
-                 this.txtMainZ.Text = $"{cg.MainZ.Value}";
 
-                 this.txtAdjaX.Text = $"{cg.Adja1X.Value}";
 
-                 this.txtAdjaY.Text = $"{cg.Adja1Y.Value}";
 
-                 this.txtAdjaZ.Text = $"{cg.Adja1Z.Value}";
 
-             }
 
-             if (station != null)
 
-             {
 
-                 this.txtsatStation.Text = $"{station.SatTxLon},{station.SatTxLat}";
 
-                 this.txtRefLocation.Text = $"{station.RefLon},{station.RefLat}";
 
-             }
 
-         }
 
-         public bool CheckParam()
 
-         {
 
-             if (!txtsatStation.CheckLonLat(dxErrorProvider, "接收站"))
 
-             {
 
-                 return false;
 
-             }
 
-             if (!txtRefLocation.CheckLonLat(dxErrorProvider, "参考站"))
 
-             {
 
-                 return false;
 
-             }
 
-             return true;
 
-         }
 
-         private void btnOk_Click(object sender, EventArgs e)
 
-         {
 
-             if (!CheckParam()) { return; }
 
-             try
 
-             {
 
-                 var MsAnt = txtsatStation.GetLonLat();
 
-                 var RefGeod = txtRefLocation.GetLonLat();
 
-                 var DtoSx = Convert.ToDouble(this.txtDtoSx.Text);
 
-                 var YbMainDto = Convert.ToDouble(this.txtYbMain.Text);
 
-                 var YbAdja1Dto = Convert.ToDouble(this.txtYbAdja.Text);
 
-                 var MainX = Convert.ToDouble(this.txtMainX.Text);
 
-                 var MainY = Convert.ToDouble(this.txtMainY.Text);
 
-                 var MainZ = Convert.ToDouble(this.txtMainZ.Text);
 
-                 var AdjaX = Convert.ToDouble(this.txtAdjaX.Text);
 
-                 var AdjaY = Convert.ToDouble(this.txtAdjaY.Text);
 
-                 var AdjaZ = Convert.ToDouble(this.txtAdjaZ.Text);
 
-                 double[] msEph = new double[] { MainX, MainY, MainZ, 0, 0, 0 };
 
-                 double[] Ns1Eph = new double[] { AdjaX, AdjaY, AdjaZ, 0, 0, 0 };
 
-                 DtoLineTwoStartOption twoStartOption = new DtoLineTwoStartOption();
 
-                 twoStartOption.MsEph = msEph;
 
-                 twoStartOption.NsEph = Ns1Eph;
 
-                 twoStartOption.MsAnt = MsAnt;
 
-                 twoStartOption.NsAnt = MsAnt;
 
-                 twoStartOption.RefGeod = RefGeod;
 
-                 twoStartOption.TargetDto = DtoSx;
 
-                 twoStartOption.RefDto = YbMainDto - YbAdja1Dto;
 
-                 twoStartOption.PosLon = info.PosLon;
 
-                 twoStartOption.PosLat = info.PosLat;
 
-                 var msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
 
-                 if (string.IsNullOrWhiteSpace(msat)) msat = cg.MainCode.Value.ToString();
 
-                 var nsat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat;
 
-                 if (string.IsNullOrWhiteSpace(nsat)) nsat = cg.Adja1Code.Value.ToString();
 
-                 var tsDtoLine = DrawDtoLineHelper.DtoLine2XStart(twoStartOption);
 
-                 mapControl1.DrawDtoPonit($"[{msat},[{nsat}]]时差线", tsDtoLine);
 
-             }
 
-             catch (Exception ex)
 
-             {
 
-                 Serilog.Log.Error(ex, $"绘制{info.PosResType.GetEnumDisplayName()}时差线失败.PosID={info.ID},SigTime={info.SigTime}");
 
-                 DxHelper.MsgBoxHelper.ShowWarning($"绘制{info.PosResType.GetEnumDisplayName()}时差线失败");
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |