-// Copyright (C) 2009-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "BL_JobsManager_QT.hxx"
#include "BL_GenericGui.hxx"
+
+#include <QApplication>
+#include <QFileDialog>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QMenu>
+#include <QPushButton>
+#include <QScrollArea>
+#include <QStandardItemModel>
+#include <QTextEdit>
+#include <QTimer>
+#include <QVBoxLayout>
#include <vector>
using namespace std;
connect(_load_jobs, SIGNAL(clicked()), this, SLOT(load_jobs_button()));
connect(_save_jobs, SIGNAL(clicked()), this, SLOT(save_jobs_button()));
- _auto_refresh_jobs = new QPushButton("Auto Refresh: no");
+ _auto_refresh_jobs = new QPushButton("Auto Refresh: 30s");
_timer = new QTimer(this);
_timer->stop();
+ _timer->start(30 * 1000);
connect(_timer, SIGNAL(timeout()), this, SLOT(RefreshJobs()));
// Menu for auto refresh
scroll_widget->setWidgetResizable(true);
setWidget(scroll_widget);
setWindowTitle("Job Manager");
- setObjectName("JobManagerDockWidget");
+ setObjectName("jmJobManagerDock");
}
BL::JobsManager_QT::~JobsManager_QT()
filters << "XML files (*.xml)"
<< "Any files (*)";
dialog.setFileMode(QFileDialog::AnyFile);
- dialog.setFilters(filters);
- dialog.selectFilter("(*.xml)");
+ dialog.setNameFilters(filters);
+ dialog.selectNameFilter("(*.xml)");
dialog.setDefaultSuffix("xml");
dialog.setConfirmOverwrite(true);
dialog.setAcceptMode(QFileDialog::AcceptSave);
BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
{
BL::Job * new_job = createJob(wizard.job_name);
- if (wizard.yacs_file != "")
+ switch (wizard.job_type)
{
+ case BL::CreateJobWizard::YACS:
// YACS schema job
new_job->setType(BL::Job::YACS_SCHEMA);
new_job->setJobFile(wizard.yacs_file);
new_job->setDumpYACSState(wizard.dump_yacs_state);
- }
- else if (wizard.command != "")
- {
+ new_job->setYacsDriverOptions(wizard.yacs_driver_options);
+ break;
+ case BL::CreateJobWizard::COMMAND:
// Command Job
new_job->setType(BL::Job::COMMAND);
new_job->setJobFile(wizard.command);
- }
- else if (wizard.python_salome_file != "")
- {
+ break;
+ case BL::CreateJobWizard::COMMAND_SALOME:
// Command Job
+ new_job->setType(BL::Job::COMMAND_SALOME);
+ new_job->setJobFile(wizard.command);
+ break;
+ case BL::CreateJobWizard::PYTHON_SALOME:
+ // Python Salome Job
new_job->setType(BL::Job::PYTHON_SALOME);
new_job->setJobFile(wizard.python_salome_file);
+ break;
+ default:
+ throw BL::Exception("Unknown job type");
}
// For all jobs
new_job->setEnvFile(wizard.env_file);
+ new_job->setPreCommand(wizard.pre_command);
BL::Job::BatchParam param;
// For COORM
param.mem_limit = wizard.mem_limit;
param.mem_req_type = wizard.mem_req_type;
param.nb_proc = wizard.nb_proc;
+ param.nb_node = wizard.nb_node;
param.exclusive = wizard.exclusive;
// Parameters for COORM
new_job->setFilesParameters(files_params);
new_job->setResource(wizard.resource_choosed);
new_job->setBatchQueue(wizard.batch_queue);
+ new_job->setBatchPartition(wizard.batch_partition);
new_job->setLoadLevelerJobType(wizard.ll_jobtype);
+ new_job->setWCKey(wizard.wckey);
+ new_job->setExtraParams(wizard.extra_params);
// End
addJobToLauncher(wizard.job_name);
{
if (event->event_name == "Ok")
{
- write_normal_text("Results of Job " + job_name + " are get\n");
+ write_normal_text("Results of Job " + job_name + " have been got.\n");
}
else
{