From 50618de314c9a68c78a0f254c358d34729c17d58 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Mon, 6 Oct 2014 18:04:45 +0200 Subject: [PATCH] Add new wizard page "Advanced Parameters" with new parameter wckey --- src/engine/BL_Job.cxx | 12 ++++++++ src/engine/BL_Job.hxx | 4 +++ src/engine/BL_SALOMEServices.cxx | 2 ++ .../AdvancedParametersWizardPage.ui | 23 ++++++++++++++ src/genericgui/BL_CreateJobWizard.cxx | 30 ++++++++++++++++++- src/genericgui/BL_CreateJobWizard.hxx | 20 +++++++++++++ src/genericgui/BL_JobsManager_QT.cxx | 1 + src/genericgui/CMakeLists.txt | 1 + 8 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/genericgui/AdvancedParametersWizardPage.ui diff --git a/src/engine/BL_Job.cxx b/src/engine/BL_Job.cxx index 487a39b..6f7886b 100644 --- a/src/engine/BL_Job.cxx +++ b/src/engine/BL_Job.cxx @@ -203,6 +203,18 @@ BL::Job::getBatchQueue() return _batch_queue; } +void +BL::Job::setWCKey(const std::string & wckey) +{ + _wckey = wckey; +} + +const std::string & +BL::Job::getWCKey() +{ + return _wckey; +} + void BL::Job::setLoadLevelerJobType(const std::string & jobtype) { diff --git a/src/engine/BL_Job.hxx b/src/engine/BL_Job.hxx index 0a26e8c..510ee1c 100644 --- a/src/engine/BL_Job.hxx +++ b/src/engine/BL_Job.hxx @@ -89,6 +89,9 @@ namespace BL{ void setBatchQueue(const std::string & queue); std::string & getBatchQueue(); + void setWCKey(const std::string & wckey); + const std::string & getWCKey(); + void setLoadLevelerJobType(const std::string & jobtype); std::string & getLoadLevelerJobType(); @@ -119,6 +122,7 @@ namespace BL{ BL::Job::FilesParam _files_params; std::string _resource_choosed; std::string _batch_queue; + std::string _wckey; std::string _ll_jobtype; int _salome_launcher_id; diff --git a/src/engine/BL_SALOMEServices.cxx b/src/engine/BL_SALOMEServices.cxx index 30f6362..c5c1129 100644 --- a/src/engine/BL_SALOMEServices.cxx +++ b/src/engine/BL_SALOMEServices.cxx @@ -321,6 +321,7 @@ BL::SALOMEServices::create_job(BL::Job * job) job_parameters->resource_required.nb_proc = cpp_batch_params.nb_proc; job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str()); job_parameters->exclusive = cpp_batch_params.exclusive; + job_parameters->wckey = CORBA::string_dup(job->getWCKey().c_str()); // Memory switch (cpp_batch_params.mem_req_type) @@ -621,6 +622,7 @@ BL::SALOMEServices::get_new_job(int job_number) job_return->setJobFile(job_parameters->job_file.in()); job_return->setEnvFile(job_parameters->env_file.in()); job_return->setBatchQueue(job_parameters->queue.in()); + job_return->setWCKey(job_parameters->wckey.in()); BL::Job::FilesParam param; param.result_directory = job_parameters->result_directory.in(); diff --git a/src/genericgui/AdvancedParametersWizardPage.ui b/src/genericgui/AdvancedParametersWizardPage.ui new file mode 100644 index 0000000..ca09411 --- /dev/null +++ b/src/genericgui/AdvancedParametersWizardPage.ui @@ -0,0 +1,23 @@ + + + AdvancedParametersWizardPage + + + Advanced Parameters + + + + + + Workload Characterization Key (wckey): + + + + + + + + + + + diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 6ff0fe2..2fe128e 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -29,6 +29,7 @@ #include #include +#include #ifdef WNT #undef ERROR @@ -87,6 +88,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO setPage(Page_Files, new BL::FilesPage(this, salome_services)); setPage(Page_Resource, new BL::ResourcePage(this, salome_services)); + setPage(Page_Advanced, new BL::AdvancedParametersPage(this)); setPage(Page_Conclusion, new BL::ConclusionPage(this)); // Specific pages @@ -214,6 +216,7 @@ BL::CreateJobWizard::clone(const std::string & name) setField("resource_choosed", QString(job->getResource().c_str())); setField("batch_queue", QString(job->getBatchQueue().c_str())); setField("ll_jobtype", QString(job->getLoadLevelerJobType().c_str())); + setField("wckey", QString(job->getWCKey().c_str())); } } @@ -344,6 +347,10 @@ BL::CreateJobWizard::end(int result) ll_jobtype = ""; } + // WC Key + QString f_wckey = field("wckey").toString(); + wckey = f_wckey.trimmed().toUtf8().constData(); + start_job = field("start_job").toBool(); } } @@ -1041,7 +1048,7 @@ FilesPage::output_itemSelectionChanged() int FilesPage::nextId() const { - return BL::CreateJobWizard::Page_Conclusion; + return BL::CreateJobWizard::Page_Advanced; } BL::ConclusionPage::ConclusionPage(QWidget * parent) @@ -1281,3 +1288,24 @@ BL::PythonSalomeMainPage::nextId() const { return BL::CreateJobWizard::Page_Resource; } + + + +AdvancedParametersPage::AdvancedParametersPage(CreateJobWizard * parent) +: QWizardPage(parent), + ui(new Ui::AdvancedParametersWizardPage) +{ + ui->setupUi(this); + registerField("wckey", ui->line_wckey); +}; + +AdvancedParametersPage::~AdvancedParametersPage() +{ + delete ui; +} + +int +AdvancedParametersPage::nextId() const +{ + return BL::CreateJobWizard::Page_Conclusion; +} diff --git a/src/genericgui/BL_CreateJobWizard.hxx b/src/genericgui/BL_CreateJobWizard.hxx index 28f1585..d5c004a 100644 --- a/src/genericgui/BL_CreateJobWizard.hxx +++ b/src/genericgui/BL_CreateJobWizard.hxx @@ -32,6 +32,7 @@ namespace Ui { class ResourceRequirementsWizardPage; class FilesWizardPage; + class AdvancedParametersWizardPage; } namespace BL{ @@ -94,6 +95,7 @@ namespace BL{ std::string resource_choosed; std::string batch_queue; + std::string wckey; bool start_job; int dump_yacs_state; @@ -108,6 +110,7 @@ namespace BL{ Page_COORM_BatchParameters, Page_Files, Page_Resource, + Page_Advanced, Page_Conclusion}; }; @@ -316,6 +319,23 @@ namespace BL{ QLineEdit * _line_PythonSalome; QLineEdit * _line_env_file; }; + + class AdvancedParametersPage: public QWizardPage + { + Q_OBJECT + + public: + AdvancedParametersPage(BL::CreateJobWizard * parent); + virtual ~AdvancedParametersPage(); + + virtual int nextId() const; + virtual void cleanupPage() {} + + private: + Ui::AdvancedParametersWizardPage * ui; + + }; + } #endif diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index 47171ed..8369dc7 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -325,6 +325,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard) new_job->setResource(wizard.resource_choosed); new_job->setBatchQueue(wizard.batch_queue); new_job->setLoadLevelerJobType(wizard.ll_jobtype); + new_job->setWCKey(wizard.wckey); // End addJobToLauncher(wizard.job_name); diff --git a/src/genericgui/CMakeLists.txt b/src/genericgui/CMakeLists.txt index 3cfc8ca..5abfb51 100644 --- a/src/genericgui/CMakeLists.txt +++ b/src/genericgui/CMakeLists.txt @@ -88,6 +88,7 @@ SET(_other_SOURCES SET(_uic_files ResourceRequirementsWizardPage.ui FilesWizardPage.ui + AdvancedParametersWizardPage.ui ) # header files / uic wrappings -- 2.39.2