|
@@ -21,11 +21,10 @@ namespace X3LeoTaskServer54.Service
|
|
|
string PosResDir;
|
|
|
string StateDir;
|
|
|
int MainSatCode;
|
|
|
- double[] Time1XYZ, Time2XYZ, Time3XYZ;
|
|
|
+ double[] MainSatXYZ, Adja1SatXYZ, Adja2SatXYZ;
|
|
|
int PosDtoFactor;
|
|
|
- double DfoErrHz;
|
|
|
- double EphPosErrM;
|
|
|
- double EphVelErr;
|
|
|
+ double DtoErrus;
|
|
|
+ double EphErrm;
|
|
|
|
|
|
public TaskService()
|
|
|
{
|
|
@@ -42,12 +41,10 @@ namespace X3LeoTaskServer54.Service
|
|
|
var PosDtoFactorstr = ConfigurationManager.AppSettings["PosDtoFactor"].Trim();
|
|
|
int.TryParse(PosDtoFactorstr, out PosDtoFactor);
|
|
|
if (PosDtoFactor == 0) PosDtoFactor = 1;
|
|
|
- var DfoErrusstr = ConfigurationManager.AppSettings["DfoErr"].Trim();
|
|
|
- double.TryParse(DfoErrusstr, out DfoErrHz);
|
|
|
- var EphPosErrstr = ConfigurationManager.AppSettings["EphPosErr"].Trim();
|
|
|
- double.TryParse(EphPosErrstr, out EphPosErrM);
|
|
|
- var EphVelErrstr = ConfigurationManager.AppSettings["EphVelErr"].Trim();
|
|
|
- double.TryParse(EphVelErrstr, out EphVelErr);
|
|
|
+ var DtoErrusstr = ConfigurationManager.AppSettings["DtoErrus"].Trim();
|
|
|
+ double.TryParse(DtoErrusstr, out DtoErrus);
|
|
|
+ var EphErrmstr = ConfigurationManager.AppSettings["EphErrm"].Trim();
|
|
|
+ double.TryParse(EphErrmstr, out EphErrm);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -84,9 +81,9 @@ namespace X3LeoTaskServer54.Service
|
|
|
var arr2 = adja1Info.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
var arr3 = adja2Info.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
MainSatCode = Convert.ToInt32(arr1[0]);
|
|
|
- Time1XYZ = GetEph(arr1);
|
|
|
- Time2XYZ = GetEph(arr2);
|
|
|
- Time3XYZ = GetEph(arr3);
|
|
|
+ MainSatXYZ = GetEph(arr1);
|
|
|
+ Adja1SatXYZ = GetEph(arr2);
|
|
|
+ Adja2SatXYZ = GetEph(arr3);
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
@@ -203,46 +200,7 @@ namespace X3LeoTaskServer54.Service
|
|
|
if (cts.IsCancellationRequested) break;
|
|
|
LeoX1ParPosDto leoX1 = new LeoX1ParPosDto()
|
|
|
{
|
|
|
- TaskID = dto.ID,
|
|
|
- SigTime = adTime.AddSeconds(data1[i].Smpstart / (double)ch0File.Fs),
|
|
|
- MainCode = MainSatCode,
|
|
|
- Adja1Code = MainSatCode,
|
|
|
- Adja2Code = MainSatCode,
|
|
|
- MainX = Time1XYZ[0],
|
|
|
- MainY = Time1XYZ[1],
|
|
|
- MainZ = Time1XYZ[2],
|
|
|
- MainVX = Time1XYZ[3],
|
|
|
- MainVY = Time1XYZ[4],
|
|
|
- MainVZ = Time1XYZ[5],
|
|
|
- Adja1X = Time2XYZ[0],
|
|
|
- Adja1Y = Time2XYZ[1],
|
|
|
- Adja1Z = Time2XYZ[2],
|
|
|
- Adja1VX = Time2XYZ[3],
|
|
|
- Adja1VY = Time2XYZ[4],
|
|
|
- Adja1VZ = Time2XYZ[5],
|
|
|
- Adja2X = Time3XYZ[0],
|
|
|
- Adja2Y = Time3XYZ[1],
|
|
|
- Adja2Z = Time3XYZ[2],
|
|
|
- Adja2VX = Time3XYZ[3],
|
|
|
- Adja2VY = Time3XYZ[4],
|
|
|
- Adja2VZ = Time3XYZ[5],
|
|
|
- Dto1 = PosDtoFactor * data1[i].Dt,
|
|
|
- Dfo1 = data1[i].Df,
|
|
|
- Snr1 = data1[i].Snr,
|
|
|
- Dto2 = PosDtoFactor * data2[i].Dt,
|
|
|
- Dfo2 = data2[i].Df,
|
|
|
- Snr2 = data2[i].Snr,
|
|
|
- FreqUp = (ch0File.FreqDownMHz + 44) * 1e6,
|
|
|
- SatTxLon = dto.CapLon,
|
|
|
- SatTxLat = dto.CapLat,
|
|
|
- FreqDown = ch0File.FreqDownMHz * 1e6,
|
|
|
- CheckRes = new CheckResDto()
|
|
|
- {
|
|
|
- FileName = Path.GetFileName(ch0File.File),
|
|
|
- SmpStart = cgDto.smpPositions[i].smpStart,
|
|
|
- SmpCount = cgDto.smpPositions[i].smpCount,
|
|
|
- PosCheckType = EnumPosCheckTypeDto.Ky5758,
|
|
|
- }
|
|
|
+
|
|
|
};
|
|
|
var result = await HttpHelper.PostRequestAsync<PosResDto>(baseUrl + "Pos/PosLeX1ParAsync", leoX1);
|
|
|
if (result.code != 200)
|
|
@@ -259,20 +217,24 @@ namespace X3LeoTaskServer54.Service
|
|
|
posLon = 0;
|
|
|
posLat = 0;
|
|
|
}
|
|
|
- ErrorEllipseLeoX1Dto errdto = new ErrorEllipseLeoX1Dto()
|
|
|
+ var errDto = new ErrEllipseX3NoRefDto()
|
|
|
{
|
|
|
- MsEph = Time1XYZ,
|
|
|
- NsEph1 = Time2XYZ,
|
|
|
- NsEph2 = Time3XYZ,
|
|
|
- SelectPoint = new double[3] { posLon, posLat, 0 },
|
|
|
- DfoErr = DfoErrHz,
|
|
|
- EphPosErr = EphPosErrM,
|
|
|
- EphVelErr = EphVelErr,
|
|
|
- fu = leoX1.FreqUp,
|
|
|
- Pe = 0.5,
|
|
|
- OutputErrPoint = false
|
|
|
+ PosLon = posLon,
|
|
|
+ PosLat = posLat,
|
|
|
+ MainX = MainSatXYZ[0],
|
|
|
+ MainY = MainSatXYZ[1],
|
|
|
+ MainZ = MainSatXYZ[2],
|
|
|
+ Adja1X = Adja1SatXYZ[0],
|
|
|
+ Adja1Y = Adja1SatXYZ[1],
|
|
|
+ Adja1Z = Adja1SatXYZ[2],
|
|
|
+ Adja2X = Adja2SatXYZ[0],
|
|
|
+ Adja2Y = Adja2SatXYZ[1],
|
|
|
+ Adja2Z = Adja2SatXYZ[2],
|
|
|
+ DtoErrus = DtoErrus,
|
|
|
+ EphErr = EphErrm,
|
|
|
+ OutputErrPoint = false,
|
|
|
};
|
|
|
- var errRes = await GetErrEllipseResDto(errdto, posLon, posLat);
|
|
|
+ var errRes = await GetErrEllipseResDto(errDto);
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
sb.Append($"{leoX1.SigTime:yyyy}\t");
|
|
|
sb.Append($"{leoX1.SigTime:MM}\t");
|
|
@@ -348,14 +310,12 @@ namespace X3LeoTaskServer54.Service
|
|
|
|
|
|
private double[] GetEph(string[] strs)
|
|
|
{
|
|
|
-
|
|
|
- var TimeXYZ = new double[6] { Convert.ToDouble(strs[1]),
|
|
|
- Convert.ToDouble(strs[2]),
|
|
|
- Convert.ToDouble(strs[3]),
|
|
|
- Convert.ToDouble(strs[4]),
|
|
|
- Convert.ToDouble(strs[5]),
|
|
|
- Convert.ToDouble(strs[6]),
|
|
|
- };
|
|
|
+ var TimeXYZ = new double[3]
|
|
|
+ {
|
|
|
+ Convert.ToDouble(strs[1]),
|
|
|
+ Convert.ToDouble(strs[2]),
|
|
|
+ Convert.ToDouble(strs[3])
|
|
|
+ };
|
|
|
return TimeXYZ;
|
|
|
|
|
|
}
|
|
@@ -376,13 +336,12 @@ namespace X3LeoTaskServer54.Service
|
|
|
return signalType;
|
|
|
}
|
|
|
|
|
|
- private async Task<ErrEllipseResDto> GetErrEllipseResDto(ErrorEllipseLeoX1Dto dto, double posLon, double posLat)
|
|
|
+ private async Task<ErrEllipseResDto> GetErrEllipseResDto(ErrEllipseX3NoRefDto dto)
|
|
|
{
|
|
|
ErrEllipseResDto errRes = new ErrEllipseResDto();
|
|
|
- if (posLon != 0 && posLat != 0 && posLon != 999 && posLat != 999)
|
|
|
+ if (dto.PosLon != 0 && dto.PosLat != 0 && dto.PosLon != 999 && dto.PosLat != 999)
|
|
|
{
|
|
|
-
|
|
|
- var errResRsp = await HttpHelper.PostRequestAsync<ErrEllipseResDto>(baseUrl + "Ellipse/X3Leo", dto);
|
|
|
+ var errResRsp = await HttpHelper.PostRequestAsync<ErrEllipseResDto>(baseUrl + "Ellipse/X3TwoDtoNoRef", dto);
|
|
|
if (errResRsp.code != 200)
|
|
|
{
|
|
|
await LogHelper.Error(errResRsp.msg);
|