|
@@ -1,11 +1,9 @@
|
|
|
using DevExpress.Utils;
|
|
|
using DevExpress.Utils.Drawing;
|
|
|
-using DevExpress.Utils.Drawing.Helpers;
|
|
|
using DevExpress.Utils.Svg;
|
|
|
using DevExpress.XtraEditors.ButtonsPanelControl;
|
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
|
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
|
|
-using DevExpress.XtraTreeList.Data;
|
|
|
using DxHelper;
|
|
|
using Microsoft.Owin.Hosting;
|
|
|
using System;
|
|
@@ -170,13 +168,11 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
mapControl1.AddPosMenu<PosRes>("绘制时差线", SvgHelper.LoadFromFile("Image\\DtoLine.svg"), item =>
|
|
|
{
|
|
|
- var posType = GetPosRes(item, "绘制时差线");
|
|
|
- DrawDtoLine(item, posType);
|
|
|
+ DrawDtoLine(item);
|
|
|
})
|
|
|
.AddPosMenu<PosRes>("绘制频差线", SvgHelper.LoadFromFile("Image\\DfoLine.svg"), item =>
|
|
|
{
|
|
|
- var posType = GetPosRes(item, "绘制频差线");
|
|
|
- DrawDfoLine(item, posType);
|
|
|
+ DrawDfoLine(item);
|
|
|
})
|
|
|
//.AddPosMenu<PosRes>("绘制GDOP", SvgHelper.LoadFromFile("Image\\GDOP.svg"), item =>
|
|
|
// {
|
|
@@ -299,34 +295,36 @@ namespace XdCxRhDW.App.UserControl
|
|
|
btnDelPos.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
}
|
|
|
var posRes = GetPosRes("");
|
|
|
- switch (posRes.Item2)
|
|
|
+ switch (posRes.PosResType)
|
|
|
{
|
|
|
- case EnumPosType.X1D1CX:
|
|
|
+ case EnumPosResType.X1D1CX:
|
|
|
//一星一地 测向线 GDOP
|
|
|
btnDrawDto.Visibility = btnDrawDfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
btnGDOP.Visibility = btnDrawCX.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
break;
|
|
|
- case EnumPosType.X2D1:
|
|
|
+ case EnumPosResType.X2D1:
|
|
|
+ case EnumPosResType.X2D1NoRef:
|
|
|
//两星一地 GDOP 时差线
|
|
|
btnDrawDto.Visibility = btnGDOP.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
btnDrawCX.Visibility = btnDrawDfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
break;
|
|
|
- case EnumPosType.RH:
|
|
|
+ case EnumPosResType.RH:
|
|
|
//融合DW 时差线 测向线
|
|
|
- btnDrawDto.Visibility = btnDrawCX.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
+ btnDrawDto.Visibility = btnDrawCX.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
btnGDOP.Visibility = btnDrawDfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
break;
|
|
|
- case EnumPosType.X3TwoDto:
|
|
|
+ case EnumPosResType.X3:
|
|
|
+ case EnumPosResType.X3NoRef:
|
|
|
//三星双时差DW GDOP 时差线
|
|
|
btnDrawDto.Visibility = btnGDOP.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
btnDrawCX.Visibility = btnDrawDfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
break;
|
|
|
- case EnumPosType.X3TwoDfo:
|
|
|
+ case EnumPosResType.X3TwoDfo:
|
|
|
//三星双频差DW GDOP 频差线
|
|
|
btnDrawDfo.Visibility = btnGDOP.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
btnDrawDto.Visibility = btnDrawCX.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
|
break;
|
|
|
- case EnumPosType.X2Dfo:
|
|
|
+ case EnumPosResType.X2Dfo:
|
|
|
//双星时频差DW GDOP 时频差线
|
|
|
btnDrawDto.Visibility = btnDrawDfo.Visibility = btnGDOP.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
|
|
|
btnDrawCX.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
|
|
@@ -587,27 +585,19 @@ namespace XdCxRhDW.App.UserControl
|
|
|
private void btnDrawDto_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
{
|
|
|
var info = GetPosRes("绘制时差");
|
|
|
- var posRes = info.Item1;
|
|
|
- if (posRes == null) return;
|
|
|
- var posType = info.Item2;
|
|
|
- DrawDtoLine(posRes, posType);
|
|
|
+ if (info == null) return;
|
|
|
+ DrawDtoLine(info);
|
|
|
}
|
|
|
- private (PosRes, EnumPosType) GetPosRes(string msg)
|
|
|
+ private PosRes GetPosRes(string msg)
|
|
|
{
|
|
|
var ids = gridView2.GetSelectedRows();
|
|
|
if (ids.Length <= 0)
|
|
|
{
|
|
|
DxHelper.MsgBoxHelper.ShowWarning($"请选择需要{msg}的定位数据信息!");
|
|
|
- return (null, default);
|
|
|
+ return null;
|
|
|
}
|
|
|
var item = gridView2.GetRow(ids[0]) as PosRes;
|
|
|
- var taskInfo = list.Find(m => m.ID == item.TaskInfoID);
|
|
|
- if (taskInfo == null)
|
|
|
- {
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"{msg}未找到任务[{item.TaskInfoID}]!");
|
|
|
- return (null, default);
|
|
|
- }
|
|
|
- return (item, taskInfo.PosType);
|
|
|
+ return item;
|
|
|
}
|
|
|
private EnumPosType GetPosRes(PosRes posRes, string msg)
|
|
|
{
|
|
@@ -623,10 +613,8 @@ namespace XdCxRhDW.App.UserControl
|
|
|
private void btnDrawDfo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
{
|
|
|
var info = GetPosRes("绘制频差");
|
|
|
- var posRes = info.Item1;
|
|
|
- if (posRes == null) return;
|
|
|
- var posType = info.Item2;
|
|
|
- DrawDfoLine(posRes, posType);
|
|
|
+ if (info == null) return;
|
|
|
+ DrawDfoLine(info);
|
|
|
}
|
|
|
|
|
|
private void btnDrawCX_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
@@ -645,70 +633,66 @@ namespace XdCxRhDW.App.UserControl
|
|
|
private void btnGDOP_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
|
|
|
{
|
|
|
var info = GetPosRes("绘制GDOP");
|
|
|
- var posRes = info.Item1;
|
|
|
- if (posRes == null) return;
|
|
|
- var posType = info.Item2;
|
|
|
- DrawGDOP(posRes, posType);
|
|
|
+ if (info == null) return;
|
|
|
+ DrawGDOP(info);
|
|
|
}
|
|
|
|
|
|
- private void DrawGDOP(PosRes item, EnumPosType posType)
|
|
|
+ private void DrawGDOP(PosRes item)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- switch (posType)
|
|
|
- {
|
|
|
- //case EnumPosType.X1D1CX:
|
|
|
- // X1D1GDOPParam x1D1GdopParam = new X1D1GDOPParam(item);
|
|
|
- // x1D1GdopParam.mapControl1 = mapControl1;
|
|
|
- // DxHelper.PopupHelper.ShowPopup(x1D1GdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
- // break;
|
|
|
- //case EnumPosType.X2D1:
|
|
|
- // X2D1GDOPParam x2D1GdopParam = new X2D1GDOPParam(item);
|
|
|
- // x2D1GdopParam.mapControl1 = mapControl1;
|
|
|
- // DxHelper.PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
- // break;
|
|
|
- //case EnumPosType.X3TwoDto:
|
|
|
- // X3GDOPParam x3GdopParam = new X3GDOPParam(item);
|
|
|
- // x3GdopParam.mapControl1 = mapControl1;
|
|
|
- // DxHelper.PopupHelper.ShowPopup(x3GdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
- // break;
|
|
|
- //case EnumPosType.X3TwoDfo:
|
|
|
- // X3DFGDOPParam x3DFGdopParam = new X3DFGDOPParam(item);
|
|
|
- // x3DFGdopParam.mapControl1 = mapControl1;
|
|
|
- // DxHelper.PopupHelper.ShowPopup(x3DFGdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
- // break;
|
|
|
- //case EnumPosType.X2Dfo:
|
|
|
- // X2DFGDOPParam x2DFGdopParam = new X2DFGDOPParam(item);
|
|
|
- // x2DFGdopParam.mapControl1 = mapControl1;
|
|
|
- // DxHelper.PopupHelper.ShowPopup(x2DFGdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
- // break;
|
|
|
- //default:
|
|
|
- // break;
|
|
|
+ switch (item.PosResType)
|
|
|
+ {
|
|
|
+ case EnumPosResType.X1D1CX:
|
|
|
+ X1D1GDOPParam x1D1GdopParam = new X1D1GDOPParam(item);
|
|
|
+ x1D1GdopParam.mapControl1 = mapControl1;
|
|
|
+ DxHelper.PopupHelper.ShowPopup(x1D1GdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
+ break;
|
|
|
+ case EnumPosResType.X2D1:
|
|
|
+ case EnumPosResType.X2D1NoRef:
|
|
|
+ X2D1GDOPParam x2D1GdopParam = new X2D1GDOPParam(item);
|
|
|
+ x2D1GdopParam.mapControl1 = mapControl1;
|
|
|
+ DxHelper.PopupHelper.ShowPopup(x2D1GdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
+ break;
|
|
|
+ case EnumPosResType.X3:
|
|
|
+ case EnumPosResType.X3NoRef:
|
|
|
+ X3GDOPParam x3GdopParam = new X3GDOPParam(item);
|
|
|
+ x3GdopParam.mapControl1 = mapControl1;
|
|
|
+ DxHelper.PopupHelper.ShowPopup(x3GdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
+ break;
|
|
|
+ case EnumPosResType.X3TwoDfo:
|
|
|
+ X3DFGDOPParam x3DFGdopParam = new X3DFGDOPParam(item);
|
|
|
+ x3DFGdopParam.mapControl1 = mapControl1;
|
|
|
+ DxHelper.PopupHelper.ShowPopup(x3DFGdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
+ break;
|
|
|
+ case EnumPosResType.X2Dfo:
|
|
|
+ X2DFGDOPParam x2DFGdopParam = new X2DFGDOPParam(item);
|
|
|
+ x2DFGdopParam.mapControl1 = mapControl1;
|
|
|
+ DxHelper.PopupHelper.ShowPopup(x2DFGdopParam, mapControl1, mapControl1.Width / 4);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"绘制{posType.GetEnumDisplayName()}GDOP失败,{ex.Message}");
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"绘制{item.PosResType.GetEnumDisplayName()}GDOP失败,{ex.Message}");
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void DrawDtoLine(PosRes item, EnumPosType posType)
|
|
|
+ private void DrawDtoLine(PosRes item)
|
|
|
{
|
|
|
|
|
|
- switch (posType)
|
|
|
+ switch (item.PosResType)
|
|
|
{
|
|
|
- case EnumPosType.X1D1CX:
|
|
|
- case EnumPosType.X2D1:
|
|
|
- DrawXDtoLine(item, posType);
|
|
|
- break;
|
|
|
- case EnumPosType.RH:
|
|
|
- DrawXDtoLine(item, EnumPosType.X1D1CX);
|
|
|
- DrawXDtoLine(item, EnumPosType.X2D1);
|
|
|
+ case EnumPosResType.X1D1CX:
|
|
|
+ case EnumPosResType.X2D1:
|
|
|
+ DrawXDtoLine(item);
|
|
|
break;
|
|
|
- case EnumPosType.X3TwoDto:
|
|
|
- case EnumPosType.X2Dfo:
|
|
|
- DrawX3toLine(item, posType);
|
|
|
+ case EnumPosResType.X3:
|
|
|
+ case EnumPosResType.X2Dfo:
|
|
|
+ DrawX3toLine(item);
|
|
|
break;
|
|
|
|
|
|
default:
|
|
@@ -717,7 +701,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
}
|
|
|
|
|
|
- private async void DrawXDtoLine(PosRes item, EnumPosType posType)
|
|
|
+ private async void DrawXDtoLine(PosRes item)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -771,7 +755,7 @@ namespace XdCxRhDW.App.UserControl
|
|
|
var xdDtoLine = DrawDtoLineHelper.DtoLineXd(dtoLineXd);
|
|
|
mapControl1.DrawDtoPonit($"星地[{msat},[{station.CdbTxLon}°]]时差线", xdDtoLine);
|
|
|
|
|
|
- if (posType == EnumPosType.X2D1)
|
|
|
+ if (item.PosResType == EnumPosResType.X2D1)
|
|
|
{
|
|
|
DtoLineTwoStartOption twoStartOption = new DtoLineTwoStartOption();
|
|
|
twoStartOption.MsEph = new double[] { cg.MainX.Value, cg.MainY.Value, cg.MainZ.Value, 0, 0, 0 };
|
|
@@ -789,12 +773,12 @@ namespace XdCxRhDW.App.UserControl
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Serilog.Log.Error($"绘制{posType.GetEnumDisplayName()}时差线失败", ex);
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"绘制{posType.GetEnumDisplayName()}时差线失败,失败信息:{ex.Message}");
|
|
|
+ Serilog.Log.Error($"绘制{item.PosResType.GetEnumDisplayName()}时差线失败", ex);
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"绘制{item.PosResType.GetEnumDisplayName()}时差线失败,失败信息:{ex.Message}");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async void DrawX3toLine(PosRes item, EnumPosType posType)
|
|
|
+ private async void DrawX3toLine(PosRes item)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -838,8 +822,8 @@ namespace XdCxRhDW.App.UserControl
|
|
|
|
|
|
var msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
|
|
|
var tsDtoLine = DrawDtoLineHelper.DtoLineXDTwoStart(twoStartOption);
|
|
|
- mapControl1.DrawDtoPonit($"{posType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat}]时差线", tsDtoLine);
|
|
|
- if (posType == EnumPosType.X3TwoDto)
|
|
|
+ mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat}]时差线", tsDtoLine);
|
|
|
+ if (item.PosResType == EnumPosResType.X3)
|
|
|
{
|
|
|
twoStartOption.NsEph = new double[] { cg.Adja2X.Value, cg.Adja2Y.Value, cg.Adja2Z.Value, 0, 0, 0 };
|
|
|
twoStartOption.TargetDto = cg.Dto2.Value;
|
|
@@ -847,29 +831,29 @@ namespace XdCxRhDW.App.UserControl
|
|
|
twoStartOption.PosLon = item.PosLon;
|
|
|
twoStartOption.PosLat = item.PosLat;
|
|
|
var tsDtoLine1 = DrawDtoLineHelper.DtoLineXDTwoStart(twoStartOption);
|
|
|
- mapControl1.DrawDtoPonit($"{posType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja2Code.Value)?.Sat}]时差线", tsDtoLine1);
|
|
|
+ mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja2Code.Value)?.Sat}]时差线", tsDtoLine1);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Serilog.Log.Error($"绘制{posType.GetEnumDisplayName()}时差线失败", ex);
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"绘制{posType.GetEnumDisplayName()}时差线失败,失败信息:{ex.Message}");
|
|
|
+ Serilog.Log.Error($"绘制{item.PosResType.GetEnumDisplayName()}时差线失败", ex);
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"绘制{item.PosResType.GetEnumDisplayName()}时差线失败,失败信息:{ex.Message}");
|
|
|
}
|
|
|
}
|
|
|
- private void DrawDfoLine(PosRes item, EnumPosType posType)
|
|
|
+ private void DrawDfoLine(PosRes item)
|
|
|
{
|
|
|
- switch (posType)
|
|
|
+ switch (item.PosResType)
|
|
|
{
|
|
|
- case EnumPosType.X3TwoDfo:
|
|
|
- case EnumPosType.X2Dfo:
|
|
|
- DrawX3DfoLine(item, posType);
|
|
|
+ case EnumPosResType.X3TwoDfo:
|
|
|
+ case EnumPosResType.X2Dfo:
|
|
|
+ DrawX3DfoLine(item);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- private async void DrawX3DfoLine(PosRes item, EnumPosType posType)
|
|
|
+ private async void DrawX3DfoLine(PosRes item)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -918,21 +902,21 @@ namespace XdCxRhDW.App.UserControl
|
|
|
twoStartOption.RefDfo = cg.YbMainDfo.Value - cg.YbAdja1Dfo.Value;
|
|
|
var msat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.Sat;
|
|
|
var tsDtoLine = DrawDfoLineHelper.DfoLineTwoStart(twoStartOption);
|
|
|
- mapControl1.DrawDtoPonit($"{posType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja1X.Value)?.Sat}]频差线", tsDtoLine);
|
|
|
+ mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja1X.Value)?.Sat}]频差线", tsDtoLine);
|
|
|
|
|
|
- if (posType == EnumPosType.X3TwoDfo)
|
|
|
+ if (item.PosResType == EnumPosResType.X3TwoDfo)
|
|
|
{
|
|
|
twoStartOption.NsEph = new double[] { cg.Adja2X.Value, cg.Adja2Y.Value, cg.Adja2Z.Value, cg.Adja2Vx.Value, cg.Adja2Vy.Value, cg.Adja2Vz.Value };
|
|
|
twoStartOption.TargetDfo = cg.Dfo2.Value;
|
|
|
twoStartOption.RefDfo = cg.YbMainDfo.Value - cg.YbAdja2Dfo.Value;
|
|
|
var tsDtoLine1 = DrawDfoLineHelper.DfoLineTwoStart(twoStartOption);
|
|
|
- mapControl1.DrawDtoPonit($"{posType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja2Code.Value)?.Sat}]频差线", tsDtoLine1);
|
|
|
+ mapControl1.DrawDtoPonit($"{item.PosResType.GetEnumDisplayName()}[{msat},{listSat.FirstOrDefault(m => m.SatCode == cg.Adja2Code.Value)?.Sat}]频差线", tsDtoLine1);
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- Serilog.Log.Error($"绘制{posType.GetEnumDisplayName()}频差线失败", ex);
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"绘制{posType.GetEnumDisplayName()}频差线失败,失败信息:{ex.Message}");
|
|
|
+ Serilog.Log.Error($"绘制{item.PosResType.GetEnumDisplayName()}频差线失败", ex);
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"绘制{item.PosResType.GetEnumDisplayName()}频差线失败,失败信息:{ex.Message}");
|
|
|
}
|
|
|
}
|
|
|
private async void DrawCXLine(PosRes item)
|