1. 添加泊松网格重建算法

2. 修改成像算法,单脉冲按照远近场公式校正振幅 R*near=far
pull/1/head
剑古敛锋 2024-05-29 15:34:47 +08:00
parent 0b4bfa44f5
commit 02254323c4
15 changed files with 6625 additions and 2061 deletions

View File

@ -401,7 +401,7 @@
<addaction name="actionPre_Window"/>
<addaction name="actionAttriutionDBShow"/>
<addaction name="actionImageShowTool"/>
<addaction name="actionRCShowTool"/>
<!--<addaction name="actionRCShowTool"/>-->
</widget>
<widget class="QMenu" name="menuGeometry">
<property name="title">

View File

@ -0,0 +1,409 @@
/**
* @file DialogPCLPoissonMesh.cpp
* @brief None
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 2024/4/5
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
// You may need to build the project (run Qt uic code generator) to get "ui_DialogPCLPoissonMesh.h"
// resolved
#include "DialogPCLPoissonMesh.h"
#include "ui_DialogPCLPoissonMesh.h"
#include "ModuleBase/ThreadTask.h"
#include "PythonModule/PyAgent.h"
#include "MeshData/meshSingleton.h"
#include "MeshData/meshSet.h"
#include <QMenu>
#include <QDebug>
#include <pcl/filters/statistical_outlier_removal.h>
#include <QtWidgets>
#include <QFileDialog>
#include <QFileInfo>
#include "MeshData/meshKernal.h"
#include "PointCloudOperator/PointCloudCommon.h"
#include "PointCloudOperator/PointCloudMesh.h"
#include "Settings/BusAPI.h"
#include "BaseTool.h"
#include "IO/IOConfig.h"
#include "ModuleBase/ThreadControl.h"
#include "ConfigOptions/ConfigOptions.h"
#include "ConfigOptions/MeshConfig.h"
#include "MeshData/meshSingleton.h"
#include "MeshData/meshKernal.h"
#include <vtkSmartPointer.h>
#include <vtkDataSetReader.h>
#include <vtkDataSet.h>
#include <vtkSTLReader.h>
#include <vtkTecplotReader.h>
#include <vtkMultiBlockDataSet.h>
#include <vtkAppendFilter.h>
#include <vtkUnstructuredGrid.h>
#include <vtkUnstructuredGridWriter.h>
#include <vtkAppendFilter.h>
#include <QFileInfo>
#include <QTextCodec>
#include <vtkSTLWriter.h>
#include "Common/DebugLogger.h"
#include <pcl/surface/poisson.h>
// auto meshData = MeshData::MeshData::getInstance();
namespace MainWidget {
DialogPCLPoissonMesh::DialogPCLPoissonMesh(GUI::MainWindow *parent)
: QFDialog(parent), _ui(new Ui::DialogPCLPoissonMesh), _mw(parent), _selectdlg(new DialogSelectComponents(parent)) {
_ui->setupUi(this);
_ui->geoSelectPoint->setToolTip(tr("Clicked Button Selected Components"));
setWindowTitle(tr("GP Meshing"));
_ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(_ui->geoSelectPoint, &QPushButton::clicked, [=]() {
_selectdlg->clearSelectItems();
_selectdlg->exec();
});
connect(_selectdlg, SIGNAL(selectedComponentsSig(QList<MeshData::MeshSet *>)), this,
SLOT(selectedComponentsSlot(QList<MeshData::MeshSet *>)));
connect(_ui->listWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this,
SLOT(customContextMenuRequestedSlot(const QPoint&)));
}
DialogPCLPoissonMesh::~DialogPCLPoissonMesh() {
delete _ui;
_ui = NULL;
delete _selectdlg;
_selectdlg = NULL;
}
void DialogPCLPoissonMesh::accept() {
if (_components.size() == 0)
return;
QString componentIds;
for (auto component: _components)
componentIds.append(QString(",%1").arg(component->getID()));
componentIds.remove(0, 1);
bool Confidence = _ui->Confidence->isChecked();
size_t Degree = _ui->Degree->value();
size_t Depth = _ui->Depth->value();
size_t IsoDivide = _ui->IsoDivide->value();
bool Manifold = _ui->Manifold->isChecked();
bool OutputPolygons = _ui->OutputPolygons->isChecked();
double SamplesPerNode = _ui->SamplesPerNode->value();
double Scale = _ui->Scale->value();
size_t SolverDivide = _ui->SolverDivide->value();
QString outfilename = "filter";
for (auto component: _components)
outfilename.append(QString("_%1").arg(component->getName()));
// 确定是否保存结果文件
QMessageBox::StandardButton result =
QMessageBox::critical(this, "info", "save as result ?");
QString filepath =
JoinPath(Setting::BusAPI::instance()->getWorkingDir(), outfilename + "_tmep.pcd");
QString AbFileName = filepath;
if (result == QMessageBox::StandardButton::Ok
|| result == QMessageBox::StandardButton::Yes) {
DebugInfo("outfilename ok ok \n");
QStringList suffixlist = IO::IOConfigure::getMeshExporters();
if (suffixlist.isEmpty()) {
QMessageBox::warning(this, tr("Warning"), tr("The MeshPlugin is not installed !"));
return;
}
QStringList meshsuffix = ConfigOption::ConfigOption::getInstance()
->getMeshConfig()
->getExportSuffix(ConfigOption::MeshDataType::vtkMesh)
.split(";");
QStringList list;
for (QString s: meshsuffix) {
for (int i = 0; i < suffixlist.size(); i++) {
QString suffix = suffixlist.at(i);
if (suffix.contains(s))
list.append(suffix);
}
}
std::sort(list.begin(), list.end());
QString suffixes = list.join(";;");
QString workDir = Setting::BusAPI::instance()->getWorkingDir();
QFileDialog dlg(this, tr("Export mesh"), workDir, suffixes);
dlg.setAcceptMode(QFileDialog::AcceptSave);
if (dlg.exec() != QFileDialog::FileName)
return;
QString aSuffix = dlg.selectedNameFilter();
QString aFileName = dlg.selectedFiles().join(",");
if (!(aFileName.isEmpty())) {
filepath = aFileName;
} else {
}
AbFileName = filepath;
} else { // 不保存成点云数据
}
DebugInfo("outfilename %s \n", AbFileName.toStdString().c_str());
// 启动线程
auto pclremesh = new WBFZ::PCLPoissonMesh(
AbFileName, WBFZ::PointCloudOperation::POINTCLOUD_MESH, _mainWindow, componentIds,
Confidence, Degree, Depth, IsoDivide, Manifold, OutputPolygons, SamplesPerNode, Scale,
SolverDivide);
ModuleBase::ThreadControl *tc = new ModuleBase::ThreadControl(pclremesh);
emit tc->threadStart(); // emit MSHwriter->start();
DebugInfo("tc overing %s \n", AbFileName.toStdString().c_str());
QFDialog::accept();
DebugInfo("QFDialog::accept() \n");
}
void DialogPCLPoissonMesh::selectedComponentsSlot(QList<MeshData::MeshSet *> components) {
for (MeshData::MeshSet *set: components) {
if (_components.contains(set))
continue;
_components.append(set);
_ui->listWidget->addItem(set->getName());
}
}
void DialogPCLPoissonMesh::customContextMenuRequestedSlot(const QPoint &point) {
QListWidgetItem *curItem = _ui->listWidget->itemAt(point);
if (!curItem)
return;
QMenu *menu = new QMenu(this);
QAction *deleteItem = new QAction(tr("delete this item"));
menu->addAction(deleteItem);
connect(menu, &QMenu::triggered, [=]() { removeCurrentItem(curItem); });
menu->exec(QCursor::pos());
}
void DialogPCLPoissonMesh::removeCurrentItem(QListWidgetItem *curItem) {
auto meshData = MeshData::MeshData::getInstance();
auto meshSet = meshData->getMeshSetByName(curItem->text());
if (!meshSet)
return;
_components.removeOne(meshSet);
_ui->listWidget->removeItemWidget(curItem);
delete curItem;
}
} // namespace MainWidget
namespace WBFZ {
PCLPoissonMesh::PCLPoissonMesh(const QString &fileName, WBFZ::PointCloudOperation operation,
GUI::MainWindow *mw, QString componentIds,
bool Confidence,
size_t Degree,
size_t Depth,
size_t IsoDivide,
bool Manifold,
bool OutputPolygons,
double SamplesPerNode,
double Scale,
size_t SolverDivide
)
: ModuleBase::ThreadTask(mw), _operation(operation), _fileName(fileName), _componentIds(componentIds)
,_Confidence(Confidence )
,_Degree(Degree )
,_Depth (Depth)
,_IsoDivide (IsoDivide)
,_Manifold(Manifold )
,_OutputPolygons(OutputPolygons )
,_SamplesPerNode(SamplesPerNode )
,_Scale (Scale)
,_SolverDivide(SolverDivide ) {
}
PCLPoissonMesh::~PCLPoissonMesh() {}
void PCLPoissonMesh::defaultMeshFinished() {
ModuleBase::ThreadTask::threadTaskFinished();
Py::PythonAgent::getInstance()->unLock();
if (_threadRuning) {
QString information{};
ModuleBase::Message msg;
if (_operation == POINTCLOUD_FILTER || _operation == POINTCLOUD_MESH) {
if (_success) {
information = QString("Successful resurface Mesh From \"%1\"").arg(_fileName);
msg.type = Common::Message::Normal;
msg.message = information;
qDebug() << "Successful Import Mesh From " << _fileName;
QFileInfo info(_fileName);
QString name = info.fileName();
QString path = info.filePath();
QString suffix = info.suffix().toLower();
if(info.exists()){
if(suffix.toLower().contains("stl")){
suffix="STL(*.stl)";
emit _mainwindow->importMeshSIGN(_fileName,suffix,-1);
}else if(suffix.toLower().contains("vtk")){
suffix="VTK(*.vtk)";
emit _mainwindow->importMeshSIGN(_fileName,suffix,-1);
}else if(suffix.toLower().contains("neu")){
suffix="Gambit(*.neu)";
emit _mainwindow->importMeshSIGN(_fileName,suffix,-1);
}else{
information = QString("Failed Filter From \"%1\"").arg(_fileName);
msg.type = Common::Message::Error;
msg.message = information;
qDebug() << "Failed Import Mesh From " << _fileName;
}
}
} else {
information = QString("Failed resurface From \"%1\"").arg(_fileName);
msg.type = Common::Message::Error;
msg.message = information;
qDebug() << "Failed resurface Mesh From " << _fileName;
}
} else {
}
emit showInformation(information);
emit _mainwindow->printMessageToMessageWindow(msg);
}
qDebug()<<"PCLPoissonMesh::defaultMeshFinished ModuleBase::ThreadTask::threadTaskFinished";
// Py::PythonAgent::getInstance()->unLock();
}
void PCLPoissonMesh::setThreadRunState(bool flag) {
_success = flag;
}
void PCLPoissonMesh::run() {
ModuleBase::ThreadTask::run();
bool result = false;
switch (_operation) {
case POINTCLOUD_MESH:
emit showInformation(tr("POINTCLOUD_MESH From \"%1\"").arg(_fileName));
result = remeshtaskProcess();
setThreadRunState(result);
break;
default:
break;
}
DebugInfo("run ok _success %d _threadRuning %d \n", _success, _threadRuning);
defaultMeshFinished();
}
bool PCLPoissonMesh::remeshtaskProcess() {
QString componentIds = _componentIds;
emit _mainwindow->printMessage(Common::Message::Normal, "PCLPoissonMeshAlg");
// 获取vtdataset
QStringList qCompontIds = QString(componentIds).split(',');
MeshData::MeshSet* meshSet = NULL;
MeshData::MeshKernal* meshKernal = NULL;
MeshData::MeshData* meshData = MeshData::MeshData::getInstance();
QString kernalName, transformedName, setType, ids;
// 创建 vtkCellDataToPointData 过滤器
vtkSmartPointer<vtkGeometryFilter> cellToPointFilter = vtkSmartPointer<vtkGeometryFilter>::New();
vtkSmartPointer<vtkPolyData> inpolyData=vtkSmartPointer<vtkPolyData>::New();
vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();
for (QString compontId: qCompontIds) {
meshSet = meshData->getMeshSetByID(compontId.toInt());
DebugInfo("point count %d : %d \n", compontId.toInt(), meshSet == nullptr);
if (!meshSet)
continue;
QString outfilename = meshSet->getName();
cellToPointFilter->SetInputData(PointCloudOperator::PointCloudCommon::meshSetToVtkDataset(meshSet));
DebugInfo("point count %d \n", compontId.toInt());
}
// 执行过滤操作
cellToPointFilter->Update();
DebugInfo("cellToPointFilter \n");
// 获取过滤后的 vtkPolyData
inpolyData = cellToPointFilter->GetOutput();
qDebug()<<inpolyData->GetNumberOfCells();
qDebug()<<inpolyData->GetNumberOfPoints();
if(PointCloudOperator::PointCloudMeshOperator::PoissonMesh(inpolyData,polydata, _Confidence, _Degree, _Depth, _IsoDivide, _Manifold,
_OutputPolygons, _SamplesPerNode, _Scale, _SolverDivide)) {
}else{
return false;
}
DebugInfo("PCLPoissonMeshAlg successfully!! wait for writing file dataset : %d \n",nullptr==polydata);
if(nullptr!=polydata){
DebugInfo("PCLPoissonMeshAlg successfully!! wait for writing file dataset : %d %d\n",polydata->GetNumberOfPoints(),polydata->GetNumberOfCells());
}
QString filepath = _fileName;
QFile outfile_presave(_fileName);
if (outfile_presave.exists()) { // 如果存在文件,就删除
outfile_presave.remove();
}
// 手动释放所有的变量
//return false;
{ // 写出到文件中
// 加载文件
QFileInfo info(filepath);
QString name = info.fileName();
QString path = info.filePath();
QString suffix = info.suffix().toLower();
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(filepath);
std::string outFileName = ba.data();
DebugInfo("writing %s suffix %s !! \n", ba.data(), suffix.toStdString().c_str());
if(suffix == "vtk") {
vtkSmartPointer<vtkUnstructuredGridWriter> writer =
vtkSmartPointer<vtkUnstructuredGridWriter>::New();
writer->SetInputData(polydata);
writer->SetFileTypeToBinary();
writer->SetFileName(ba);
writer->Write();
DebugInfo("writing vtk !! \n");
} else if(suffix == "stl") {
QTextCodec* codec = QTextCodec::codecForName("GB18030");
QByteArray ba = codec->fromUnicode(_fileName);
vtkSmartPointer<vtkSTLWriter> writer = vtkSmartPointer<vtkSTLWriter>::New();
writer->SetInputData(polydata);
writer->SetFileTypeToBinary();
writer->SetFileName(ba);
writer->Write();
DebugInfo("writing stl !! \n");
} else {
}
}
DebugInfo("dataset %d _fileName %s \n", nullptr==polydata, _fileName.toStdString().c_str());
if (nullptr == polydata) { } else {
DebugInfo("GP variable start release !! \n");
//dataset->Delete();
//dataset=nullptr;
DebugInfo("GP variable finish release!! \n");
}
QFile outfile(_fileName);
if (outfile.exists()) {
DebugInfo("GP main process sucessfully !! \n");
return true;
} else {
DebugInfo("GP main process fail !! \n");
return false;
}
DebugInfo("GP main process fail !! \n");
return false;
}
} // namespace WBFZ

View File

@ -0,0 +1,108 @@
/**
* @file DialogPCLPoissonMesh.h
* @brief
* @author (3045316072@qq.com)
* @version 2.5.0
* @date 2024/4/5
* @copyright Copyright (c) Since 2024 All rights reserved.
*/
#ifndef LAMPCAE_DialogPCLPoissonMesh_H
#define LAMPCAE_DialogPCLPoissonMesh_H
#include <vtkPolyData.h>
#include "WBFZExchangePluginAPI.h"
#include "SelfDefObject/QFDialog.h"
#include "MainWidgets/DialogVTKTransform.h"
#include "PointCloudThreadBase.h"
#include "MainWindow/MainWindow.h"
#include "MainWindow/SubWindowManager.h"
namespace WBFZ{
class PointCloudThreadBase;
}
class QListWidgetItem;
namespace Ui
{
class DialogPCLPoissonMesh;
}
namespace MeshData
{
class MeshSet;
}
namespace GUI
{
class MainWindow;
class SubWindowManager;
}
namespace WBFZ{
class PCLPoissonMesh : public ModuleBase::ThreadTask
{
public:
PCLPoissonMesh(const QString& fileName, WBFZ::PointCloudOperation operation,
GUI::MainWindow* mw, QString componentIds, bool Confidence, size_t Degree,
size_t Depth, size_t IsoDivide, bool Manifold, bool OutputPolygons,
double SamplesPerNode, double Scale, size_t SolverDivide);
~PCLPoissonMesh();
public:
virtual void run();
void defaultMeshFinished();
void setThreadRunState(bool);
bool remeshtaskProcess();
// vtkDataSet* remesh() ;
// vtkDataSet* DialogPCLPoissonMeshAlg(QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
private:
bool _success{false};
QString _fileName;
PointCloudOperation _operation;
QString _componentIds;
bool _Confidence; //是否使用法向量的大小作为置信信息。如果false所有法向量均归一化。
size_t _Degree; //设置参数degree[1,5],值越大越精细,耗时越久。
size_t _Depth; //树的最大深度求解2^d x 2^d x 2^d立方体元。由于八叉树自适应采样密度指定值仅为最大深度。
size_t _IsoDivide; //用于提取ISO等值面的算法的深度
bool _Manifold; //是否添加多边形的重心,当多边形三角化时。 设置流行标志如果设置为true则对多边形进行细分三角话时添加重心设置false则不添加
bool _OutputPolygons; //是否输出多边形网格(而不是三角化移动立方体的结果)
double _SamplesPerNode; //设置落入一个八叉树结点中的样本点的最小数量。无噪声,[1.0-5.0],有噪声[15.-20.]平滑
double _Scale; //设置用于重构的立方体直径和样本边界立方体直径的比率。
size_t _SolverDivide; //设置求解线性方程组的Gauss-Seidel迭代方法的深度
};
}
namespace MainWidget {
class DialogSelectComponents;
class DialogPCLPoissonMesh : public QFDialog {
Q_OBJECT
public:
DialogPCLPoissonMesh(GUI::MainWindow* parent);
~DialogPCLPoissonMesh() ;
private:
void removeCurrentItem(QListWidgetItem* curItem);
signals: // 这里采用信号来直接与 主界面通信,避免参数浪费
void excuteAlg( QString componentIds , double SearchRadius, double Mu,int MaximumNearestNeighbors,double MaximumSurfaceAngle,double MaximumAngle,double MinimumAngle);
private slots:
virtual void accept();
void selectedComponentsSlot(QList<MeshData::MeshSet*> components);
void customContextMenuRequestedSlot(const QPoint& point);
private:
GUI::MainWindow* _mw;
DialogSelectComponents* _selectdlg;
QList<MeshData::MeshSet*> _components;
private:
Ui::DialogPCLPoissonMesh* _ui;
};
} // namespace MainWidget
#endif // LAMPCAE_DialogPCLPoissonMesh_H

View File

@ -0,0 +1,415 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogPCLPoissonMesh</class>
<widget class="QDialog" name="DialogPCLPoissonMesh">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>803</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>673</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>DialogPCLPoissonMesh</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="0">
<widget class="QDialogButtonBox" name="btBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>357</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>400</height>
</size>
</property>
<property name="title">
<string>params</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<widget class="QLabel" name="SearchRadiusLabel">
<property name="minimumSize">
<size>
<width>91</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>设置参数degree[1,5],值越大越精细,耗时越久</string>
</property>
<property name="text">
<string>Degree : </string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="MuLabel">
<property name="minimumSize">
<size>
<width>91</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>树的最大深度求解2^d x 2^d x 2^d立方体元。由于八叉树自适应采样密度指定值仅为最大深度。</string>
</property>
<property name="text">
<string>Depth : </string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QDoubleSpinBox" name="SamplesPerNode">
<property name="minimumSize">
<size>
<width>238</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>238</width>
<height>25</height>
</size>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>20.000000000000000</double>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="MaximumNearestNeighborsLabel">
<property name="minimumSize">
<size>
<width>91</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>用于提取ISO等值面的算法的深度</string>
</property>
<property name="text">
<string>IsoDivide : </string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QDoubleSpinBox" name="Scale">
<property name="maximum">
<double>99999.990000000005239</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="OutputPolygons">
<property name="toolTip">
<string>是否输出多边形网格(而不是三角化移动立方体的结果)</string>
</property>
<property name="text">
<string>OutputPolygons </string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="IsoDivide">
<property name="minimumSize">
<size>
<width>238</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>238</width>
<height>25</height>
</size>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="stepType">
<enum>QAbstractSpinBox::DefaultStepType</enum>
</property>
<property name="value">
<number>8</number>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_2">
<property name="toolTip">
<string>设置求解线性方程组的Gauss-Seidel迭代方法的深度</string>
</property>
<property name="text">
<string>SolverDivide</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="Manifold">
<property name="toolTip">
<string>是否添加多边形的重心,当多边形三角化时。 设置流行标志如果设置为true则对多边形进行细分三角话时添加重心设置false则不添加</string>
</property>
<property name="text">
<string>Manifold</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="MinimumAngleLabel">
<property name="minimumSize">
<size>
<width>91</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>25</height>
</size>
</property>
<property name="toolTip">
<string>设置落入一个八叉树结点中的样本点的最小数量。无噪声,[1.0-5.0],有噪声[15.-20.]平滑</string>
</property>
<property name="text">
<string>SamplesPerNode : </string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label">
<property name="toolTip">
<string>设置用于重构的立方体直径和样本边界立方体直径的比率</string>
</property>
<property name="text">
<string>Scale </string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="Confidence">
<property name="toolTip">
<string>是否使用法向量的大小作为置信信息。如果false所有法向量均归一化。</string>
</property>
<property name="text">
<string>Confidence</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="Degree">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>5</number>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="Depth">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10</number>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QSpinBox" name="SolverDivide">
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>8</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_4">
<property name="minimumSize">
<size>
<width>357</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>300</height>
</size>
</property>
<property name="title">
<string>Selected Component</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0" rowspan="2">
<widget class="QListWidget" name="listWidget">
<property name="minimumSize">
<size>
<width>299</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>550</width>
<height>500</height>
</size>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="geoSelectPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolTip">
<string extracomment="Clicked Button Selected Components"/>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../qrc/qianfan.qrc">
<normaloff>:/QUI/geometry/selectface.png</normaloff>:/QUI/geometry/selectface.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../qrc/qianfan.qrc"/>
</resources>
<connections>
<connection>
<sender>btBox</sender>
<signal>accepted()</signal>
<receiver>DialogPCLPoissonMesh</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>299</x>
<y>688</y>
</hint>
<hint type="destinationlabel">
<x>299</x>
<y>365</y>
</hint>
</hints>
</connection>
<connection>
<sender>btBox</sender>
<signal>rejected()</signal>
<receiver>DialogPCLPoissonMesh</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>299</x>
<y>688</y>
</hint>
<hint type="destinationlabel">
<x>299</x>
<y>365</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -185,8 +185,8 @@ TopoDS_Shape FEKOBase::SatellitePos2FEKOAntPos(SatelliteState satepos, double in
}
}
// qDebug() << u8"// 2. 根据方位角与俯仰角,调整雷达姿态 --- 此步确定 Y 轴已经调整完毕 ";
// qDebug() << u8"// 2. a 根据 incidenceAngle 调整 Z
// 2. 根据方位角与俯仰角,调整雷达姿态 --- 此步确定 Y 轴已经调整完毕 ";
// 2. a 根据 incidenceAngle 调整 Z
// 的指向,需要先根据左右视判断出雷达照射方向";
{ // 按照 Y 轴进行计算
@ -284,9 +284,9 @@ FEKOBase::NearFieldEchoCSVParser::~NearFieldEchoCSVParser() {}
bool FEKOBase::NearFieldEchoCSVParser::checkPRFModel()
{
qDebug() << u8"正在检查是否可以采用脉冲计数模式 configuration Name PRF_{脉冲计数}";
qDebug() << u8"正在检查是否可以采用脉冲计数模式 configuration Name {发射极化}_PRF_{脉冲计数}";
QRegExp regex("(\\d+)");
QRegExp regex("(\\d+)"); // 提取数字
// 判断是否需要按照脉冲次序排序
bool usePRFbool = true;
QMap<QString, size_t> configName_prfidx;
@ -1438,8 +1438,6 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
const size_t frepoints = echoData.cols();
Eigen::MatrixXcd factorj = Eigen::MatrixXcd::Zero(1, echoData.cols()); // 1 , freqs
if(EchoMode == FEKOBase::FARFIELD) { // 远场模式只有 ISAR 与 圆迹成像模式启动
}
factorj =
freqmatrix.array().cast<std::complex<double>>().array() * j * 4 * M_PI / c; // 声明校正矩阵
@ -1460,107 +1458,19 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
Eigen::MatrixXd normw = WINDOWFun(echoData, winfun);
#endif
if(EchoMode == FEKOBase::FARFIELD) { // 远场模式只有 ISAR 与 圆迹成像模式启动
/*
* if flag == 1
* Mat_Freq = data.Freq*ones(1,data.Na);
* data.phdata = data.phdata.*exp(1j*4*pi/c*Mat_Freq.*data.r); %
* data.R0 = data.r; end
**/
Eigen::MatrixXd Mat_Freq = Eigen::MatrixXd::Ones(PRFCount, frepoints);
for(size_t i = 0; i < frepoints; i++) {
Mat_Freq.col(i) =
Mat_Freq.col(i).array() * freqmatrix(0, i); // freqmatrix : 1, echoData.cols()
}
echoData =
(Mat_Freq.array().cast<std::complex<double>>().array() * j * 4 * M_PI / c).exp().array()
* (echoData.array());
{ // 适用于近场成像 ,只有 ISAR 与 圆迹SAR 适用于远场
#ifdef __IMAGEPARALLEL
#pragma omp parallel for
for(long ii = 0; ii < image_height; ii++) {
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算 ok
im_R = im_R.array() - CIRCLESARREFRANGE;
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
}
#else
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(long ii = 0; ii < image_height; ii++) {
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算
im_R = im_R.array() - CIRCLESARREFRANGE; //
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
#ifdef __SHOWPROCESS
progressDialog.setValue(ii);
#endif
}
#endif
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
im_final = im_final.array() / (normw.array().sum());
#endif
} else { // 适用于近场成像
#ifdef __IMAGEPARALLEL
#pragma omp parallel for
for(long ii = 0; ii < image_height; ii++) {
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算 ok
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
}
#else
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(long ii = 0; ii < image_height; ii++) {
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
@ -1572,8 +1482,11 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#ifdef __PRFPLUSECORRECT_R_
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()*im_R(tt, 0) ).sum(); // 对每个脉冲校正求和
#else
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#endif
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
@ -1581,7 +1494,7 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
progressDialog.setValue(ii);
#endif
}
#endif
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
im_final = im_final.array() / (normw.array().sum());
@ -1967,30 +1880,12 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算 ok
im_R = im_R.array() - CIRCLESARREFRANGE;
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
}
#else
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(long ii = 0; ii < image_height; ii++) {
#endif
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
@ -2002,8 +1897,11 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#ifdef __PRFPLUSECORRECT_R_
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()*im_R(tt, 0) ).sum(); // 对每个脉冲校正求和
#else
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#endif
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
@ -2011,42 +1909,25 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
progressDialog.setValue(ii);
#endif
}
#endif
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
im_final = im_final.array() / (normw.array().sum());
#endif
} else { // 适用于近场成像
}
else { // 适用于近场成像
#ifdef __IMAGEPARALLEL
#pragma omp parallel for
for(long ii = 0; ii < image_height; ii++) {
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算 ok
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
}
#else
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(long ii = 0; ii < image_height; ii++) {
#endif
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
@ -2058,8 +1939,12 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#ifdef __PRFPLUSECORRECT_R_
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()*im_R(tt, 0) ).sum(); // 对每个脉冲校正求和
#else
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#endif
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
@ -2067,7 +1952,6 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
progressDialog.setValue(ii);
#endif
}
#endif
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
im_final = im_final.array() / (normw.array().sum());
@ -2173,30 +2057,12 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算 ok
im_R = im_R.array() - CIRCLESARREFRANGE;
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
}
#else
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(long ii = 0; ii < image_height; ii++) {
#endif
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
@ -2208,8 +2074,11 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#ifdef __PRFPLUSECORRECT_R_
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()*im_R(tt, 0) ).sum(); // 对每个脉冲校正求和
#else
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#endif
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
@ -2217,42 +2086,26 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
progressDialog.setValue(ii);
#endif
}
#endif
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
im_final = im_final.array() / (normw.array().sum());
#endif
} else { // 适用于近场成像
}
else { // 适用于近场成像
#ifdef __IMAGEPARALLEL
#pragma omp parallel for
for(long ii = 0; ii < image_height; ii++) {
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
+ (antPos.col(2).array() - Z(ii, jj)).array().pow(2))
.array()
.sqrt()
.array(); // 获取目标到天线矩阵 计算 ok
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
}
#else
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
for(long ii = 0; ii < image_height; ii++) {
#endif
for(size_t jj = 0; jj < image_width; jj++) {
im_R.col(0) = ((antPos.col(0).array() - X(ii, jj)).array().pow(2)
+ (antPos.col(1).array() - Y(ii, jj)).array().pow(2)
@ -2264,8 +2117,11 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
// im_R PRF_count x 1
for(size_t tt = 0; tt < PRFCount; tt++) {
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
pluse_R(tt, 0) =
(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#ifdef __PRFPLUSECORRECT_R_
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()*im_R(tt, 0) ).sum(); // 对每个脉冲校正求和
#else
pluse_R(tt, 0) =(echoData.row(tt).array() * term_R.array()).sum(); // 对每个脉冲校正求和
#endif
}
im_final(ii, jj) = pluse_R.array().sum(); // 计算图像
}
@ -2273,7 +2129,7 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
progressDialog.setValue(ii);
#endif
}
#endif
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
im_final = im_final.array() / (normw.array().sum());

View File

@ -291,7 +291,7 @@ void FEKOBase::FEKOSimulationSARClass::saveFEKOImageSettingXML() {
qDebug() << "finish save fekoSimulation xml file.";
}
QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfidx, size_t endprfidx,QString cfxName) {
QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfidx, size_t endprfidx,QString cfxName,FEKOBase::TRANSLATIONPOLARTYPE polartype) {
if (this->simulationparams->startfreq > 1e6) {
@ -301,6 +301,14 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
this->simulationparams->endfreq = this->simulationparams->endfreq / 1e9;
}
QString polarTranslationflag="";
if(polartype==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
polarTranslationflag="VT";
}else if(polartype==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
polarTranslationflag="HT";
}else{
polarTranslationflag="VT";
}
QString luascript = QString(u8"--- create feko task :%1\n--- mode:%2\n\n").arg(this->simulationparams->taskName).arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode));
luascript = luascript + QString(u8"--runbat example : cadfeko trihedral.cfx --non-interactive --run-script trihedral.lua \n");
luascript = luascript + QString(u8"-- create strip pulse \n");
@ -310,7 +318,14 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8"app=cf.GetApplication()\n");
luascript = luascript + QString(u8"project=app.Project --- get current project\n");
luascript = luascript + QString(u8"farFieldData = project.FieldDataList:AddFarFieldData(\"%1\",%2,%3) -- farField Gains\n").arg(this->simulationparams->AntennaRadiationFileName).arg(QString::number(this->simulationparams->farsource_thetaPoints)).arg(QString::number(this->simulationparams->farsource_phiPoints));
if(polartype==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
luascript = luascript + QString(u8"farFieldData = project.FieldDataList:AddFarFieldData(\"%1\",%2,%3) -- farField Gains\n").arg(this->simulationparams->AntennaRadiationFileName).arg(QString::number(this->simulationparams->farsource_thetaPoints)).arg(QString::number(this->simulationparams->farsource_phiPoints));
}else if(polartype==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
luascript = luascript + QString(u8"farFieldData = project.FieldDataList:AddFarFieldData(\"%1\",%2,%3) -- farField Gains\n").arg(this->simulationparams->AntennaRadiationFileNameH).arg(QString::number(this->simulationparams->farsource_thetaPointsH)).arg(QString::number(this->simulationparams->farsource_phiPointsH));
}else{
luascript = luascript + QString(u8"farFieldData = project.FieldDataList:AddFarFieldData(\"%1\",%2,%3) -- farField Gains\n").arg(this->simulationparams->AntennaRadiationFileName).arg(QString::number(this->simulationparams->farsource_thetaPoints)).arg(QString::number(this->simulationparams->farsource_phiPoints));
}
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8"--const values\n");
luascript = luascript + QString(u8"local pi=3.141592653589793238462643383279\n");
@ -334,60 +349,63 @@ QString FEKOBase::FEKOSimulationSARClass::createLuaSciptString(size_t startprfid
luascript = luascript + QString(u8"--- local ant_phi_delta= 3/2800 -- 这里调整步进增量为\n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8"--- PRF POint Setting --- \n");
// ------------------------------------------ 参数设置 ------------------------
for (size_t i = startprfidx; i < this->FEKOAntPoselist.size() && i < endprfidx; i++) {
FEKOBase::FEKOSatelliteParams temp = this->FEKOAntPoselist[i];
QString prf_id = QString::number(QString::number(temp.PRFidx).toInt());
luascript = luascript + QString(u8" ---------------------\"PRF_%1\" start -------------------------------------------------\n").arg(prf_id);
luascript = luascript + QString(u8" PRF_phi=%1 --- 天线照射方向\n").arg(QString::number(temp.antpos.phi));
luascript = luascript + QString(u8" PRF_theta=%1 --- 入射角\n").arg(QString::number(temp.antpos.theta));
luascript = luascript + QString(u8" temp_standardConfiguration = project.SolutionConfigurations:AddStandardConfiguration()\n");
luascript = luascript + QString(u8" temp_standardConfiguration.Label=\"PRF_%1\" -- set standardConfiguration label PRF Count\n").arg(prf_id);
luascript = luascript + QString(u8" --- set frequency\n"); // 设置频率
luascript = luascript + QString(u8" frequencyRange=temp_standardConfiguration.Frequency\n");
luascript = luascript + QString(u8" properties = frequencyRange:GetProperties()\n");
luascript = luascript + QString(u8" properties.RangeType = cf.Enums.FrequencyRangeTypeEnum.LinearSpacedDiscrete\n");
luascript = luascript + QString(u8" properties.Start = f1 -- start\n");
luascript = luascript + QString(u8" properties.End=f2 --end \n");
luascript = luascript + QString(u8" properties.NumberOfDiscreteValues=freq_num -- freq_num\n");
luascript = luascript + QString(u8" frequencyRange:SetProperties(properties)\n");
luascript = luascript + QString(u8" -- set Source\n");
luascript = luascript + QString(u8" farFieldSource = temp_standardConfiguration.Sources:AddFarFieldSource(farFieldData)\n"); // 设置发射源
luascript = luascript + QString(u8" farFieldSource.Label=\"FarSource_PRF_%1\"\n").arg(prf_id);
luascript = luascript + QString(u8" farFieldSource.Position.U=%1\n").arg(QString::number(temp.antpos.x));
luascript = luascript + QString(u8" farFieldSource.Position.V=%1\n").arg(QString::number(temp.antpos.y));
luascript = luascript + QString(u8" farFieldSource.Position.N=%1\n").arg(QString::number(temp.antpos.z));
luascript = luascript + QString(u8" farFieldSource.Theta=PRF_theta\n");
luascript = luascript + QString(u8" farFieldSource.Phi=PRF_phi\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane=farFieldSource.LocalWorkplane\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.X=0 -- move reference Point\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.Y=0\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.Z=0 \n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8" -- set nearfield\n");
luascript = luascript + QString(u8" temp_nearFieldRequest=temp_standardConfiguration.NearFields:AddSpherical(%1,%2,%3,%4,%5,%6,1,1,1) -- nearfield \n").arg(QString::number(0)).arg(QString::number(temp.antpos.theta)).arg(QString::number(temp.antpos.phi)).arg(QString::number(0)).arg(QString::number(temp.antpos.theta)).arg(QString::number(temp.antpos.phi)); // 设置接收点
luascript = luascript + QString(u8" temp_nearFieldRequest.Label=\"NearField_PRF_%1\"\n").arg(prf_id);
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane=temp_nearFieldRequest.LocalWorkplane\n");
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.X=%1\n").arg(QString::number(temp.antpos.x));
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.Y=%1\n").arg(QString::number(temp.antpos.y));
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.Z=%1\n").arg(QString::number(temp.antpos.z));
luascript = luascript + QString(u8" -- set nearfieldAdavance\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance=temp_nearFieldRequest.Advanced\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.CalculationType=cf.Enums.NearFieldCalculationTypeEnum.Fields\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.CalculateElectricFields=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.CalculateMagneticFields=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.ExportSettings.ASCIIEnabled=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.ExportSettings.OutFileEnabled=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.OnlyScatteredPartCalculationEnabled=true \n");
luascript = luascript + QString(u8" \n");
luascript = luascript + QString(u8" \n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8" -- \n");
luascript = luascript + QString(u8" print(\"PRF_%1\")\n").arg(prf_id);
luascript = luascript + QString(u8" ---------------------\"PRF_%1\" end -------------------------------------------------\n").arg(prf_id);
luascript = luascript + QString(u8"\n");
}
{
// ------------------------------------------ 参数设置 ------------------------
for (size_t i = startprfidx; i < this->FEKOAntPoselist.size() && i < endprfidx; i++) {
FEKOBase::FEKOSatelliteParams temp = this->FEKOAntPoselist[i];
QString prf_id = QString::number(QString::number(temp.PRFidx).toInt());
luascript = luascript + QString(u8" ---------------------\"%1_PRF_%2\" start polarangle do not rotation -------------------------------------------------\n").arg(polarTranslationflag).arg(prf_id);
luascript = luascript + QString(u8" PRF_phi=%1 --- 天线照射方向\n").arg(QString::number(temp.antpos.phi));
luascript = luascript + QString(u8" PRF_theta=%1 --- 入射角\n").arg(QString::number(temp.antpos.theta));
luascript = luascript + QString(u8" temp_standardConfiguration = project.SolutionConfigurations:AddStandardConfiguration()\n");
luascript = luascript + QString(u8" temp_standardConfiguration.Label=\"%1_PRF_%2\" -- set standardConfiguration label PRF Count\n").arg(polarTranslationflag).arg(prf_id);
luascript = luascript + QString(u8" --- set frequency\n"); // 设置频率
luascript = luascript + QString(u8" frequencyRange=temp_standardConfiguration.Frequency\n");
luascript = luascript + QString(u8" properties = frequencyRange:GetProperties()\n");
luascript = luascript + QString(u8" properties.RangeType = cf.Enums.FrequencyRangeTypeEnum.LinearSpacedDiscrete\n");
luascript = luascript + QString(u8" properties.Start = f1 -- start\n");
luascript = luascript + QString(u8" properties.End=f2 --end \n");
luascript = luascript + QString(u8" properties.NumberOfDiscreteValues=freq_num -- freq_num\n");
luascript = luascript + QString(u8" frequencyRange:SetProperties(properties)\n");
luascript = luascript + QString(u8" -- set Source\n");
luascript = luascript + QString(u8" farFieldSource = temp_standardConfiguration.Sources:AddFarFieldSource(farFieldData)\n"); // 设置发射源
luascript = luascript + QString(u8" farFieldSource.Label=\"FarSource_%1_PRF_%2\"\n").arg(polarTranslationflag).arg(prf_id);
luascript = luascript + QString(u8" farFieldSource.Position.U=%1\n").arg(QString::number(temp.antpos.x));
luascript = luascript + QString(u8" farFieldSource.Position.V=%1\n").arg(QString::number(temp.antpos.y));
luascript = luascript + QString(u8" farFieldSource.Position.N=%1\n").arg(QString::number(temp.antpos.z));
luascript = luascript + QString(u8" farFieldSource.Theta=PRF_theta\n");
luascript = luascript + QString(u8" farFieldSource.Phi=PRF_phi\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane=farFieldSource.LocalWorkplane\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.X=0 -- move reference Point\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.Y=0\n");
luascript = luascript + QString(u8" temp_farFieldSource_workplane.Origin.Z=0 \n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8" -- set nearfield\n");
luascript = luascript + QString(u8" temp_nearFieldRequest=temp_standardConfiguration.NearFields:AddSpherical(%1,%2,%3,%4,%5,%6,1,1,1) -- nearfield \n").arg(QString::number(0)).arg(QString::number(temp.antpos.theta)).arg(QString::number(temp.antpos.phi)).arg(QString::number(0)).arg(QString::number(temp.antpos.theta)).arg(QString::number(temp.antpos.phi)); // 设置接收点
luascript = luascript + QString(u8" temp_nearFieldRequest.Label=\"NearField_%1_PRF_%2\"\n").arg(polarTranslationflag).arg(prf_id);
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane=temp_nearFieldRequest.LocalWorkplane\n");
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.X=%1\n").arg(QString::number(temp.antpos.x));
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.Y=%1\n").arg(QString::number(temp.antpos.y));
luascript = luascript + QString(u8" temp_nearFieldRequest_workplane.Origin.Z=%1\n").arg(QString::number(temp.antpos.z));
luascript = luascript + QString(u8" -- set nearfieldAdavance\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance=temp_nearFieldRequest.Advanced\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.CalculationType=cf.Enums.NearFieldCalculationTypeEnum.Fields\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.CalculateElectricFields=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.CalculateMagneticFields=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.ExportSettings.ASCIIEnabled=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.ExportSettings.OutFileEnabled=true\n");
luascript = luascript + QString(u8" temp_nearfieldAdvance.OnlyScatteredPartCalculationEnabled=true \n");
luascript = luascript + QString(u8" \n");
luascript = luascript + QString(u8" \n");
luascript = luascript + QString(u8"\n");
luascript = luascript + QString(u8" -- \n");
luascript = luascript + QString(u8" print(\"%1_PRF_%2\")\n").arg(polarTranslationflag).arg(prf_id);
luascript = luascript + QString(u8" ---------------------\"%1_PRF_%2\" end -------------------------------------------------\n").arg(polarTranslationflag).arg(prf_id);
luascript = luascript + QString(u8"\n");
}
}
luascript = luascript + QString(u8"-- prf point setting over -------\n");
luascript = luascript + QString(u8" \n");
@ -840,28 +858,63 @@ QString FEKOBase::FEKOSimulationDataparams::getAntennaRadiationFileName() {
// 设置远程天线等效辐射方向图文件地址
void FEKOBase::FEKOSimulationDataparams::setAntennaRadiationFileName(
QString AntennaRadiationFileName) {
AntennaRadiationFileName = AntennaRadiationFileName;
QString AntennaRadiationFileName,FEKOBase::TRANSLATIONPOLARTYPE PolarType) {
if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
AntennaRadiationFileName = AntennaRadiationFileName;
}else if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
AntennaRadiationFileNameH = AntennaRadiationFileName;
}
}
// 获取远程天线等效辐射方向图的 thetaPoints
long FEKOBase::FEKOSimulationDataparams::getFarsourceThetaPoints() {
return farsource_thetaPoints;
long FEKOBase::FEKOSimulationDataparams::getFarsourceThetaPoints(FEKOBase::TRANSLATIONPOLARTYPE PolarType) {
if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
return farsource_thetaPoints;
}else if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
return farsource_thetaPointsH;
}
else{
return farsource_thetaPoints;
}
}
// 设置远程天线等效辐射方向图的 thetaPoints
void FEKOBase::FEKOSimulationDataparams::setFarsourceThetaPoints(long thetaPoints) {
farsource_thetaPoints = thetaPoints;
void FEKOBase::FEKOSimulationDataparams::setFarsourceThetaPoints(long thetaPoints,FEKOBase::TRANSLATIONPOLARTYPE PolarType) {
if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
farsource_thetaPoints = thetaPoints;
}else if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
farsource_thetaPointsH = thetaPoints;
}
else{
farsource_thetaPoints = thetaPoints;
}
}
// 获取远程天线等效辐射方向图的 phiPoints
long FEKOBase::FEKOSimulationDataparams::getFarsourcePhiPoints() {
return farsource_phiPoints;
long FEKOBase::FEKOSimulationDataparams::getFarsourcePhiPoints(FEKOBase::TRANSLATIONPOLARTYPE PolarType) {
if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
return farsource_phiPoints;
}else if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
return farsource_phiPointsH;
}
else{
return farsource_phiPoints;
}
}
// 设置远程天线等效辐射方向图的 phiPoints
void FEKOBase::FEKOSimulationDataparams::setFarsourcePhiPoints(long phiPoints) {
farsource_phiPoints = phiPoints;
void FEKOBase::FEKOSimulationDataparams::setFarsourcePhiPoints(long phiPoints,FEKOBase::TRANSLATIONPOLARTYPE PolarType) {
if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT){
farsource_phiPoints = phiPoints;
}else if(PolarType==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
farsource_phiPointsH = phiPoints;
}
else{
farsource_phiPoints = phiPoints;
}
}
// 根据FEKOBase::FEKOSimulationDataparams 构建xml,并提供 loadxmlsavexml 函数copilot

View File

@ -18,6 +18,14 @@
namespace FEKOBase {
enum TRANSLATIONPOLARTYPE{
POLAR_VT,
POLAR_HT
};
//==========================================================
// FEKO成像仿真参数类
//==========================================================
@ -42,10 +50,16 @@ namespace FEKOBase {
public: // 属性字段
QString taskName; // 任务名称
FEKOImageMode imagemode; // 成像时间
QString AntennaRadiationFileName; // 远程天线等效辐射方向图文件地址
long farsource_thetaPoints;
QString AntennaRadiationFileName; // 远程天线等效辐射方向图文件地址 V发射
QString AntennaRadiationFileNameH; // 远程天线等效辐射方向图文件地址 H发射
long farsource_thetaPoints; // V
long farsource_phiPoints;
long farsource_thetaPointsH; // H
long farsource_phiPointsH;
bool isRight = false; // 是否为右视
double refRange; // 参考距离 m
double incangle; // 入射角 °
@ -162,11 +176,11 @@ namespace FEKOBase {
void setDelta_angle(double Delta_angle); // 扫描角间隔
QString getAntennaRadiationFileName();
void setAntennaRadiationFileName(QString path);
long getFarsourceThetaPoints();
void setFarsourceThetaPoints(long thetaPoints);
long getFarsourcePhiPoints();
void setFarsourcePhiPoints(long phiPoints);
void setAntennaRadiationFileName(QString path,FEKOBase::TRANSLATIONPOLARTYPE PolarType=FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT);
long getFarsourceThetaPoints(FEKOBase::TRANSLATIONPOLARTYPE PolarType=FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT);
void setFarsourceThetaPoints(long thetaPoints,FEKOBase::TRANSLATIONPOLARTYPE PolarType=FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT);
long getFarsourcePhiPoints(FEKOBase::TRANSLATIONPOLARTYPE PolarType=FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT);
void setFarsourcePhiPoints(long phiPoints,FEKOBase::TRANSLATIONPOLARTYPE PolarType=FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT);
};
@ -221,7 +235,7 @@ namespace FEKOBase {
public: // 初始化模型
void loadFEKOImageSettingXML(QString xmlpath);
void saveFEKOImageSettingXML();
QString createLuaSciptString(size_t startprfidx, size_t endprfidx,QString cfxName);
QString createLuaSciptString(size_t startprfidx, size_t endprfidx,QString cfxName,FEKOBase::TRANSLATIONPOLARTYPE polartype=FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT);
};
//==========================================================

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>712</width>
<height>615</height>
<height>631</height>
</rect>
</property>
<property name="windowTitle">
@ -109,32 +109,22 @@
<property name="title">
<string>成像极化选择</string>
</property>
<widget class="QCheckBox" name="checkBoxTheta">
<property name="geometry">
<rect>
<x>40</x>
<y>30</y>
<width>91</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>theta极化</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_phi">
<property name="geometry">
<rect>
<x>190</x>
<y>30</y>
<width>91</width>
<height>19</height>
</rect>
</property>
<property name="text">
<string>phi极化</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="checkBoxTheta">
<property name="text">
<string>theta极化V</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_phi">
<property name="text">
<string>phi极化H)</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>

File diff suppressed because it is too large Load Diff

View File

@ -115,13 +115,15 @@ public slots:
void on_radioButton_F11_toggled(bool flag);
void on_radioButton_F12_toggled(bool flag);
void on_checkBox_A1_toggled(bool flag);
void on_checkBox_A2_toggled(bool flag);
void on_translationAnt_Setting();
void on_radioButton_A1_toggled(bool flag);
void on_radioButton_A2_toggled(bool flag);
void on_checkBox_AllScatter_toggled(bool flag);
void on_lineEdit_A1_incAngle_editingFinished();
void on_lineEdit_A2_incAngle_editingFinished();
void on_pushButton_load_clicked();
void on_pushButton_apply_clicked();
void on_okButton_clicked();

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>692</width>
<height>581</height>
<height>663</height>
</rect>
</property>
<property name="windowTitle">
@ -155,6 +155,12 @@
</item>
<item row="6" column="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
@ -166,14 +172,14 @@
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="checkBox_A1">
<widget class="QRadioButton" name="radioButton_A1">
<property name="text">
<string>A1</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_A2">
<widget class="QRadioButton" name="radioButton_A2">
<property name="text">
<string>A2</string>
</property>
@ -211,6 +217,12 @@
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3">
@ -218,13 +230,13 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>120</height>
<height>130</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>120</height>
<height>130</height>
</size>
</property>
<property name="title">

View File

@ -144,16 +144,17 @@ QtSARAntModelSettingClass::QtSARAntModelSettingClass(QWidget* parent)
DebugInfo(" FEKOImageSettingFun has init WidgetstriMode init \n");
DebugInfo(" FEKOImageSettingFun has init connect init \n");
QObject::connect(this->WidgetISARMode, SIGNAL(OKClick()), this, SLOT(OKClickISAR()));
QObject::connect(this->WidgetstriMode, SIGNAL(OKClick()), this, SLOT(OKClickStrip()));
QObject::connect(this->WidgetCirCleSARMode, SIGNAL(OKClick()), this, SLOT(OKClickCircleSAR()));
QObject::connect(this->WidgetScanMode, SIGNAL(OKClick()), this, SLOT(OKClickScane()));
QObject::connect(this->Widgetfreqsetting, SIGNAL(OKClick()), this, SLOT(OKClickFreqSetting()));
QObject::connect(this->WidgetImageSetting, SIGNAL(OKClick()), this,
connect(this->WidgetISARMode, SIGNAL(OKClick()), this, SLOT(OKClickISAR()));
connect(this->WidgetstriMode, SIGNAL(OKClick()), this, SLOT(OKClickStrip()));
connect(this->WidgetCirCleSARMode, SIGNAL(OKClick()), this, SLOT(OKClickCircleSAR()));
connect(this->WidgetScanMode, SIGNAL(OKClick()), this, SLOT(OKClickScane()));
connect(this->Widgetfreqsetting, SIGNAL(OKClick()), this, SLOT(OKClickFreqSetting()));
connect(this->WidgetImageSetting, SIGNAL(OKClick()), this,
SLOT(OKClickImageSetting()));
connect(this->ui->horizontalSlider_PRF,SIGNAL(valueChanged(int)),this,SLOT(on_horizontalSliderPRF_valueChanged(int)));
connect(this->ui->checkBox_HT,SIGNAL(stateChanged(int)),this,SLOT(on_polarMode_change(int)));
connect(this->ui->checkBox_VT,SIGNAL(stateChanged(int)),this,SLOT(on_polarMode_change(int)));
// 添加频率
// this->Widgetfreqsetting->freqParams = this->freqSetting;
this->ui->tabWidget->removeTab(0);
this->ui->tabWidget->insertTab(0, this->Widgetfreqsetting, u8"频率设置");
@ -177,6 +178,10 @@ QtSARAntModelSettingClass::QtSARAntModelSettingClass(QWidget* parent)
this->antModel = nullptr;
// this->myContext = nullptr;
this->ui->tabantModeMove->setEnabled(false);
this->ui->checkBox_HT->setChecked(false);
this->ui->checkBox_VT->setChecked(true);
this->on_polarMode_change(0);
}
QtSARAntModelSettingClass::~QtSARAntModelSettingClass() {}
@ -253,6 +258,7 @@ void QtSARAntModelSettingClass::refreshFEKOSimulationParams()
{
this->simulationparams->taskName = this->ui->lineEdit_TaskName->text();
this->simulationparams->AntennaRadiationFileName = this->ui->lineEdit_farsourcePath->text();
this->simulationparams->AntennaRadiationFileNameH=this->ui->lineEdit_HfarsourcePath->text();
this->simulationparams->isRight = this->ui->comboBox_LookSide->currentIndex() == 1;
this->simulationparams->imagemode =
FEKOBase::FEKOImageModeString2Enum(this->ui->comboBox_ImageMode->currentText().trimmed());
@ -420,86 +426,178 @@ void QtSARAntModelSettingClass::on_pushButton_OK_clicked()
this->refreshFEKOSimulationParams(); // 最后更新下参数
this->saveFEKOImageSettingXML();
QProgressDialog progressDialog(u8"构建馈源设置脚本", u8"终止", 0, this->FEKOAntPoselist.size());
progressDialog.setWindowTitle("imaging...");
progressDialog.setModal(true);
progressDialog.setAutoClose(true);
progressDialog.setValue(0);
progressDialog.setMaximum(this->FEKOAntPoselist.size());
progressDialog.setMinimum(0);
progressDialog.show();
QStringList lualist;
for(size_t start_prf_idx = 0; start_prf_idx < this->FEKOAntPoselist.size();) {
size_t end_prf_idx = start_prf_idx + 100;
if(end_prf_idx > this->FEKOAntPoselist.size()) {
end_prf_idx = this->FEKOAntPoselist.size();
} else {
if(this->ui->checkBox_VT->isChecked()) {
QProgressDialog progressDialog(u8"构建馈源设置脚本V", u8"终止", 0,
this->FEKOAntPoselist.size());
progressDialog.setWindowTitle("imaging...");
progressDialog.setModal(true);
progressDialog.setAutoClose(true);
progressDialog.setValue(0);
progressDialog.setMaximum(this->FEKOAntPoselist.size());
progressDialog.setMinimum(0);
progressDialog.show();
QStringList lualist;
for(size_t start_prf_idx = 0; start_prf_idx < this->FEKOAntPoselist.size();) {
size_t end_prf_idx = start_prf_idx + 100;
if(end_prf_idx > this->FEKOAntPoselist.size()) {
end_prf_idx = this->FEKOAntPoselist.size();
} else {
}
QString cfxName =
QString("%1_%2_POLAR_VT_PRF_%3_T_%4")
.arg(this->simulationparams->taskName)
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode))
.arg(QString::number(start_prf_idx))
.arg(QString::number(end_prf_idx - 1));
QString luatext = this->createLuaSciptString(start_prf_idx, end_prf_idx, cfxName,FEKOBase::POLAR_VT);
// 写入文件
QString filePath =
this->workSpace + QDir::separator() + QString(u8"%1.lua").arg(cfxName);
// 创建文件对象
QFile file(filePath);
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << luatext;
// 关闭文件
file.close();
qDebug() << "File written successfully. " + filePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
progressDialog.setValue(end_prf_idx);
start_prf_idx = end_prf_idx;
lualist.append(
QString(u8" cadfeko 目标与场景模型.cfx --non-interactive --run-script %1.lua")
.arg(cfxName));
}
QString cfxName =
QString("%1_%2_PRF_%3_T_%4")
.arg(this->simulationparams->taskName)
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode))
.arg(QString::number(start_prf_idx))
.arg(QString::number(end_prf_idx-1));
QString luatext = this->createLuaSciptString(start_prf_idx, end_prf_idx, cfxName);
// 写入文件
QString filePath = this->workSpace + QDir::separator() + QString(u8"%1.lua").arg(cfxName);
// 创建文件对象
QFile file(filePath);
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
progressDialog.setValue(this->FEKOAntPoselist.size());
progressDialog.close();
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << luatext;
// 关闭文件
file.close();
qDebug() << "File written successfully. "+ filePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
progressDialog.setValue(end_prf_idx);
start_prf_idx=end_prf_idx;
lualist.append(QString(u8" cadfeko 目标与场景模型.cfx --non-interactive --run-script %1.lua").arg(cfxName));
}
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
progressDialog.setValue(this->FEKOAntPoselist.size());
progressDialog.close();
// 保存示例脚本
{
QString createluabat = "";
for(size_t i = 0; i < lualist.count(); i++) {
createluabat = createluabat + lualist[i] + "\n";
}
// 生成脚本
QString batfilePath = this->workSpace + QDir::separator()
+ QString(u8"%1_CADFEKO.bat").arg(this->simulationparams->taskName);
QFile file(batfilePath);
// 保存示例脚本
{
QString createluabat = "";
for(size_t i = 0; i < lualist.count(); i++) {
createluabat = createluabat + lualist[i] + "\n";
}
// 生成脚本
QString batfilePath = this->workSpace + QDir::separator()
+ QString(u8"%1_CADFEKO.bat").arg(this->simulationparams->taskName);
QFile file(batfilePath);
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << createluabat;
// 关闭文件
file.close();
qDebug() << "File written successfully." + batfilePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << createluabat;
// 关闭文件
file.close();
qDebug() << "File written successfully." + batfilePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
}
}
if(this->ui->checkBox_HT->isChecked()){
QProgressDialog progressDialog(u8"构建馈源设置脚本H", u8"终止", 0,
this->FEKOAntPoselist.size());
progressDialog.setWindowTitle("imaging...");
progressDialog.setModal(true);
progressDialog.setAutoClose(true);
progressDialog.setValue(0);
progressDialog.setMaximum(this->FEKOAntPoselist.size());
progressDialog.setMinimum(0);
progressDialog.show();
QStringList lualist;
for(size_t start_prf_idx = 0; start_prf_idx < this->FEKOAntPoselist.size();) {
size_t end_prf_idx = start_prf_idx + 100;
if(end_prf_idx > this->FEKOAntPoselist.size()) {
end_prf_idx = this->FEKOAntPoselist.size();
} else {
}
QString cfxName =
QString("%1_%2_POLAR_HT_PRF_%3_T_%4")
.arg(this->simulationparams->taskName)
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode))
.arg(QString::number(start_prf_idx))
.arg(QString::number(end_prf_idx - 1));
QString luatext = this->createLuaSciptString(start_prf_idx, end_prf_idx, cfxName,FEKOBase::POLAR_HT);
// 写入文件
QString filePath =
this->workSpace + QDir::separator() + QString(u8"%1.lua").arg(cfxName);
// 创建文件对象
QFile file(filePath);
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << luatext;
// 关闭文件
file.close();
qDebug() << "File written successfully. " + filePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
progressDialog.setValue(end_prf_idx);
start_prf_idx = end_prf_idx;
lualist.append(
QString(u8" cadfeko 目标与场景模型.cfx --non-interactive --run-script %1.lua")
.arg(cfxName));
}
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
progressDialog.setValue(this->FEKOAntPoselist.size());
progressDialog.close();
// 保存示例脚本
{
QString createluabat = "";
for(size_t i = 0; i < lualist.count(); i++) {
createluabat = createluabat + lualist[i] + "\n";
}
// 生成脚本
QString batfilePath = this->workSpace + QDir::separator()
+ QString(u8"%1_CADFEKO.bat").arg(this->simulationparams->taskName);
QFile file(batfilePath);
// 打开文件以供写入,如果文件不存在将创建新文件
if(file.open(QIODevice::WriteOnly | QIODevice::Text)) {
// 创建文本流并设置编码为UTF-8
QTextStream stream(&file);
stream.setCodec("UTF-8");
stream << createluabat;
// 关闭文件
file.close();
qDebug() << "File written successfully." + batfilePath;
} else {
qDebug() << "Could not open file for writing.";
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入失败"));
}
}
}
// 提示文件写入成功
QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"),
QString::fromUtf8(u8"文件写入成功!\n%1\n%2").arg(this->workSpace).arg("参考指令 cadfeko trihedral.cfx --non-interactive --run-script trihedral.lua "));
// 询问用户是否关闭窗口
QMessageBox::StandardButton reply;
reply = QMessageBox::question(
@ -601,3 +699,58 @@ void QtSARAntModelSettingClass::bandingsetFEKOSimulationDataparams()
this->WidgetstriMode->setFEKOSimulationDataparams(this->simulationparams);
emit this->simulationparams->FEKOSimulationDataparamsChanged();
}
void QtSARAntModelSettingClass::on_pushButton_ffeH_clicked() {
QtWidgetsClass_FarSourceSetting* ffeselectwindows = new QtWidgetsClass_FarSourceSetting(this);
QObject::connect(ffeselectwindows, SIGNAL(setResultSelected(size_t, size_t, QString)), this,
SLOT(SelectFFESourcePathH(size_t, size_t, QString)));
ffeselectwindows->show();
}
void QtSARAntModelSettingClass::SelectFFESourcePathH(size_t thetaPoints, size_t phiPoints,
QString ffePath)
{
if(!isExists(ffePath)) {
// 警告文件不存在
QMessageBox::information(nullptr, QString::fromUtf8(u8"错误"),
QString::fromUtf8(u8"文件不存在"));
return;
}
QString filename = getFileNameFromPath(ffePath);
{
QFile sourceFile(ffePath);
QString fullpath = QDir::cleanPath(this->workSpace + QDir::separator() + filename);
QFile destinationFile(fullpath);
// 打开源文件以供读取
if(sourceFile.open(QIODevice::ReadOnly)) {
// 打开目标文件以供写入
if(destinationFile.open(QIODevice::WriteOnly)) {
// 将源文件内容复制到目标文件
QByteArray data = sourceFile.readAll();
destinationFile.write(data);
// 关闭文件
destinationFile.close();
} else {
qDebug() << "Could not open destination file for writing.";
}
// 关闭源文件
sourceFile.close();
} else {
qDebug() << "Could not open source file for reading.";
}
}
this->ui->lineEdit_HfarsourcePath->setText(filename);
this->simulationparams->setAntennaRadiationFileName(filename,FEKOBase::POLAR_HT);
this->simulationparams->setFarsourceThetaPoints(thetaPoints,FEKOBase::POLAR_HT);
this->simulationparams->setFarsourcePhiPoints(phiPoints,FEKOBase::POLAR_HT);
}
void QtSARAntModelSettingClass::on_polarMode_change(int state) {
this->ui->lineEdit_HfarsourcePath->setEnabled(this->ui->checkBox_HT->isChecked());
this->ui->pushButton_ffeH->setEnabled(this->ui->checkBox_HT->isChecked());
this->ui->lineEdit_farsourcePath->setEnabled(this->ui->checkBox_VT->isChecked());
this->ui->pushButton_ffe->setEnabled(this->ui->checkBox_VT->isChecked());
qDebug()<<this->ui->checkBox_VT->isChecked();
qDebug()<<this->ui->checkBox_HT->isChecked();
}

View File

@ -115,13 +115,18 @@ public slots:
void on_comboBox_ImageMode_currentIndexChanged(int index);
void on_pushButton_ffe_clicked();
void on_pushButton_ffeH_clicked();
void on_comboBox_LookSide_currentIndexChanged(int index);
void on_horizontalSliderPRF_valueChanged(int value);
void on_pushButton_OK_clicked();
void on_pushButton_Cancel_clicked();
void on_lineEdit_refRange_editingFinished();
void on_polarMode_change(int state);
void SelectFFESourcePath(size_t thetaPoints, size_t phiPoints, QString ffePath);
void SelectFFESourcePathH(size_t thetaPoints, size_t phiPoints, QString ffePath);
public slots:
void FEKOSimulationDataparamsChanged_slots() ;
public:

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>759</width>
<height>859</height>
<width>841</width>
<height>1077</height>
</rect>
</property>
<property name="windowTitle">
@ -17,7 +17,7 @@
<item row="11" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>2</number>
</property>
<widget class="QWidget" name="tabfreqsetting">
<attribute name="title">
@ -309,7 +309,7 @@
</size>
</property>
<property name="text">
<string>打开</string>
<string>选择</string>
</property>
</widget>
</item>
@ -382,7 +382,7 @@
</size>
</property>
<property name="text">
<string>辐射方向图文件</string>
<string>V发射辐射方向图文件</string>
</property>
</widget>
</item>
@ -576,50 +576,85 @@
</size>
</property>
<property name="text">
<string>天线极化:</string>
<string>发射极化:</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_13">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>H发射辐射方向图文件</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="lineEdit_HfarsourcePath">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="QPushButton" name="pushButton_ffeH">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QWidget" name="widget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>35</height>
</size>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string/>
</property>
<widget class="QRadioButton" name="radioButton_PolarAngle0">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>115</width>
<height>19</height>
</rect>
</property>
<property name="toolTip">
<string>极化角度与原始天线的极化角度不变,例如原天线是水平发射( H ),本工程也是水平发射( H )</string>
</property>
<property name="text">
<string>极化角度不变</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_2">
<property name="geometry">
<rect>
<x>340</x>
<y>10</y>
<width>115</width>
<height>19</height>
</rect>
</property>
<property name="toolTip">
<string>极化角度与原始天线的极化角度相差90度例如原天线是水平发射( H ),本工程修改为垂直发射( V )</string>
</property>
<property name="text">
<string>极化角度+90</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox_VT">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>发射极化方向与模型飞行方向垂直飞行方向假定为Y轴方向天线极化方向对应天线模型的Y轴</string>
</property>
<property name="text">
<string>V</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_HT">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>发射极化方向与模型飞行方向水平平行飞行方向假定为Y轴方向天线极化方向对应天线模型的X轴</string>
</property>
<property name="text">
<string>H</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>

View File

@ -22,12 +22,13 @@
//#define __SHOWPROCESS
//#define __SHOWMATPLOTLIBCPPTEST // 局部绘制结果调试
#ifndef __SHOWPROCESS
#define __IMAGEPARALLEL // 成像算法并行版本
#endif
#define __IMAGEWINDOWSPROCESS // 成像算法使用加窗函数
#define __PRFPLUSECORRECT_R_ // 使用R 校正单脉冲辐射情况
#ifdef __SHOWMATPLOTLIBCPPTEST
#include <matplot/matplot.h>
@ -37,12 +38,7 @@
//#define __SHOWIMAGEPROCESSING // 展示成像中间结果
//#define __SHOWIMAGEPROCESSRESULT// 展示成像结果
#endif
#endif
#endif