|
@@ -599,16 +599,6 @@ namespace XdCxRhDW.App.UserControl
|
|
|
var item = gridView2.GetRow(ids[0]) as PosRes;
|
|
|
return item;
|
|
|
}
|
|
|
- private EnumPosType GetPosRes(PosRes posRes, string msg)
|
|
|
- {
|
|
|
- var taskInfo = list.Find(m => m.ID == posRes.TaskInfoID);
|
|
|
- if (taskInfo == null)
|
|
|
- {
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"{msg}未找到任务[{posRes.TaskInfoID}]!");
|
|
|
- return default;
|
|
|
- }
|
|
|
- return taskInfo.PosType;
|
|
|
- }
|
|
|
|
|
|
private void btnDrawDfo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
{
|
|
@@ -713,7 +703,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
listSat = db.SatInfos.ToList();
|
|
|
cg = await db.CgRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
- station = await db.StationRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
+ station = await db.StationRes.Where(m => m.ID == item.StationResID).FirstOrDefaultAsync();
|
|
|
}
|
|
|
if (cg == null)
|
|
|
{
|
|
@@ -750,8 +740,11 @@ namespace XdCxRhDW.App.UserControl
|
|
|
dtoLineXd.RefDto = cg.YbMainDto.Value;
|
|
|
dtoLineXd.PosLon = item.PosLon;
|
|
|
dtoLineXd.PosLat = item.PosLat;
|
|
|
-
|
|
|
- var msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
|
|
|
+ string msat = string.Empty;
|
|
|
+ if (cg.MainCode.HasValue)
|
|
|
+ {
|
|
|
+ msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
|
|
|
+ }
|
|
|
var xdDtoLine = DrawDtoLineHelper.DtoLineXd(dtoLineXd);
|
|
|
mapControl1.DrawDtoPonit($"星地[{msat},[{station.CdbTxLon}°]]时差线", xdDtoLine);
|
|
|
|
|
@@ -768,7 +761,12 @@ namespace XdCxRhDW.App.UserControl
|
|
|
twoStartOption.PosLon = item.PosLon;
|
|
|
twoStartOption.PosLat = item.PosLat;
|
|
|
var tsDtoLine = DrawDtoLineHelper.DtoLineXDTwoStart(twoStartOption);
|
|
|
- mapControl1.DrawDtoPonit($"双星[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat}]时差线", tsDtoLine);
|
|
|
+ string nsat = string.Empty;
|
|
|
+ if (cg.Adja1Code.HasValue)
|
|
|
+ {
|
|
|
+ nsat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat;
|
|
|
+ }
|
|
|
+ mapControl1.DrawDtoPonit($"双星[{msat},{nsat}]时差线", tsDtoLine);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -790,7 +788,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
listSat = db.SatInfos.ToList();
|
|
|
cg = await db.CgRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
- station = await db.StationRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
+ station = await db.StationRes.Where(m => m.ID == item.StationResID).FirstOrDefaultAsync();
|
|
|
}
|
|
|
if (cg == null)
|
|
|
{
|
|
@@ -866,7 +864,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
listSat = db.SatInfos.ToList();
|
|
|
cg = await db.CgRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
|
|
|
- station = await db.StationRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
+ station = await db.StationRes.Where(m => m.ID == item.StationResID).FirstOrDefaultAsync();
|
|
|
}
|
|
|
if (cg == null)
|
|
|
{
|
|
@@ -900,8 +898,9 @@ namespace XdCxRhDW.App.UserControl
|
|
|
twoStartOption.Turn1 = Math.Abs(twoStartOption.Freq - (cg.TarFreqDown.HasValue ? cg.TarFreqDown.Value : 0));
|
|
|
twoStartOption.Turn2 = Math.Abs(twoStartOption.RefFreq - (cg.RefFreqDown.HasValue ? cg.RefFreqDown.Value : 0));
|
|
|
twoStartOption.RefDfo = cg.YbMainDfo.Value - cg.YbAdja1Dfo.Value;
|
|
|
- var msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
|
|
|
var tsDtoLine = DrawDfoLineHelper.DfoLineTwoStart(twoStartOption);
|
|
|
+
|
|
|
+ var msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
|
|
|
mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja1X.Value)?.Sat}]频差线", tsDtoLine);
|
|
|
|
|
|
if (item.PosResType == EnumPosResType.X3TwoDfo)
|
|
@@ -933,7 +932,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
using (RHDWContext db = new RHDWContext())
|
|
|
{
|
|
|
cx = await db.CxRes.Where(m => m.ID == item.CxResID.Value).FirstOrDefaultAsync();
|
|
|
- station = await db.StationRes.Where(m => m.ID == item.CgResID).FirstOrDefaultAsync();
|
|
|
+ station = await db.StationRes.Where(m => m.ID == item.StationResID).FirstOrDefaultAsync();
|
|
|
}
|
|
|
if (cx == null)
|
|
|
{
|
|
@@ -951,15 +950,14 @@ namespace XdCxRhDW.App.UserControl
|
|
|
DxHelper.MsgBoxHelper.ShowWarning($"测向站信息为空!");
|
|
|
return;
|
|
|
}
|
|
|
- double startdeg = 360;
|
|
|
- double deg = startdeg - cx.Fx;//向北顺时针方向为夹角
|
|
|
+ double deg = cx.Fx;//向北顺时针方向为夹角
|
|
|
//计算测向站到定位点之间的距离
|
|
|
var km = MapControlEx.CalcLineKm(station.CxLon.Value, station.CxLat.Value, item.PosLon, item.PosLat);
|
|
|
var endpoint = MapControlEx.CalcSituation(station.CxLon.Value, station.CxLat.Value, deg, (km + 100) * 1000);
|
|
|
List<(double, double)> points = new List<(double, double)>();
|
|
|
points.Add((station.CxLon.Value, station.CxLat.Value));
|
|
|
points.Add((endpoint.Item1, endpoint.Item2));
|
|
|
- mapControl1.DrawCXLine($"测向线角度:{cx.Fx}°\t\n", points);
|
|
|
+ mapControl1.DrawCXLine($"测向线角度:{cx.Fx}°\t\n", points, true);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|