2025-04-08 02:43:31 +00:00
|
|
|
|
#include "QSimulationBPImageMultiProduction.h"
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
#include "TBPImageAlgCls.h"
|
|
|
|
|
#include "EchoDataFormat.h"
|
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
|
#include <thread>
|
|
|
|
|
#include "ui_QSimulationBPImageMultiProduction.h"
|
2025-04-08 03:01:52 +00:00
|
|
|
|
#include "ImageNetOperator.h"
|
2025-04-08 02:43:31 +00:00
|
|
|
|
|
|
|
|
|
QSimulationBPImageMultiProduction::QSimulationBPImageMultiProduction(QWidget *parent)
|
|
|
|
|
: QDialog(parent),ui(new Ui::QSimulationBPImageMultiProductionClass)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
|
|
QObject::connect(ui->pushButtonEchoSelect, SIGNAL(clicked()), this, SLOT(onpushButtonEchoSelectClicked()));
|
2025-04-08 03:01:52 +00:00
|
|
|
|
QObject::connect(ui->LookTableBtn, SIGNAL(clicked()), this, SLOT(onpushButtonLookTableBtnClicked()));
|
|
|
|
|
QObject::connect(ui->GridNetBtn, SIGNAL(clicked()), this, SLOT(onpushButtonGridNetBtnSelectClicked()));
|
|
|
|
|
QObject::connect(ui->L1ASelectBtn, SIGNAL(clicked()), this, SLOT(onpushButtonL1ASelectBtnClicked()));
|
|
|
|
|
QObject::connect(ui->L2SelectSelect, SIGNAL(clicked()), this, SLOT(onpushButtonL2SelectSelectClicked()));
|
2025-04-08 02:43:31 +00:00
|
|
|
|
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onbtnaccepted()));
|
|
|
|
|
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onbtnrejected()));
|
2025-04-08 03:01:52 +00:00
|
|
|
|
|
2025-04-08 02:43:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QSimulationBPImageMultiProduction::~QSimulationBPImageMultiProduction()
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
void QSimulationBPImageMultiProduction::onpushButtonEchoSelectClicked()
|
|
|
|
|
{
|
|
|
|
|
QString fileNames = QFileDialog::getOpenFileName(
|
|
|
|
|
this, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tr(u8"ѡ<EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
QString(), // Ĭ<><C4AC>·<EFBFBD><C2B7>
|
|
|
|
|
tr(u8"xml Files (*.xml);;All Files (*)") // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
if (!fileNames.isEmpty()) {
|
|
|
|
|
QString message = "ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>У<EFBFBD>\n";
|
|
|
|
|
this->ui->lineEditEchoPath->setText(fileNames);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-08 03:01:52 +00:00
|
|
|
|
|
|
|
|
|
void QSimulationBPImageMultiProduction::onpushButtonLookTableBtnClicked()
|
|
|
|
|
{
|
|
|
|
|
QString fileNames = QFileDialog::getOpenFileName(
|
|
|
|
|
this, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tr(u8"ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ұ<EFBFBD><EFBFBD>ļ<EFBFBD>"), // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
QString(), // Ĭ<><C4AC>·<EFBFBD><C2B7>
|
|
|
|
|
tr(u8"All Files(*)") // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
if (!fileNames.isEmpty()) {
|
|
|
|
|
this->ui->lineEditLookTablePath->setText(fileNames);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QSimulationBPImageMultiProduction::onpushButtonGridNetBtnSelectClicked()
|
|
|
|
|
{
|
|
|
|
|
QString fileNames = QFileDialog::getOpenFileName(
|
|
|
|
|
this, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tr(u8"ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
QString(), // Ĭ<><C4AC>·<EFBFBD><C2B7>
|
|
|
|
|
tr(u8"All Files(*)") // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
if (!fileNames.isEmpty()) {
|
|
|
|
|
this->ui->lineEditImageNetPath->setText(fileNames);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QSimulationBPImageMultiProduction::onpushButtonL1ASelectBtnClicked()
|
|
|
|
|
{
|
|
|
|
|
QString fileNames = QFileDialog::getSaveFileName(
|
|
|
|
|
this, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tr(u8"ѡ<EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
QString(), // Ĭ<><C4AC>·<EFBFBD><C2B7>
|
|
|
|
|
tr(u8"All Files(*)") // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
if (!fileNames.isEmpty()) {
|
|
|
|
|
this->ui->lineEditL1AProductionPath->setText(fileNames);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QSimulationBPImageMultiProduction::onpushButtonL2SelectSelectClicked()
|
2025-04-08 02:43:31 +00:00
|
|
|
|
{
|
|
|
|
|
QString fileNames = QFileDialog::getSaveFileName(
|
|
|
|
|
this, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tr(u8"ѡ<EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
QString(), // Ĭ<><C4AC>·<EFBFBD><C2B7>
|
|
|
|
|
tr(u8"All Files(*)") // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
if (!fileNames.isEmpty()) {
|
2025-04-08 03:01:52 +00:00
|
|
|
|
this->ui->lineEditL2ProductionPath->setText(fileNames);
|
2025-04-08 02:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
QMessageBox::information(this, tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>"), tr(u8"û<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QSimulationBPImageMultiProduction::onbtnaccepted()
|
|
|
|
|
{
|
2025-04-08 03:01:52 +00:00
|
|
|
|
QString L1ADataPath = this->ui->lineEditL1AProductionPath->text().trimmed();
|
|
|
|
|
QString L2DataPath = this->ui->lineEditL2ProductionPath->text().trimmed();
|
|
|
|
|
QString looktablePath = this->ui->lineEditLookTablePath->text().trimmed();
|
|
|
|
|
QString imgNetPath = this->ui->lineEditImageNetPath->text().trimmed();
|
|
|
|
|
QString echoDataPath = this->ui->lineEditEchoPath->text().trimmed();
|
|
|
|
|
|
2025-04-08 02:43:31 +00:00
|
|
|
|
this->hide();
|
2025-04-08 03:01:52 +00:00
|
|
|
|
QString echofile = echoDataPath;
|
|
|
|
|
QString outImageFolder = getParantFromPath(L2DataPath);
|
|
|
|
|
QString imagename = getFileNameFromPath(L2DataPath);
|
2025-04-08 02:43:31 +00:00
|
|
|
|
std::shared_ptr<EchoL0Dataset> echoL0ds(new EchoL0Dataset);
|
|
|
|
|
echoL0ds->Open(echofile);
|
|
|
|
|
|
|
|
|
|
std::shared_ptr< SARSimulationImageL1Dataset> imagL1(new SARSimulationImageL1Dataset);
|
|
|
|
|
imagL1->setCenterAngle(echoL0ds->getCenterAngle());
|
|
|
|
|
imagL1->setCenterFreq(echoL0ds->getCenterFreq());
|
|
|
|
|
imagL1->setNearRange(echoL0ds->getNearRange());
|
|
|
|
|
imagL1->setRefRange((echoL0ds->getNearRange() + echoL0ds->getFarRange()) / 2);
|
|
|
|
|
imagL1->setFarRange(echoL0ds->getFarRange());
|
|
|
|
|
imagL1->setFs(echoL0ds->getFs());
|
|
|
|
|
imagL1->setLookSide(echoL0ds->getLookSide());
|
|
|
|
|
|
2025-04-08 03:01:52 +00:00
|
|
|
|
gdalImage imgxyzimg(imgNetPath);
|
|
|
|
|
imagL1->OpenOrNew(outImageFolder, imagename, imgxyzimg.height, imgxyzimg.width);
|
2025-04-08 02:43:31 +00:00
|
|
|
|
|
2025-04-08 03:01:52 +00:00
|
|
|
|
qDebug() << u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
2025-04-08 02:43:31 +00:00
|
|
|
|
TBPImageAlgCls TBPimag;
|
|
|
|
|
TBPimag.setEchoL0(echoL0ds);
|
|
|
|
|
TBPimag.setImageL1(imagL1);
|
|
|
|
|
long cpucore_num = std::thread::hardware_concurrency();
|
|
|
|
|
TBPimag.setGPU(true);
|
2025-04-08 03:01:52 +00:00
|
|
|
|
TBPimag.ProcessWithGridNet(cpucore_num, imgNetPath);
|
|
|
|
|
qDebug() << u8"ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
|
2025-04-09 07:06:06 +00:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
std::shared_ptr< SARSimulationImageL1Dataset> imagL2(new SARSimulationImageL1Dataset);
|
|
|
|
|
imagL2->setCenterAngle(echoL0ds->getCenterAngle());
|
|
|
|
|
imagL2->setCenterFreq(echoL0ds->getCenterFreq());
|
|
|
|
|
imagL2->setNearRange(echoL0ds->getNearRange());
|
|
|
|
|
imagL2->setRefRange((echoL0ds->getNearRange() + echoL0ds->getFarRange()) / 2);
|
|
|
|
|
imagL2->setFarRange(echoL0ds->getFarRange());
|
|
|
|
|
imagL2->setFs(echoL0ds->getFs());
|
|
|
|
|
imagL2->setLookSide(echoL0ds->getLookSide());
|
2025-04-08 03:01:52 +00:00
|
|
|
|
|
|
|
|
|
|
2025-04-09 07:06:06 +00:00
|
|
|
|
QString outL1AImageFolder = getParantFromPath(L1ADataPath);
|
|
|
|
|
QString L1Aimagename = getFileNameFromPath(L1ADataPath);
|
2025-04-08 03:01:52 +00:00
|
|
|
|
|
2025-04-09 07:06:06 +00:00
|
|
|
|
gdalImage Looktableimg(looktablePath);
|
|
|
|
|
imagL2->OpenOrNew(outL1AImageFolder, L1Aimagename, Looktableimg.height, Looktableimg.width);
|
|
|
|
|
|
|
|
|
|
QString L1AEchoDataPath =imagL2->getImageRasterPath();
|
2025-04-08 02:43:31 +00:00
|
|
|
|
|
2025-04-09 07:06:06 +00:00
|
|
|
|
ResampleEChoDataFromGeoEcho(imagL1->getImageRasterPath(), looktablePath, L1AEchoDataPath);
|
2025-04-08 02:43:31 +00:00
|
|
|
|
|
2025-04-09 07:06:06 +00:00
|
|
|
|
|
|
|
|
|
this->show();
|
|
|
|
|
|
|
|
|
|
QMessageBox::information(this,u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",u8"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
|
2025-04-08 02:43:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-08 03:01:52 +00:00
|
|
|
|
void QSimulationBPImageMultiProduction::onbtnrejected()
|
2025-04-08 02:43:31 +00:00
|
|
|
|
{
|
2025-04-08 03:01:52 +00:00
|
|
|
|
this->close();
|
2025-04-08 02:43:31 +00:00
|
|
|
|
}
|
2025-04-08 03:01:52 +00:00
|
|
|
|
|