|
@@ -53,25 +53,23 @@ namespace DW5S.App.UserControl
|
|
|
{
|
|
|
layoutControlItem14.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
|
|
|
}
|
|
|
-
|
|
|
- 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.txtStationLocation1.Text = $"{station.CdbTxLon},{station.CdbTxLat}";
|
|
|
- this.txtRefLocation1.Text = $"{station.RefLon},{station.RefLat}";
|
|
|
- }
|
|
|
+ this.txtStationLocation1.Text = $"{station.CdbTxLon},{station.CdbTxLat}";
|
|
|
+ this.txtRefLocation1.Text = $"{station.RefLon},{station.RefLat}";
|
|
|
+ }
|
|
|
|
|
|
- if (cg != null)
|
|
|
- {
|
|
|
- var mainEph = (cg.MainX, cg.MainY, cg.MainZ, cg.MainVx, cg.MainVy, cg.MainVz);
|
|
|
- ucEphXYZMain.SetParam($"主星", cg.MainCode, mainEph, Color.Black);
|
|
|
+ if (cg != null)
|
|
|
+ {
|
|
|
+ var mainEph = (cg.MainX, cg.MainY, cg.MainZ, cg.MainVx, cg.MainVy, cg.MainVz);
|
|
|
+ ucEphXYZMain.SetParam($"主星", cg.MainCode, mainEph, Color.Black);
|
|
|
|
|
|
- var adjaEph = (cg.Adja1X, cg.Adja1Y, cg.Adja1Z, cg.Adja1Vx, cg.Adja1Vy, cg.Adja1Vz);
|
|
|
- ucEphXYZAdja.SetParam($"邻星", cg.Adja1Code, adjaEph, Color.Black);
|
|
|
- }
|
|
|
+ var adjaEph = (cg.Adja1X, cg.Adja1Y, cg.Adja1Z, cg.Adja1Vx, cg.Adja1Vy, cg.Adja1Vz);
|
|
|
+ ucEphXYZAdja.SetParam($"邻星", cg.Adja1Code, adjaEph, Color.Black);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -157,8 +155,8 @@ namespace DW5S.App.UserControl
|
|
|
{
|
|
|
var mainCode = ucEphXYZMain.GetSatCode();
|
|
|
var adjaCode = ucEphXYZAdja.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 +166,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 adjaxlInfo = await XlRepository.GetLatestAsync(adjaCode, sigTime);
|
|
|
+ var adjaxlInfo = await repsXl.GetLatestAsync(adjaCode, sigTime);
|
|
|
if (adjaxlInfo == null)
|
|
|
{
|
|
|
DxHelper.MsgBoxHelper.ShowWarning($"卫星:{adjaCode}未找到对应的星历信息,请导入星历");
|
|
@@ -183,9 +181,6 @@ namespace DW5S.App.UserControl
|
|
|
string msg = $"手动推算{PosResType.GetEnumDisplayName()}星历失败,SigTime={sigTime}";
|
|
|
logger.LogError(ex, msg);
|
|
|
DxHelper.MsgBoxHelper.ShowError(msg);
|
|
|
-
|
|
|
- DW5S.Framework.LogHelper.Error($"手动推算{PosResType.GetEnumDisplayName()}星历失败,SigTime={sigTime}", ex);
|
|
|
- DxHelper.MsgBoxHelper.ShowError($"手动推算{PosResType.GetEnumDisplayName()}星历失败,{ex.Message}");
|
|
|
}
|
|
|
}
|
|
|
}
|