2025-02-12 01:34:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "QSimulationSARPolynomialOrbitModel.h"
|
|
|
|
|
#include "ui_QSimulationSARPolynomialOrbitModel.h"
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
#include "OribtModelOperator.h"
|
2025-02-14 02:18:48 +00:00
|
|
|
|
#include "LogInfoCls.h"
|
|
|
|
|
#include "SARSatelliteSimulationAbstractCls.h"
|
|
|
|
|
#include "SatelliteOribtModel.h"
|
2025-02-12 01:34:03 +00:00
|
|
|
|
|
|
|
|
|
QSimulationPolynomialSAROrbitModel::QSimulationPolynomialSAROrbitModel(QWidget *parent)
|
|
|
|
|
: QDialog(parent),ui(new Ui::QSimulationSARPolynomialOrbitModelClass)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
connect(ui->pushButtongpxml, SIGNAL(clicked(bool)), this, SLOT(onpushButtongpxmlClicked(bool)));
|
|
|
|
|
connect(ui->pushButtonOrbitModel, SIGNAL(clicked(bool)), this, SLOT(onpushButtonOrbitModelClicked(bool)));
|
|
|
|
|
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onbtnaccepted()));
|
|
|
|
|
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onbtnrejected()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QSimulationPolynomialSAROrbitModel::~QSimulationPolynomialSAROrbitModel()
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
void QSimulationPolynomialSAROrbitModel::onpushButtongpxmlClicked(bool)
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>һ<EFBFBD><D2BB> .tif <20>ļ<EFBFBD>
|
|
|
|
|
QString fileName = QFileDialog::getOpenFileName(this,
|
|
|
|
|
u8"GPS xml", // <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
"", // <20><>ʼĿ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ·<CEAA><C2B7>
|
|
|
|
|
u8"xml Files (*.xml)"); // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
if (!fileName.isEmpty()) {
|
|
|
|
|
this->ui->gpsXmlPathEdit->setText(fileName);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>", u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void QSimulationPolynomialSAROrbitModel::onpushButtonOrbitModelClicked(bool)
|
|
|
|
|
{
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>һ<EFBFBD><D2BB> .tif <20>ļ<EFBFBD>
|
|
|
|
|
QString fileName = QFileDialog::getSaveFileName(this,
|
|
|
|
|
u8"Polynomial GPS Model xml", // <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
"", // <20><>ʼĿ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ·<CEAA><C2B7>
|
|
|
|
|
u8"xml Files (*.xml)"); // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
if (!fileName.isEmpty()) {
|
2025-02-13 04:10:52 +00:00
|
|
|
|
this->ui->modelxmlPathEdit->setText(fileName);
|
2025-02-12 01:34:03 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>", u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QSimulationPolynomialSAROrbitModel::onbtnaccepted()
|
|
|
|
|
{
|
|
|
|
|
QString gpsxmlpath = this->ui->gpsXmlPathEdit->text();
|
|
|
|
|
QString outmodelpath = this->ui->modelxmlPathEdit->text();
|
|
|
|
|
qDebug() << "Input GPS Xml:\t" << gpsxmlpath;
|
|
|
|
|
qDebug() << "out Model Xml:\t" << outmodelpath;
|
|
|
|
|
|
2025-02-14 02:18:48 +00:00
|
|
|
|
//2. <20><>ȡGPS<50>ڵ<EFBFBD>
|
|
|
|
|
std::vector<SatelliteOribtNode> nodes;
|
|
|
|
|
ErrorCode stateCode = ReadSateGPSPointsXML(gpsxmlpath, nodes);
|
|
|
|
|
|
|
|
|
|
if (stateCode != ErrorCode::SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
qWarning() << QString::fromStdString(errorCode2errInfo(stateCode));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else {}
|
|
|
|
|
std::shared_ptr<PolyfitSatelliteOribtModel> ployfitOribtModel = std::make_shared< PolyfitSatelliteOribtModel>();
|
|
|
|
|
double startTime = 0;
|
|
|
|
|
for (long i = 0; i < nodes.size(); i++) {
|
|
|
|
|
ployfitOribtModel->addOribtNode(nodes[i]);
|
|
|
|
|
startTime += nodes[i].time / nodes.size();
|
|
|
|
|
}
|
|
|
|
|
long polynum = 3;
|
|
|
|
|
qDebug() << "refrence time " << startTime;
|
|
|
|
|
qDebug() << "poly degree " << polynum;
|
|
|
|
|
|
|
|
|
|
ployfitOribtModel->setSatelliteOribtStartTime(startTime);
|
2025-02-17 07:03:09 +00:00
|
|
|
|
stateCode = ployfitOribtModel->polyFit(polynum, false);
|
2025-02-14 02:18:48 +00:00
|
|
|
|
if (stateCode != ErrorCode::SUCCESS) {
|
|
|
|
|
qDebug() << QString::fromStdString(errorCode2errInfo(stateCode));
|
|
|
|
|
return ;
|
|
|
|
|
}
|
2025-02-17 07:03:09 +00:00
|
|
|
|
|
|
|
|
|
ployfitOribtModel->saveToXml(outmodelpath);
|
2025-02-12 01:34:03 +00:00
|
|
|
|
qDebug() << "PolynomialSAROrbitModel fit finished!!";
|
|
|
|
|
QMessageBox::information(this, u8"<EFBFBD><EFBFBD>Ϣ", u8"ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϳɹ<EFBFBD>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QSimulationPolynomialSAROrbitModel::onbtnrejected()
|
|
|
|
|
{
|
|
|
|
|
this->close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|