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"
36 class CreateJobWizard: public QWizard
41 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
42 virtual ~CreateJobWizard();
44 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
46 void clone(const std::string & name);
53 QLineEdit * _nameLineEdit;
54 BL::JobsManager_QT * _jobs_manager;
55 QListWidget * _input_files_list;
56 QListWidget * _output_files_list;
58 BL::JobNamePage * _job_name_page;
59 BL::SALOMEServices * _salome_services;
65 std::string yacs_file;
67 std::string python_salome_file;
71 std::string batch_directory;
74 std::string coorm_batch_directory;
76 std::string maximum_duration;
77 std::string expected_memory;
80 // Parameters for COORM
81 std::string launcher_file;
82 std::string launcher_args;
84 std::string result_directory;
85 std::list<std::string> input_files_list;
86 std::list<std::string> output_files_list;
88 std::string resource_choosed;
89 std::string batch_queue;
93 std::string ll_jobtype;
98 Page_Command_Main_Definitions,
99 Page_PythonSalome_Main_Definitions,
100 Page_BatchParameters,
101 Page_COORM_BatchParameters,
107 class JobNamePage: public QWizardPage
112 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
113 virtual ~JobNamePage();
115 virtual bool validatePage();
116 virtual int nextId() const ;
117 virtual void cleanupPage() {}
120 void yacs_schema_button(bool checked);
121 void command_button(bool checked);
122 void python_salome_button(bool checked);
125 BL::JobsManager_QT * _jobs_manager;
126 QLabel * _explanation;
129 QRadioButton * _yacs_schema_button;
130 QRadioButton * _command_button;
131 QRadioButton * _python_salome_button;
135 class ConclusionPage: public QWizardPage
138 ConclusionPage(QWidget * parent);
139 virtual ~ConclusionPage();
141 virtual bool validatePage();
142 virtual int nextId() const ;
143 virtual void cleanupPage() {}
146 class BatchParametersPage: public QWizardPage
151 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
152 virtual ~BatchParametersPage();
154 virtual bool validatePage();
155 virtual int nextId() const;
156 virtual void cleanupPage();
157 virtual void initializePage();
160 BL::SALOMEServices * _salome_services;
161 QString resource_choosed;
165 class COORM_BatchParametersPage: public QWizardPage
170 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
171 virtual ~COORM_BatchParametersPage();
173 virtual bool validatePage();
174 virtual int nextId() const;
175 virtual void cleanupPage();
176 virtual void initializePage();
179 void choose_launcher_file();
182 BL::SALOMEServices * _salome_services;
183 QLineEdit * _launcher_file_text;
184 QString resource_choosed;
187 class FilesPage: public QWizardPage
192 FilesPage(BL::CreateJobWizard * parent);
193 virtual ~FilesPage();
195 virtual int nextId() const;
196 virtual bool validatePage();
197 virtual void cleanupPage() {}
200 void choose_input_files();
201 void remove_input_files();
202 void input_itemSelectionChanged();
203 void choose_local_directory();
205 void add_output_file();
206 void remove_output_files();
207 void output_itemSelectionChanged();
210 QPushButton * _input_files_button;
211 QPushButton * _remove_input_files_button;
212 QListWidget * _input_files_list;
213 QLineEdit * _result_directory;
215 QPushButton * _output_files_button;
216 QPushButton * _remove_output_files_button;
217 QListWidget * _output_files_list;
220 class ResourcePage: public QWizardPage
225 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
226 virtual ~ResourcePage();
228 virtual int nextId() const;
229 virtual bool validatePage();
230 virtual void initializePage();
231 virtual void cleanupPage() {}
234 void itemSelected(QListWidgetItem * item);
237 JM::ResourceCatalog * _resource_list;
238 QLineEdit * _resource_choosed;
239 BL::SALOMEServices * _salome_services;
242 QLineEdit * _ll_value;
243 QGridLayout * _main_layout;
246 class YACSSchemaPage: public QWizardPage
251 YACSSchemaPage(QWidget * parent);
252 virtual ~YACSSchemaPage();
254 virtual bool validatePage();
255 virtual int nextId() const ;
256 virtual void cleanupPage() {}
260 void choose_env_file();
263 QLineEdit * _yacs_file_text;
264 QLineEdit * _line_env_file;
267 class CommandMainPage: public QWizardPage
272 CommandMainPage(QWidget * parent);
273 virtual ~CommandMainPage();
275 virtual bool validatePage();
276 virtual int nextId() const ;
277 virtual void cleanupPage() {}
280 void choose_command_file();
281 void choose_env_file();
284 QLineEdit * _line_command;
285 QLineEdit * _line_env_file;
288 class PythonSalomeMainPage: public QWizardPage
293 PythonSalomeMainPage(QWidget * parent);
294 virtual ~PythonSalomeMainPage();
296 virtual bool validatePage();
297 virtual int nextId() const ;
298 virtual void cleanupPage() {}
301 void choose_PythonSalome_file();
302 void choose_env_file();
305 QLineEdit * _line_PythonSalome;
306 QLineEdit * _line_env_file;