|
@@ -132,7 +132,7 @@ namespace XdCxRhDW.App.EditForms
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
- if (info.PosResType == EnumPosResType.X2D1 && !txtRefLocation.CheckLonLat(dxErrorProvider, "参考站"))
|
|
|
+ if (!string.IsNullOrWhiteSpace(txtRefLocation.Text) && !txtRefLocation.CheckLonLat(dxErrorProvider, "参考站"))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
@@ -145,11 +145,11 @@ namespace XdCxRhDW.App.EditForms
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
- if (info.PosResType == EnumPosResType.X2D1 && !txtYbMain.CheckDouble(dxErrorProvider, "样本主星时差"))
|
|
|
+ if (!string.IsNullOrWhiteSpace(txtYbMain.Text) && !txtYbMain.CheckDouble(dxErrorProvider, "样本主星时差"))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
- if (info.PosResType == EnumPosResType.X2D1 && !txtYbAdja.CheckDouble(dxErrorProvider, "样本邻星时差"))
|
|
|
+ if (!string.IsNullOrWhiteSpace(txtYbAdja.Text) && !txtYbAdja.CheckDouble(dxErrorProvider, "样本邻星时差"))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
@@ -167,17 +167,24 @@ namespace XdCxRhDW.App.EditForms
|
|
|
private void btnDtoLine_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
if (!CheckParam()) { return; }
|
|
|
+ bool isRef = false;
|
|
|
+ if (!string.IsNullOrWhiteSpace(txtRefLocation.Text)
|
|
|
+ && !string.IsNullOrWhiteSpace(txtYbMain.Text)
|
|
|
+ && !string.IsNullOrWhiteSpace(txtYbAdja.Text))
|
|
|
+ {
|
|
|
+ isRef = true;
|
|
|
+ }
|
|
|
try
|
|
|
{
|
|
|
|
|
|
var MsAnt = txtsatStation.GetLonLat();
|
|
|
var CDBAnt = txtcdbStation.GetLonLat();
|
|
|
- var RefGeod = info.PosResType == EnumPosResType.X2D1 ? txtRefLocation.GetLonLat() : new double[3] { 0, 0, 0 };
|
|
|
+ var RefGeod = isRef ? txtRefLocation.GetLonLat() : new double[3] { 0, 0, 0 };
|
|
|
|
|
|
var DtoSx = Convert.ToDouble(this.txtDtoSx.Text);
|
|
|
var DtoCdb = Convert.ToDouble(this.txtDtoCdb.Text);
|
|
|
- var YbMainDto = info.PosResType == EnumPosResType.X2D1 ? Convert.ToDouble(this.txtYbMain.Text) : 0;
|
|
|
- var YbAdja1Dto = info.PosResType == EnumPosResType.X2D1 ? Convert.ToDouble(this.txtYbAdja.Text) : 0;
|
|
|
+ var YbMainDto = isRef ? Convert.ToDouble(this.txtYbMain.Text) : 0;
|
|
|
+ var YbAdja1Dto = isRef ? Convert.ToDouble(this.txtYbAdja.Text) : 0;
|
|
|
|
|
|
|
|
|
double[] msEph = ucEphXYZMain.EphXYZ();
|
|
@@ -207,7 +214,7 @@ namespace XdCxRhDW.App.EditForms
|
|
|
if (string.IsNullOrWhiteSpace(msat)) msat = cg.MainCode.Value.ToString();
|
|
|
var nsat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.Sat;
|
|
|
if (string.IsNullOrWhiteSpace(nsat)) nsat = cg.Adja1Code.Value.ToString();
|
|
|
- if (info.PosResType == EnumPosResType.X2D1)
|
|
|
+ if (isRef)
|
|
|
{
|
|
|
var xdDtoLine = DrawDtoLineHelper.DtoLineXdNew(dtoLineXd);
|
|
|
List<MapPolyline> polylines = new List<MapPolyline>();
|
|
@@ -296,17 +303,24 @@ namespace XdCxRhDW.App.EditForms
|
|
|
{
|
|
|
if (!CheckParam()) { return; }
|
|
|
txtPosRes.Text = " ";
|
|
|
+ bool isRef = false;
|
|
|
+ if (!string.IsNullOrWhiteSpace(txtRefLocation.Text)
|
|
|
+ && !string.IsNullOrWhiteSpace(txtYbMain.Text)
|
|
|
+ && !string.IsNullOrWhiteSpace(txtYbAdja.Text))
|
|
|
+ {
|
|
|
+ isRef = true;
|
|
|
+ }
|
|
|
try
|
|
|
{
|
|
|
|
|
|
var MsAnt = txtsatStation.GetLonLat();
|
|
|
var CDBAnt = txtcdbStation.GetLonLat();
|
|
|
- var RefGeod = info.PosResType == EnumPosResType.X2D1 ? txtRefLocation.GetLonLat() : new double[3] { 0, 0, 0 };
|
|
|
+ var RefGeod = isRef ? txtRefLocation.GetLonLat() : new double[3] { 0, 0, 0 };
|
|
|
|
|
|
var DtoSx = Convert.ToDouble(this.txtDtoSx.Text);
|
|
|
var DtoCdb = Convert.ToDouble(this.txtDtoCdb.Text);
|
|
|
- var YbMainDto = info.PosResType == EnumPosResType.X2D1 ? Convert.ToDouble(this.txtYbMain.Text) : 0;
|
|
|
- var YbAdja1Dto = info.PosResType == EnumPosResType.X2D1 ? Convert.ToDouble(this.txtYbAdja.Text) : 0;
|
|
|
+ var YbMainDto = isRef ? Convert.ToDouble(this.txtYbMain.Text) : 0;
|
|
|
+ var YbAdja1Dto = isRef ? Convert.ToDouble(this.txtYbAdja.Text) : 0;
|
|
|
|
|
|
double[] msEph = ucEphXYZMain.EphXYZ();
|
|
|
double[] nsEph = ucEphXYZAdaj.EphXYZ();
|
|
@@ -323,7 +337,7 @@ namespace XdCxRhDW.App.EditForms
|
|
|
};
|
|
|
|
|
|
|
|
|
- if (info.PosResType == EnumPosResType.X2D1NoRef)
|
|
|
+ if (!isRef)
|
|
|
{
|
|
|
X2D1NoParPosDto dto = new X2D1NoParPosDto()
|
|
|
{
|