删除了允许用户导入雷达模型的功能
parent
fea08bd5fd
commit
619c9ec065
|
@ -111,10 +111,11 @@ Geometry::GeometrySet* antModelClass::get_antModelset()
|
|||
|
||||
antModelClass antModelClassFactory()
|
||||
{
|
||||
QString filepath = getOpenFilePath(
|
||||
nullptr, QString::fromUtf8(u8"导入雷达模型"),
|
||||
QString::fromUtf8(u8"STL Files (*.stl);;STL Files (*.stla);;step Files (*.stp);;step Files "
|
||||
u8"(*.step);;IGES Files (*.iges);;IGES Files (*.igs)"));
|
||||
QString filepath="";
|
||||
// filepath = getOpenFilePath(
|
||||
// nullptr, QString::fromUtf8(u8"导入雷达模型"),
|
||||
// QString::fromUtf8(u8"STL Files (*.stl);;STL Files (*.stla);;step Files (*.stp);;step Files "
|
||||
// u8"(*.step);;IGES Files (*.iges);;IGES Files (*.igs)"));
|
||||
antModelClass result(filepath);
|
||||
return result;
|
||||
}
|
||||
|
@ -270,10 +271,11 @@ void QtSARAntModelSettingClass::setOCCTDocument(GUI::MainWindow* m)
|
|||
{
|
||||
this->m = m;
|
||||
|
||||
QString antFilePath = getOpenFilePath(
|
||||
nullptr, QString::fromUtf8(u8"导入雷达模型"),
|
||||
QString::fromUtf8(u8"STL Files (*.stl);;STL Files (*.stla);;step Files (*.stp);;step Files "
|
||||
u8"(*.step);;IGES Files (*.iges);;IGES Files (*.igs)"));
|
||||
QString antFilePath ="";
|
||||
// antFilePath= getOpenFilePath(
|
||||
// nullptr, QString::fromUtf8(u8"导入雷达模型"),
|
||||
// QString::fromUtf8(u8"STL Files (*.stl);;STL Files (*.stla);;step Files (*.stp);;step Files "
|
||||
// u8"(*.step);;IGES Files (*.iges);;IGES Files (*.igs)"));
|
||||
|
||||
if(isExists(antFilePath)) {
|
||||
this->antModel = new antModelClass(antFilePath);
|
||||
|
@ -427,7 +429,12 @@ void QtSARAntModelSettingClass::on_pushButton_OK_clicked()
|
|||
this->saveFEKOImageSettingXML();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(this->ui->checkBox_VT->isChecked()) {
|
||||
this->CreateInitCfxScript(FEKOBase::POLAR_VT);
|
||||
|
||||
QProgressDialog progressDialog(u8"构建馈源设置脚本V", u8"终止", 0,
|
||||
this->FEKOAntPoselist.size());
|
||||
progressDialog.setWindowTitle("imaging...");
|
||||
|
@ -438,6 +445,7 @@ void QtSARAntModelSettingClass::on_pushButton_OK_clicked()
|
|||
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;
|
||||
|
@ -477,6 +485,16 @@ void QtSARAntModelSettingClass::on_pushButton_OK_clicked()
|
|||
lualist.append(
|
||||
QString(u8" cadfeko 目标与场景模型.cfx --non-interactive --run-script %1.lua")
|
||||
.arg(cfxName));
|
||||
|
||||
QCoreApplication::processEvents(); // 允许事件处理,以便取消按钮响应
|
||||
|
||||
// 检查是否点击了取消按钮
|
||||
if (progressDialog.wasCanceled()) {
|
||||
qDebug() << "User canceled operation.";
|
||||
break; // 退出任务循环
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
progressDialog.setWindowTitle(u8"馈源脚本生产成功");
|
||||
progressDialog.setValue(this->FEKOAntPoselist.size());
|
||||
|
@ -510,6 +528,7 @@ void QtSARAntModelSettingClass::on_pushButton_OK_clicked()
|
|||
}
|
||||
}
|
||||
if(this->ui->checkBox_HT->isChecked()){
|
||||
this->CreateInitCfxScript(FEKOBase::POLAR_HT);
|
||||
QProgressDialog progressDialog(u8"构建馈源设置脚本H", u8"终止", 0,
|
||||
this->FEKOAntPoselist.size());
|
||||
progressDialog.setWindowTitle("imaging...");
|
||||
|
@ -754,3 +773,50 @@ void QtSARAntModelSettingClass::on_polarMode_change(int state) {
|
|||
qDebug()<<this->ui->checkBox_VT->isChecked();
|
||||
qDebug()<<this->ui->checkBox_HT->isChecked();
|
||||
}
|
||||
void QtSARAntModelSettingClass::CreateInitCfxScript(FEKOBase::TRANSLATIONPOLARTYPE polartype) {
|
||||
size_t start_prf_idx=0;
|
||||
size_t end_prf_idx = 1;
|
||||
if(end_prf_idx > this->FEKOAntPoselist.size()) {
|
||||
end_prf_idx = this->FEKOAntPoselist.size();
|
||||
} else {
|
||||
}
|
||||
QString cfxName ="";
|
||||
QString luatext="";
|
||||
if(polartype==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_VT) {
|
||||
cfxName = QString("%1_%2_POLAR_VT_PRF_ant_init_script")
|
||||
.arg(this->simulationparams->taskName)
|
||||
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode))
|
||||
.arg(QString::number(start_prf_idx))
|
||||
.arg(QString::number(end_prf_idx - 1));
|
||||
luatext =this->createLuaSciptString(start_prf_idx, end_prf_idx, cfxName, FEKOBase::POLAR_VT);
|
||||
}else if(polartype==FEKOBase::TRANSLATIONPOLARTYPE::POLAR_HT){
|
||||
cfxName = QString("%1_%2_POLAR_HT_PRF_ant_init_script")
|
||||
.arg(this->simulationparams->taskName)
|
||||
.arg(FEKOBase::FEKOImageModeenumToString(this->simulationparams->imagemode))
|
||||
.arg(QString::number(start_prf_idx))
|
||||
.arg(QString::number(end_prf_idx - 1));
|
||||
luatext=this->createLuaSciptString(start_prf_idx, end_prf_idx, cfxName, FEKOBase::POLAR_HT);
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
// 写入文件
|
||||
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"文件写入失败"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,8 +101,9 @@ public:
|
|||
|
||||
void refreshFEKOSimulationParams();
|
||||
|
||||
void CreateInitCfxScript(FEKOBase::TRANSLATIONPOLARTYPE polartype);
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
|
@ -123,8 +124,6 @@ public slots:
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue