为工具增加界面

Release
陈增辉 2024-11-26 01:51:20 +08:00
parent 4ac2ca27e6
commit 8709c48b8e
27 changed files with 1389 additions and 86 deletions

View File

@ -13,6 +13,7 @@ QComplex2AmpPhase::QComplex2AmpPhase(QWidget *parent)
QObject::connect(ui.radioButtonAmp,SIGNAL(toggled(bool)),this,SLOT(radioButtonAmptoggled(bool)));
QObject::connect(ui.radioButtonPhase, SIGNAL(toggled(bool)), this, SLOT(radioButtonPhasetoggled(bool)));
QObject::connect(ui.radioButtonSigma0, SIGNAL(toggled(bool)), this, SLOT(radioButtonSigma0toggled(bool)));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
//toggled(bool )
}

View File

@ -11,6 +11,7 @@ QImportGF3StripL1ADataset::QImportGF3StripL1ADataset(QWidget *parent)
QObject::connect( ui.pushButtonAdd,SIGNAL(clicked(clicked)),this,SLOT(onpushButtonAddClicked(bool)));
QObject::connect(ui.pushButtonRemove, SIGNAL(clicked(clicked)), this, SLOT(onpushButtonRemoveClicked(bool)));
QObject::connect(ui.pushButtonWorkSpace, SIGNAL(clicked(clicked)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}

View File

@ -16,7 +16,7 @@ QOrthSlrRaster::QOrthSlrRaster(QWidget *parent)
connect(ui.pushButtonRemove, SIGNAL(clicked(bool)), this, SLOT(onpushButtonRemoveClicked(bool)));
connect(ui.pushButtonDEMSelect, SIGNAL(clicked(bool)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
connect(ui.pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(pushButtonDEMSelectClicked(bool)));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
QOrthSlrRaster::~QOrthSlrRaster()
@ -113,3 +113,4 @@ void QOrthSlrRaster::pushButtonDEMSelectClicked(bool)
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
}
}

View File

@ -23,3 +23,5 @@ public slots:
void pushButtonDEMSelectClicked(bool);
};

View File

@ -12,6 +12,7 @@ QRDOrthProcessClass::QRDOrthProcessClass(QWidget *parent)
connect(ui.pushButtonRemove,SIGNAL(clicked(bool)),this,SLOT(onpushButtonRemoveClicked(bool)));
connect(ui.pushButtonDEMSelect,SIGNAL(clicked(bool)),this,SLOT(onpushButtonWorkSpaceClicked(bool)));
connect(ui.pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(pushButtonDEMSelectClicked(bool)));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
// QDialogButtonBox* buttonBox;
//QLineEdit* lineEditDEM;
//QLineEdit* lineEditWorkDir;

View File

@ -11,46 +11,90 @@ RasterProcessTool::RasterProcessTool(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
QObject::connect(this->ui.actionmergeRaster, SIGNAL(triggered()), this, SLOT(onactionmergeRasterTriggered()));
QObject::connect(this->ui.actionImportGF3Strip, SIGNAL(triggered()), this, SLOT(onactionImportGF3StripTriggered()));
QObject::connect(this->ui.actioncomplex2amporphase, SIGNAL(triggered()), this, SLOT(onactioncomplex2amporphaseTriggered()));
QObject::connect(this->ui.actionlooktableCreate, SIGNAL(triggered()), this, SLOT(onactionlooktableCreateTriggered()));
QObject::connect(this->ui.actionorthinterpRaster, SIGNAL(triggered()), this, SLOT(onactionorthinterpRasterTriggered()));
QObject::connect(this, SIGNAL(addBoxToolItemSIGNAL(QToolAbstract*)), this, SLOT(addBoxToolItemSLOT(QToolAbstract*)));
}
RasterProcessTool::~RasterProcessTool()
{}
void RasterProcessTool::onactionImportGF3StripTriggered()
void RasterProcessTool::addBoxToolItemSLOT(QToolAbstract* item)
{
QImportGF3StripL1ADataset* dialog = new QImportGF3StripL1ADataset(this);
dialog->show();
QVector<QString> xnodepath = item->getToolXpath();
QString toolName = item->getToolName();
QTreeWidgetItem* parentItem = findOrCreateParentItem(xnodepath);
// 检查该父项是否已经绑定了 toolButton
if (parentItem && ui.treeWidgetToolBox->itemWidget(parentItem, 0) == nullptr) {
QTreeWidgetItem* actionItem = new QTreeWidgetItem(parentItem);
parentItem->addChild(actionItem);
QPushButton* button = new QPushButton(ui.treeWidgetToolBox);
button->setText(toolName);
ui.treeWidgetToolBox->setItemWidget(actionItem, 0, button);
connect(button, SIGNAL(clicked()), item, SLOT(excute()));
item->setParent(ui.treeWidgetToolBox);
qDebug() << "ToolButton bound to parent:" << actionItem->text(0);
}
else {
qDebug() << "ToolButton already bound to parent:" << parentItem->text(0);
}
}
void RasterProcessTool::onactioncomplex2amporphaseTriggered()
{
QComplex2AmpPhase* dialog = new QComplex2AmpPhase(this);
dialog->show();
// 根据路径查找或创建父项
QTreeWidgetItem* RasterProcessTool::findOrCreateParentItem( QVector<QString>& path) {
QTreeWidgetItem* currentItem = nullptr;
// 从树的顶层开始查找
for ( QString& nodeName : path) {
if (currentItem == nullptr) {
// 如果是顶级节点
currentItem = findOrCreateTopLevelItem(nodeName);
}
else {
// 如果是子节点,查找当前父项下是否存在该子节点
currentItem = findChildItemByName(currentItem, nodeName);
if (currentItem == nullptr) {
currentItem = new QTreeWidgetItem(currentItem);
currentItem->setText(0, nodeName);
}
}
}
return currentItem;
}
void RasterProcessTool::onactionlooktableCreateTriggered()
{
QRDOrthProcessClass* dialog = new QRDOrthProcessClass(this);
dialog->show();
// 查找顶级节点,如果没有找到则创建
QTreeWidgetItem* RasterProcessTool::findOrCreateTopLevelItem( QString& name) {
for (int i = 0; i < ui.treeWidgetToolBox->topLevelItemCount(); ++i) {
QTreeWidgetItem* item = ui.treeWidgetToolBox->topLevelItem(i);
if (item->text(0) == name) {
return item;
}
}
// 如果没有找到,创建新的顶级节点
QTreeWidgetItem* newItem = new QTreeWidgetItem(ui.treeWidgetToolBox);
newItem->setText(0, name);
return newItem;
}
void RasterProcessTool::onactionorthinterpRasterTriggered()
{
QOrthSlrRaster* dialog = new QOrthSlrRaster(this);
dialog->show();
// 查找子节点,如果没有找到则返回 nullptr
QTreeWidgetItem* RasterProcessTool::findChildItemByName(QTreeWidgetItem* parentItem, QString& name) {
for (int i = 0; i < parentItem->childCount(); ++i) {
QTreeWidgetItem* childItem = parentItem->child(i);
if (childItem->text(0) == name) {
return childItem;
}
}
return nullptr;
}
void RasterProcessTool::onactionmergeRasterTriggered()
{
QMergeRasterProcessDialog* dialog = new QMergeRasterProcessDialog(this);
dialog->show();
}

View File

@ -2,6 +2,7 @@
#include <QtWidgets/QMainWindow>
#include "ui_RasterProcessTool.h"
#include "QToolAbstract.h"
class RasterProcessTool : public QMainWindow
{
@ -11,13 +12,18 @@ public:
RasterProcessTool(QWidget *parent = nullptr);
~RasterProcessTool();
public slots:
signals:
void addBoxToolItemSIGNAL(QToolAbstract* item);
public slots:
void addBoxToolItemSLOT(QToolAbstract* item);
QTreeWidgetItem* findOrCreateParentItem( QVector<QString>& path);
QTreeWidgetItem* findOrCreateTopLevelItem( QString& name);
QTreeWidgetItem* findChildItemByName(QTreeWidgetItem* parentItem, QString& name);
void onactionmergeRasterTriggered();
void onactionImportGF3StripTriggered();
void onactioncomplex2amporphaseTriggered();
void onactionlooktableCreateTriggered();
void onactionorthinterpRasterTriggered();
private:
Ui::RasterProcessToolClass ui;
};

Binary file not shown.

View File

@ -13,7 +13,9 @@
<property name="windowTitle">
<string>RasterProcessTool</string>
</property>
<widget class="QWidget" name="centralWidget"/>
<widget class="QWidget" name="centralWidget">
<layout class="QHBoxLayout" name="horizontalLayout"/>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
@ -23,23 +25,6 @@
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menurasterProcessTool">
<property name="title">
<string>rasterProcessTool</string>
</property>
<addaction name="actionmergeRaster"/>
</widget>
<widget class="QMenu" name="menuGF3ToolBox">
<property name="title">
<string>GF3ToolBox</string>
</property>
<addaction name="actionImportGF3Strip"/>
<addaction name="actioncomplex2amporphase"/>
<addaction name="actionlooktableCreate"/>
<addaction name="actionorthinterpRaster"/>
</widget>
<addaction name="menurasterProcessTool"/>
<addaction name="menuGF3ToolBox"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
@ -50,6 +35,18 @@
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QDockWidget" name="dockWidget">
<attribute name="dockWidgetArea">
<number>2</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTreeWidget" name="treeWidgetToolBox"/>
</item>
</layout>
</widget>
</widget>
<action name="actionmergeRaster">
<property name="text">
<string>mergeRaster</string>
@ -75,6 +72,21 @@
<string>orthinterpRaster</string>
</property>
</action>
<action name="actionSARRTPC">
<property name="text">
<string>SARRTPC</string>
</property>
</action>
<action name="actionSimuSARRTPC">
<property name="text">
<string>SimuSARRTPC</string>
</property>
</action>
<action name="actionSimuBPImage">
<property name="text">
<string>SimuBPImage</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>

View File

@ -113,6 +113,14 @@
<ClCompile Include="BaseLibraryCPP\QToolProcessBarDialog.cpp" />
<ClCompile Include="GF3ProcessToolbox\QOrthSlrRaster.cpp" />
<ClCompile Include="QSimulationRTPCGUI.cpp" />
<ClCompile Include="RegisterToolbox.cpp">
<DynamicSource Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">input</DynamicSource>
<QtMocFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Filename).moc</QtMocFileName>
<DynamicSource Condition="'$(Configuration)|$(Platform)'=='Release|x64'">input</DynamicSource>
<QtMocFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Filename).moc</QtMocFileName>
</ClCompile>
<ClCompile Include="SimulationSAR\QImageSARRTPC.cpp" />
<ClCompile Include="SimulationSAR\QToolAbstract.cpp" />
<ClCompile Include="SimulationSAR\RTPCProcessCls.cpp" />
<ClCompile Include="SimulationSAR\SARSatelliteSimulationAbstractCls.cpp" />
<ClCompile Include="SimulationSAR\SARSimulationTaskSetting.cpp" />
@ -157,6 +165,7 @@
<ClCompile Include="QMergeRasterProcessDialog.cpp" />
<ClCompile Include="RasterProcessTool.cpp" />
<ClCompile Include="main.cpp" />
<QtUic Include="SimulationSAR\QImageSARRTPC.ui" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BaseLibraryCPP\BaseConstVariable.h" />
@ -164,6 +173,9 @@
<ClInclude Include="BaseLibraryCPP\EchoDataFormat.h" />
<ClInclude Include="BaseLibraryCPP\FileOperator.h" />
<ClInclude Include="BaseLibraryCPP\GeoOperator.h" />
<QtMoc Include="SimulationSAR\QImageSARRTPC.h" />
<QtMoc Include="SimulationSAR\QToolAbstract.h" />
<QtMoc Include="RegisterToolbox.h" />
<ClInclude Include="SimulationSAR\TBPImageAlgCls.h" />
<QtMoc Include="QSimulationRTPCGUI.h" />
<QtMoc Include="GF3ProcessToolbox\QOrthSlrRaster.h" />

View File

@ -27,12 +27,12 @@
<Filter Include="Imageshow">
<UniqueIdentifier>{dec5c630-193b-4820-a36a-e1dada57e814}</UniqueIdentifier>
</Filter>
<Filter Include="GF3ProcessToolbox">
<UniqueIdentifier>{c49d5cbf-5e46-46f8-880c-1f1f9d6e32e9}</UniqueIdentifier>
</Filter>
<Filter Include="SimulationSAR">
<UniqueIdentifier>{c019ab22-835f-44bd-8689-f5550c9c690d}</UniqueIdentifier>
</Filter>
<Filter Include="GF3ProcessToolbox">
<UniqueIdentifier>{c49d5cbf-5e46-46f8-880c-1f1f9d6e32e9}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<QtRcc Include="RasterProcessTool.qrc">
@ -142,6 +142,15 @@
<ClCompile Include="SimulationSAR\TBPImageAlgCls.cpp">
<Filter>SimulationSAR</Filter>
</ClCompile>
<ClCompile Include="SimulationSAR\QToolAbstract.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RegisterToolbox.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SimulationSAR\QImageSARRTPC.cpp">
<Filter>SimulationSAR</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="BaseLibraryCPP\BaseConstVariable.h">
@ -236,6 +245,15 @@
<QtMoc Include="BaseLibraryCPP\QToolProcessBarDialog.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="SimulationSAR\QToolAbstract.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="RegisterToolbox.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="SimulationSAR\QImageSARRTPC.h">
<Filter>SimulationSAR</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtUic Include="QMergeRasterProcessDialog.ui">
@ -265,6 +283,9 @@
<QtUic Include="BaseLibraryCPP\QToolProcessBarDialog.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="SimulationSAR\QImageSARRTPC.ui">
<Filter>SimulationSAR</Filter>
</QtUic>
</ItemGroup>
<ItemGroup>
<CudaCompile Include="SimulationSAR\TBPGPU.cu">

144
RegisterToolbox.cpp Normal file
View File

@ -0,0 +1,144 @@
#include "RegisterToolbox.h"
#include "QToolAbstract.h"
#include "QMergeRasterProcessDialog.h"
#include "QImportGF3StripL1ADataset.h"
#include "QComplex2AmpPhase.h"
#include "QRDOrthProcessClass.h"
#include "QOrthSlrRaster.h"
GF3ImportDataToolButton::GF3ImportDataToolButton( QWidget* parent):QToolAbstract(parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"数据导入导出");
this->toolname =QString( u8"导入GF3条带");
}
GF3ImportDataToolButton::~GF3ImportDataToolButton()
{
}
void GF3ImportDataToolButton::excute()
{
QImportGF3StripL1ADataset* dialog = new QImportGF3StripL1ADataset();
dialog->show();
}
Complex2AmpPhaseToolButton::Complex2AmpPhaseToolButton( QWidget* parent) :QToolAbstract( parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"基础处理");
this->toolname = QString(u8"复数据转换");
}
Complex2AmpPhaseToolButton::~Complex2AmpPhaseToolButton()
{
}
void Complex2AmpPhaseToolButton::excute()
{
QComplex2AmpPhase* dialog = new QComplex2AmpPhase();
dialog->show();
}
QRDOrthProcessClassToolButton::QRDOrthProcessClassToolButton( QWidget* parent) :QToolAbstract( parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"基础处理");
this->toolname = QString(u8"创建查找表");
}
QRDOrthProcessClassToolButton::~QRDOrthProcessClassToolButton()
{
}
void QRDOrthProcessClassToolButton::excute()
{
QRDOrthProcessClass* dialog = new QRDOrthProcessClass();
dialog->show();
}
QOrthSlrRasterToolButton::QOrthSlrRasterToolButton( QWidget* parent) :QToolAbstract( parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"基础处理");
this->toolname = QString(u8"图像正射");
}
QOrthSlrRasterToolButton::~QOrthSlrRasterToolButton()
{
}
void QOrthSlrRasterToolButton::excute()
{
QOrthSlrRaster* dialog = new QOrthSlrRaster();
dialog->show();
}
MergeRasterProcessToolButton::MergeRasterProcessToolButton( QWidget* parent) :QToolAbstract( parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"基础处理");
this->toolname = QString(u8"图像合并");
}
MergeRasterProcessToolButton::~MergeRasterProcessToolButton()
{
}
void MergeRasterProcessToolButton::excute()
{
QMergeRasterProcessDialog* dialog = new QMergeRasterProcessDialog();
dialog->show();
}
SARSimlulationRTPCToolButton::SARSimlulationRTPCToolButton( QWidget* parent) :QToolAbstract( parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"仿真工具库");
this->toolname = QString(u8"RTPC");
}
SARSimlulationRTPCToolButton::~SARSimlulationRTPCToolButton()
{
}
void SARSimlulationRTPCToolButton::excute()
{
}
SARSimulationTBPImageToolButton::SARSimulationTBPImageToolButton( QWidget* parent) :QToolAbstract( parent)
{
this->toolPath = QVector<QString>(0);
this->toolPath.push_back(u8"成像工具库");
this->toolname = QString(u8"TimeBP仿真成像");
}
SARSimulationTBPImageToolButton::~SARSimulationTBPImageToolButton()
{
}
void SARSimulationTBPImageToolButton::excute()
{
}
void RegisterPreToolBox(RasterProcessTool* mainWindows)
{
GF3ImportDataToolButton* items1 = new GF3ImportDataToolButton(nullptr);
Complex2AmpPhaseToolButton* items2 = new Complex2AmpPhaseToolButton(nullptr);
QRDOrthProcessClassToolButton* items3 = new QRDOrthProcessClassToolButton(nullptr);
QOrthSlrRasterToolButton* items4 = new QOrthSlrRasterToolButton(nullptr);
MergeRasterProcessToolButton* items5 = new MergeRasterProcessToolButton(nullptr);
SARSimlulationRTPCToolButton* items6 = new SARSimlulationRTPCToolButton(nullptr);
SARSimulationTBPImageToolButton* items7 = new SARSimulationTBPImageToolButton(nullptr);
emit mainWindows->addBoxToolItemSIGNAL(items1);
emit mainWindows->addBoxToolItemSIGNAL(items2);
emit mainWindows->addBoxToolItemSIGNAL(items3);
emit mainWindows->addBoxToolItemSIGNAL(items4);
emit mainWindows->addBoxToolItemSIGNAL(items5);
emit mainWindows->addBoxToolItemSIGNAL(items6);
emit mainWindows->addBoxToolItemSIGNAL(items7);
}

79
RegisterToolbox.h Normal file
View File

@ -0,0 +1,79 @@
#pragma once
#include "QToolAbstract.h"
#include "RasterProcessTool.h"
class GF3ImportDataToolButton : public QToolAbstract {
Q_OBJECT
public:
GF3ImportDataToolButton( QWidget* parent = nullptr);
~GF3ImportDataToolButton();
public slots:
virtual void excute() override;
};
class Complex2AmpPhaseToolButton : public QToolAbstract {
Q_OBJECT
public:
Complex2AmpPhaseToolButton( QWidget* parent = nullptr);
~Complex2AmpPhaseToolButton();
public slots:
virtual void excute() override;
};
class QRDOrthProcessClassToolButton : public QToolAbstract {
Q_OBJECT
public:
QRDOrthProcessClassToolButton( QWidget* parent = nullptr);
~QRDOrthProcessClassToolButton();
public slots:
virtual void excute() override;
};
class QOrthSlrRasterToolButton : public QToolAbstract {
Q_OBJECT
public:
QOrthSlrRasterToolButton( QWidget* parent = nullptr);
~QOrthSlrRasterToolButton();
public slots:
virtual void excute() override;
};
class MergeRasterProcessToolButton : public QToolAbstract {
Q_OBJECT
public:
MergeRasterProcessToolButton( QWidget* parent = nullptr);
~MergeRasterProcessToolButton();
public slots:
virtual void excute() override;
};
class SARSimlulationRTPCToolButton : public QToolAbstract {
Q_OBJECT
public:
SARSimlulationRTPCToolButton( QWidget* parent = nullptr);
~SARSimlulationRTPCToolButton();
public slots:
virtual void excute() override;
};
class SARSimulationTBPImageToolButton : public QToolAbstract {
Q_OBJECT
public:
SARSimulationTBPImageToolButton( QWidget* parent = nullptr);
~SARSimulationTBPImageToolButton();
public slots:
virtual void excute() override;
};
void RegisterPreToolBox(RasterProcessTool* mainWindows);

View File

@ -0,0 +1,252 @@
#include "QImageSARRTPC.h"
#include <QFileDialog>
#include <QMessageBox>
#include "RTPCProcessCls.h"
#include <boost/thread.hpp>
#include <thread>
QImageSARRTPC::QImageSARRTPC(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
QObject::connect(ui.pushButtonRP, SIGNAL(clicked()), this, SLOT(onpushButtonRPClieck()));
QObject::connect(ui.pushButtonTP, SIGNAL(clicked()), this, SLOT(onpushButtonTPClieck()));
QObject::connect(ui.pushButtonEcho, SIGNAL(clicked()), this, SLOT(onpushButtonEchoClieck()));
QObject::connect(ui.pushButtongpxml, SIGNAL(clicked()), this, SLOT(onpushButtongpxmlClieck()));
QObject::connect(ui.pushButtonTaskxml, SIGNAL(clicked()), this, SLOT(onpushButtonTaskxmlClieck()));
QObject::connect(ui.pushButtondem, SIGNAL(clicked()), this, SLOT(onpushButtondemClieck()));
QObject::connect(ui.pushButtonlandcover, SIGNAL(clicked()), this, SLOT(onpushButtonlandcoverClieck()));
QObject::connect(ui.pushButtonHHSigma0, SIGNAL(clicked()), this, SLOT(onpushButtonHHSigma0Clieck()));
QObject::connect(ui.pushButtonHVSigma0, SIGNAL(clicked()), this, SLOT(onpushButtonHVSigma0Clieck()));
QObject::connect(ui.pushButtonVHSigma0, SIGNAL(clicked()), this, SLOT(onpushButtonVHSigma0Clieck()));
QObject::connect(ui.pushButtonVVSigma0, SIGNAL(clicked()), this, SLOT(onpushButtonVVSigma0Clieck()));
QObject::connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(onBtnaccept()));
QObject::connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(onBtnReject()));
}
QImageSARRTPC::~QImageSARRTPC()
{}
void QImageSARRTPC::onpushButtonRPClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"接收方向图", // 对话框标题
"", // 初始目录,可以设置为路径
u8"csv Files (*.csv);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.receivePatternFilePathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonTPClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"发射方向图", // 对话框标题
"", // 初始目录,可以设置为路径
u8"csv Files (*.csv);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.transformPatternFilePathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonEchoClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getExistingDirectory(this, u8"选择回波存放路径", "");
if (!fileName.isEmpty()) {
this->ui.outEchoPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件夹", u8"没有选择任何文件夹");
}
}
void QImageSARRTPC::onpushButtongpxmlClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"GPS xml", // 对话框标题
"", // 初始目录,可以设置为路径
u8"xml Files (*.xml);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.gpsXmlPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonTaskxmlClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"任务xml", // 对话框标题
"", // 初始目录,可以设置为路径
u8"xml Files (*.xml);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.taskXmlPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtondemClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"dem文件", // 对话框标题
"", // 初始目录,可以设置为路径
u8"Image Files (*.tif);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.demTiffPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonlandcoverClieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"地表覆盖数据", // 对话框标题
"", // 初始目录,可以设置为路径
u8"Image Files (*.tif);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.landCoverPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonHHSigma0Clieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"HH后向散射系数", // 对话框标题
"", // 初始目录,可以设置为路径
u8"Image Files (*.tif);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.hhSigmaPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonHVSigma0Clieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"HV后向散射系数", // 对话框标题
"", // 初始目录,可以设置为路径
u8"Image Files (*.tif);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.hvSigmaPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonVHSigma0Clieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"VH后向散射系数", // 对话框标题
"", // 初始目录,可以设置为路径
u8"Image Files (*.tif);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.vhSigmaPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onpushButtonVVSigma0Clieck()
{
// 调用文件选择对话框并选择一个 .tif 文件
QString fileName = QFileDialog::getSaveFileName(this,
u8"VV后向散射系数", // 对话框标题
"", // 初始目录,可以设置为路径
u8"Image Files (*.tif);;All Files (*)"); // 文件类型过滤器
if (!fileName.isEmpty()) {
this->ui.vvSigmaPathEdit->setText(fileName);
}
else {
QMessageBox::information(this, u8"没有选择文件", u8"没有选择任何文件");
}
}
void QImageSARRTPC::onBtnaccept()
{
QString GPSXmlPath = ui.gpsXmlPathEdit->text();// u8"./TestData/GF3_Simulation_GPSNode.xml";
QString TaskXmlPath = ui.taskXmlPathEdit->text();//u8"./TestData/GF3_Simulation_Setting.xml";
QString demTiffPath = ui.demTiffPathEdit->text();//u8"./TestData/115E39N_COP30_clip.tif";
QString landConverPath = ui.landCoverPathEdit->text();// u8"./TestData/landcover_aligned.tiff";
QString HHSigmaPath = ui.hhSigmaPathEdit->text();// u8"./TestData/PALSAR-2/N45E116_23_MOS_F02DAR/N45E116_2023_sl_HH_F02DAR.tif";
QString HVSigmaPath = ui.hvSigmaPathEdit->text();// u8"./TestData/PALSAR-2/N45E116_23_MOS_F02DAR/N45E116_2023_sl_HV_F02DAR.tif";
QString VHSigmaPath = ui.vhSigmaPathEdit->text();// HVSigmaPath;
QString VVSigmaPath = ui.vvSigmaPathEdit->text();//HHSigmaPath;
QString OutEchoPath = ui.outEchoPathEdit->text();// u8"./TestData/outData/";
QString simulationtaskName = ui.simulationTaskNameEdit->text();// u8"GF3_Simulation";
// 天线方向图
QString TransAntPatternFilePath = ui.transformPatternFilePathEdit->text();// "./TestData/ant/ant_model_setting_Horn_conical1_FarField-theta.csv"; //
QString ReceiveAntPatternFilePath = ui.receivePatternFilePathEdit->text();//"./TestData/ant/ant_model_setting_Horn_conical1_FarField-phi.csv";
// 打印参数
// 打印解析的参数
std::cout << "GPS XML Path: " << GPSXmlPath.toStdString() << "\n"
<< "Task XML Path: " << TaskXmlPath.toStdString() << "\n"
<< "DEM TIFF Path: " << demTiffPath.toStdString() << "\n"
<< "Land Cover Path: " << landConverPath.toStdString() << "\n"
<< "HH Sigma Path: " << HHSigmaPath.toStdString() << "\n"
<< "HV Sigma Path: " << HVSigmaPath.toStdString() << "\n"
<< "VH Sigma Path: " << VHSigmaPath.toStdString() << "\n"
<< "VV Sigma Path: " << VVSigmaPath.toStdString() << "\n"
<< "Trans AntPattern Path: " << TransAntPatternFilePath.toStdString() << "\n"
<< "Reception AntPattern Path: " << ReceiveAntPatternFilePath.toStdString() << "\n"
<< "Output Path: " << OutEchoPath.toStdString() << "\n"
<< "Simulation Task Name: " << simulationtaskName.toStdString() << "\n";
long cpucore_num = std::thread::hardware_concurrency();
RTPCProcessMain(cpucore_num, TransAntPatternFilePath, ReceiveAntPatternFilePath, simulationtaskName, OutEchoPath, GPSXmlPath, TaskXmlPath, demTiffPath, landConverPath, HHSigmaPath, HVSigmaPath, VHSigmaPath, VVSigmaPath);
}
void QImageSARRTPC::onBtnReject()
{
this->close();
}

View File

@ -0,0 +1,34 @@
#pragma once
#include <QMainWindow>
#include "ui_QImageSARRTPC.h"
class QImageSARRTPC : public QDialog
{
Q_OBJECT
public:
QImageSARRTPC(QWidget *parent = nullptr);
~QImageSARRTPC();
public slots:
void test();
void onpushButtonRPClieck();
void onpushButtonTPClieck();
void onpushButtonEchoClieck();
void onpushButtongpxmlClieck();
void onpushButtonTaskxmlClieck();
void onpushButtondemClieck();
void onpushButtonlandcoverClieck();
void onpushButtonHHSigma0Clieck();
void onpushButtonHVSigma0Clieck();
void onpushButtonVHSigma0Clieck();
void onpushButtonVVSigma0Clieck();
void onBtnaccept();
void onBtnReject();
private:
Ui::QImageSARRTPCClass ui;
};

View File

@ -0,0 +1,466 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QImageSARRTPCClass</class>
<widget class="QDialog" name="QImageSARRTPCClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>873</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Custom Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>853</width>
<height>451</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="9" column="0">
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>参考HH极化后向散射系数:</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>参考VH极化后向散射系数</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>仿真任务名称:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="receivePatternFilePathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="landCoverPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="outEchoPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="taskXmlPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>接收方向图:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="transformPatternFilePathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLineEdit" name="vhSigmaPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_1">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>发射方向图:</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QLineEdit" name="vvSigmaPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="demTiffPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>输出回波地址:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="hhSigmaPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_8">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>地表覆盖文件地址:</string>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_12">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>参考VV极化后向散射系数</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>参考HV极化后向散射系数</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="gpsXmlPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="hvSigmaPathEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>参考DEM 地址:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>GPS xml 地址:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="simulationTaskNameEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>任务 xml 地址:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButtonRP">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButtonTP">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="pushButtonEcho">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="pushButtongpxml">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QPushButton" name="pushButtonTaskxml">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QPushButton" name="pushButtondem">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QPushButton" name="pushButtonlandcover">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QPushButton" name="pushButtonHHSigma0">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="QPushButton" name="pushButtonHVSigma0">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="QPushButton" name="pushButtonVHSigma0">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="12" column="2">
<widget class="QPushButton" name="pushButtonVVSigma0">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,36 @@
#include "QToolAbstract.h"
QToolAbstract::QToolAbstract(QObject* parent)
:QObject(parent)
{
}
QToolAbstract::~QToolAbstract()
{
}
void QToolAbstract::setToolXpath(QVector<QString> intoolPath)
{
this->toolPath = intoolPath;
}
void QToolAbstract::setToolName(QString intoolname)
{
this->toolname = intoolname;
}
QVector<QString> QToolAbstract::getToolXpath()
{
return this->toolPath;
}
QString QToolAbstract::getToolName()
{
return this->toolname;
}
void QToolAbstract::excute()
{
}

View File

@ -0,0 +1,28 @@
#pragma once
#include <QTreeWidgetItem>
#include <QPushButton>
#include <QMessageBox>
#include <QDebug>
#include <QWidget>
#include <QItemDelegate>
#include <QString>
// ×Ô¶¨Òå QTreeWidgetItem ¼Ì³ÐÀà
class QToolAbstract : public QObject {
Q_OBJECT
public:
QToolAbstract(QObject* parent=nullptr);
~QToolAbstract();
public slots:
virtual void excute();
virtual void setToolXpath(QVector<QString> toolPath);
virtual void setToolName(QString toolname);
virtual QVector<QString> getToolXpath();
virtual QString getToolName();
public:
QVector<QString> toolPath;
QString toolname;
};

View File

@ -12,6 +12,7 @@
#include <QDir>
#include <QDatetime>
#include <omp.h>
#include <QProgressDialog>
#ifdef DEBUGSHOWDIALOG
@ -289,7 +290,6 @@ ErrorCode RTPCProcessCls::DEMPreprocess()
return ErrorCode::SUCCESS;
}
ErrorCode RTPCProcessCls::RTPCMainProcess(long num_thread)
{
omp_set_num_threads(num_thread);// 设置openmp 线程数量
@ -332,23 +332,25 @@ ErrorCode RTPCProcessCls::RTPCMainProcess(long num_thread)
outP=XYZ2LLA(InP);
antpos.get()[prf_id * 16 + 0] = prf_time + imageStarttime;
antpos.get()[prf_id * 16 + 1] = sateOirbtNode.Px;
antpos.get()[prf_id * 16 + 2] = sateOirbtNode.Py;
antpos.get()[prf_id * 16 + 3] = sateOirbtNode.Pz;
antpos.get()[prf_id * 16 + 4] = sateOirbtNode.Vx;
antpos.get()[prf_id * 16 + 5] = sateOirbtNode.Vy;
antpos.get()[prf_id * 16 + 6] = sateOirbtNode.Vz;
antpos.get()[prf_id * 16 + 7] = sateOirbtNode.AntDirecX;
antpos.get()[prf_id * 16 + 8] = sateOirbtNode.AntDirecY;
antpos.get()[prf_id * 16 + 9] = sateOirbtNode.AntDirecZ;
antpos.get()[prf_id * 16 + 10] = sateOirbtNode.AVx;
antpos.get()[prf_id * 16 + 11] = sateOirbtNode.AVy;
antpos.get()[prf_id * 16 + 12] = sateOirbtNode.AVz;
antpos.get()[prf_id * 16 + 13] = outP.lon;
antpos.get()[prf_id * 16 + 14] = outP.lat;
antpos.get()[prf_id * 16 + 15] = outP.ati;
antpos.get()[prf_id * 19 + 0] = prf_time + imageStarttime;
antpos.get()[prf_id * 19 + 1] = sateOirbtNode.Px;
antpos.get()[prf_id * 19 + 2] = sateOirbtNode.Py;
antpos.get()[prf_id * 19 + 3] = sateOirbtNode.Pz;
antpos.get()[prf_id * 19 + 4] = sateOirbtNode.Vx;
antpos.get()[prf_id * 19 + 5] = sateOirbtNode.Vy;
antpos.get()[prf_id * 19 + 6] = sateOirbtNode.Vz;
antpos.get()[prf_id * 19 + 7] = sateOirbtNode.AntDirecX;
antpos.get()[prf_id * 19 + 8] = sateOirbtNode.AntDirecY;
antpos.get()[prf_id * 19 + 9] = sateOirbtNode.AntDirecZ;
antpos.get()[prf_id * 19 + 10] = sateOirbtNode.AVx;
antpos.get()[prf_id * 19 + 11] = sateOirbtNode.AVy;
antpos.get()[prf_id * 19 + 12] = sateOirbtNode.AVz;
antpos.get()[prf_id * 19 + 13] = sateOirbtNode.zeroDopplerDirectX;
antpos.get()[prf_id * 19 + 14] = sateOirbtNode.zeroDopplerDirectY;
antpos.get()[prf_id * 19 + 15] = sateOirbtNode.zeroDopplerDirectZ;
antpos.get()[prf_id * 19 + 16] = outP.lon;
antpos.get()[prf_id * 19 + 17] = outP.lat;
antpos.get()[prf_id * 19 + 18] = outP.ati;
sateOirbtNodes[prf_id] = sateOirbtNode;
}
this->EchoSimulationData->saveAntPos(antpos);
@ -471,7 +473,18 @@ ErrorCode RTPCProcessCls::RTPCMainProcess(long num_thread)
#endif
//qDebug() << " pluse bolck size :\t " << pluseStep << " all size:\t" << this->PluseCount;
long processNumber = 0;
QProgressDialog progressDialog(u8"RTPC回波生成中", u8"终止", 0, this->PluseCount);
progressDialog.setWindowTitle(u8"RTPC回波生成中");
progressDialog.setWindowModality(Qt::WindowModal);
progressDialog.setAutoClose(true);
progressDialog.setValue(0);
progressDialog.setMaximum(this->PluseCount);
progressDialog.setMinimum(0);
progressDialog.show();
#pragma omp parallel for
for (long startprfidx = 0; startprfidx < this->PluseCount; startprfidx=startprfidx+ pluseStep) { // 17 + 0.3 MB
@ -692,13 +705,18 @@ ErrorCode RTPCProcessCls::RTPCMainProcess(long num_thread)
}
omp_set_lock(&lock); // 保存文件
processNumber = processNumber + pluseStep;
processNumber = processNumber < progressDialog.maximum() ? processNumber : progressDialog.maximum();
progressDialog.setValue(processNumber);
this->EchoSimulationData->saveEchoArr(echo ,0, PluseCount);
omp_unset_lock(&lock); // 解锁
qDebug() << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz") << " \t " << start_ids << "\t--\t " << start_ids + line_invert<<"\t/\t" << demxyz.height;
}
progressDialog.close();
}
omp_destroy_lock(&lock); // 销毁锁
this->EchoSimulationData->saveEchoArr(echo, 0, PluseCount);
this->EchoSimulationData->saveToXml();
return ErrorCode::SUCCESS;
}

View File

@ -77,6 +77,11 @@ void AbstractSatelliteOribtModel::setAntnnaAxisZ(double X, double Y, double Z)
{
}
ErrorCode AbstractSatelliteOribtModel::getZeroDopplerAntDirect(SatelliteOribtNode& node)
{
return ErrorCode();
}
ErrorCode AbstractSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode& node)
{
return ErrorCode::VIRTUALABSTRACT;

View File

@ -59,10 +59,16 @@ struct SatelliteOribtNode {
double AntDirecY;
double AntDirecZ;
double zeroDopplerDirectX; // 0 多普勒方向
double zeroDopplerDirectY;
double zeroDopplerDirectZ;
double beamAngle; // 波位角
double AzAngle;// 摆动角
};
@ -197,7 +203,7 @@ public: //
virtual void setAntnnaAxisX(double X,double Y,double Z); // 设置天线X轴指向
virtual void setAntnnaAxisY(double X, double Y, double Z); // 设置天线X轴指向
virtual void setAntnnaAxisZ(double X, double Y, double Z); // 设置天线X轴指向
virtual ErrorCode getZeroDopplerAntDirect(SatelliteOribtNode& node);// 获取0多普勒天线方向
virtual ErrorCode getAntnnaDirection( SatelliteOribtNode &node); // 获取天线指向方向
public:
virtual double getPt();

View File

@ -117,6 +117,11 @@ ErrorCode PolyfitSatelliteOribtModel::getSatelliteOribtNode(double& timeFromStar
return state;
} else {}
state = getZeroDopplerAntDirect(node);
if (state != ErrorCode::SUCCESS) {
return state;
}
else {}
return ErrorCode::SUCCESS;
}
@ -263,6 +268,35 @@ ErrorCode PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode& nod
return ErrorCode::SUCCESS;
}
ErrorCode PolyfitSatelliteOribtModel::getZeroDopplerAntDirect(SatelliteOribtNode& node)
{
// 1. 计算天线指向
Eigen::Vector3d axisZ0 = { -1 * node.Px ,-1 * node.Py,-1 * node.Pz }; // z 轴 --波位角为0时天线指向的反方向
Eigen::Vector3d axisX0 = { node.Vx ,node.Vy,node.Vz }; // x 轴 --飞行方向
Eigen::Vector3d axisY0 = axisZ0.cross(axisX0); // y 轴 --右手定则 -- 初始坐标系
double rotateAngle = this->RightLook ? -this->beamAngle : this->beamAngle; // 旋转角度 左逆时针theta , 右(顺时针): -theta
// 1.2. 根据波位角确定卫星绕X轴-飞行轴
Eigen::Matrix3d rotateMatrixBeam = rotationMatrix(axisX0, rotateAngle * d2r); // 旋转矩阵
axisZ0 = rotateMatrixBeam * axisZ0; // 旋转矩阵
axisY0 = rotateMatrixBeam * axisY0;
axisX0 = rotateMatrixBeam * axisX0;
// 1.3. 根据方位角确定卫星绕Y轴旋转
double azangle = 0;
Eigen::Matrix3d rotateMatrixAzAngle = rotationMatrix(axisY0, rotateAngle * d2r); // 旋转矩阵
axisZ0 = rotateMatrixAzAngle * axisZ0; // 旋转矩阵
axisY0 = rotateMatrixAzAngle * axisY0;
axisX0 = rotateMatrixAzAngle * axisX0;
// 1.4. 计算实际指向
node.zeroDopplerDirectX = axisZ0[0];
node.zeroDopplerDirectY = axisZ0[1];
node.zeroDopplerDirectZ = axisZ0[2];
return ErrorCode::SUCCESS;
}
void PolyfitSatelliteOribtModel::addOribtNode(SatelliteOribtNode node)
{
this->oribtNodes.push_back(node);

View File

@ -45,6 +45,7 @@ public: //
virtual void setAntnnaAxisZ(double X, double Y, double Z) override; // 设置天线X轴指向
virtual ErrorCode getAntnnaDirection(SatelliteOribtNode& node) override; // 获取天线指向方向
virtual ErrorCode getZeroDopplerAntDirect(SatelliteOribtNode& node) override;
private: // 变量
long double oribtStartTime; // 卫星模型参考时间
double beamAngle; // 波位角

View File

@ -13,7 +13,9 @@
/// <param name="antpos_ptr">ÎÀÐǹìµÀ×ø±ê</param>
/// <param name="echoArr">»Ø²¨¾ØÕó</param>
/// <param name="img_arr">ͼÏñ¾ØÕó</param>
void TBPImageGPUAlg(std::shared_ptr<float> antpos_ptr,std::shared_ptr<std::complex<float>> echoArr,std::shared_ptr<std::complex<float>> img_arr) {
void TBPImageGPUAlg(std::shared_ptr<float> antPx, std::shared_ptr<float> antPy, std::shared_ptr<float> antPz,
std::shared_ptr<float> antVx, std::shared_ptr<float> antVy, std::shared_ptr<float> antVz,
std::shared_ptr<std::complex<double>> echoArr,std::shared_ptr<std::complex<double>> img_arr) {

View File

@ -3,7 +3,6 @@
#include <QDateTime>
#include <QDebug>
#include <QString>
#include "ImageShowDialogClass.h"
#include <cmath>
void TBPImageProcess(QString echofile, QString outImageFolder, QString imagePlanePath,long num_thread)
@ -62,11 +61,16 @@ std::shared_ptr<SARSimulationImageL1Dataset> TBPImageAlgCls::getImageL0()
ErrorCode TBPImageAlgCls::Process(long num_thread)
{
return this->ProcessNoImagePlane(num_thread);
if (GPURUN) {
}
else {
return this->ProcessCPU(num_thread);
}
}
ErrorCode TBPImageAlgCls::ProcessNoImagePlane(long num_thread)
ErrorCode TBPImageAlgCls::ProcessCPU(long num_thread)
{
omp_set_num_threads(num_thread);
// ³£ÓòÎÊý
@ -95,7 +99,6 @@ ErrorCode TBPImageAlgCls::ProcessNoImagePlane(long num_thread)
echodata.reset();
}
Eigen::MatrixXd pixelX = Eigen::MatrixXd::Zero(rowCount, colCount);
Eigen::MatrixXd pixelY = Eigen::MatrixXd::Zero(rowCount, colCount);
Eigen::MatrixXd pixelZ = Eigen::MatrixXd::Zero(rowCount, colCount);
@ -230,6 +233,98 @@ ErrorCode TBPImageAlgCls::ProcessNoImagePlane(long num_thread)
this->L1ds->saveImageRaster(imagarr, 0, rowCount);
this->L1ds->saveToXml();
return ErrorCode::SUCCESS;
}
ErrorCode TBPImageAlgCls::ProcessGPU()
{
// 常用参数
long rowCount = this->L1ds->getrowCount();
long colCount = this->L1ds->getcolCount();
long pixelCount = rowCount * colCount;
long PRFCount = this->L0ds->getPluseCount();
long PlusePoints = this->L0ds->getPlusePoints();
double Rnear = this->L1ds->getNearRange();
double Rfar = this->L1ds->getFarRange();
double fs = this->L1ds->getFs();
double dx = LIGHTSPEED / 2 / fs;
double factorj = this->L1ds->getCenterFreq() * 4 * M_PI / LIGHTSPEED * 1e9;
std::shared_ptr<float> pixelX(new float[rowCount*colCount],delArrPtr);
std::shared_ptr<float> pixelY(new float[rowCount*colCount],delArrPtr);
std::shared_ptr<float> pixelZ(new float[rowCount*colCount],delArrPtr);
std::shared_ptr<float> Pxs (new float[this->L0ds->getPluseCount()]);
std::shared_ptr<float> Pys (new float[this->L0ds->getPluseCount()]);
std::shared_ptr<float> Pzs (new float[this->L0ds->getPluseCount()]);
std::shared_ptr<float> Vxs (new float[this->L0ds->getPluseCount()]);
std::shared_ptr<float> Vys (new float[this->L0ds->getPluseCount()]);
std::shared_ptr<float> Vzs (new float[this->L0ds->getPluseCount()]);
// 图像网格坐标
{
std::shared_ptr<double> antpos = this->L0ds->getAntPos();
double time = 0;
double Px = 0;
double Py = 0;
double Pz = 0;
double Vx = 0;
double Vy = 0;
double Vz = 0;
double AntDirectX = 0;
double AntDirectY = 0;
double AntDirectZ = 0;
double AVx = 0;
double AVy = 0;
double AVz = 0;
double R = 0;
double NormAnt = 0;
for (long i = 0; i < rowCount; i++) {
time = antpos.get()[i * 16 + 0];
Px = antpos.get()[i * 16 + 1];
Py = antpos.get()[i * 16 + 2];
Pz = antpos.get()[i * 16 + 3];
Vx = antpos.get()[i * 16 + 4];
Vy = antpos.get()[i * 16 + 5];
Vz = antpos.get()[i * 16 + 6];
AntDirectX = antpos.get()[i * 16 + 7];
AntDirectY = antpos.get()[i * 16 + 8];
AntDirectZ = antpos.get()[i * 16 + 9];
AVx = antpos.get()[i * 16 + 10];
AVy = antpos.get()[i * 16 + 11];
AVz = antpos.get()[i * 16 + 12];
NormAnt = std::sqrt(AntDirectX * AntDirectX + AntDirectY * AntDirectY + AntDirectZ * AntDirectZ);
AntDirectX = AntDirectX / NormAnt;
AntDirectY = AntDirectY / NormAnt;
AntDirectZ = AntDirectZ / NormAnt;// 归一化
antpos.get()[i * 16 + 7] = AntDirectX;
antpos.get()[i * 16 + 8] = AntDirectY;
antpos.get()[i * 16 + 9] = AntDirectZ;
for (long j = 0; j < colCount; j++) {
R = j * dx + Rnear;
}
}
this->L1ds->saveAntPos(antpos);
antpos.reset();
}
return ErrorCode::SUCCESS;
}

View File

@ -36,6 +36,7 @@ private:
std::shared_ptr<SARSimulationImageL1Dataset> L1ds;
std::shared_ptr < EchoL0Dataset> L0ds;
QString imagePlanePath;
bool GPURUN;
public:
void setImagePlanePath(QString imagePlanePath);
@ -51,10 +52,9 @@ public:
ErrorCode Process(long num_thread);
private:
ErrorCode ProcessImagePlane(long num_thread);
ErrorCode ProcessNoImagePlane(long num_thread);
ErrorCode ProcessCPU(long num_thread);
ErrorCode ProcessGPU();
};

View File

@ -1,10 +1,12 @@
#include "RasterProcessTool.h"
#include <QtWidgets/QApplication>
#include "RegisterToolbox.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
RasterProcessTool w;// Ö÷˝çĂć
w.show();
RasterProcessTool* w=new RasterProcessTool;// Ö÷½çÃæ
RegisterPreToolBox(w);
w->show();
return a.exec();
}