|
@@ -12,11 +12,17 @@ using DW5S.DTO;
|
|
|
using DW5S.Entity;
|
|
|
|
|
|
using DW5S.Repostory;
|
|
|
+using Microsoft.Extensions.Logging;
|
|
|
|
|
|
namespace DW5S.App.UserControl
|
|
|
{
|
|
|
public partial class X3DFGDOPParam : DevExpress.XtraEditors.XtraUserControl
|
|
|
{
|
|
|
+ [Autowired]
|
|
|
+ private readonly ILogger logger;
|
|
|
+
|
|
|
+ [Autowired]
|
|
|
+ private readonly UnitOfWork unitOfWork;
|
|
|
public MapControl mapControl1;
|
|
|
public X3DFGDOP接口 Model => new X3DFGDOP接口()
|
|
|
{
|
|
@@ -43,28 +49,27 @@ namespace DW5S.App.UserControl
|
|
|
this.txtEphVelErr1.EditValue = 0.1;
|
|
|
this.txtDfoErr1.EditValue = 0.01;
|
|
|
PosResType = item.PosResType;
|
|
|
- using (RHDWPartContext db = RHDWPartContext.GetContext(item.SigTime))
|
|
|
+ var repsCg = unitOfWork.Of<CgRes>();
|
|
|
+ var repsStation = unitOfWork.Of<StationRes>();
|
|
|
+ var cg = repsCg.FirstOrDefaultAsync(m => m.Id == item.CgResID).Result;
|
|
|
+ var station = repsStation.FirstOrDefaultAsync(m => m.Id == item.StationResID).Result;
|
|
|
+ if (station != null)
|
|
|
{
|
|
|
- var cg = db?.CgRes.Where(m => m.ID == item.CgResID).FirstOrDefault();
|
|
|
- var station = db?.StationRes.Where(m => m.ID == item.StationResID).FirstOrDefault();
|
|
|
- if (station != null)
|
|
|
- {
|
|
|
- this.txtRefLocation1.Text = $"{station.RefLon},{station.RefLat}";
|
|
|
- }
|
|
|
- if (cg != null)
|
|
|
- {
|
|
|
- this.txtFu1.EditValue = cg.TarFreqUp.HasValue ? cg.TarFreqUp.Value * 1e-6 : 0;
|
|
|
- this.txtFu2.EditValue = cg.RefFreqUp.HasValue ? cg.RefFreqUp.Value * 1e-6 : 0;
|
|
|
+ this.txtRefLocation1.Text = $"{station.RefLon},{station.RefLat}";
|
|
|
+ }
|
|
|
+ if (cg != null)
|
|
|
+ {
|
|
|
+ this.txtFu1.EditValue = cg.TarFreqUp.HasValue ? cg.TarFreqUp.Value * 1e-6 : 0;
|
|
|
+ this.txtFu2.EditValue = cg.RefFreqUp.HasValue ? cg.RefFreqUp.Value * 1e-6 : 0;
|
|
|
|
|
|
- var mainEph = (cg.MainX, cg.MainY, cg.MainZ, cg.MainVx, cg.MainVy, cg.MainVz);
|
|
|
- ucEphXYZMain.SetParam($"主星", cg.MainCode, mainEph, Color.Black);
|
|
|
+ var mainEph = (cg.MainX, cg.MainY, cg.MainZ, cg.MainVx, cg.MainVy, cg.MainVz);
|
|
|
+ ucEphXYZMain.SetParam($"主星", cg.MainCode, mainEph, Color.Black);
|
|
|
|
|
|
- var adja1Eph = (cg.Adja1X, cg.Adja1Y, cg.Adja1Z, cg.Adja1Vx, cg.Adja1Vy, cg.Adja1Vz);
|
|
|
- ucEphXYZAdja1.SetParam($"邻星1", cg.Adja1Code, adja1Eph, Color.Black);
|
|
|
+ var adja1Eph = (cg.Adja1X, cg.Adja1Y, cg.Adja1Z, cg.Adja1Vx, cg.Adja1Vy, cg.Adja1Vz);
|
|
|
+ ucEphXYZAdja1.SetParam($"邻星1", cg.Adja1Code, adja1Eph, Color.Black);
|
|
|
|
|
|
- var adja2Eph = (cg.Adja2X, cg.Adja2Y, cg.Adja2Z, cg.Adja2Vx, cg.Adja2Vy, cg.Adja2Vz);
|
|
|
- ucEphXYZAdja2.SetParam($"邻星2", cg.Adja2Code, adja2Eph, Color.Black);
|
|
|
- }
|
|
|
+ var adja2Eph = (cg.Adja2X, cg.Adja2Y, cg.Adja2Z, cg.Adja2Vx, cg.Adja2Vy, cg.Adja2Vz);
|
|
|
+ ucEphXYZAdja2.SetParam($"邻星2", cg.Adja2Code, adja2Eph, Color.Black);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -135,7 +140,9 @@ namespace DW5S.App.UserControl
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- DxHelper.MsgBoxHelper.ShowError($"绘制{PosResType.GetEnumDisplayName()}GDOP失败,{ex.Message}");
|
|
|
+ string msg = $"绘制{PosResType.GetEnumDisplayName()}GDOP失败";
|
|
|
+ logger.LogError(ex, msg);
|
|
|
+ DxHelper.MsgBoxHelper.ShowError(msg);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -158,7 +165,8 @@ namespace DW5S.App.UserControl
|
|
|
var mainCode = ucEphXYZMain.GetSatCode();
|
|
|
var adja1Code = ucEphXYZAdja1.GetSatCode();
|
|
|
var adja2Code = ucEphXYZAdja2.GetSatCode();
|
|
|
- var mainxlInfo = await XlRepository.GetLatestAsync(mainCode, sigTime);
|
|
|
+ var repsXl = unitOfWork.Of<XlInfo>() as XlRepository;
|
|
|
+ var mainxlInfo = await repsXl.GetLatestAsync(mainCode, sigTime);
|
|
|
if (mainxlInfo == null)
|
|
|
{
|
|
|
DxHelper.MsgBoxHelper.ShowWarning($"卫星:{mainCode}未找到对应的星历信息,请导入星历");
|
|
@@ -168,7 +176,7 @@ namespace DW5S.App.UserControl
|
|
|
var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
|
|
|
ucEphXYZMain.SetParam("主星", mainCode, (maineph.data.X, maineph.data.Y, maineph.data.Z, maineph.data.VX, maineph.data.VY, maineph.data.VZ), Color.Red);
|
|
|
|
|
|
- var adja1xlInfo = await XlRepository.GetLatestAsync(adja1Code, sigTime);
|
|
|
+ var adja1xlInfo = await repsXl.GetLatestAsync(adja1Code, sigTime);
|
|
|
if (adja1xlInfo == null)
|
|
|
{
|
|
|
DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adja1Code}未找到对应的星历信息,请导入星历");
|
|
@@ -178,7 +186,7 @@ namespace DW5S.App.UserControl
|
|
|
var adja1eph = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
|
|
|
ucEphXYZAdja1.SetParam("邻星1", adja1Code, (adja1eph.data.X, adja1eph.data.Y, adja1eph.data.Z, adja1eph.data.VX, adja1eph.data.VY, adja1eph.data.VZ), Color.Red);
|
|
|
|
|
|
- var adja2xlInfo = await XlRepository.GetLatestAsync(adja2Code, sigTime);
|
|
|
+ var adja2xlInfo = await repsXl.GetLatestAsync(adja2Code, sigTime);
|
|
|
if (adja2xlInfo == null)
|
|
|
{
|
|
|
DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adja2Code}未找到对应的星历信息,请导入星历");
|
|
@@ -190,8 +198,9 @@ namespace DW5S.App.UserControl
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- DW5S.Framework.LogHelper.Error($"手动推算{PosResType.GetEnumDisplayName()}星历失败,SigTime={sigTime}", ex);
|
|
|
- DxHelper.MsgBoxHelper.ShowError($"手动推算{PosResType.GetEnumDisplayName()}星历失败,{ex.Message}");
|
|
|
+ string msg = $"手动推算{PosResType.GetEnumDisplayName()}星历失败,SigTime={sigTime}";
|
|
|
+ logger.LogError(ex, msg);
|
|
|
+ DxHelper.MsgBoxHelper.ShowError(msg);
|
|
|
}
|
|
|
}
|
|
|
}
|