1 // Copyright (C) 2009-2013 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.
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;
41 class BatchParametersPage;
42 class CreateJobWizard: public QWizard
47 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
48 virtual ~CreateJobWizard();
50 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
52 void clone(const std::string & name);
58 BL::JobsManager_QT * _jobs_manager;
59 QListWidget * _input_files_list;
60 QListWidget * _output_files_list;
62 BL::JobNamePage * _job_name_page;
63 BL::BatchParametersPage * _batch_parameters_page;
64 BL::SALOMEServices * _salome_services;
70 std::string yacs_file;
72 std::string python_salome_file;
76 std::string batch_directory;
79 std::string coorm_batch_directory;
81 std::string maximum_duration;
82 unsigned long mem_limit;
83 BL::Job::MemReqType mem_req_type;
87 // Parameters for COORM
88 std::string launcher_file;
89 std::string launcher_args;
91 std::string result_directory;
92 std::list<std::string> input_files_list;
93 std::list<std::string> output_files_list;
95 std::string resource_choosed;
96 std::string batch_queue;
100 std::string ll_jobtype;
105 Page_Command_Main_Definitions,
106 Page_PythonSalome_Main_Definitions,
107 Page_BatchParameters,
108 Page_COORM_BatchParameters,
114 class JobNamePage: public QWizardPage
119 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
120 virtual ~JobNamePage();
122 virtual bool validatePage();
123 virtual int nextId() const ;
124 virtual void cleanupPage() {}
127 void yacs_schema_button(bool checked);
128 void command_button(bool checked);
129 void python_salome_button(bool checked);
132 BL::JobsManager_QT * _jobs_manager;
133 QLabel * _explanation;
136 QRadioButton * _yacs_schema_button;
137 QRadioButton * _command_button;
138 QRadioButton * _python_salome_button;
142 class ConclusionPage: public QWizardPage
145 ConclusionPage(QWidget * parent);
146 virtual ~ConclusionPage();
148 virtual bool validatePage();
149 virtual int nextId() const ;
150 virtual void cleanupPage() {}
153 class BatchParametersPage: public QWizardPage
158 enum MemUnit {MB, GB};
160 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
161 virtual ~BatchParametersPage();
163 virtual void initializePage();
164 virtual bool isComplete() const;
165 virtual int nextId() const;
166 virtual void cleanupPage();
168 MemUnit getMemUnit() const;
169 void setMemUnit(MemUnit mem_unit);
171 BL::Job::MemReqType getMemReqType() const;
172 void setMemReqType(BL::Job::MemReqType mem_req_type);
175 Ui::ResourceRequirementsWizardPage * ui;
176 BL::SALOMEServices * _salome_services;
177 std::string resource_choosed;
181 class COORM_BatchParametersPage: public QWizardPage
186 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
187 virtual ~COORM_BatchParametersPage();
189 virtual bool validatePage();
190 virtual int nextId() const;
191 virtual void cleanupPage();
192 virtual void initializePage();
195 void choose_launcher_file();
198 BL::SALOMEServices * _salome_services;
199 QLineEdit * _launcher_file_text;
200 QString resource_choosed;
203 class FilesPage: public QWizardPage
208 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
209 virtual ~FilesPage();
211 virtual void initializePage();
212 virtual int nextId() const;
213 virtual bool validatePage();
214 virtual void cleanupPage() {}
217 void choose_input_files();
218 void remove_input_files();
219 void input_itemSelectionChanged();
220 void choose_local_directory();
222 void add_output_file();
223 void remove_output_files();
224 void output_itemSelectionChanged();
227 Ui::FilesWizardPage * ui;
228 BL::SALOMEServices * _salome_services;
229 QString resource_choosed;
232 class ResourcePage: public QWizardPage
237 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
238 virtual ~ResourcePage();
240 virtual int nextId() const;
241 virtual bool validatePage();
242 virtual void initializePage();
243 virtual void cleanupPage() {}
246 void itemSelected(QListWidgetItem * item);
249 JM::ResourceCatalog * _resource_list;
250 QLineEdit * _resource_choosed;
251 BL::SALOMEServices * _salome_services;
254 QLineEdit * _ll_value;
255 QGridLayout * _main_layout;
258 class YACSSchemaPage: public QWizardPage
263 YACSSchemaPage(QWidget * parent);
264 virtual ~YACSSchemaPage();
266 virtual bool validatePage();
267 virtual int nextId() const ;
268 virtual void cleanupPage() {}
272 void choose_env_file();
275 QLineEdit * _yacs_file_text;
276 QLineEdit * _line_env_file;
279 class CommandMainPage: public QWizardPage
284 CommandMainPage(QWidget * parent);
285 virtual ~CommandMainPage();
287 virtual bool validatePage();
288 virtual int nextId() const ;
289 virtual void cleanupPage() {}
292 void choose_command_file();
293 void choose_env_file();
296 QLineEdit * _line_command;
297 QLineEdit * _line_env_file;
300 class PythonSalomeMainPage: public QWizardPage
305 PythonSalomeMainPage(QWidget * parent);
306 virtual ~PythonSalomeMainPage();
308 virtual bool validatePage();
309 virtual int nextId() const ;
310 virtual void cleanupPage() {}
313 void choose_PythonSalome_file();
314 void choose_env_file();
317 QLineEdit * _line_PythonSalome;
318 QLineEdit * _line_env_file;