1 // Copyright (C) 2009-2014 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 #include "BL_Traces.hxx"
26 #include "BL_SALOMEServices.hxx"
27 #include "JM_ResourceCatalog.hxx"
33 class ResourceRequirementsWizardPage;
34 class FilesWizardPage;
35 class AdvancedParametersWizardPage;
42 class BatchParametersPage;
43 class CreateJobWizard: public QWizard
48 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
49 virtual ~CreateJobWizard();
51 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
53 void clone(const std::string & name);
59 BL::JobsManager_QT * _jobs_manager;
60 QListWidget * _input_files_list;
61 QListWidget * _output_files_list;
63 BL::JobNamePage * _job_name_page;
64 BL::BatchParametersPage * _batch_parameters_page;
65 BL::SALOMEServices * _salome_services;
71 std::string yacs_file;
73 std::string python_salome_file;
77 std::string batch_directory;
80 std::string coorm_batch_directory;
82 std::string maximum_duration;
84 BL::Job::MemReqType mem_req_type;
88 // Parameters for COORM
89 std::string launcher_file;
90 std::string launcher_args;
92 std::string result_directory;
93 std::list<std::string> input_files_list;
94 std::list<std::string> output_files_list;
96 std::string resource_choosed;
97 std::string batch_queue;
102 std::string ll_jobtype;
107 Page_Command_Main_Definitions,
108 Page_PythonSalome_Main_Definitions,
109 Page_BatchParameters,
110 Page_COORM_BatchParameters,
117 class JobNamePage: public QWizardPage
122 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
123 virtual ~JobNamePage();
125 virtual bool validatePage();
126 virtual int nextId() const ;
127 virtual void cleanupPage() {}
130 void yacs_schema_button(bool checked);
131 void command_button(bool checked);
132 void python_salome_button(bool checked);
135 BL::JobsManager_QT * _jobs_manager;
136 QLabel * _explanation;
139 QRadioButton * _yacs_schema_button;
140 QRadioButton * _command_button;
141 QRadioButton * _python_salome_button;
145 class ConclusionPage: public QWizardPage
148 ConclusionPage(QWidget * parent);
149 virtual ~ConclusionPage();
151 virtual bool validatePage();
152 virtual int nextId() const ;
153 virtual void cleanupPage() {}
156 class BatchParametersPage: public QWizardPage
161 enum MemUnit {MB, GB};
163 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
164 virtual ~BatchParametersPage();
166 virtual void initializePage();
167 virtual int nextId() const;
168 virtual void cleanupPage();
170 MemUnit getMemUnit() const;
171 void setMemUnit(MemUnit mem_unit);
173 BL::Job::MemReqType getMemReqType() const;
174 void setMemReqType(BL::Job::MemReqType mem_req_type);
181 Ui::ResourceRequirementsWizardPage * ui;
182 BL::SALOMEServices * _salome_services;
183 std::string resource_choosed;
187 class COORM_BatchParametersPage: public QWizardPage
192 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
193 virtual ~COORM_BatchParametersPage();
195 virtual bool validatePage();
196 virtual int nextId() const;
197 virtual void cleanupPage();
198 virtual void initializePage();
201 void choose_launcher_file();
204 BL::SALOMEServices * _salome_services;
205 QLineEdit * _launcher_file_text;
206 QString resource_choosed;
209 class FilesPage: public QWizardPage
214 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
215 virtual ~FilesPage();
217 virtual void initializePage();
218 virtual int nextId() const;
219 virtual bool isComplete() const;
220 virtual void cleanupPage() {}
223 void choose_input_files();
224 void remove_input_files();
225 void input_itemSelectionChanged();
226 void choose_local_directory();
228 void add_output_file();
229 void remove_output_files();
230 void output_itemSelectionChanged();
233 Ui::FilesWizardPage * ui;
234 BL::SALOMEServices * _salome_services;
235 QString resource_choosed;
238 class ResourcePage: public QWizardPage
243 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
244 virtual ~ResourcePage();
246 virtual int nextId() const;
247 virtual bool validatePage();
248 virtual void initializePage();
249 virtual void cleanupPage() {}
252 void itemSelected(QListWidgetItem * item);
255 JM::ResourceCatalog * _resource_list;
256 QLineEdit * _resource_choosed;
257 BL::SALOMEServices * _salome_services;
260 QLineEdit * _ll_value;
261 QGridLayout * _main_layout;
264 class YACSSchemaPage: public QWizardPage
269 YACSSchemaPage(QWidget * parent);
270 virtual ~YACSSchemaPage();
272 virtual bool validatePage();
273 virtual int nextId() const ;
274 virtual void cleanupPage() {}
278 void choose_env_file();
281 QLineEdit * _yacs_file_text;
282 QLineEdit * _line_env_file;
285 class CommandMainPage: public QWizardPage
290 CommandMainPage(QWidget * parent);
291 virtual ~CommandMainPage();
293 virtual bool validatePage();
294 virtual int nextId() const ;
295 virtual void cleanupPage() {}
298 void choose_command_file();
299 void choose_env_file();
302 QLineEdit * _line_command;
303 QLineEdit * _line_env_file;
306 class PythonSalomeMainPage: public QWizardPage
311 PythonSalomeMainPage(QWidget * parent);
312 virtual ~PythonSalomeMainPage();
314 virtual bool validatePage();
315 virtual int nextId() const ;
316 virtual void cleanupPage() {}
319 void choose_PythonSalome_file();
320 void choose_env_file();
323 QLineEdit * _line_PythonSalome;
324 QLineEdit * _line_env_file;
327 class AdvancedParametersPage: public QWizardPage
332 AdvancedParametersPage(BL::CreateJobWizard * parent);
333 virtual ~AdvancedParametersPage();
335 virtual int nextId() const;
336 virtual void cleanupPage() {}
339 Ui::AdvancedParametersWizardPage * ui;