1 // Copyright (C) 2009-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _BL_CREATEJOBWIZARD_HXX_
21 #define _BL_CREATEJOBWIZARD_HXX_
25 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
29 #include "BL_Traces.hxx"
30 #include "BL_SALOMEServices.hxx"
31 #include "JM_ResourceCatalog.hxx"
37 class ResourceRequirementsWizardPage;
38 class FilesWizardPage;
39 class AdvancedParametersWizardPage;
46 class BatchParametersPage;
47 class CreateJobWizard: public QWizard
52 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
53 virtual ~CreateJobWizard();
55 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
57 void clone(const std::string & name);
63 BL::JobsManager_QT * _jobs_manager;
64 QListWidget * _input_files_list;
65 QListWidget * _output_files_list;
67 BL::JobNamePage * _job_name_page;
68 BL::BatchParametersPage * _batch_parameters_page;
69 BL::SALOMEServices * _salome_services;
74 enum {YACS, COMMAND, PYTHON_SALOME} job_type;
76 std::string yacs_file;
78 std::string python_salome_file;
82 std::string batch_directory;
85 std::string coorm_batch_directory;
87 std::string maximum_duration;
89 BL::Job::MemReqType mem_req_type;
93 // Parameters for COORM
94 std::string launcher_file;
95 std::string launcher_args;
97 std::string result_directory;
98 std::list<std::string> input_files_list;
99 std::list<std::string> output_files_list;
101 std::string resource_choosed;
102 std::string batch_queue;
104 std::string extra_params;
108 std::string ll_jobtype;
113 Page_Command_Main_Definitions,
114 Page_PythonSalome_Main_Definitions,
115 Page_BatchParameters,
116 Page_COORM_BatchParameters,
123 class JobNamePage: public QWizardPage
128 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
129 virtual ~JobNamePage();
131 virtual bool validatePage();
132 virtual int nextId() const ;
133 virtual void cleanupPage() {}
136 void yacs_schema_button(bool checked);
137 void command_button(bool checked);
138 void python_salome_button(bool checked);
141 BL::JobsManager_QT * _jobs_manager;
142 QLabel * _explanation;
148 class ConclusionPage: public QWizardPage
151 ConclusionPage(QWidget * parent);
152 virtual ~ConclusionPage();
154 virtual bool validatePage();
155 virtual int nextId() const ;
156 virtual void cleanupPage() {}
159 class BatchParametersPage: public QWizardPage
164 enum MemUnit {MB, GB};
166 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
167 virtual ~BatchParametersPage();
169 virtual void initializePage();
170 virtual int nextId() const;
171 virtual void cleanupPage();
173 MemUnit getMemUnit() const;
174 void setMemUnit(MemUnit mem_unit);
176 BL::Job::MemReqType getMemReqType() const;
177 void setMemReqType(BL::Job::MemReqType mem_req_type);
184 Ui::ResourceRequirementsWizardPage * ui;
185 BL::SALOMEServices * _salome_services;
186 std::string resource_choosed;
190 class COORM_BatchParametersPage: public QWizardPage
195 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
196 virtual ~COORM_BatchParametersPage();
198 virtual bool validatePage();
199 virtual int nextId() const;
200 virtual void cleanupPage();
201 virtual void initializePage();
204 void choose_launcher_file();
207 BL::SALOMEServices * _salome_services;
208 QLineEdit * _launcher_file_text;
209 QString resource_choosed;
212 class FilesPage: public QWizardPage
217 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
218 virtual ~FilesPage();
220 virtual void initializePage();
221 virtual int nextId() const;
222 virtual bool isComplete() const;
223 virtual void cleanupPage() {}
226 void choose_input_files();
227 void remove_input_files();
228 void input_itemSelectionChanged();
229 void choose_local_directory();
231 void add_output_file();
232 void remove_output_files();
233 void output_itemSelectionChanged();
236 Ui::FilesWizardPage * ui;
237 BL::SALOMEServices * _salome_services;
238 QString resource_choosed;
241 class ResourcePage: public QWizardPage
246 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
247 virtual ~ResourcePage();
249 virtual int nextId() const;
250 virtual bool validatePage();
251 virtual void initializePage();
252 virtual void cleanupPage() {}
255 void itemSelected(QListWidgetItem * item);
258 JM::ResourceCatalog * _resource_list;
259 QLineEdit * _resource_choosed;
260 BL::SALOMEServices * _salome_services;
263 QLineEdit * _ll_value;
264 QGridLayout * _main_layout;
267 class YACSSchemaPage: public QWizardPage
272 YACSSchemaPage(QWidget * parent);
273 virtual ~YACSSchemaPage();
275 virtual bool validatePage();
276 virtual int nextId() const ;
277 virtual void cleanupPage() {}
281 void choose_env_file();
284 QLineEdit * _yacs_file_text;
285 QLineEdit * _line_env_file;
288 class CommandMainPage: public QWizardPage
293 CommandMainPage(QWidget * parent);
294 virtual ~CommandMainPage();
296 virtual bool validatePage();
297 virtual int nextId() const ;
298 virtual void cleanupPage() {}
301 void choose_command_file();
302 void choose_env_file();
305 QLineEdit * _line_command;
306 QLineEdit * _line_env_file;
309 class PythonSalomeMainPage: public QWizardPage
314 PythonSalomeMainPage(QWidget * parent);
315 virtual ~PythonSalomeMainPage();
317 virtual bool validatePage();
318 virtual int nextId() const ;
319 virtual void cleanupPage() {}
322 void choose_PythonSalome_file();
323 void choose_env_file();
326 QLineEdit * _line_PythonSalome;
327 QLineEdit * _line_env_file;
330 class AdvancedParametersPage: public QWizardPage
335 AdvancedParametersPage(BL::CreateJobWizard * parent);
336 virtual ~AdvancedParametersPage();
338 virtual int nextId() const;
339 virtual void cleanupPage() {}
342 Ui::AdvancedParametersWizardPage * ui;