From 5741dda08ce6bed7221b3e75d732921cbb518e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A2=9E=E8=BE=89?= <3045316072@qq.com> Date: Sun, 16 Mar 2025 14:26:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=A8=E9=81=93=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E8=B0=83=E7=94=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPG4Tool/SPG4Function.cpp | 2 +- SPG4Tool/SPG4Toolmain.cpp | 10 +++++----- .../BaseToolbox/QtCreateGPSPointsDialog.cpp | 17 ++++++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/SPG4Tool/SPG4Function.cpp b/SPG4Tool/SPG4Function.cpp index 99dac1e..dc207cd 100644 --- a/SPG4Tool/SPG4Function.cpp +++ b/SPG4Tool/SPG4Function.cpp @@ -145,7 +145,7 @@ std::vector getGPSPoints(std::string line1, std::string line2, std::cout << "Start time:\t" << start; std::cout << "End time:\t" << end; std::cout << "inc time:\t" << inc << std::endl; - std::vector result= RunTle(tle, start, end, inc, printfinfoflag); + std::vector result= RunTle(tle, start, end, inc, printfinfoflag,running,first_run); return result; } diff --git a/SPG4Tool/SPG4Toolmain.cpp b/SPG4Tool/SPG4Toolmain.cpp index 4faaabe..4b628d4 100644 --- a/SPG4Tool/SPG4Toolmain.cpp +++ b/SPG4Tool/SPG4Toolmain.cpp @@ -8,7 +8,7 @@ #include "CoordTopocentric.h" #include #include "SPG4Function.h" - +#include "SPG4Tool.h" /** 陆探四号01星卫星轨道 @@ -18,7 +18,7 @@ */ -// + //int main(int argc, char *argv[]) //{ // @@ -28,10 +28,10 @@ // libsgp4::Tle tle("GF3", line1, line2); // // double start = 0; -// double end = 10; -// double inc = 1; +// double end = 1; +// double inc = 1/60.0; // -// RunTle(tle, start, end, inc); +// RunTle(tle, start, end, inc,true); // //QCoreApplication a(argc, argv); // // //return a.exec(); diff --git a/Toolbox/BaseToolbox/BaseToolbox/QtCreateGPSPointsDialog.cpp b/Toolbox/BaseToolbox/BaseToolbox/QtCreateGPSPointsDialog.cpp index 0aca402..797d8f2 100644 --- a/Toolbox/BaseToolbox/BaseToolbox/QtCreateGPSPointsDialog.cpp +++ b/Toolbox/BaseToolbox/BaseToolbox/QtCreateGPSPointsDialog.cpp @@ -69,8 +69,14 @@ void QtCreateGPSPointsDialog::onaccepted() QString inLTEPath = this->ui->lineEditLTE->text(); QString outGPSxmlPath = this->ui->lineEditoutGPSxml->text(); - double start = this->ui->StartimedateTimeEdit->dateTime().toTime_t(); - double end = this->ui->EndimedateTimeEdit->dateTime().toTime_t(); + QDateTime startTime = this->ui->StartimedateTimeEdit->dateTime().toUTC(); + QDateTime endTime = this->ui->EndimedateTimeEdit->dateTime().toUTC(); + + double start = startTime.toTime_t(); + double end = endTime.toTime_t(); + // 转换为utc时间 + + long gpsoint = this->ui->spinBoxGPSPoints->value(); @@ -111,6 +117,11 @@ void QtCreateGPSPointsDialog::onaccepted() double inc = (end - start) / (gpsoint-1); + start = start / 60.0; // 转换为分钟 + end = end / 60.0; + inc = inc / 60.0; + + std::vector gpspoints = getGPSPoints(tle1, tle2, start, end, inc, true,true,false); qDebug() << "create gpspoints size:" << gpspoints.size(); @@ -124,7 +135,7 @@ void QtCreateGPSPointsDialog::onaccepted() ofs << "\n\n"; for (const auto& point : gpspoints) { // 缩放单位 ofs << "\n"; - ofs << "" << QDateTime::fromTime_t(point.time+ tle1TimeOffset).toString("yyyy-MM-dd HH:mm:ss.zzz").toStdString() << "\n"; + ofs << "" << QDateTime::fromTime_t(point.time*60.0+ tle1TimeOffset, Qt::UTC).toLocalTime().toString("yyyy-MM-dd HH:mm:ss.zzz").toStdString() << "\n"; ofs << "" << point.Px*1000.0 << "\n"; ofs << "" << point.Py*1000.0 << "\n"; ofs << "" << point.Pz*1000.0 << "\n";