|
@@ -70,25 +70,16 @@ namespace XdCxRhDW.App.EditForms
|
|
|
}
|
|
|
if (cg != null)
|
|
|
{
|
|
|
- //mainSat = listSat.FirstOrDefault(m => m.SatCode == cg.MainCode.Value)?.SatCode;
|
|
|
- //adjaSat = listSat.FirstOrDefault(m => m.SatCode == cg.Adja1Code.Value)?.SatCode;
|
|
|
-
|
|
|
this.txtDtoSx.Text = $"{cg.Dto1.Value:f3}";
|
|
|
this.txtYbMain.Text = $"{cg.YbMainDto.Value:f3}";
|
|
|
this.txtYbAdja.Text = $"{cg.YbAdja1Dto.Value:f3}";
|
|
|
this.txtSigTime.EditValue = info.SigTime;
|
|
|
- this.txtMainX.Text = $"{cg.MainX.Value:f3}";
|
|
|
- this.txtMainY.Text = $"{cg.MainY.Value:f3}";
|
|
|
- this.txtMainZ.Text = $"{cg.MainZ.Value:f3}";
|
|
|
- this.txtAdjaX.Text = $"{cg.Adja1X.Value:f3}";
|
|
|
- this.txtAdjaY.Text = $"{cg.Adja1Y.Value:f3}";
|
|
|
- this.txtAdjaZ.Text = $"{cg.Adja1Z.Value:f3}";
|
|
|
- this.txtMainVx.Text = $"{cg.MainVx.Value:f3}";
|
|
|
- this.txtMainVy.Text = $"{cg.MainVy.Value:f3}";
|
|
|
- this.txtMainVz.Text = $"{cg.MainVz.Value:f3}";
|
|
|
- this.txtAdjaVx.Text = $"{cg.Adja1Vx.Value:f3}";
|
|
|
- this.txtAdjaVy.Text = $"{cg.Adja1Vy.Value:f3}";
|
|
|
- this.txtAdjaVz.Text = $"{cg.Adja1Vy.Value:f3}";
|
|
|
+
|
|
|
+ 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);
|
|
|
|
|
|
this.txtDfo.Text = $"{cg.Dfo1.Value:f3}";
|
|
|
this.txtYbMainDfo.Text = $"{cg.YbMainDfo.Value:f3}";
|
|
@@ -118,7 +109,7 @@ namespace XdCxRhDW.App.EditForms
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private void btnOk_Click(object sender, EventArgs e)
|
|
|
+ private void btnOk_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
if (!CheckParam()) { return; }
|
|
|
try
|
|
@@ -131,18 +122,8 @@ namespace XdCxRhDW.App.EditForms
|
|
|
var YbMainDto = Convert.ToDouble(this.txtYbMain.Text);
|
|
|
var YbAdja1Dto = Convert.ToDouble(this.txtYbAdja.Text);
|
|
|
|
|
|
- var MainX = Convert.ToDouble(this.txtMainX.Text);
|
|
|
- var MainY = Convert.ToDouble(this.txtMainY.Text);
|
|
|
- var MainZ = Convert.ToDouble(this.txtMainZ.Text);
|
|
|
- var AdjaX = Convert.ToDouble(this.txtAdjaX.Text);
|
|
|
- var AdjaY = Convert.ToDouble(this.txtAdjaY.Text);
|
|
|
- var AdjaZ = Convert.ToDouble(this.txtAdjaZ.Text);
|
|
|
- var MainVx = Convert.ToDouble(this.txtMainVx.Text);
|
|
|
- var MainVy = Convert.ToDouble(this.txtMainVy.Text);
|
|
|
- var MainVz = Convert.ToDouble(this.txtMainVz.Text);
|
|
|
- var AdjaVx = Convert.ToDouble(this.txtAdjaVx.Text);
|
|
|
- var AdjaVy = Convert.ToDouble(this.txtAdjaVy.Text);
|
|
|
- var AdjaVz = Convert.ToDouble(this.txtAdjaVz.Text);
|
|
|
+ var msEph = ucEphXYZMain.EphParam();
|
|
|
+ var ns1Eph = ucEphXYZAdja.EphParam();
|
|
|
|
|
|
var Dfo = Convert.ToDouble(this.txtDfo.Text);
|
|
|
var YbMainDfo = Convert.ToDouble(this.txtYbMainDfo.Text);
|
|
@@ -154,9 +135,6 @@ namespace XdCxRhDW.App.EditForms
|
|
|
|
|
|
var sigTime = txtSigTime.DateTime;
|
|
|
|
|
|
- double[] msEph = new double[] { MainX, MainY, MainZ, 0, 0, 0 };
|
|
|
- double[] Ns1Eph = new double[] { AdjaX, AdjaY, AdjaZ, 0, 0, 0 };
|
|
|
-
|
|
|
var StationRes = new StationRes()
|
|
|
{
|
|
|
SatTxLon = MsAnt[0],
|
|
@@ -177,22 +155,22 @@ namespace XdCxRhDW.App.EditForms
|
|
|
YbAdjaDto = YbAdja1Dto,
|
|
|
YbMainDfo = YbMainDfo,
|
|
|
YbAdjaDfo = YbAdja1Dfo,
|
|
|
- TarFreqUp = TarFreqUp ,
|
|
|
+ TarFreqUp = TarFreqUp,
|
|
|
TarFreqDown = TarFreqDown,
|
|
|
RefFreqUp = RefFreqUp,
|
|
|
RefFreqDown = RefFreqDown,
|
|
|
- MainX = MainX,
|
|
|
- MainY = MainY,
|
|
|
- MainZ = MainZ,
|
|
|
- MainVx = MainVx,
|
|
|
- MainVy = MainVy,
|
|
|
- MainVz = MainVz,
|
|
|
- AdjaX = AdjaX,
|
|
|
- AdjaY = AdjaY,
|
|
|
- AdjaZ = AdjaZ,
|
|
|
- AdjaVx = AdjaVx,
|
|
|
- AdjaVy = AdjaVy,
|
|
|
- AdjaVz = AdjaVz,
|
|
|
+ MainX = msEph[0],
|
|
|
+ MainY = msEph[1],
|
|
|
+ MainZ = msEph[2],
|
|
|
+ MainVx = msEph[3],
|
|
|
+ MainVy = msEph[4],
|
|
|
+ MainVz = msEph[5],
|
|
|
+ AdjaX = ns1Eph[0],
|
|
|
+ AdjaY = ns1Eph[1],
|
|
|
+ AdjaZ = ns1Eph[2],
|
|
|
+ AdjaVx = ns1Eph[3],
|
|
|
+ AdjaVy = ns1Eph[4],
|
|
|
+ AdjaVz = ns1Eph[5],
|
|
|
SatTxLon = MsAnt[0],
|
|
|
SatTxLat = MsAnt[1],
|
|
|
RefLon = RefGeod[0],
|
|
@@ -213,10 +191,10 @@ namespace XdCxRhDW.App.EditForms
|
|
|
TarFreqDown = dto.TarFreqDown,
|
|
|
RefFreqUp = dto.RefFreqUp,
|
|
|
RefFreqDown = dto.RefFreqDown,
|
|
|
- // StationResID = StationRes.ID,
|
|
|
+ // StationResID = StationRes.ID,
|
|
|
MainCode = dto.MainCode,
|
|
|
Adja1Code = dto.AdjaCode,
|
|
|
- // TaskID = runTask.ID,
|
|
|
+ // TaskID = runTask.ID,
|
|
|
MainX = dto.MainX,
|
|
|
MainY = dto.MainY,
|
|
|
MainZ = dto.MainZ,
|
|
@@ -247,43 +225,49 @@ namespace XdCxRhDW.App.EditForms
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private async void btnMainXl_Click(object sender, EventArgs e)
|
|
|
+
|
|
|
+ private async void txtEphCalc_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- var xlInfo = await XlRepository.GetLatestAsync(cg.MainCode.Value, txtSigTime.DateTime);
|
|
|
- if (xlInfo == null)
|
|
|
+ if (txtSigTime.DateTime == DateTime.MinValue)
|
|
|
{
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.MainCode.Value}未找到对应的星历信息,请导入星历");
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning("信号时间不能为空!");
|
|
|
return;
|
|
|
}
|
|
|
- var XlCalcDto = new XlCalcDto() { tleStr = xlInfo.TwoLine, dt = txtSigTime.DateTime };
|
|
|
+ var sigTime = txtSigTime.DateTime;
|
|
|
+ try
|
|
|
+ {
|
|
|
|
|
|
- string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var ephMain = await HttpHelper.PostRequestAsync<SatEphResDto>(url, XlCalcDto);
|
|
|
- this.txtMainX.Text = ephMain.data.X.ToString("f3");
|
|
|
- this.txtMainY.Text = ephMain.data.Y.ToString("f3");
|
|
|
- this.txtMainZ.Text = ephMain.data.Z.ToString("f3");
|
|
|
- this.txtMainVx.Text = ephMain.data.VX.ToString("f3");
|
|
|
- this.txtMainVy.Text = ephMain.data.VY.ToString("f3");
|
|
|
- this.txtMainVz.Text = ephMain.data.VZ.ToString("f3");
|
|
|
- }
|
|
|
+ var mainxlInfo = await XlRepository.GetLatestAsync(cg.MainCode.Value, sigTime);
|
|
|
+ if (mainxlInfo == null)
|
|
|
+ {
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.MainCode.Value}未找到对应的星历信息,请导入星历");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- private async void txtAdjaXl_Click(object sender, EventArgs e)
|
|
|
- {
|
|
|
- var xlInfo = await XlRepository.GetLatestAsync(cg.Adja1Code.Value, txtSigTime.DateTime);
|
|
|
- if (xlInfo == null)
|
|
|
+ var XlCalcDto = new XlCalcDto() { tleStr = mainxlInfo.TwoLine, dt = sigTime };
|
|
|
+
|
|
|
+ string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
+ var maineph = await HttpHelper.PostRequestAsync<SatEphResDto>(url, XlCalcDto);
|
|
|
+ ucEphXYZMain.SetParam("主星", cg.MainCode.Value, (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(cg.Adja1Code.Value, sigTime);
|
|
|
+ if (adjaxlInfo == null)
|
|
|
+ {
|
|
|
+ DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.Adja1Code.Value}未找到对应的星历信息,请导入星历");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ XlCalcDto.tleStr = adjaxlInfo.TwoLine;
|
|
|
+ var adjaeph = await HttpHelper.PostRequestAsync<SatEphResDto>(url, XlCalcDto);
|
|
|
+ ucEphXYZAdja.SetParam("邻星", cg.Adja1Code.Value, (adjaeph.data.X, adjaeph.data.Y, adjaeph.data.Z, adjaeph.data.VX, adjaeph.data.VY, adjaeph.data.VZ), Color.Red);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- DxHelper.MsgBoxHelper.ShowWarning($"卫星:{cg.Adja1Code.Value}未找到对应的星历信息,请导入星历");
|
|
|
- return;
|
|
|
+ Serilog.Log.Error(ex, $"手动推算{info.PosResType.GetEnumDisplayName()}星历失败,SigTime={sigTime}");
|
|
|
+ DxHelper.MsgBoxHelper.ShowError($"手动推算{info.PosResType.GetEnumDisplayName()}星历失败,{ex.Message}");
|
|
|
}
|
|
|
- var XlCalcDto = new XlCalcDto() { tleStr = xlInfo.TwoLine, dt = txtSigTime.DateTime };
|
|
|
- string url = string.Format("http://{0}:{1}/Api/Xl/Calc", IpHelper.GetLocalIp(), settings.HttpPort);
|
|
|
- var ephAdja = await HttpHelper.PostRequestAsync<SatEphResDto>(url, XlCalcDto);
|
|
|
- this.txtAdjaX.Text = ephAdja.data.X.ToString("f3");
|
|
|
- this.txtAdjaY.Text = ephAdja.data.Y.ToString("f3");
|
|
|
- this.txtAdjaZ.Text = ephAdja.data.Z.ToString("f3");
|
|
|
- this.txtAdjaVx.Text = ephAdja.data.VX.ToString("f3");
|
|
|
- this.txtAdjaVy.Text = ephAdja.data.VY.ToString("f3");
|
|
|
- this.txtAdjaVz.Text = ephAdja.data.VZ.ToString("f3");
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|