|
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
|
|
using XdCxRhDW.Repostory.Model;
|
|
|
using XdCxRhDW.Repostory.EFContext;
|
|
|
using XdCxRhDW.Core.Api;
|
|
|
+using System.Runtime.ConstrainedExecution;
|
|
|
namespace XdCxRhDW.App.UserControl
|
|
|
{
|
|
|
public partial class X1D1GDOPParam : DevExpress.XtraEditors.XtraUserControl
|
|
@@ -24,7 +25,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
RefLat = Convert.ToDouble(txtRefLocation1.Text.Replace(",", ",").Split(',')[1].Trim()),
|
|
|
DtousErr = Convert.ToDouble(txtDtousErr1.Text),
|
|
|
SatLocErr = Convert.ToDouble(txtSatLocErr1.Text),
|
|
|
- CXErr= Convert.ToDouble(txtCxErr.Text),
|
|
|
+ CXErr = Convert.ToDouble(txtCxErr.Text),
|
|
|
};
|
|
|
public X1D1GDOPParam(PosRes item)
|
|
|
{
|
|
@@ -51,7 +52,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
{
|
|
|
this.txtStationLocation1.Text = $"{station.CdbTxLon},{station.CdbTxLat}";
|
|
|
this.txtRefLocation1.Text = $"{station.RefLon},{station.RefLat}";
|
|
|
- this.txtCXStation.Text= $"{station.CxLon},{station.CxLat}";
|
|
|
+ this.txtCXStation.Text = $"{station.CxLon},{station.CxLat}";
|
|
|
}
|
|
|
var xlList = db.XlInfos.OrderBy(p => p.SatName).OrderByDescending(p => p.TimeBJ).ToList();
|
|
|
xlall.AddRange(xlList.Select(m => m.TwoLine));
|
|
@@ -72,25 +73,66 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ private (bool, string) ParamValidate()
|
|
|
+ {
|
|
|
+ if (string.IsNullOrWhiteSpace(txtTleMain.Text.Trim()))
|
|
|
+ {
|
|
|
+ return (false, "主星星历不能为空!");
|
|
|
+ }
|
|
|
+ if (txtCapTime.DateTime==DateTime.MinValue)
|
|
|
+ {
|
|
|
+ return (false, "采集时刻不能为空!");
|
|
|
+ }
|
|
|
+ var txtstat = txtStationLocation1.CheckLonLat("超短波");
|
|
|
+ if (!txtstat.Item1)
|
|
|
+ {
|
|
|
+ return txtstat;
|
|
|
+ }
|
|
|
+ var cxsta = txtCXStation.CheckLonLat("测向站");
|
|
|
+ if (!cxsta.Item1)
|
|
|
+ {
|
|
|
+ return cxsta;
|
|
|
+ }
|
|
|
+ var refsta = txtRefLocation1.CheckLonLat("参考站");
|
|
|
+ if (!refsta.Item1)
|
|
|
+ {
|
|
|
+ return refsta;
|
|
|
+ }
|
|
|
+ return (true, "");
|
|
|
+ }
|
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- mapControl1.ClearMap();
|
|
|
- var cdb = new double[] { Model.StationLon, Model.StationLat, 0 };
|
|
|
- var cx = new double[] { Model.StationLon, Model.StationLat, 0 };
|
|
|
- var refstation = new double[] { Model.RefLon, Model.RefLat, 0 };
|
|
|
- var (listSat, data) = GdopHelper.Gdop1Sat1D(Model.TleMain, Model.CapTime, cdb, cx,
|
|
|
- Model.DtousErr,Model.CXErr, Model.SatLocErr, refstation);
|
|
|
- if (data == null)
|
|
|
+ var pv = ParamValidate();
|
|
|
+ if (!pv.Item1)
|
|
|
{
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"{pv.Item2}");
|
|
|
return;
|
|
|
}
|
|
|
- foreach (var errLins in data)//画GDOP
|
|
|
+ try
|
|
|
+ {
|
|
|
+ mapControl1.ClearMap();
|
|
|
+ var cdb = new double[] { Model.StationLon, Model.StationLat, 0 };
|
|
|
+ var cx = new double[] { Model.StationLon, Model.StationLat, 0 };
|
|
|
+ var refstation = new double[] { Model.RefLon, Model.RefLat, 0 };
|
|
|
+ var (listSat, data) = GdopHelper.Gdop1Sat1D(Model.TleMain, Model.CapTime, cdb, cx,
|
|
|
+ Model.DtousErr, Model.CXErr, Model.SatLocErr, refstation);
|
|
|
+ if (data == null)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ foreach (var errLins in data)//画GDOP
|
|
|
+ {
|
|
|
+ var mapDots = errLins.MapDots.Select(p => p).Select(p => (p.Lon, p.Lat));
|
|
|
+ mapControl1.DrawGdopLineTwo(errLins.ErrDistanceKm, mapDots, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- var mapDots = errLins.MapDots.Select(p => p).Select(p => (p.Lon, p.Lat));
|
|
|
- mapControl1.DrawGdopLineTwo(errLins.ErrDistanceKm, mapDots, 1);
|
|
|
+ DxHelper.MsgBoxHelper.ShowError($"绘制GDOP失败,{ex.Message}");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
|
{
|