| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #include <QMessageBox> |
| | #include <QStandardPaths> |
| | #include <QThread> |
| |
|
| |
|
| | #include <App/Application.h> |
| |
|
| | #include "DlgSettingsFemCcxImp.h" |
| | #include "ui_DlgSettingsFemCcx.h" |
| |
|
| |
|
| | using namespace FemGui; |
| |
|
| | DlgSettingsFemCcxImp::DlgSettingsFemCcxImp(QWidget* parent) |
| | : PreferencePage(parent) |
| | , ui(new Ui_DlgSettingsFemCcxImp) |
| | { |
| | ui->setupUi(this); |
| | |
| | ui->dsb_ccx_time_period->setMaximum(std::numeric_limits<float>::max()); |
| | ui->dsb_ccx_initial_time_increment->setMaximum(std::numeric_limits<float>::max()); |
| |
|
| | connect( |
| | ui->fc_ccx_binary_path, |
| | &Gui::PrefFileChooser::fileNameSelected, |
| | this, |
| | &DlgSettingsFemCcxImp::onfileNameSelected |
| | ); |
| | } |
| |
|
| | DlgSettingsFemCcxImp::~DlgSettingsFemCcxImp() = default; |
| |
|
| | void DlgSettingsFemCcxImp::saveSettings() |
| | { |
| | ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( |
| | "User parameter:BaseApp/Preferences/Mod/Fem/Ccx" |
| | ); |
| | hGrp->SetInt("Solver", ui->cmb_solver->currentIndex()); |
| | hGrp->SetInt("AnalysisType", ui->cb_analysis_type->currentIndex()); |
| |
|
| | ui->sb_ccx_numcpu->onSave(); |
| | ui->cmb_solver->onSave(); |
| | ui->cb_ccx_non_lin_geom->onSave(); |
| | ui->cb_use_iterations_param->onSave(); |
| |
|
| | ui->cb_static->onSave(); |
| | ui->sb_ccx_max_increments->onSave(); |
| | ui->dsb_ccx_initial_time_increment->onSave(); |
| | ui->dsb_ccx_time_period->onSave(); |
| | ui->dsb_ccx_minimum_time_increment->onSave(); |
| | ui->dsb_ccx_maximum_time_increment->onSave(); |
| | ui->ckb_pipeline_result->onSave(); |
| | ui->ckb_result_format->onSave(); |
| |
|
| | ui->cb_analysis_type->onSave(); |
| | ui->cb_BeamShellOutput->onSave(); |
| | ui->sb_eigenmode_number->onSave(); |
| | ui->dsb_eigenmode_high_limit->onSave(); |
| | ui->dsb_eigenmode_low_limit->onSave(); |
| |
|
| | ui->cb_int_editor->onSave(); |
| | ui->fc_ext_editor->onSave(); |
| | ui->fc_ccx_binary_path->onSave(); |
| | ui->cb_split_inp_writer->onSave(); |
| | } |
| |
|
| | void DlgSettingsFemCcxImp::loadSettings() |
| | { |
| | ui->sb_ccx_numcpu->onRestore(); |
| | ui->cmb_solver->onRestore(); |
| | ui->cb_ccx_non_lin_geom->onRestore(); |
| | ui->cb_use_iterations_param->onRestore(); |
| |
|
| | ui->cb_static->onRestore(); |
| | ui->sb_ccx_max_increments->onRestore(); |
| | ui->dsb_ccx_initial_time_increment->onRestore(); |
| | ui->dsb_ccx_time_period->onRestore(); |
| | ui->dsb_ccx_minimum_time_increment->onRestore(); |
| | ui->dsb_ccx_maximum_time_increment->onRestore(); |
| | ui->ckb_pipeline_result->onRestore(); |
| | ui->ckb_result_format->onRestore(); |
| |
|
| | ui->cb_analysis_type->onRestore(); |
| | ui->cb_BeamShellOutput->onRestore(); |
| | ui->sb_eigenmode_number->onRestore(); |
| | ui->dsb_eigenmode_high_limit->onRestore(); |
| | ui->dsb_eigenmode_low_limit->onRestore(); |
| |
|
| | ui->cb_int_editor->onRestore(); |
| | ui->fc_ext_editor->onRestore(); |
| | ui->fc_ccx_binary_path->onRestore(); |
| | ui->cb_split_inp_writer->onRestore(); |
| |
|
| | ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( |
| | "User parameter:BaseApp/Preferences/Mod/Fem/Ccx" |
| | ); |
| |
|
| | |
| | int processor_count = hGrp->GetInt("AnalysisNumCPUs", QThread::idealThreadCount()); |
| | ui->sb_ccx_numcpu->setValue(processor_count); |
| |
|
| | int index = hGrp->GetInt("Solver", 0); |
| | if (index > -1) { |
| | ui->cmb_solver->setCurrentIndex(index); |
| | } |
| | index = hGrp->GetInt("AnalysisType", 0); |
| | if (index > -1) { |
| | ui->cb_analysis_type->setCurrentIndex(index); |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | void DlgSettingsFemCcxImp::changeEvent(QEvent* e) |
| | { |
| | if (e->type() == QEvent::LanguageChange) { |
| | int c_index = ui->cb_analysis_type->currentIndex(); |
| | ui->retranslateUi(this); |
| | ui->cb_analysis_type->setCurrentIndex(c_index); |
| | } |
| | else { |
| | QWidget::changeEvent(e); |
| | } |
| | } |
| |
|
| | void DlgSettingsFemCcxImp::onfileNameSelected(const QString& fileName) |
| | { |
| | if (!fileName.isEmpty() && QStandardPaths::findExecutable(fileName).isEmpty()) { |
| | QMessageBox::critical(this, tr("CalculiX"), tr("Executable '%1' not found").arg(fileName)); |
| | } |
| | } |
| |
|
| | #include "moc_DlgSettingsFemCcxImp.cpp" |
| |
|