]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
- Compile with KERNEL interface
authorribes <ribes>
Thu, 7 Jan 2010 10:40:33 +0000 (10:40 +0000)
committerribes <ribes>
Thu, 7 Jan 2010 10:40:33 +0000 (10:40 +0000)
- Machine to Resource

17 files changed:
src/engine/BL_Job.cxx
src/engine/BL_Job.hxx
src/engine/BL_SALOMEServices.cxx
src/engine/BL_SALOMEServices.hxx
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/BL_GenericGui.cxx
src/genericgui/BL_GenericGui.hxx
src/genericgui/BL_JobTab.cxx
src/genericgui/BL_JobTab.hxx
src/genericgui/BL_JobsManager_QT.cxx
src/genericgui/BL_MachineCatalog.cxx [deleted file]
src/genericgui/BL_MachineCatalog.hxx [deleted file]
src/genericgui/BL_QModelManager.cxx
src/genericgui/JM_ResourceCatalog.cxx [new file with mode: 0644]
src/genericgui/JM_ResourceCatalog.hxx [new file with mode: 0644]
src/genericgui/Makefile.am

index 2d22f9357e08430de593ebaed2d4d955df01f941..958117524a1da951eb6c9a38dd58a19727db9c4c 100644 (file)
@@ -31,7 +31,7 @@ BL::Job::Job()
   _batch_params.expected_memory = "";
   _batch_params.nb_proc = 0;
   _files_params.result_directory = "";
-  _machine_choosed = "";
+  _resource_choosed = "";
   _batch_queue = "";
   _state = BL::Job::CREATED;
   _thread_state = BL::Job::NOTHING;
@@ -50,7 +50,7 @@ BL::Job::Job(const std::string & name)
   _batch_params.expected_memory = "";
   _batch_params.nb_proc = 0;
   _files_params.result_directory = "";
-  _machine_choosed = "";
+  _resource_choosed = "";
   _batch_queue = "";
   _state = BL::Job::CREATED;
   _thread_state = BL::Job::NOTHING;
@@ -150,15 +150,15 @@ BL::Job::getFilesParameters()
 }
 
 void
-BL::Job::setMachine(std::string & machine)
+BL::Job::setResource(std::string & resource)
 {
-  _machine_choosed = machine;
+  _resource_choosed = resource;
 }
 
 std::string &
-BL::Job::getMachine()
+BL::Job::getResource()
 {
-  return _machine_choosed;
+  return _resource_choosed;
 }
 
 void
index 3ea4658da016cde12b6650bcbd1969b33ff7b68e..df38b68711a0aa492d5668ed770529cc6567a850 100644 (file)
@@ -68,8 +68,8 @@ namespace BL{
       void setFilesParameters(BL::Job::FilesParam & param);
       BL::Job::FilesParam & getFilesParameters();
 
-      void setMachine(std::string & machine);
-      std::string & getMachine();
+      void setResource(std::string & resource);
+      std::string & getResource();
 
       void setBatchQueue(std::string & queue);
       std::string & getBatchQueue();
@@ -99,7 +99,7 @@ namespace BL{
   
       BL::Job::BatchParam _batch_params;
       BL::Job::FilesParam _files_params;
-      std::string _machine_choosed;
+      std::string _resource_choosed;
       std::string _batch_queue;
 
       int _salome_launcher_id;
index 4ecb47bfffae440d5d1a94884a495fead5d7201d..16910da766d11409312d4110cbd9be0b513cef26 100644 (file)
@@ -64,23 +64,23 @@ BL::SALOMEServices::initNS()
 }
 
 std::list<std::string> 
-BL::SALOMEServices::getMachineList()
+BL::SALOMEServices::getResourceList()
 {
-  std::list<std::string> machine_list;
+  std::list<std::string> resource_list;
   
   if (_state)
   {
-    Engines::MachineParameters params;
+    Engines::ResourceParameters params;
     _lcc->preSet(params);
-    Engines::MachineList * machineList = _resources_manager->GetFittingResources(params);
-    for (int i = 0; i < machineList->length(); i++)
+    Engines::ResourceList * resourceList = _resources_manager->GetFittingResources(params);
+    for (int i = 0; i < resourceList->length(); i++)
     {
-      const char* aMachine = (*machineList)[i];
-      machine_list.push_back(aMachine);
+      const char* aResource = (*resourceList)[i];
+      resource_list.push_back(aResource);
     }
   }
 
-  return machine_list;
+  return resource_list;
 }
 
 std::string
@@ -94,12 +94,12 @@ BL::SALOMEServices::create_job(BL::Job * job)
   if (job->getType() == BL::Job::COMMAND)
   {
     job_parameters->job_type = CORBA::string_dup("command");
-    job_parameters->command = CORBA::string_dup(job->getCommand().c_str());
+    job_parameters->job_file = CORBA::string_dup(job->getCommand().c_str());
   }
   else if (job->getType() == BL::Job::YACS_SCHEMA)
   {
     job_parameters->job_type = CORBA::string_dup("yacs_file");
-    job_parameters->yacs_file = CORBA::string_dup(job->getYACSFile().c_str());
+    job_parameters->job_file = CORBA::string_dup(job->getYACSFile().c_str());
   }
 
   // Files
@@ -130,7 +130,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
 
   // Resource
   job_parameters->maximum_duration = CORBA::string_dup(cpp_batch_params.maximum_duration.c_str());
-  job_parameters->resource_required.hostname = CORBA::string_dup(job->getMachine().c_str());
+  job_parameters->resource_required.name = CORBA::string_dup(job->getResource().c_str());
   job_parameters->resource_required.nb_node = cpp_batch_params.nb_proc;
   job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str());
 
index ef8ac9551bac12a481c75022bd0df59a4dd8416d..c81f022467fdd01a86021c0fd50e245345b246ea 100644 (file)
@@ -41,7 +41,7 @@ namespace BL{
 
       bool initNS();
 
-      std::list<std::string> getMachineList();
+      std::list<std::string> getResourceList();
 
       std::string create_job(BL::Job * job);
       std::string start_job(BL::Job * job);
index ad54e2df89c9a78d2d674c8eebc26c4cd025d7a8..733a2cb40b86957ba8bcc580a6c12bddf7f302bf 100644 (file)
@@ -37,7 +37,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO
 
   result_directory = "";
 
-  machine_choosed = "";
+  resource_choosed = "";
   batch_queue = "";
 
   start_job = false;
@@ -49,7 +49,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO
   setPage(Page_BatchParameters, new BL::BatchParametersPage(this));
   setPage(Page_Files, new BL::FilesPage(this));
   setPage(Page_Command_Main_Definitions, new BL::CommandMainPage(this));
-  setPage(Page_Machine, new BL::MachinePage(this, salome_services));
+  setPage(Page_Resource, new BL::ResourcePage(this, salome_services));
   setPage(Page_Conclusion, new BL::CreateJobWizard::ConclusionPage(this));
 
   setWindowTitle("Create Job Wizard");
@@ -130,9 +130,9 @@ BL::CreateJobWizard::end(int result)
       output_files_list.push_back(item_text.toStdString());
     }
 
-    // Machine list
-    QString f_machine_choosed = field("machine_choosed").toString();
-    machine_choosed = f_machine_choosed.toStdString(); 
+    // Resource list
+    QString f_resource_choosed = field("resource_choosed").toString();
+    resource_choosed = f_resource_choosed.toStdString(); 
 
     // Batch Queue
     QString f_batch_queue = field("batch_queue").toString();
@@ -651,7 +651,7 @@ BL::FilesPage::output_itemSelectionChanged()
 int 
 BL::FilesPage::nextId() const
 {
-  return BL::CreateJobWizard::Page_Machine;
+  return BL::CreateJobWizard::Page_Resource;
 }
 
 BL::CreateJobWizard::ConclusionPage::ConclusionPage(QWidget * parent)
@@ -680,77 +680,77 @@ BL::CreateJobWizard::ConclusionPage::nextId() const
   return -1;
 }
 
-BL::MachinePage::MachinePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services)
+BL::ResourcePage::ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services)
 : QWizardPage(parent)
 {
   _salome_services = salome_services;
-  setTitle("Select a Machine");
+  setTitle("Select a Resource");
 
-  QLabel * main_label = new QLabel("In this step you select the machine of your job");
+  QLabel * main_label = new QLabel("In this step you select the resource of your job");
   main_label->setWordWrap(true);
 
-  // input_Machine
-  QGroupBox * machine_group_box = new QGroupBox("Machine List");
-  _machine_list = new QListWidget();
-  _machine_list->setSelectionMode(QAbstractItemView::SingleSelection);
-  std::list<std::string> machine_list = _salome_services->getMachineList();
+  // input_Resource
+  QGroupBox * resource_group_box = new QGroupBox("Resource List");
+  _resource_list = new QListWidget();
+  _resource_list->setSelectionMode(QAbstractItemView::SingleSelection);
+  std::list<std::string> resource_list = _salome_services->getResourceList();
   std::list<std::string>::iterator it;
-  for (it = machine_list.begin(); it != machine_list.end(); it++)
+  for (it = resource_list.begin(); it != resource_list.end(); it++)
   {
-    std::string machine = *it;
-    _machine_list->addItem(QString(machine.c_str()));
+    std::string resource = *it;
+    _resource_list->addItem(QString(resource.c_str()));
   }
-  connect(_machine_list, SIGNAL(itemSelectionChanged()), this, SLOT(machine_itemSelectionChanged()));
-  QVBoxLayout * machine_list_layout = new QVBoxLayout();
-  machine_list_layout->addWidget(_machine_list);
-  machine_group_box->setLayout(machine_list_layout);
+  connect(_resource_list, SIGNAL(itemSelectionChanged()), this, SLOT(resource_itemSelectionChanged()));
+  QVBoxLayout * resource_list_layout = new QVBoxLayout();
+  resource_list_layout->addWidget(_resource_list);
+  resource_group_box->setLayout(resource_list_layout);
 
-  QLabel * machine_label = new QLabel("Machine selected: ");
-  _machine_choosed = new QLineEdit();
-  _machine_choosed->setText("");
-  _machine_choosed->setReadOnly(true);
-  registerField("machine_choosed", _machine_choosed);
+  QLabel * resource_label = new QLabel("Resource selected: ");
+  _resource_choosed = new QLineEdit();
+  _resource_choosed->setText("");
+  _resource_choosed->setReadOnly(true);
+  registerField("resource_choosed", _resource_choosed);
 
   QLabel * bqLabel = new QLabel("Batch Queue (optional):");
   QLineEdit * _bqLineEdit = new QLineEdit(this);
   registerField("batch_queue", _bqLineEdit);
 
   QGridLayout * main_layout = new QGridLayout;
-  main_layout->addWidget(machine_group_box, 0, 0, 1, -1);
-  main_layout->addWidget(machine_label, 1, 0);
-  main_layout->addWidget(_machine_choosed, 1, 1);
+  main_layout->addWidget(resource_group_box, 0, 0, 1, -1);
+  main_layout->addWidget(resource_label, 1, 0);
+  main_layout->addWidget(_resource_choosed, 1, 1);
   main_layout->addWidget(bqLabel, 2, 0);
   main_layout->addWidget(_bqLineEdit, 2, 1);
   setLayout(main_layout);
 };
 
-BL::MachinePage::~MachinePage()
+BL::ResourcePage::~ResourcePage()
 {}
 
 bool
-BL::MachinePage::validatePage()
+BL::ResourcePage::validatePage()
 {
-  QString machine_choosed = field("machine_choosed").toString();
-  if (machine_choosed == "")
+  QString resource_choosed = field("resource_choosed").toString();
+  if (resource_choosed == "")
   {
-    QMessageBox::warning(NULL, "Machine Error", "Please choose a machine");
+    QMessageBox::warning(NULL, "Resource Error", "Please choose a resource");
     return false;
   }
   return true;
 }
 
 void 
-BL::MachinePage::machine_itemSelectionChanged()
+BL::ResourcePage::resource_itemSelectionChanged()
 {
-  _machine_choosed->setReadOnly(false);
-  QList<QListWidgetItem *> list = _machine_list->selectedItems();
+  _resource_choosed->setReadOnly(false);
+  QList<QListWidgetItem *> list = _resource_list->selectedItems();
   QListWidgetItem * item = list.at(0);
-  _machine_choosed->setText(item->text());
-  _machine_choosed->setReadOnly(true);
+  _resource_choosed->setText(item->text());
+  _resource_choosed->setReadOnly(true);
 }
 
 int 
-BL::MachinePage::nextId() const
+BL::ResourcePage::nextId() const
 {
   return BL::CreateJobWizard::Page_Conclusion;
 }
index 3b36b2cebafe2f0f4da1bc4821ef255ee7616951..ffd6612fcaad557c9c3027b0e142c83fa51c4ae8 100644 (file)
@@ -70,14 +70,14 @@ namespace BL{
       std::list<std::string> input_files_list;
       std::list<std::string> output_files_list;
 
-      std::string machine_choosed;
+      std::string resource_choosed;
       std::string batch_queue;
 
       bool start_job;
 
     public:
       enum {Page_JobName, Page_YACSSchema, Page_BatchParameters, Page_Files, 
-       Page_Command_Main_Definitions, Page_Machine, Page_Conclusion};
+       Page_Command_Main_Definitions, Page_Resource, Page_Conclusion};
 
       class JobNamePage: virtual public QWizardPage
       {
@@ -190,23 +190,23 @@ namespace BL{
       QListWidget * _output_files_list;
   };
 
-  class MachinePage: virtual public QWizardPage
+  class ResourcePage: virtual public QWizardPage
   {
     Q_OBJECT
 
     public:
-      MachinePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
-      virtual ~MachinePage();
+      ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
+      virtual ~ResourcePage();
 
       virtual int nextId() const;
       virtual bool validatePage();
 
     public slots:
-      void machine_itemSelectionChanged();
+      void resource_itemSelectionChanged();
 
     private:
-      QListWidget * _machine_list;
-      QLineEdit * _machine_choosed;
+      QListWidget * _resource_list;
+      QLineEdit * _resource_choosed;
       BL::SALOMEServices * _salome_services;
   };
 }
index 49d37af618b868bc474d8e414f707bec7953f387..66aae0de2aaf4da751340a469956a1e52f56ecaf 100644 (file)
@@ -82,18 +82,18 @@ BL::GenericGui::GenericGui(BL::MainWindows_Wrap * wrapper) : QObject(wrapper->ge
   _summary->setModel(_model);
   _dw_summary->setWidget(_summary);
 
-  /* MachineCatalog */
-  _dw_machine_catalog = new QDockWidget(_dock_parent);
-  _dw_machine_catalog->setWindowTitle("Machine Catalog");
-  _machine_catalog = new BL::MachineCatalog(_dock_parent, _salome_services);
-  _dw_machine_catalog->setWidget(_machine_catalog);
+  /* ResourceCatalog */
+  _dw_resource_catalog = new QDockWidget(_dock_parent);
+  _dw_resource_catalog->setWindowTitle("Resource Catalog");
+  _resource_catalog = new JM::ResourceCatalog(_dock_parent, _salome_services);
+  _dw_resource_catalog->setWidget(_resource_catalog);
 
   /* Main Dock Window */
   _dock_parent->addDockWidget(Qt::RightDockWidgetArea, _jobs_manager);
   _dock_parent->addDockWidget(Qt::RightDockWidgetArea, _dw_summary);
-  _dock_parent->addDockWidget(Qt::RightDockWidgetArea, _dw_machine_catalog);
+  _dock_parent->addDockWidget(Qt::RightDockWidgetArea, _dw_resource_catalog);
   _dock_parent->splitDockWidget(_jobs_manager, _dw_summary, Qt::Vertical);
-  _dock_parent->tabifyDockWidget(_dw_summary, _dw_machine_catalog);
+  _dock_parent->tabifyDockWidget(_dw_summary, _dw_resource_catalog);
 
   /* Signals and Slots */
 
@@ -130,7 +130,7 @@ BL::GenericGui::showDockWidgets(bool isVisible)
   DEBTRACE("BL::GenericGui::showDockWidgets " << isVisible);
   if (_jobs_manager) _jobs_manager->setVisible(isVisible);
   if (_dw_summary) _dw_summary->setVisible(isVisible);
-  if (_dw_machine_catalog) _dw_machine_catalog->setVisible(isVisible);
+  if (_dw_resource_catalog) _dw_resource_catalog->setVisible(isVisible);
 }
 
 void
index 161a24e41184b1a91a92889e3870fbc45eebdc85..5a80e5e747683d3730f102dac17fc630a40470b4 100644 (file)
@@ -34,7 +34,7 @@
 #include "BL_JobTab.hxx"
 #include "BL_Buttons.hxx"
 #include "BL_Summary.hxx"
-#include "BL_MachineCatalog.hxx"
+#include "JM_ResourceCatalog.hxx"
 
 namespace BL 
 {
@@ -72,7 +72,7 @@ namespace BL
       QMainWindow * _dock_parent;
       QMainWindow * _tab_parent;
       QDockWidget * _dw_summary;
-      QDockWidget * _dw_machine_catalog;
+      QDockWidget * _dw_resource_catalog;
      
       BL::Buttons * _buttons;
       BL::JobsTable * _jobs_table;  
@@ -88,7 +88,7 @@ namespace BL
       BL::JobsManager_QT * _jobs_manager;
       BL::QModelManager * _model_manager;
       QStandardItemModel * _model;
-      BL::MachineCatalog * _machine_catalog;
+      JM::ResourceCatalog * _resource_catalog;
 
       int _row_selected;
       QString _job_name_selected;
index 3be18ad76a6bea67163595e9e10ecedc19078f24..c78d93c810a704e36680f2bf0e1ed33e83997f47 100644 (file)
@@ -61,8 +61,8 @@ BL::JobTab::createJobSummaryTab()
   _job_type_label_value = new QLabel("");
   QLabel * job_state_label = new QLabel("State:");
   _job_state_label_value = new QLabel("");
-  QLabel * job_machine_label = new QLabel("Machine:");
-  _job_machine_label_value = new QLabel("");
+  QLabel * job_resource_label = new QLabel("Resource:");
+  _job_resource_label_value = new QLabel("");
   _job_command_label = new QLabel("Schema or Command:");
   _job_command_label_value = new QLabel("");
 
@@ -71,7 +71,7 @@ BL::JobTab::createJobSummaryTab()
   values_form->insertRow(0, job_name_label, _job_name_label_value);
   values_form->insertRow(1, job_type_label, _job_type_label_value);
   values_form->insertRow(2, job_state_label, _job_state_label_value);
-  values_form->insertRow(3, job_machine_label, _job_machine_label_value);
+  values_form->insertRow(3, job_resource_label, _job_resource_label_value);
   values_form->insertRow(4, _job_command_label, _job_command_label_value);
   main_values_box->setLayout(values_form);
 
@@ -177,7 +177,7 @@ BL::JobTab::job_selected(const QModelIndex & index)
       _job_type_label_value->setText("Command");
     }
 
-    _job_machine_label_value->setText(QString(job->getMachine().c_str()));
+    _job_resource_label_value->setText(QString(job->getResource().c_str()));
 
     BL::Job::BatchParam batch_params = job->getBatchParameters();
 
@@ -243,7 +243,7 @@ BL::JobTab::reset(QString job_name)
   _job_name_label_value->setText("");
   _job_type_label_value->setText("");
   _job_state_label_value->setText("");
-  _job_machine_label_value->setText("");
+  _job_resource_label_value->setText("");
   _job_nif_label_value->setText("");
   _job_nof_label_value->setText("");
   _job_bd_label_value->setText("");
index 7f1031ec68eb210c2ce8bb6ddb93feb6c9e3c2f2..cd40316f0e444e63d4e9d30274ee03b75f04b664 100644 (file)
@@ -54,7 +54,7 @@ namespace BL
       QLabel * _job_name_label_value;
       QLabel * _job_type_label_value;
       QLabel * _job_state_label_value;
-      QLabel * _job_machine_label_value;
+      QLabel * _job_resource_label_value;
       QLabel * _job_command_label;
       QLabel * _job_command_label_value;
 
index bcd1e3342c91ecda4049542a52b92c3361e8650a..c9d642b83b9a5a03aeea7f3f84d6e8bb606a723b 100644 (file)
@@ -173,7 +173,7 @@ BL::JobsManager_QT::create_job_wizard()
        files_params.input_files_list = wizard.input_files_list;
        files_params.output_files_list = wizard.output_files_list;
        new_job->setFilesParameters(files_params);
-       new_job->setMachine(wizard.machine_choosed);
+       new_job->setResource(wizard.resource_choosed);
        new_job->setBatchQueue(wizard.batch_queue);
       }
       else
@@ -193,7 +193,7 @@ BL::JobsManager_QT::create_job_wizard()
        files_params.input_files_list = wizard.input_files_list;
        files_params.output_files_list = wizard.output_files_list;
        new_job->setFilesParameters(files_params);
-       new_job->setMachine(wizard.machine_choosed);
+       new_job->setResource(wizard.resource_choosed);
        new_job->setBatchQueue(wizard.batch_queue);
       }
       addJobToLauncher(wizard.job_name);
diff --git a/src/genericgui/BL_MachineCatalog.cxx b/src/genericgui/BL_MachineCatalog.cxx
deleted file mode 100644 (file)
index eae8ded..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//  Copyright (C) 2009 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
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "BL_MachineCatalog.hxx"
-#include "BL_Traces.hxx"
-
-BL::MachineCatalog::MachineCatalog(QWidget *parent, BL::SALOMEServices * salome_services) : QWidget(parent)
-{
-  DEBTRACE("Creating BL::MachineCatalog");
-  BL_ASSERT(parent);
-  BL_ASSERT(salome_services);
-  _parent = parent;
-  _salome_services = salome_services;
-  
-  _refresh_button = new QPushButton("Refresh Machine List");
-  _refresh_button->show();
-  connect(_refresh_button, SIGNAL(clicked()), this, SLOT(refresh_machine_list()));
-  _machine_files_list = new QListWidget(this);
-  _machine_files_list->setSelectionMode(QAbstractItemView::NoSelection);
-  std::list<std::string> machine_list = _salome_services->getMachineList();
-  std::list<std::string>::iterator it;
-  for (it = machine_list.begin(); it != machine_list.end(); it++)
-  {
-    std::string machine = *it;
-    _machine_files_list->addItem(QString(machine.c_str()));
-  }
-
-  QVBoxLayout * mainLayout = new QVBoxLayout(this);
-  mainLayout->addWidget(_refresh_button);
-  mainLayout->addWidget(_machine_files_list);
-  setLayout(mainLayout);
-}
-
-BL::MachineCatalog::~MachineCatalog()
-{
-  DEBTRACE("Destroying BL::MachineCatalog");
-}
-
-void
-BL::MachineCatalog::refresh_machine_list()
-{
-  _machine_files_list->clear();
-  std::list<std::string> machine_list = _salome_services->getMachineList();
-  std::list<std::string>::iterator it;
-  for (it = machine_list.begin(); it != machine_list.end(); it++)
-  {
-    std::string machine = *it;
-    _machine_files_list->addItem(QString(machine.c_str()));
-  }
-}
diff --git a/src/genericgui/BL_MachineCatalog.hxx b/src/genericgui/BL_MachineCatalog.hxx
deleted file mode 100644 (file)
index 95355b4..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-//  Copyright (C) 2009 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
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _BL_MACHINECATALOG_HXX_
-#define _BL_MACHINECATALOG_HXX_
-
-#include <QtGui>
-
-#include "BL_SALOMEServices.hxx"
-
-#include <string>
-#include <list>
-
-namespace BL 
-{
-  class MachineCatalog: public QWidget
-  {
-    Q_OBJECT
-
-    public:
-      MachineCatalog(QWidget *parent, BL::SALOMEServices * salome_services);
-      virtual ~MachineCatalog();
-
-    public slots:
-      void refresh_machine_list();
-
-    protected:
-      QWidget* _parent;
-      BL::SALOMEServices * _salome_services;
-
-      QPushButton * _refresh_button;
-      QListWidget * _machine_files_list;
-  };
-}
-
-#endif
-
-
index 6412dd21d37c8fe7d9a8cc79fe669ecc8f0f0335..e806ac7c17345cd138bb1fa55bbfa525d2d624fb 100644 (file)
@@ -27,7 +27,7 @@ BL::QModelManager::QModelManager(QObject * parent, BL::JobsManager_QT * jobs_man
 
   _model = new QStandardItemModel(this);
   QStringList headers;
-  headers << "Job Name" << "Type" << "State" << "Machine";
+  headers << "Job Name" << "Type" << "State" << "Resource";
   _model->setHorizontalHeaderLabels(headers);
 }
 
@@ -70,13 +70,13 @@ BL::QModelManager::new_job_added(const QString & name)
   else 
     new_job_state = new QStandardItem("Finished");
 
-  QStandardItem * new_job_machine =  new QStandardItem(job->getMachine().c_str());
+  QStandardItem * new_job_resource =  new QStandardItem(job->getResource().c_str());
 
   int row = _model->rowCount();
   _model->setItem(row, 0, new_job_name);
   _model->setItem(row, 1, new_job_type);
   _model->setItem(row, 2, new_job_state);
-  _model->setItem(row, 3, new_job_machine);
+  _model->setItem(row, 3, new_job_resource);
 }
 
 void
diff --git a/src/genericgui/JM_ResourceCatalog.cxx b/src/genericgui/JM_ResourceCatalog.cxx
new file mode 100644 (file)
index 0000000..1ca831a
--- /dev/null
@@ -0,0 +1,66 @@
+//  Copyright (C) 2009 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
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "JM_ResourceCatalog.hxx"
+#include "BL_Traces.hxx"
+
+JM::ResourceCatalog::ResourceCatalog(QWidget *parent, BL::SALOMEServices * salome_services) : QWidget(parent)
+{
+  DEBTRACE("Creating JM::ResourceCatalog");
+  BL_ASSERT(parent);
+  BL_ASSERT(salome_services);
+  _parent = parent;
+  _salome_services = salome_services;
+  
+  _refresh_button = new QPushButton("Refresh Resource List");
+  _refresh_button->show();
+  connect(_refresh_button, SIGNAL(clicked()), this, SLOT(refresh_resource_list()));
+  _resource_files_list = new QListWidget(this);
+  _resource_files_list->setSelectionMode(QAbstractItemView::NoSelection);
+  std::list<std::string> resource_list = _salome_services->getResourceList();
+  std::list<std::string>::iterator it;
+  for (it = resource_list.begin(); it != resource_list.end(); it++)
+  {
+    std::string resource = *it;
+    _resource_files_list->addItem(QString(resource.c_str()));
+  }
+
+  QVBoxLayout * mainLayout = new QVBoxLayout(this);
+  mainLayout->addWidget(_refresh_button);
+  mainLayout->addWidget(_resource_files_list);
+  setLayout(mainLayout);
+}
+
+JM::ResourceCatalog::~ResourceCatalog()
+{
+  DEBTRACE("Destroying JM::ResourceCatalog");
+}
+
+void
+JM::ResourceCatalog::refresh_resource_list()
+{
+  _resource_files_list->clear();
+  std::list<std::string> resource_list = _salome_services->getResourceList();
+  std::list<std::string>::iterator it;
+  for (it = resource_list.begin(); it != resource_list.end(); it++)
+  {
+    std::string resource = *it;
+    _resource_files_list->addItem(QString(resource.c_str()));
+  }
+}
diff --git a/src/genericgui/JM_ResourceCatalog.hxx b/src/genericgui/JM_ResourceCatalog.hxx
new file mode 100644 (file)
index 0000000..59e3699
--- /dev/null
@@ -0,0 +1,54 @@
+//  Copyright (C) 2009 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
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _JM_RESOURCECATALOG_HXX_
+#define _JM_RESOURCECATALOG_HXX_
+
+#include <QtGui>
+
+#include "BL_SALOMEServices.hxx"
+
+#include <string>
+#include <list>
+
+namespace JM 
+{
+  class ResourceCatalog: public QWidget
+  {
+    Q_OBJECT
+
+    public:
+      ResourceCatalog(QWidget *parent, BL::SALOMEServices * salome_services);
+      virtual ~ResourceCatalog();
+
+    public slots:
+      void refresh_resource_list();
+
+    protected:
+      QWidget* _parent;
+      BL::SALOMEServices * _salome_services;
+
+      QPushButton * _refresh_button;
+      QListWidget * _resource_files_list;
+  };
+}
+
+#endif
+
+
index e0e69f370c2c723e0ed7937235fafcf22c0e3c67..383fd240a8a030020ac6b4b35751cbcfaddb1783 100644 (file)
@@ -29,13 +29,13 @@ libBL_GenericGui_la_SOURCES = BL_GenericGui.hxx BL_GenericGui.cxx \
                              BL_QModelManager.hxx BL_QModelManager.cxx \
                              BL_CreateJobWizard.hxx BL_CreateJobWizard.cxx \
                              BL_Summary.hxx BL_Summary.cxx \
-                             BL_MachineCatalog.hxx BL_MachineCatalog.cxx
+                             JM_ResourceCatalog.hxx JM_ResourceCatalog.cxx
 
 nodist_libBL_GenericGui_la_SOURCES = BL_GenericGui_moc.cxx BL_JobsTable_moc.cxx \
                                     BL_JobTab_moc.cxx  \
                                     BL_Buttons_moc.cxx BL_JobsManager_QT_moc.cxx \
                                     BL_QModelManager_moc.cxx BL_CreateJobWizard_moc.cxx \
-                                    BL_Summary_moc.cxx BL_MachineCatalog_moc.cxx
+                                    BL_Summary_moc.cxx JM_ResourceCatalog_moc.cxx
 
 libBL_GenericGui_la_CXXFLAGS = $(qt4_cppflags) \
                               -I$(top_srcdir)/src/bases \