zoule 5 tháng trước cách đây
mục cha
commit
c8c907e2bd

+ 1 - 6
DW5S.App/EditForms/X3DfoParamEditor.cs

@@ -47,12 +47,7 @@ namespace DW5S.App.EditForms
 
             var repsStation = unitOfWork.Of<StationRes>();
             station = await repsStation.FirstOrDefaultAsync(m => m.Id == info.StationResID);
-            using (OracleContext db = new OracleContext())
-            {
-                listSat = await db.SatInfos.ToListAsync();
-                cg = await db?.CgRes.Where(m =>m.TaskID==info.TaskInfoID&& m.Id == info.CgResID).FirstOrDefaultAsync();
-                station = await db?.StationRes.Where(m => m.TaskID == info.TaskInfoID && m.Id == info.StationResID).FirstOrDefaultAsync();
-            }
+
             if (cg != null)
             {
                 this.txtDfo1.Text = $"{cg.Dfo1.Value}";

+ 17 - 22
DW5S.App/UserControl/X2D1GDOPParam.cs

@@ -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}");
             }
         }
     }

+ 3 - 1
DW5S.App/UserControl/X2DFGDOPParam.cs

@@ -144,7 +144,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);
             }
         }