diff --git a/src/ALLBUILD/CMakeLists.txt b/src/ALLBUILD/CMakeLists.txt index c1d1dc7..960a132 100644 --- a/src/ALLBUILD/CMakeLists.txt +++ b/src/ALLBUILD/CMakeLists.txt @@ -42,8 +42,9 @@ add_library(ALLBUILD list(APPEND _depend_library # LAMPCAE PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin PluginMotorBike - PluginAddTree PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin PluginMotorBike PluginRasterTool PluginLAMPScatterProcess -# PluginRasterTool + PluginAddTree PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin PluginMotorBike PluginRasterTool + PluginRCSDBManager PluginRasterTool +# PluginRasterTool PluginLAMPScatterProcess ) diff --git a/src/MainWindow/MainWindow.cpp b/src/MainWindow/MainWindow.cpp index cc035f0..2a36281 100644 --- a/src/MainWindow/MainWindow.cpp +++ b/src/MainWindow/MainWindow.cpp @@ -562,6 +562,7 @@ namespace GUI { connect(_ui->actionShowRCSTable,SIGNAL(triggered()), this,SIGNAL(on_actionShowRCSTableSIGNAL())); connect(_ui->actionQueryRCSData,SIGNAL(triggered()), this,SIGNAL(on_actionactionQueryRCSDataSIGNAL())); + connect(_ui->actionactionRCSScatterSetting,SIGNAL(triggered()), this,SIGNAL(on_actionRCSScatterSettingSIGNAL())); } diff --git a/src/MainWindow/MainWindow.h b/src/MainWindow/MainWindow.h index ba1a621..987dbdc 100644 --- a/src/MainWindow/MainWindow.h +++ b/src/MainWindow/MainWindow.h @@ -164,7 +164,7 @@ namespace GUI { signals: void on_actionLine2FaceSIGNAL(); - + void on_actionRCSScatterSettingSIGNAL(); void on_actionImportRCSDataSIGNAL(); void on_actionShowRCSTableSIGNAL(); void on_actionactionQueryRCSDataSIGNAL(); diff --git a/src/MainWindow/MainWindow.ui b/src/MainWindow/MainWindow.ui index 7345fbb..75bb6b1 100644 --- a/src/MainWindow/MainWindow.ui +++ b/src/MainWindow/MainWindow.ui @@ -915,6 +915,7 @@ + @@ -3675,6 +3676,11 @@ 查询RCS数据 + + + RCS测量散射设置 + + diff --git a/src/PluginRCSDBManager/CMakeLists.txt b/src/PluginRCSDBManager/CMakeLists.txt index 3534245..e2f51cf 100644 --- a/src/PluginRCSDBManager/CMakeLists.txt +++ b/src/PluginRCSDBManager/CMakeLists.txt @@ -82,13 +82,6 @@ add_library(PluginRCSDBManager ${_header} ${_source} ${SOURCES} - RCSDBManagerClass.cpp - RCSDBManagerClass.h - RCSDBQueryDialog.cpp - RCSDBQueryDialog.h - RCSDBQueryDialog.ui - QueryDataTableModel.cpp - QueryDataTableModel.h ) diff --git a/src/PluginRCSDBManager/QueryDataTableModel.cpp b/src/PluginRCSDBManager/QueryDataTableModel.cpp index 8c1dead..f6d59b4 100644 --- a/src/PluginRCSDBManager/QueryDataTableModel.cpp +++ b/src/PluginRCSDBManager/QueryDataTableModel.cpp @@ -53,6 +53,7 @@ void QueryDataTableModel::loadRCSRecordDataSet(std::vector RCSRecordS QStringList rowIDlist; bool hascolnames = true; colnames.append(u8"ProjectID"); + colnames.append(u8"ProjectName"); colnames.append(u8"freq"); colnames.append(u8"azimuthAngle"); colnames.append(u8"incidentAngle"); @@ -68,16 +69,17 @@ void QueryDataTableModel::loadRCSRecordDataSet(std::vector RCSRecordS for (int64_t i=0;i mapline(colnames.count()); // 单行数据 mapline[0]=RCSRecordSets[i].projectID; - mapline[1]=RCSRecordSets[i].frequency; - mapline[2]=RCSRecordSets[i].phi; - mapline[3]=RCSRecordSets[i].theta; - mapline[4]=RCSRecordSets[i].TransPolar; - mapline[5]=RCSRecordSets[i].reEphi; - mapline[6]=RCSRecordSets[i].imEphi; - mapline[7]=RCSRecordSets[i].reEtheta; - mapline[8]=RCSRecordSets[i].imEtheta; - mapline[9]=RCSRecordSets[i].RCS_Phi; - mapline[10]=RCSRecordSets[i].RCS_Theta; + mapline[1]=RCSRecordSets[i].projectName; + mapline[2]=RCSRecordSets[i].frequency; + mapline[3]=RCSRecordSets[i].phi; + mapline[4]=RCSRecordSets[i].theta; + mapline[5]=RCSRecordSets[i].TransPolar; + mapline[6]=RCSRecordSets[i].reEphi; + mapline[7]=RCSRecordSets[i].imEphi; + mapline[8]=RCSRecordSets[i].reEtheta; + mapline[9]=RCSRecordSets[i].imEtheta; + mapline[10]=RCSRecordSets[i].RCS_Phi; + mapline[11]=RCSRecordSets[i].RCS_Theta; datamap.append(mapline); rowIDlist.append(QString::number(rowid)); diff --git a/src/PluginRCSDBManager/RCSDBManagerClass.h b/src/PluginRCSDBManager/RCSDBManagerClass.h index 868ca82..e4c0ea5 100644 --- a/src/PluginRCSDBManager/RCSDBManagerClass.h +++ b/src/PluginRCSDBManager/RCSDBManagerClass.h @@ -22,6 +22,7 @@ namespace RCSDBManagerTool { struct RCSRecord { int projectID; + QString projectName; QString fileType; QString fileFormat; QString source; diff --git a/src/PluginRCSDBManager/RCSDBQueryDialog.cpp b/src/PluginRCSDBManager/RCSDBQueryDialog.cpp index da51020..25ad685 100644 --- a/src/PluginRCSDBManager/RCSDBQueryDialog.cpp +++ b/src/PluginRCSDBManager/RCSDBQueryDialog.cpp @@ -35,7 +35,8 @@ namespace RCSDBManagerTool { } void RCSDBQueryDialog::OnExportCSV() { - + this->RCSDBTable->saveFilePath(); + QMessageBox::information(nullptr,u8"提示",u8"RCS文件导出成功"); } void RCSDBQueryDialog::OnQueryData() { @@ -73,9 +74,11 @@ namespace RCSDBManagerTool { qDebug()<<"ProjectID:"< RCSRecordTemp=db->queryRCSDataRecordsByProjectID(project_descs[i].projectID); for (int32_t j=0;jprojDescTable->clear(); this->RCSDBTable->clear(); this->projDescTable->loadProjectDescDataSet(project_descs); @@ -87,23 +90,22 @@ namespace RCSDBManagerTool { } void RCSDBQueryDialog::onFieldChanged(int indx) { - if (this->ui->comboBoxQueryField->currentIndex()==0) { + if (this->ui->comboBoxQueryField->currentIndex() == 0) { RCSDBManagerClass *db = RCSDBManagerClass::instance(); - std::vector projectlist=db->getAllProjectRecords(); + std::vector projectlist = db->getAllProjectRecords(); this->ui->comboBoxQueryValue->clear(); - for (int32_t i=0;iui->comboBoxQueryValue->addItem(QString::number(projectlist[i].projectID)); + for (int32_t i = 0; i < projectlist.size(); i++) { + this->ui->comboBoxQueryValue->addItem(QString::number(projectlist[i].projectID)); } - - }else if (ui->comboBoxQueryField->currentIndex()==1) { + } else if (ui->comboBoxQueryField->currentIndex() == 1) { RCSDBManagerClass *db = RCSDBManagerClass::instance(); - std::vector projectlist=db->getAllProjectRecords(); + std::vector projectlist = db->getAllProjectRecords(); this->ui->comboBoxQueryValue->clear(); - for (int32_t i=0;iui->comboBoxQueryValue->addItem(projectlist[i].projectName); } - - }else{} + } else { + } } } // RCSDBManagerTool diff --git a/src/PluginWBFZExchangePlugin/CMakeLists.txt b/src/PluginWBFZExchangePlugin/CMakeLists.txt index 908386e..20a6bf4 100644 --- a/src/PluginWBFZExchangePlugin/CMakeLists.txt +++ b/src/PluginWBFZExchangePlugin/CMakeLists.txt @@ -106,6 +106,12 @@ add_library(PluginWBFZExchangePlugin ${_header} ${_source} ${SOURCES} + FEKORCSScatterSettingDialog.cpp + FEKORCSScatterSettingDialog.h + FEKORCSScatterSettingDialog.ui + FEKORCSScatterSettingDialog.cpp + FEKORCSScatterSettingDialog.h + FEKORCSScatterSettingDialog.ui ) diff --git a/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.cpp b/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.cpp new file mode 100644 index 0000000..323b45b --- /dev/null +++ b/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.cpp @@ -0,0 +1,187 @@ +// +// Created by 30453 on 25-6-27. +// + +// You may need to build the project (run Qt uic code generator) to get "ui_FEKORCSScatterSettingDialog.h" resolved +#include "AllHead.h" +#include "FEKORCSScatterSettingDialog.h" +#include "ui_FEKORCSScatterSettingDialog.h" +#include "QFileDialog" +#include "Settings/BusAPI.h" +#include "QMessageBox" + + +FEKORCSScatterSettingDialog::FEKORCSScatterSettingDialog(QWidget *parent) : + QDialog(parent), ui(new Ui::FEKORCSScatterSettingDialog) { + ui->setupUi(this); + this->initUI(); +} + +FEKORCSScatterSettingDialog::~FEKORCSScatterSettingDialog() { + delete ui; +} + +void FEKORCSScatterSettingDialog::initUI() { + // 事件绑定 + QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(on_buttonBoxaccepted())); + QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(on_buttonBoxrejected())); + QObject::connect(ui->doubleSpinBox_IncDelta, SIGNAL(editingFinished()), this, SLOT(on_incangle_Changevalues())); + QObject::connect(ui->doubleSpinBox_IncStart, SIGNAL(editingFinished()), this, SLOT(on_incangle_Changevalues())); + QObject::connect(ui->doubleSpinBox_IncEnd, SIGNAL(editingFinished()), this, SLOT(on_incangle_Changevalues())); + + QObject::connect(ui->doubleSpinBox_AzStart, SIGNAL(editingFinished()), this, SLOT(on_Azangle_Changevalues())); + QObject::connect(ui->doubleSpinBox_AzDelta, SIGNAL(editingFinished()), this, SLOT(on_Azangle_Changevalues())); + QObject::connect(ui->doubleSpinBox_AzEnd, SIGNAL(editingFinished()), this, SLOT(on_Azangle_Changevalues())); + + QObject::connect(ui->doubleSpinBox_FreqStart, SIGNAL(editingFinished()), this, SLOT(on_Freq_Changevalues())); + QObject::connect(ui->spinBox_NumberFreq, SIGNAL(editingFinished()), this, SLOT(on_Freq_Changevalues())); + QObject::connect(ui->doubleSpinBox_FreqEnd, SIGNAL(editingFinished()), this, SLOT(on_Freq_Changevalues())); + + + + + + +} + +void FEKORCSScatterSettingDialog::on_buttonBoxaccepted() { + // 提取所有参数 + double Inc_start=ui->doubleSpinBox_IncStart->value(); + double Inc_delta=ui->doubleSpinBox_IncDelta->value(); + double Inc_end=ui->doubleSpinBox_IncEnd->value(); + + double Az_start=ui->doubleSpinBox_AzStart->value(); + double Az_delta=ui->doubleSpinBox_AzDelta->value(); + double Az_end=ui->doubleSpinBox_AzEnd->value(); + + double freq_start=ui->doubleSpinBox_FreqStart->value(); + int64_t freq_N=ui->spinBox_NumberFreq->value(); + double freq_end=ui->doubleSpinBox_FreqEnd->value(); + + double polarAngle=ui->doubleSpinBox_TransPolarAngle->value(); + + QString projectName=ui->lineEditProjectName->text(); + + // 输出文件 + QString filePath = QFileDialog::getSaveFileName( + this, // Parent widget + tr(u8"仿真天线参数初始化文件"), // Dialog title + Setting::BusAPI::instance()->getLastSelectPath(), // Starting directory + tr("_ant_init_script (*.lua)") // File filter + ); + + + // 输出文件 + QString luascript = QString( + "app=cf.GetApplication()\n" + "project=app.Project --- get current project\n" + "solutionConfigurations = project.SolutionConfigurations \n" + "solutionConfigurations:SetSourcesPerConfiguration()\n" + "\n" + "---- input params region ------------------\n" + "f1=%1\n" + "f2=%2\n" + "fn=%3\n" + "incStart=%4\n" + "incDelta=%5\n" + "incEnd=%6\n" + "AzStart=%7\n" + "AzDelta=%8\n" + "AzEnd=%9\n" + "polarAngle=%10\n" + "configLable='%11'\n" + "---- input params region ------------------\n" + "\n" + "configuration=solutionConfigurations[1]\n" + "configuration.Label=configLable\n" + "--- freq setting ----\n" + "frequencyRange=configuration.Frequency\n" + "properties = frequencyRange:GetProperties()\n" + "properties.RangeType = cf.Enums.FrequencyRangeTypeEnum.LinearSpacedDiscrete\n" + "properties.Start = f1 -- start\n" + "properties.End=f2 --end \n" + "properties.NumberOfDiscreteValues=fn -- freq_num\n" + "frequencyRange:SetProperties(properties)\n" + "\n" + "--- plane wave setting ------\n" + "planeWave = configuration.Sources:AddPlaneWave(0,0)\n" + "planeWave.DefinitionMethod=cf.Enums.PlaneWaveDefinitionMethodEnum.Multiple\n" + "\n" + "--- incangle theta ------\n" + "planeWave.StartTheta=incStart\n" + "planeWave.ThetaIncrement=incDelta\n" + "planeWave.EndTheta=incEnd\n" + "\n" + "\n" + "--- Az phi ------\n" + "planeWave.PhiIncrement=AzDelta\n" + "planeWave.StartPhi=AzStart\n" + "planeWave.EndPhi=AzEnd\n" + "\n" + "--- polar angle ---\n" + "planeWave.PolarisationAngle=polarAngle\n" + "\n" + "--- far field requests setting ---\n" + "farFieldRequest = configuration.FarFields:Add(0,0,90,180,30,60)\n" + "farFieldRequest.CalculationDirection=cf.Enums.FarFieldCalculationDirectionEnum.FromPlaneWave\n" + "farFieldRequest.Advanced.OnlyScatteredPartCalculationEnabled = true\n" + "farFieldRequest.Advanced.ExportSettings.ASCIIEnabled = true\n" + "farFieldRequest.Advanced.ExportSettings.OutFileEnabled = true\n" + "farFieldRequest.Label=configLable") + .arg(freq_start) + .arg(freq_end) + .arg(freq_N) + .arg(Inc_start) + .arg(Inc_delta) + .arg(Inc_end) + .arg(Az_start) + .arg(Az_delta) + .arg(Az_end) + .arg(polarAngle) + .arg(projectName) ; + + QFile file(filePath); // 创建文件对象 + if(file.open(QIODevice::WriteOnly | QIODevice::Text)) { + QTextStream stream(&file); // 创建文本流,并设置编码为UTF-8 + stream.setCodec("UTF-8"); + stream << luascript; + file.close(); + QMessageBox::information( + nullptr, QString::fromUtf8(u8"提示"), + QString::fromUtf8(u8"文件写入成功!\n%1").arg(filePath)); // 提示文件写入成功 + qDebug() << "File written successfully."; + } else { + qDebug() << "Could not open file for writing."; + QMessageBox::information(nullptr, QString::fromUtf8(u8"提示"), + QString::fromUtf8(u8"文件写入失败")); + } +} + +void FEKORCSScatterSettingDialog::on_buttonBoxrejected() { + this->close(); +} + +void FEKORCSScatterSettingDialog::on_incangle_Changevalues() { + double Inc_start=ui->doubleSpinBox_IncStart->value(); + double Inc_delta=ui->doubleSpinBox_IncDelta->value(); + double Inc_end=ui->doubleSpinBox_IncEnd->value(); +} + +void FEKORCSScatterSettingDialog::on_Azangle_Changevalues() { + double Az_start=ui->doubleSpinBox_AzStart->value(); + double Az_delta=ui->doubleSpinBox_AzDelta->value(); + double Az_end=ui->doubleSpinBox_AzEnd->value(); + +} + +void FEKORCSScatterSettingDialog::on_Freq_Changevalues() { + double freq_start=ui->doubleSpinBox_FreqStart->value(); + int64_t freq_N=ui->spinBox_NumberFreq->value(); + double freq_end=ui->doubleSpinBox_FreqEnd->value(); + + double freqdelta=(freq_end-freq_start)/(freq_N-1); + this->ui->label_freqDelta->setText(QString(u8"频率间隔: %1 MHz").arg(freqdelta/1e6)); + + + +} diff --git a/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.h b/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.h new file mode 100644 index 0000000..d464a69 --- /dev/null +++ b/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.h @@ -0,0 +1,36 @@ +// +// Created by 30453 on 25-6-27. +// + +#ifndef FEKORCSSCATTERSETTINGDIALOG_H +#define FEKORCSSCATTERSETTINGDIALOG_H + +#include + + +QT_BEGIN_NAMESPACE +namespace Ui { class FEKORCSScatterSettingDialog; } +QT_END_NAMESPACE + +class FEKORCSScatterSettingDialog : public QDialog { +Q_OBJECT + +public: + explicit FEKORCSScatterSettingDialog(QWidget *parent = nullptr); + ~FEKORCSScatterSettingDialog() override; +public: + void initUI(); + +public slots: + void on_buttonBoxaccepted(); + void on_buttonBoxrejected(); + void on_incangle_Changevalues(); + void on_Azangle_Changevalues(); + void on_Freq_Changevalues(); + +private: + Ui::FEKORCSScatterSettingDialog *ui; +}; + + +#endif //FEKORCSSCATTERSETTINGDIALOG_H diff --git a/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.ui b/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.ui new file mode 100644 index 0000000..0392eb1 --- /dev/null +++ b/src/PluginWBFZExchangePlugin/FEKORCSScatterSettingDialog.ui @@ -0,0 +1,450 @@ + + + FEKORCSScatterSettingDialog + + + + 0 + 0 + 446 + 420 + + + + FEKORCSScatterSettingDialog + + + + + + + + + 0 + 30 + + + + 仿真工程名称: + + + + + + + + 0 + 30 + + + + 请以英文开头,输入 英文、数字、英文下滑线_ + + + + + + + + + + 0 + 30 + + + + 天线方向设置 + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 30 + + + + 方位角间隔 + + + + + + + + 120 + 30 + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + + 120 + 30 + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + + 0 + 30 + + + + 入射角起始 + + + + + + + + 120 + 30 + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + + 0 + 30 + + + + 入射角结束 + + + + + + + + 120 + 30 + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + + 0 + 30 + + + + 方位角结束 + + + + + + + + 0 + 30 + + + + 入射角间隔 + + + + + + + + 0 + 30 + + + + 方位角起始 + + + + + + + + 120 + 30 + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + + 120 + 30 + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 频率与极化角度设置 + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 120 + 30 + + + + 100000000000000004764729344.000000000000000 + + + QAbstractSpinBox::DefaultStepType + + + + + + + + 120 + 30 + + + + 100000000000000004764729344.000000000000000 + + + + + + + + 0 + 30 + + + + 发射极化角 + + + + + + + + 120 + 30 + + + + H极化:0 度,V极化:90度 + + + 3 + + + -360.000000000000000 + + + 360.000000000000000 + + + + + + + + 0 + 30 + + + + 频率点数 + + + + + + + + 120 + 30 + + + + 999999999 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 30 + + + + 结束频率(Hz) + + + + + + + + 0 + 30 + + + + 起始频率(Hz) + + + + + + + + 0 + 30 + + + + 频率间隔: + + + + + + + + + + Qt::Vertical + + + + 20 + 35 + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + diff --git a/src/PluginWBFZExchangePlugin/WBFZExchangePlugin.cpp b/src/PluginWBFZExchangePlugin/WBFZExchangePlugin.cpp index aff45eb..0e9dfd5 100644 --- a/src/PluginWBFZExchangePlugin/WBFZExchangePlugin.cpp +++ b/src/PluginWBFZExchangePlugin/WBFZExchangePlugin.cpp @@ -24,8 +24,10 @@ #include "LAMPImageCreateClass.h" #include "OCCTLine2Face.h" #include "MeasurementDataInputDialog.h" +#include "FEKORCSScatterSettingDialog.h" //#include "dialogechodatashow.h" + namespace WBFZ { GUI::MainWindow* WBFZ::WBFZExchangePlugin::_mainwindow = nullptr; @@ -75,6 +77,10 @@ namespace WBFZ { connect(_mainwindow,SIGNAL(on_actionFEKOImageSetting_SCaneImage_SIGNAL()), this,SLOT(on_actionFEKOImageSetting_SCaneImage_SIGNAL())); connect(_mainwindow,SIGNAL(on_actionFEKOImageSetting_ISARImage_SIGNAL()), this,SLOT(on_actionFEKOImageSetting_ISARImage_SIGNAL())); connect(_mainwindow,SIGNAL(on_actionFEKOImageSetting_CircleImage_SIGNAL()), this,SLOT(on_actionFEKOImageSetting_CircleImage_SIGNAL())); + // 散射设置 + connect(_mainwindow,SIGNAL(on_actionRCSScatterSettingSIGNAL()), this,SLOT(on_actionRCSScatterSettingSLOT())); + + // 室内测量成像 connect(_mainwindow,SIGNAL(on_actionImportRoomMeasurementImage_SIGNAL()), this,SLOT(on_actionImportRoomMeasurementImage_SIGNAL())); connect(_mainwindow,SIGNAL(onactionForestTargetStructMeasurement_SIGNAL()), this,SLOT(onactionForestTargetStructMeasurement_SIGNAL())); @@ -345,6 +351,14 @@ namespace WBFZ { } + void WBFZExchangePlugin::on_actionRCSScatterSettingSLOT() { + // 散射界面设置 + FEKORCSScatterSettingDialog* dialog=new FEKORCSScatterSettingDialog(_mainwindow); + dialog->setWindowTitle((u8"仿真RCS参数设置")); + dialog->show(); + + } + void WBFZExchangePlugin::onactionForestTargetStructMeasurement_SIGNAL() { qDebug()<