From b347fc93340fd6d523c6c891ff5321b96afad4ac Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 20 May 2016 17:44:25 +0300 Subject: [PATCH 01/16] Increment version: 7.8.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41dc892..05a4b75 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,11 @@ CMAKE_POLICY(SET CMP0003 NEW) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 7) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 8) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 1) +SET(${PROJECT_NAME_UC}_VERSION_DEV 0) # Find KERNEL # =========== -- 2.39.2 From b21a3d5b68e9c2fc0b2692d3919c76029c72e023 Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 18 Jul 2016 15:57:43 +0300 Subject: [PATCH 02/16] Windows compatibility --- src/engine/BL_SALOMEServices.cxx | 2 +- src/genericgui/BL_CreateJobWizard.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/BL_SALOMEServices.cxx b/src/engine/BL_SALOMEServices.cxx index 2082b22..bc7e640 100644 --- a/src/engine/BL_SALOMEServices.cxx +++ b/src/engine/BL_SALOMEServices.cxx @@ -277,7 +277,7 @@ BL::SALOMEServices::create_job(BL::Job * job) new_parameter->value = CORBA::string_dup(oss.str().c_str()); job_parameters->specific_parameters[job_parameters->specific_parameters.length() - 1] = new_parameter; } - if (not job->getYacsDriverOptions().empty()) + if (!job->getYacsDriverOptions().empty()) { job_parameters->specific_parameters.length(job_parameters->specific_parameters.length() + 1); Engines::Parameter_var new_parameter = new Engines::Parameter; diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index bf4fd3a..eba7034 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -139,7 +139,7 @@ BL::CreateJobWizard::clone(const std::string & name) value.setNum(job->getDumpYACSState()); setField("dump_yacs_state", value); } - if (not job->getYacsDriverOptions().empty()) + if (!job->getYacsDriverOptions().empty()) { setField("yacs_driver_options", job->getYacsDriverOptions().c_str()); } -- 2.39.2 From f6e6ec28285e91cd1c3f96ff37d172ad18c512df Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 25 Jul 2016 17:06:07 +0300 Subject: [PATCH 03/16] Windows: suppress Cmake warnings --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39fb9fb..b88d4d6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,9 @@ PROJECT(SalomeJOBMANAGER C CXX) # Ensure a proper linker behavior: CMAKE_POLICY(SET CMP0003 NEW) +IF(WIN32) + CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib +ENDIF(WIN32) # Versioning # =========== -- 2.39.2 From 3df7b140d9b9e11889486114af29caafe3063438 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 28 Jul 2016 14:25:22 +0300 Subject: [PATCH 04/16] Merge 'abn/configuration' into master branch. --- CMakeLists.txt | 12 +++++-- adm_local/CMakeLists.txt | 1 - adm_local/cmake_files/CMakeLists.txt | 28 --------------- .../cmake_files/FindSalomeJOBMANAGER.cmake | 34 ------------------- 4 files changed, 10 insertions(+), 65 deletions(-) delete mode 100755 adm_local/cmake_files/CMakeLists.txt delete mode 100644 adm_local/cmake_files/FindSalomeJOBMANAGER.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b88d4d6..75a95a1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,16 @@ SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) SET(${PROJECT_NAME_UC}_VERSION_DEV 1) +# Common CMake macros +# =================== +SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files") +IF(EXISTS ${CONFIGURATION_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake") + INCLUDE(SalomeMacros) +ELSE() + MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") +ENDIF() + # Find KERNEL # =========== SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") @@ -54,8 +64,6 @@ ENDIF(EXISTS ${KERNEL_ROOT_DIR}) INCLUDE(SalomeSetupPlatform) # From KERNEL # Always build libraries as shared objects: SET(BUILD_SHARED_LIBS TRUE) -# Local macros: -LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") # User options # ============ diff --git a/adm_local/CMakeLists.txt b/adm_local/CMakeLists.txt index 907360e..4df2dc0 100755 --- a/adm_local/CMakeLists.txt +++ b/adm_local/CMakeLists.txt @@ -18,4 +18,3 @@ # ADD_SUBDIRECTORY(unix) -ADD_SUBDIRECTORY(cmake_files) diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt deleted file mode 100755 index f047158..0000000 --- a/adm_local/cmake_files/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2012-2016 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, or (at your option) any later version. -# -# 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 -# - -# =============================================================== -# Files to be installed -# =============================================================== - -# These files are data, module or lib files -SET(_adm_data - FindSalomeJOBMANAGER.cmake -) -INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL}) diff --git a/adm_local/cmake_files/FindSalomeJOBMANAGER.cmake b/adm_local/cmake_files/FindSalomeJOBMANAGER.cmake deleted file mode 100644 index 8a9b4cf..0000000 --- a/adm_local/cmake_files/FindSalomeJOBMANAGER.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2007-2016 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, or (at your option) any later version. -# -# 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 -# - -IF(NOT SalomeJOBMANAGER_FIND_QUIETLY) - MESSAGE(STATUS "Looking for Salome JOBMANAGER ...") -ENDIF() - -SET(CMAKE_PREFIX_PATH "${JOBMANAGER_ROOT_DIR}") - -SALOME_FIND_PACKAGE(SalomeJOBMANAGER SalomeJOBMANAGER CONFIG) - -IF(NOT SalomeJOBMANAGER_FIND_QUIETLY) - MESSAGE(STATUS "Found Salome JOBMANAGER: ${JOBMANAGER_ROOT_DIR}") -ENDIF() - -FOREACH(_res ${SalomeJOBMANAGER_EXTRA_ENV}) - SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeJOBMANAGER_EXTRA_ENV_${_res}}") -ENDFOREACH() \ No newline at end of file -- 2.39.2 From 8aa63006f0b8ff0a0a3e6e0c971ef25a9533e553 Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 24 Aug 2016 19:25:41 +0300 Subject: [PATCH 05/16] Fix for '0053540: Crash on activating JOBMANAGER' issue. --- src/genericgui/BL_JobsTable.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/genericgui/BL_JobsTable.cxx b/src/genericgui/BL_JobsTable.cxx index c04c9ef..ac51b67 100644 --- a/src/genericgui/BL_JobsTable.cxx +++ b/src/genericgui/BL_JobsTable.cxx @@ -83,7 +83,10 @@ BL::JobsTable::selectionChanged ( const QItemSelection & selected, const QItemSe QModelIndexList selected_rows = selectionModel()->selectedRows(); if (selected_rows.length() == 0) { - _main_gui->reset_job_selection(); + if (_main_gui) + { + _main_gui->reset_job_selection(); + } } else if (selected_rows.length() == 1) { -- 2.39.2 From 76b38e9c121d9c63ccdd01495fa5a65940206223 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 13 Sep 2016 12:46:16 +0300 Subject: [PATCH 06/16] Increment version: 8.1.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75a95a1..bc35f2e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,11 +31,11 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 0) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 1) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 1) +SET(${PROJECT_NAME_UC}_VERSION_DEV 0) # Common CMake macros # =================== -- 2.39.2 From f89de0c44c8f1cbd9a6c30c6614a7f917ce29c43 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 28 Sep 2016 13:15:37 +0300 Subject: [PATCH 07/16] Set dev version marker to 1. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc35f2e..364e10c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 1) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 0) +SET(${PROJECT_NAME_UC}_VERSION_DEV 1) # Common CMake macros # =================== -- 2.39.2 From aaf64126a396abbcb9f1f66590ffd2e8c437860d Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 29 Nov 2016 16:33:12 +0300 Subject: [PATCH 08/16] Increment version: 8.2.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 364e10c..d29a521 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 1) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 2) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -- 2.39.2 From c62ec6549eded9348d8b0f564688c691f044b223 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 7 Mar 2017 17:46:08 +0300 Subject: [PATCH 09/16] Build SALOME on Fedora-24 with native products. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d29a521..1d75b0a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,11 @@ IF(SALOME_USE_MPI) FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx ENDIF() IF(SALOME_BUILD_DOC) + + # Python: should be detected before sphinx + FIND_PACKAGE(SalomePythonInterp REQUIRED) + FIND_PACKAGE(SalomePythonLibs REQUIRED) + FIND_PACKAGE(SalomeSphinx) SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC) ENDIF() -- 2.39.2 From 37965b0a1eddeca979b7aa79d2e5685bf5ba7129 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 7 Apr 2017 15:29:45 +0300 Subject: [PATCH 10/16] Increment version: 8.3.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d75b0a..991a755 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,11 +31,11 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 2) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 3) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 1) +SET(${PROJECT_NAME_UC}_VERSION_DEV 0) # Common CMake macros # =================== -- 2.39.2 From 22edb677a083146acf2b0b4c068e4bc5ebee8c81 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 28 Apr 2017 16:27:59 +0300 Subject: [PATCH 11/16] Merge V8_3_BR branch. --- CMakeLists.txt | 2 +- doc/conf.py.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 991a755..02c7100 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 3) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 0) +SET(${PROJECT_NAME_UC}_VERSION_DEV 1) # Common CMake macros # =================== diff --git a/doc/conf.py.in b/doc/conf.py.in index 0712436..8bffbc9 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -39,7 +39,7 @@ master_doc = 'index' # General information about the project. project = 'jobmanager' -copyright = '2010-2016 CEA/DEN, EDF R&D, A. Ribes' +copyright = '2010-2017 CEA/DEN, EDF R&D, A. Ribes' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the -- 2.39.2 From f73ad33a0e91d570fd5da3bb4c7a5124b59fc657 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 3 Oct 2017 11:19:31 +0300 Subject: [PATCH 12/16] Merge V8_4_BR branch. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02c7100..24b96f4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ ENDIF(WIN32) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 3) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 4) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -- 2.39.2 From 9a115d09d791b6fab1ed6f5d7fffdb2bce83fff3 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 14 Dec 2017 10:32:26 +0100 Subject: [PATCH 13/16] Fix standalone window. --- src/standalone/main.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/standalone/main.cxx b/src/standalone/main.cxx index 53a44c0..31bc64c 100644 --- a/src/standalone/main.cxx +++ b/src/standalone/main.cxx @@ -30,6 +30,8 @@ int main(int argc, char *argv[]) QMainWindow main_window; BL::MainWindows_Qt wrapper(&main_window); BL::GenericGui * main_widget = new BL::GenericGui(&wrapper); + main_widget->createDockWidgets(); + main_widget->createCentralWidget(); main_widget->createActions(); main_widget->createMenus(); main_widget->updateButtonsStates(); -- 2.39.2 From dcfaadac21fb066b95142a2a0f63fb77db553b86 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Fri, 15 Dec 2017 16:52:59 +0100 Subject: [PATCH 14/16] Add preprocess command. --- src/engine/BL_Job.cxx | 14 ++++ src/engine/BL_Job.hxx | 4 ++ src/engine/BL_SALOMEServices.cxx | 2 + src/genericgui/BL_CreateJobWizard.cxx | 97 +++++++++++++++++++++++---- src/genericgui/BL_CreateJobWizard.hxx | 7 ++ src/genericgui/BL_JobsManager_QT.cxx | 1 + 6 files changed, 112 insertions(+), 13 deletions(-) diff --git a/src/engine/BL_Job.cxx b/src/engine/BL_Job.cxx index a380c86..11ed0a1 100644 --- a/src/engine/BL_Job.cxx +++ b/src/engine/BL_Job.cxx @@ -26,6 +26,7 @@ BL::Job::Job() _type = COMMAND; _job_file = ""; _env_file = ""; + _pre_command = ""; _batch_params.batch_directory = ""; _batch_params.maximum_duration = ""; _batch_params.mem_limit = 0; @@ -54,6 +55,7 @@ BL::Job::Job(const std::string & name) _type = COMMAND; _job_file = ""; _env_file = ""; + _pre_command = ""; _batch_params.batch_directory = ""; _batch_params.maximum_duration = ""; _batch_params.mem_limit = 0; @@ -167,6 +169,18 @@ BL::Job::getEnvFile() return _env_file; } +void +BL::Job::setPreCommand(const std::string & pre_command) +{ + _pre_command = pre_command; +} + +std::string & +BL::Job::getPreCommand() +{ + return _pre_command; +} + void BL::Job::setBatchParameters(const BL::Job::BatchParam & param) { diff --git a/src/engine/BL_Job.hxx b/src/engine/BL_Job.hxx index f2dc145..532b31d 100644 --- a/src/engine/BL_Job.hxx +++ b/src/engine/BL_Job.hxx @@ -53,6 +53,9 @@ namespace BL{ void setEnvFile(const std::string & env_file); std::string & getEnvFile(); + void setPreCommand(const std::string & pre_command); + std::string & getPreCommand(); + void setDumpYACSState(const int & dump_yacs_state); int getDumpYACSState(); @@ -124,6 +127,7 @@ namespace BL{ BL::Job::JobType _type; std::string _job_file; std::string _env_file; + std::string _pre_command; BL::Job::BatchParam _batch_params; BL::Job::FilesParam _files_params; diff --git a/src/engine/BL_SALOMEServices.cxx b/src/engine/BL_SALOMEServices.cxx index bc7e640..1a1e0d6 100644 --- a/src/engine/BL_SALOMEServices.cxx +++ b/src/engine/BL_SALOMEServices.cxx @@ -299,6 +299,7 @@ BL::SALOMEServices::create_job(BL::Job * job) job_parameters->job_name = CORBA::string_dup(job->getName().c_str()); job_parameters->job_file = CORBA::string_dup(job->getJobFile().c_str()); job_parameters->env_file = CORBA::string_dup(job->getEnvFile().c_str()); + job_parameters->pre_command = CORBA::string_dup(job->getPreCommand().c_str()); BL::Job::FilesParam files = job->getFilesParameters(); std::list::iterator it; int i = 0; @@ -630,6 +631,7 @@ BL::SALOMEServices::get_new_job(int job_number) job_return->setType(job_parameters->job_type.in()); job_return->setJobFile(job_parameters->job_file.in()); job_return->setEnvFile(job_parameters->env_file.in()); + job_return->setPreCommand(job_parameters->pre_command.in()); job_return->setBatchQueue(job_parameters->queue.in()); job_return->setWCKey(job_parameters->wckey.in()); job_return->setExtraParams(job_parameters->extra_params.in()); diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index eba7034..f14ade8 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -56,6 +56,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO command = ""; python_salome_file = ""; env_file = ""; + pre_command = ""; batch_directory = ""; // For COORM @@ -133,6 +134,7 @@ BL::CreateJobWizard::clone(const std::string & name) setField("yacs_file", QString(job->getJobFile().c_str())); setField("job_type_yacs", true); setField("env_yacs_file", QString(job->getEnvFile().c_str())); + setField("pre_yacs_file", QString(job->getPreCommand().c_str())); if (job->getDumpYACSState() != -1) { QString value; @@ -149,29 +151,31 @@ BL::CreateJobWizard::clone(const std::string & name) setField("command", QString(job->getJobFile().c_str())); setField("job_type_command", true); setField("env_command_file", QString(job->getEnvFile().c_str())); + setField("pre_command_file", QString(job->getPreCommand().c_str())); } else if (job->getType() == BL::Job::PYTHON_SALOME) { setField("PythonSalome", QString(job->getJobFile().c_str())); setField("job_type_python_salome", true); setField("env_PythonSalome_file", QString(job->getEnvFile().c_str())); + setField("pre_PythonSalome_file", QString(job->getPreCommand().c_str())); } - // For COORM + // For COORM BL::Job::BatchParam batch_params = job->getBatchParameters(); - BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(job->getResource().c_str()); - std::string batch = resource_descr.batch.c_str(); - if (batch == "coorm") - { - setField("coorm_batch_directory", QString(batch_params.batch_directory.c_str())); - setField("launcher_file", QString(batch_params.launcher_file.c_str())); - setField("launcher_args", QString(batch_params.launcher_args.c_str())); - } - else - { - setField("batch_directory", QString(batch_params.batch_directory.c_str())); - } + BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(job->getResource().c_str()); + std::string batch = resource_descr.batch.c_str(); + if (batch == "coorm") + { + setField("coorm_batch_directory", QString(batch_params.batch_directory.c_str())); + setField("launcher_file", QString(batch_params.launcher_file.c_str())); + setField("launcher_args", QString(batch_params.launcher_args.c_str())); + } + else + { + setField("batch_directory", QString(batch_params.batch_directory.c_str())); + } QString proc_value; proc_value.setNum(batch_params.nb_proc); @@ -287,6 +291,15 @@ BL::CreateJobWizard::end(int result) f_env_file = field("env_PythonSalome_file").toString(); env_file = f_env_file.trimmed().toUtf8().constData(); + QString f_pre_command_file; + if (job_type == YACS) + f_pre_command_file = field("pre_yacs_file").toString(); + else if (job_type == COMMAND) + f_pre_command_file = field("pre_command_file").toString(); + else if (job_type == PYTHON_SALOME) + f_pre_command_file = field("pre_PythonSalome_file").toString(); + pre_command = f_pre_command_file.trimmed().toUtf8().constData(); + // Batch Panel QString f_batch_directory = field("batch_directory").toString(); batch_directory = f_batch_directory.trimmed().toUtf8().constData(); @@ -555,11 +568,19 @@ BL::YACSSchemaPage::YACSSchemaPage(QWidget * parent) _line_env_file = new QLineEdit(this); registerField("env_yacs_file", _line_env_file); _line_env_file->setReadOnly(true); + QPushButton * command_pre_command_button = new QPushButton(tr("Choose a pre processing script")); + connect(command_pre_command_button, SIGNAL(clicked()), + this, SLOT(choose_pre_command_file())); + _line_pre_command = new QLineEdit(this); + registerField("pre_yacs_file", _line_pre_command); + _line_pre_command->setReadOnly(true); QGridLayout * files_layout = new QGridLayout; files_layout->addWidget(yacs_file_button, 0, 0); files_layout->addWidget(_yacs_file_text, 0, 1); files_layout->addWidget(command_env_file_button, 1, 0); files_layout->addWidget(_line_env_file, 1, 1); + files_layout->addWidget(command_pre_command_button, 2, 0); + files_layout->addWidget(_line_pre_command, 2, 1); files_param_box->setLayout(files_layout); QGroupBox * spec_param_box = new QGroupBox("YACS specific parameters"); @@ -628,6 +649,16 @@ BL::YACSSchemaPage::choose_env_file() _line_env_file->setReadOnly(true); } +void +BL::YACSSchemaPage::choose_pre_command_file() +{ + QString pre_command_file = QFileDialog::getOpenFileName(this, + tr("Open script file"), "", + tr("All Files (*)")); + _line_pre_command->setReadOnly(false); + _line_pre_command->setText(pre_command_file); + _line_pre_command->setReadOnly(true); +} int BL::YACSSchemaPage::nextId() const @@ -655,11 +686,20 @@ BL::CommandMainPage::CommandMainPage(QWidget * parent) registerField("env_command_file", _line_env_file); _line_env_file->setReadOnly(true); + QPushButton * command_pre_command_button = new QPushButton(tr("Choose a pre processing script")); + connect(command_pre_command_button, SIGNAL(clicked()), + this, SLOT(choose_pre_command_file())); + _line_pre_command = new QLineEdit(this); + registerField("pre_command_file", _line_pre_command); + _line_pre_command->setReadOnly(true); + QGridLayout *layout = new QGridLayout; layout->addWidget(command_file_button, 0, 0); layout->addWidget(_line_command, 0, 1); layout->addWidget(command_env_file_button, 1, 0); layout->addWidget(_line_env_file, 1, 1); + layout->addWidget(command_pre_command_button, 2, 0); + layout->addWidget(_line_pre_command, 2, 1); QVBoxLayout * main_layout = new QVBoxLayout; main_layout->addWidget(label); @@ -692,6 +732,17 @@ BL::CommandMainPage::choose_env_file() _line_env_file->setReadOnly(true); } +void +BL::CommandMainPage::choose_pre_command_file() +{ + QString pre_command_file = QFileDialog::getOpenFileName(this, + tr("Open script file"), "", + tr("All Files (*)")); + _line_pre_command->setReadOnly(false); + _line_pre_command->setText(pre_command_file); + _line_pre_command->setReadOnly(true); +} + bool BL::CommandMainPage::validatePage() { @@ -1304,11 +1355,20 @@ BL::PythonSalomeMainPage::PythonSalomeMainPage(QWidget * parent) registerField("env_PythonSalome_file", _line_env_file); _line_env_file->setReadOnly(true); + QPushButton * command_pre_command_button = new QPushButton(tr("Choose a pre processing script")); + connect(command_pre_command_button, SIGNAL(clicked()), + this, SLOT(choose_pre_command_file())); + _line_pre_command = new QLineEdit(this); + registerField("pre_PythonSalome_file", _line_pre_command); + _line_pre_command->setReadOnly(true); + QGridLayout *layout = new QGridLayout; layout->addWidget(PythonSalome_file_button, 0, 0); layout->addWidget(_line_PythonSalome, 0, 1); layout->addWidget(PythonSalome_env_file_button, 1, 0); layout->addWidget(_line_env_file, 1, 1); + layout->addWidget(command_pre_command_button, 2, 0); + layout->addWidget(_line_pre_command, 2, 1); QVBoxLayout * main_layout = new QVBoxLayout; main_layout->addWidget(label); @@ -1341,6 +1401,17 @@ BL::PythonSalomeMainPage::choose_env_file() _line_env_file->setReadOnly(true); } +void +BL::PythonSalomeMainPage::choose_pre_command_file() +{ + QString pre_command_file = QFileDialog::getOpenFileName(this, + tr("Open script file"), "", + tr("All Files (*)")); + _line_pre_command->setReadOnly(false); + _line_pre_command->setText(pre_command_file); + _line_pre_command->setReadOnly(true); +} + bool BL::PythonSalomeMainPage::validatePage() { diff --git a/src/genericgui/BL_CreateJobWizard.hxx b/src/genericgui/BL_CreateJobWizard.hxx index d2d0613..84f8960 100644 --- a/src/genericgui/BL_CreateJobWizard.hxx +++ b/src/genericgui/BL_CreateJobWizard.hxx @@ -79,6 +79,7 @@ namespace BL { std::string python_salome_file; std::string env_file; + std::string pre_command; std::string batch_directory; @@ -281,10 +282,12 @@ namespace BL { public slots: void choose_file(); void choose_env_file(); + void choose_pre_command_file(); private: QLineEdit * _yacs_file_text; QLineEdit * _line_env_file; + QLineEdit * _line_pre_command; }; class CommandMainPage: public QWizardPage @@ -302,10 +305,12 @@ namespace BL { public slots: void choose_command_file(); void choose_env_file(); + void choose_pre_command_file(); private: QLineEdit * _line_command; QLineEdit * _line_env_file; + QLineEdit * _line_pre_command; }; class PythonSalomeMainPage: public QWizardPage @@ -323,10 +328,12 @@ namespace BL { public slots: void choose_PythonSalome_file(); void choose_env_file(); + void choose_pre_command_file(); private: QLineEdit * _line_PythonSalome; QLineEdit * _line_env_file; + QLineEdit * _line_pre_command; }; class AdvancedParametersPage: public QWizardPage diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index e56bde1..91ac18e 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -309,6 +309,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard) // For all jobs new_job->setEnvFile(wizard.env_file); + new_job->setPreCommand(wizard.pre_command); BL::Job::BatchParam param; // For COORM -- 2.39.2 From 0a7f1415546035d43f9b2e797e6fa04d268d5867 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 21 Dec 2017 17:09:30 +0100 Subject: [PATCH 15/16] You can now select folders in the input files list. --- src/genericgui/BL_CreateJobWizard.cxx | 29 +++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index f14ade8..ed7acdf 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -22,6 +22,7 @@ #include #include +#include #ifndef WNT #include @@ -1095,13 +1096,29 @@ FilesPage::isComplete() const void FilesPage::choose_input_files() { - QStringList files = QFileDialog::getOpenFileNames(this, - tr("Add input files"), "", - tr("All Files (*)")); - for (int i = 0; i < files.size(); ++i) + // We need to be able to select both files and folders. + // Standard QFileDialog cannot do it. + QFileDialog w(this, tr("Select input files"), + "", tr("All files and folders(*)")) ; + w.setOption(QFileDialog::DontUseNativeDialog,true); + QListView *l = w.findChild("listView"); + if (l) + { + l->setSelectionMode(QAbstractItemView::MultiSelection); + } + QTreeView *t = w.findChild(); + if (t) { - if (ui->input_files_list->findItems(files.at(i), Qt::MatchFixedString).size() == 0) - ui->input_files_list->addItem(files.at(i)); + t->setSelectionMode(QAbstractItemView::MultiSelection); + } + if(w.exec()) + { + QStringList files = w.selectedFiles(); + for (int i = 0; i < files.size(); ++i) + { + if (ui->input_files_list->findItems(files.at(i), Qt::MatchFixedString).size() == 0) + ui->input_files_list->addItem(files.at(i)); + } } } -- 2.39.2 From 31d1f8d5cf1b5dac7eb1c7e1a769c0cefefb7a5f Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Wed, 27 Dec 2017 11:16:20 +0100 Subject: [PATCH 16/16] Grammar. --- src/genericgui/BL_JobsManager_QT.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index 91ac18e..7fee384 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -454,7 +454,7 @@ BL::JobsManager_QT::event(QEvent * e) { 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 { -- 2.39.2