2024-11-25 01:30:14 +00:00
# include "stdafx.h"
# include "SatelliteOribtModel.h"
# include "GeoOperator.h"
# include <boost/math/tools/polynomial.hpp> // <20> <> <EFBFBD> <EFBFBD> ʽ
# include "BaseTool.h"
# include <QDebug>
PolyfitSatelliteOribtModel : : PolyfitSatelliteOribtModel ( )
{
this - > oribtStartTime = 0 ;
this - > beamAngle = 0 ;
this - > RightLook = true ;
this - > cycletime = 0 ;
this - > minAzAngle = 0 ;
this - > maxAzAngle = 0 ;
this - > referenceAzAngle = 0 ;
this - > referenceTimeFromStartTime = 0 ;
this - > AntnnaAxisX = Point3 { 1 , 0 , 0 } ;
this - > AntnnaAxisY = Point3 { 0 , 1 , 0 } ;
this - > AntnnaAxisZ = Point3 { 0 , 0 , 1 } ;
this - > Pxchisq = 0 ;
this - > Pychisq = 0 ;
this - > Pzchisq = 0 ;
this - > Vxchisq = 0 ;
this - > Vychisq = 0 ;
this - > Vzchisq = 0 ;
this - > Pt = 1 ;
this - > Gri = 1 ;
}
PolyfitSatelliteOribtModel : : ~ PolyfitSatelliteOribtModel ( )
{
//TODO: <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
2024-11-25 06:26:46 +00:00
QString PolyfitSatelliteOribtModel : : getSatelliteOribtModelParamsString ( )
{
QString result = " " ;
result + = this - > polyfitPx . size ( ) - 1 + " \n " ;
result + = " ----------- poly Position X ------------------------- \n " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
result + = QString : : number ( this - > polyfitPx [ i ] , ' e ' , 6 ) + " \n " ;
}
result + = " ----------- poly Position Y ------------------------- \n " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
result + = QString : : number ( this - > polyfitPy [ i ] , ' e ' , 6 ) + " \n " ;
}
result + = " ----------- poly Position Z ------------------------- \n " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
result + = QString : : number ( this - > polyfitPz [ i ] , ' e ' , 6 ) + " \n " ;
}
result + = " ----------- poly Position Vector X ------------------ \n " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
result + = QString : : number ( this - > polyfitVx [ i ] , ' e ' , 6 ) + " \n " ;
}
result + = " ----------- poly Position Vector Y ------------------ \n " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
result + = QString : : number ( this - > polyfitVy [ i ] , ' e ' , 6 ) + " \n " ;
}
result + = " ----------- poly Position Vector Z ------------------ \n " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
result + = QString : : number ( this - > polyfitVz [ i ] , ' e ' , 6 ) + " \n " ;
}
result + = " ------------------------------------------------------ \n " ;
return result ;
}
2024-11-25 01:30:14 +00:00
SatelliteOribtNode PolyfitSatelliteOribtModel : : getSatelliteOribtNode ( double & timeFromStartTime , bool & antAzAngleFlag )
{
// λ<> á<EFBFBD> <C3A1> ٶ<EFBFBD>
SatelliteOribtNode node ;
ErrorCode state = getSatelliteOribtNode ( timeFromStartTime , node , antAzAngleFlag ) ;
return node ;
}
ErrorCode PolyfitSatelliteOribtModel : : getSatelliteOribtNode ( double & timeFromStartTime , SatelliteOribtNode & node , bool & antAzAngleFlag )
{
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ꣬<EFBFBD> ٶȷ<D9B6> <C8B7> <EFBFBD>
node . time = timeFromStartTime ;
node . Px = 0 ;
node . Py = 0 ;
node . Pz = 0 ;
node . Vx = 0 ;
node . Vy = 0 ;
node . Vz = 0 ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
node . Px + = this - > polyfitPx [ i ] * pow ( timeFromStartTime , i ) ;
node . Py + = this - > polyfitPy [ i ] * pow ( timeFromStartTime , i ) ;
node . Pz + = this - > polyfitPz [ i ] * pow ( timeFromStartTime , i ) ;
node . Vx + = this - > polyfitVx [ i ] * pow ( timeFromStartTime , i ) ;
node . Vy + = this - > polyfitVy [ i ] * pow ( timeFromStartTime , i ) ;
node . Vz + = this - > polyfitVz [ i ] * pow ( timeFromStartTime , i ) ;
}
node . beamAngle = this - > beamAngle ; // <20> <> λ<EFBFBD> <CEBB>
ErrorCode Azstatecode = this - > getAzAngleInCurrentTimeFromStartTime ( timeFromStartTime , node . AzAngle ) ; // <20> ڶ<EFBFBD> <DAB6> <EFBFBD>
if ( Azstatecode ! = ErrorCode : : SUCCESS ) {
return Azstatecode ;
} else { }
if ( ! antAzAngleFlag ) {
return ErrorCode : : SUCCESS ;
} else {
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8>
ErrorCode state = getAntnnaDirection ( node ) ;
if ( state ! = ErrorCode : : SUCCESS ) {
return state ;
} else { }
return ErrorCode : : SUCCESS ;
}
ErrorCode PolyfitSatelliteOribtModel : : getSatelliteAntDirectNormal ( SatelliteOribtNode & Rs , Vector3D & Rt , SatelliteAntDirect & antNode )
{
//Vector3D Rts = Vector3D{Rt.x-Rs.Px,Rt.y- Rs.Py,Rt.z-Rs.Pz}; // Rts t-->s
antNode . Xst = ( Rt . x - Rs . Px ) ; // <20> <> <EFBFBD> <EFBFBD> --> <20> <> <EFBFBD> <EFBFBD>
antNode . Yst = ( Rt . y - Rs . Py ) ;
antNode . Zst = ( Rt . z - Rs . Pz ) ;
antNode . Vxs = Rs . Vx ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ٶ<EFBFBD>
antNode . Vys = Rs . Vy ;
antNode . Vzs = Rs . Vz ;
// <20> <> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> µ<EFBFBD> ֵ
antNode . Xant = ( antNode . Xst * ( Rs . AntYaxisY * Rs . AntZaxisZ - Rs . AntYaxisZ * Rs . AntZaxisY ) + antNode . Xst * ( Rs . AntXaxisZ * Rs . AntZaxisY - Rs . AntXaxisY * Rs . AntZaxisZ ) + antNode . Xst * ( Rs . AntXaxisY * Rs . AntYaxisZ - Rs . AntXaxisZ * Rs . AntYaxisY ) ) / ( Rs . AntXaxisX * ( Rs . AntYaxisY * Rs . AntZaxisZ - Rs . AntZaxisY * Rs . AntYaxisZ ) - Rs . AntYaxisX * ( Rs . AntXaxisY * Rs . AntZaxisZ - Rs . AntXaxisZ * Rs . AntZaxisY ) + Rs . AntZaxisX * ( Rs . AntXaxisY * Rs . AntYaxisZ - Rs . AntXaxisZ * Rs . AntYaxisY ) ) ;
antNode . Yant = ( antNode . Yst * ( Rs . AntYaxisZ * Rs . AntZaxisX - Rs . AntYaxisX * Rs . AntZaxisZ ) + antNode . Yst * ( Rs . AntXaxisX * Rs . AntZaxisZ - Rs . AntXaxisZ * Rs . AntZaxisX ) + antNode . Yst * ( Rs . AntYaxisX * Rs . AntXaxisZ - Rs . AntXaxisX * Rs . AntYaxisZ ) ) / ( Rs . AntXaxisX * ( Rs . AntYaxisY * Rs . AntZaxisZ - Rs . AntZaxisY * Rs . AntYaxisZ ) - Rs . AntYaxisX * ( Rs . AntXaxisY * Rs . AntZaxisZ - Rs . AntXaxisZ * Rs . AntZaxisY ) + Rs . AntZaxisX * ( Rs . AntXaxisY * Rs . AntYaxisZ - Rs . AntXaxisZ * Rs . AntYaxisY ) ) ;
antNode . Zant = ( antNode . Zst * ( Rs . AntYaxisX * Rs . AntZaxisY - Rs . AntYaxisY * Rs . AntZaxisX ) + antNode . Zst * ( Rs . AntXaxisY * Rs . AntZaxisX - Rs . AntXaxisX * Rs . AntZaxisY ) + antNode . Zst * ( Rs . AntXaxisX * Rs . AntYaxisY - Rs . AntYaxisX * Rs . AntXaxisY ) ) / ( Rs . AntXaxisX * ( Rs . AntYaxisY * Rs . AntZaxisZ - Rs . AntZaxisY * Rs . AntYaxisZ ) - Rs . AntYaxisX * ( Rs . AntXaxisY * Rs . AntZaxisZ - Rs . AntXaxisZ * Rs . AntZaxisY ) + Rs . AntZaxisX * ( Rs . AntXaxisY * Rs . AntYaxisZ - Rs . AntXaxisZ * Rs . AntYaxisY ) ) ;
// <20> <> <EFBFBD> <EFBFBD> theta <20> <> phi
antNode . Norm = std : : sqrt ( antNode . Xant * antNode . Xant + antNode . Yant * antNode . Yant + antNode . Zant * antNode . Zant ) ; // <20> <> <EFBFBD> <EFBFBD> pho
antNode . ThetaAnt = std : : acos ( antNode . Zant / antNode . Norm ) ; // theta <20> <> Z<> <5A> <EFBFBD> ļн<C4BC>
antNode . PhiAnt = ( antNode . Yant * std : : sin ( antNode . ThetaAnt ) / std : : abs ( antNode . Yant * std : : sin ( antNode . ThetaAnt ) ) ) * std : : acos ( antNode . Xant / ( antNode . Norm * std : : sin ( antNode . ThetaAnt ) ) ) ;
return ErrorCode : : SUCCESS ;
}
void PolyfitSatelliteOribtModel : : setSatelliteOribtStartTime ( long double oribtStartTime )
{
this - > oribtStartTime = oribtStartTime ;
}
long double PolyfitSatelliteOribtModel : : getSatelliteOribtStartTime ( )
{
return this - > oribtStartTime ;
}
void PolyfitSatelliteOribtModel : : setbeamAngle ( double beamAngle , bool RightLook )
{
this - > beamAngle = beamAngle ;
this - > RightLook = RightLook ;
}
void PolyfitSatelliteOribtModel : : setAzAngleRange ( double cycletime , double minAzAngle , double maxAzAngle , double referenceAzAngle , double referenceTimeFromStartTime )
{
this - > cycletime = cycletime ;
this - > minAzAngle = minAzAngle ;
this - > maxAzAngle = maxAzAngle ;
this - > referenceAzAngle = referenceAzAngle ;
this - > referenceTimeFromStartTime = referenceTimeFromStartTime ;
}
double PolyfitSatelliteOribtModel : : getAzAngleInCurrentTimeFromStartTime ( double & currentTime )
{
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ƕ<EFBFBD>
double Azangle = 0 ;
ErrorCode state = getAzAngleInCurrentTimeFromStartTime ( currentTime , Azangle ) ;
return Azangle ;
}
///
/// X=Y x Z <20> ڶ<EFBFBD> <DAB6> <EFBFBD> (-<2D> <> <20> ڶ<EFBFBD> <DAB6> ǣ<EFBFBD> +<2B> <>
/// Z Z Z
/// ^ \ /
/// | \ /
/// y<--X--- y<--X--- y<--X---
/// | |\ /|
/// | \ /
///
ErrorCode PolyfitSatelliteOribtModel : : getAzAngleInCurrentTimeFromStartTime ( double & currentTime , double & AzAngle )
{
if ( std : : abs ( this - > maxAzAngle - this - > minAzAngle ) < 1e-7 | | std : : abs ( this - > cycletime ) < 1e-7 ) {
AzAngle = this - > referenceAzAngle ;
return ErrorCode : : SUCCESS ;
}
else {
AzAngle = this - > referenceAzAngle + ( currentTime - this - > referenceTimeFromStartTime ) / this - > cycletime * ( this - > maxAzAngle - this - > minAzAngle ) ;
return ErrorCode : : SUCCESS ;
}
}
void PolyfitSatelliteOribtModel : : setAntnnaAxisX ( double X , double Y , double Z )
{
this - > AntnnaAxisX = Point3 { X , Y , Z } ;
}
void PolyfitSatelliteOribtModel : : setAntnnaAxisY ( double X , double Y , double Z )
{
this - > AntnnaAxisY = Point3 { X , Y , Z } ;
}
void PolyfitSatelliteOribtModel : : setAntnnaAxisZ ( double X , double Y , double Z )
{
this - > AntnnaAxisZ = Point3 { X , Y , Z } ;
}
/// <20> <> <EFBFBD> <EFBFBD> (+<2B> <> <20> <> <EFBFBD> ӣ<EFBFBD> -<2D> <>
/// Z Z Z
/// ^ \ /
/// | \ /
/// x<--O--- x<--O--- x<--O---
/// | |\ /|
/// \ /
///
ErrorCode PolyfitSatelliteOribtModel : : getAntnnaDirection ( SatelliteOribtNode & node )
{
// 1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8>
Eigen : : Vector3d axisZ0 = { - 1 * node . Px , - 1 * node . Py , - 1 * node . Pz } ; // z <20> <> --<2D> <> λ<EFBFBD> <CEBB> Ϊ0ʱ<30> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> ķ<EFBFBD> <C4B7> <EFBFBD> <EFBFBD> <EFBFBD>
Eigen : : Vector3d axisX0 = { node . Vx , node . Vy , node . Vz } ; // x <20> <> --<2D> <> <EFBFBD> з<EFBFBD> <D0B7> <EFBFBD>
Eigen : : Vector3d axisY0 = axisZ0 . cross ( axisX0 ) ; // y <20> <> --<2D> <> <EFBFBD> ֶ<EFBFBD> <D6B6> <EFBFBD> -- <20> <> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD> ϵ
double rotateAngle = this - > RightLook ? - this - > beamAngle : this - > beamAngle ; // <20> <> ת<EFBFBD> Ƕ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> 룩<EFBFBD> <EBA3A9> theta , <20> ң<EFBFBD> ˳ʱ<CBB3> 룩<EFBFBD> <EBA3A9> -theta
// 1.2. <20> <> <EFBFBD> ݲ<EFBFBD> λ<EFBFBD> ǣ<EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> X<EFBFBD> <58> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
Eigen : : Matrix3d rotateMatrixBeam = rotationMatrix ( axisX0 , rotateAngle * d2r ) ; // <20> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD>
axisZ0 = rotateMatrixBeam * axisZ0 ; // <20> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD>
axisY0 = rotateMatrixBeam * axisY0 ;
axisX0 = rotateMatrixBeam * axisX0 ;
// 1.3. <20> <> <EFBFBD> ݷ<EFBFBD> λ<EFBFBD> ǣ<EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Y<EFBFBD> <59> <EFBFBD> <EFBFBD> ת
double azangle = node . AzAngle ;
Eigen : : Matrix3d rotateMatrixAzAngle = rotationMatrix ( axisY0 , rotateAngle * d2r ) ; // <20> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD>
axisZ0 = rotateMatrixAzAngle * axisZ0 ; // <20> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD>
axisY0 = rotateMatrixAzAngle * axisY0 ;
axisX0 = rotateMatrixAzAngle * axisX0 ;
// 1.4. <20> <> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> ָ<EFBFBD> <D6B8>
node . AntDirecX = axisZ0 [ 0 ] ;
node . AntDirecY = axisZ0 [ 1 ] ;
node . AntDirecZ = axisZ0 [ 2 ] ;
// 2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߷<EFBFBD> <DFB7> <EFBFBD> ͼ
node . AntXaxisX = axisX0 [ 0 ] ; // ʵ<> <CAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ <20> <> WGS84 <20> <> <EFBFBD> <EFBFBD> ϵ
node . AntXaxisY = axisX0 [ 1 ] ;
node . AntXaxisZ = axisX0 [ 2 ] ;
node . AntYaxisX = axisY0 [ 0 ] ;
node . AntYaxisY = axisY0 [ 1 ] ;
node . AntYaxisZ = axisY0 [ 2 ] ;
node . AntZaxisX = axisZ0 [ 0 ] ;
node . AntZaxisY = axisZ0 [ 1 ] ;
node . AntZaxisZ = axisZ0 [ 2 ] ;
return ErrorCode : : SUCCESS ;
}
void PolyfitSatelliteOribtModel : : addOribtNode ( SatelliteOribtNode node )
{
this - > oribtNodes . push_back ( node ) ;
}
ErrorCode PolyfitSatelliteOribtModel : : polyFit ( int polynum /*=3*/ , bool input_timeFromReferenceTime )
{
if ( polynum > this - > oribtNodes . size ( ) - 1 ) {
return ErrorCode : : OrbitNodeNotEnough ;
}
else { }
this - > polyfitPx = std : : vector < double > ( polynum + 1 , 0 ) ;
this - > polyfitPy = std : : vector < double > ( polynum + 1 , 0 ) ;
this - > polyfitPz = std : : vector < double > ( polynum + 1 , 0 ) ;
this - > polyfitVx = std : : vector < double > ( polynum + 1 , 0 ) ;
this - > polyfitVy = std : : vector < double > ( polynum + 1 , 0 ) ;
this - > polyfitVz = std : : vector < double > ( polynum + 1 , 0 ) ;
std : : vector < double > timeArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
std : : vector < double > PxArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
std : : vector < double > PyArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
std : : vector < double > PzArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
std : : vector < double > VxArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
std : : vector < double > VyArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
std : : vector < double > VzArr = std : : vector < double > ( this - > oribtNodes . size ( ) , 0 ) ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <D7BC>
for ( long i = 0 ; i < this - > oribtNodes . size ( ) ; i + + ) {
if ( input_timeFromReferenceTime ) {
timeArr [ i ] = this - > oribtNodes [ i ] . time ;
}
else {
timeArr [ i ] = this - > oribtNodes [ i ] . time - this - > oribtStartTime ; // <20> Բο <D4B2> ʱ<EFBFBD> <CAB1> Ϊ<EFBFBD> <CEAA>
qDebug ( ) < < this - > oribtNodes [ i ] . time < < " \t ---> \t " < < timeArr [ i ] ;
}
PxArr [ i ] = this - > oribtNodes [ i ] . Px ;
PyArr [ i ] = this - > oribtNodes [ i ] . Py ;
PzArr [ i ] = this - > oribtNodes [ i ] . Pz ;
VxArr [ i ] = this - > oribtNodes [ i ] . Vx ;
VyArr [ i ] = this - > oribtNodes [ i ] . Vy ;
VzArr [ i ] = this - > oribtNodes [ i ] . Vz ;
}
// <20> <> <EFBFBD> <EFBFBD> Px Py Pz Vx Vy Vz
ErrorCode codePx = polynomial_fit ( timeArr , PxArr , polynum , this - > polyfitPx , this - > Pxchisq ) ;
ErrorCode codePy = polynomial_fit ( timeArr , PyArr , polynum , this - > polyfitPy , this - > Pychisq ) ;
ErrorCode codePz = polynomial_fit ( timeArr , PzArr , polynum , this - > polyfitPz , this - > Pzchisq ) ;
ErrorCode codeVx = polynomial_fit ( timeArr , VxArr , polynum , this - > polyfitVx , this - > Vxchisq ) ;
ErrorCode codeVy = polynomial_fit ( timeArr , VyArr , polynum , this - > polyfitVy , this - > Vychisq ) ;
ErrorCode codeVz = polynomial_fit ( timeArr , VzArr , polynum , this - > polyfitVz , this - > Vzchisq ) ;
// <20> <> ӡ this->polyfitPx
qDebug ( ) < < " polyfit value: " ;
qDebug ( ) < < " Px " < < " \t " < < " Py " < < " \t " < < " Pz " < < " \t " < < " Vx " < < " \t " < < " Vy " < < " \t " < < " Vz " ;
for ( long i = 0 ; i < this - > polyfitPx . size ( ) ; i + + ) { // <20> <> <EFBFBD> <EFBFBD> ƽ <EFBFBD> <C6BD>
qDebug ( ) < < this - > polyfitPx [ i ] < < " \t " < < this - > polyfitPy [ i ] < < " \t " < < this - > polyfitPz [ i ] < < " \t " < < this - > polyfitVx [ i ] < < " \t " < < this - > polyfitVy [ i ] < < " \t " < < this - > polyfitVz [ i ] ;
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double starttime = this - > oribtStartTime ;
qDebug ( ) < < " oribt refrence time: " < < starttime ;
qDebug ( ) < < " time " < < " \t " < < " dPx " < < " \t " < < " dPy " < < " \t " < < " dPz " < < " \t " < < " dVx " < < " \t " < < " dVy " < < " \t " < < " dVz " ;
for ( long i = 0 ; i < timeArr . size ( ) ; i + + ) {
double time_temp = timeArr [ i ] ;
bool flag = false ;
SatelliteOribtNode tempnode ;
this - > getSatelliteOribtNode ( time_temp , tempnode , flag ) ;
qDebug ( ) < < timeArr [ i ] < < " \t " < < PxArr [ i ] - tempnode . Px < < " \t " < < PyArr [ i ] - tempnode . Py < < " \t " < < PzArr [ i ] - tempnode . Pz < < " \t " < < VxArr [ i ] - tempnode . Vx < < " \t " < < VyArr [ i ] - tempnode . Vy < < " \t " < < VzArr [ i ] - tempnode . Vz ;
}
return ErrorCode : : SUCCESS ;
}
double PolyfitSatelliteOribtModel : : getPt ( )
{
return this - > Pt ;
}
double PolyfitSatelliteOribtModel : : getGri ( )
{
return this - > Gri ;
}
void PolyfitSatelliteOribtModel : : setPt ( double pt )
{
this - > Pt = pt ;
}
void PolyfitSatelliteOribtModel : : setGri ( double gri )
{
this - > Gri = gri ;
}
std : : shared_ptr < AbstractSatelliteOribtModel > CreataPolyfitSatelliteOribtModel ( std : : vector < SatelliteOribtNode > & nodes , long double startTime , int polynum )
{
qDebug ( ) < < " CreataPolyfitSatelliteOribtModel \t " < < ( double ) startTime < < " \t " < < polynum ;
std : : shared_ptr < PolyfitSatelliteOribtModel > ployfitOribtModel = std : : make_shared < PolyfitSatelliteOribtModel > ( ) ;
for ( long i = 0 ; i < nodes . size ( ) ; i + + ) {
ployfitOribtModel - > addOribtNode ( nodes [ i ] ) ;
}
ployfitOribtModel - > setSatelliteOribtStartTime ( startTime ) ;
ErrorCode stateCode = ployfitOribtModel - > polyFit ( polynum , false ) ;
if ( stateCode ! = ErrorCode : : SUCCESS ) {
qDebug ( ) < < QString : : fromStdString ( errorCode2errInfo ( stateCode ) ) ;
return nullptr ;
}
else {
return ployfitOribtModel ;
}
return ployfitOribtModel ;
}