]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
- Some improvements:
authorribes <ribes>
Mon, 25 Jan 2010 10:03:46 +0000 (10:03 +0000)
committerribes <ribes>
Mon, 25 Jan 2010 10:03:46 +0000 (10:03 +0000)
  - status messages
  - Result directory without output files
  - job type explanation

src/engine/BL_JobsManager.cxx
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/BL_JobsManager_QT.cxx

index eabee2e47caf38359acc898c2bd9ad54084e50c7..b6e25a38596b132194bb441a936eb4bb0adef41f 100644 (file)
@@ -231,7 +231,16 @@ BL::JobsManager::refresh_job(void * object_ptr)
        if (job_state != BL::Job::FINISHED or job_state != BL::Job::ERROR)
        {
          std::string result = object->_salome_services->refresh_job(job);
-         if (result == "QUEUED")
+         if (result == "CREATED")
+         {
+           if (job_state != BL::Job::CREATED)
+           {
+             job->setState(BL::Job::CREATED);
+             if (object->_observer)
+               object->_observer->sendEvent("refresh_job", "Ok", job->getName(), "new state");
+           }
+         }
+         else if (result == "QUEUED")
          {
            if (job_state != BL::Job::QUEUED)
            {
@@ -269,15 +278,21 @@ BL::JobsManager::refresh_job(void * object_ptr)
          }
          else if (result == "FINISHED")
          {
-           job->setState(BL::Job::FINISHED);
-           if (object->_observer)
-             object->_observer->sendEvent("refresh_job", "Ok", job->getName(), "new state");
+           if (job_state != BL::Job::FINISHED)
+           {
+             job->setState(BL::Job::FINISHED);
+             if (object->_observer)
+               object->_observer->sendEvent("refresh_job", "Ok", job->getName(), "new state");
+           }
          }
          else if (result == "ERROR")
          {
-           job->setState(BL::Job::ERROR);
-           if (object->_observer)
-             object->_observer->sendEvent("refresh_job", "Ok", job->getName(), "new state");
+           if (job_state != BL::Job::ERROR)
+           {
+             job->setState(BL::Job::ERROR);
+             if (object->_observer)
+               object->_observer->sendEvent("refresh_job", "Ok", job->getName(), "new state");
+           }
          }
          else
          {
index eed2df291e1e0f6aa9f1140e4aaebd9ae1c9fcc3..70211a13e1fab33b3685a2d8525e1885245804fc 100644 (file)
@@ -171,7 +171,7 @@ BL::JobNamePage::JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager
   registerField("job_name", _nameLineEdit);
 
   QLabel * label_type = new QLabel("Choose type of batch job:");
-  QGroupBox *groupBox = new QGroupBox();
+  QGroupBox *groupBox = new QGroupBox("Type of job");
   _yacs_schema_button = new QRadioButton(tr("YACS Schema"));
   _yacs_schema_button->setChecked(true);
   _command_button = new QRadioButton(tr("Command"));
@@ -183,6 +183,14 @@ BL::JobNamePage::JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager
   vbox->addStretch(1);
   groupBox->setLayout(vbox);
 
+  QGroupBox * explanationBox = new QGroupBox("Explanation");
+  QVBoxLayout *explanationvbox = new QVBoxLayout;
+  _explanation = new QLabel();
+  _explanation->setWordWrap(true);
+  explanationvbox->addWidget(_explanation);
+  explanationvbox->addStretch(1);
+  explanationBox->setLayout(explanationvbox);
+
   // Layouts
   QVBoxLayout * main_layout = new QVBoxLayout;
   main_layout->addWidget(label);
@@ -192,12 +200,41 @@ BL::JobNamePage::JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager
   main_layout->insertLayout(-1, layout);
   layout->addWidget(label_type, 2, 0);
   layout->addWidget(groupBox, 3, 0, 1, -1);
+  layout->addWidget(explanationBox, 4, 0, 1, -1);
   setLayout(main_layout);
+
+  connect(_yacs_schema_button, SIGNAL(clicked(bool)), this, SLOT(yacs_schema_button(bool)));
+  connect(_command_button, SIGNAL(clicked(bool)), this, SLOT(command_button(bool)));
+  connect(_python_salome_button, SIGNAL(clicked(bool)), this, SLOT(python_salome_button(bool)));
+
+  // Default button
+  yacs_schema_button(true);
 }
 
 BL::JobNamePage::~JobNamePage()
 {}
 
+void
+BL::JobNamePage::yacs_schema_button(bool checked)
+{
+  if (checked)
+    _explanation->setText("This job permits to launch a YACS schema into a SALOME application");
+}
+
+void
+BL::JobNamePage::command_button(bool checked)
+{
+  if (checked)
+    _explanation->setText("This job permits to launch a script into a distributed resource. This script is not launched into a SALOME application");
+}
+
+void
+BL::JobNamePage::python_salome_button(bool checked)
+{
+  if (checked)
+    _explanation->setText("This job permits to launch a python script into a SALOME application");
+}
+
 bool
 BL::JobNamePage::validatePage()
 {
@@ -600,12 +637,6 @@ BL::FilesPage::validatePage()
     return false;
   }
 
-  if (result_directory != "" and _output_files_list->count() == 0)
-  {
-    QMessageBox::warning(NULL, "Result Error", "Please add output files or erase result directory");
-    return false;
-  }
-
   return true;
 }
 
index 76ede8e5b87da549ed6cc2700a62cadd80a18ca7..78bd2509209c9021aa99801385419e09e590ee93 100644 (file)
@@ -90,6 +90,8 @@ namespace BL{
 
   class JobNamePage: virtual public QWizardPage
   {
+    Q_OBJECT
+
     public:
       JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
       virtual ~JobNamePage();
@@ -97,11 +99,17 @@ namespace BL{
       virtual bool validatePage();
       virtual int nextId() const ;
 
+    public slots:
+      void yacs_schema_button(bool checked);
+      void command_button(bool checked);
+      void python_salome_button(bool checked);
+
     private:     
       BL::JobsManager_QT * _jobs_manager;
       QRadioButton * _yacs_schema_button;
       QRadioButton * _command_button;
       QRadioButton * _python_salome_button;
+      QLabel * _explanation;
   };
 
   class ConclusionPage: virtual public QWizardPage
index 97e25c9693fd88135e9f9f31f7a5cdd766b44c6e..f6c9627fb39faa5817370379e4336fde5741aec1 100644 (file)
@@ -44,6 +44,8 @@ BL::JobsManager_QT::JobsManager_QT(QWidget * parent, BL::SALOMEServices * salome
 
   _load_jobs = new QPushButton("Load Jobs");
   _save_jobs = new QPushButton("Save Jobs");
+  _load_jobs->setEnabled(false);
+  _save_jobs->setEnabled(false);
   _auto_refresh_jobs = new QPushButton("Auto Refresh: no");
   _timer = new QTimer(this);
   _timer->stop();