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;
81 // Parameters for COORM
82 std::string launcher_file;
83 std::string launcher_args;
85 std::string result_directory;
86 std::list<std::string> input_files_list;
87 std::list<std::string> output_files_list;
89 std::string resource_choosed;
90 std::string batch_queue;
94 std::string ll_jobtype;
99 Page_Command_Main_Definitions,
100 Page_PythonSalome_Main_Definitions,
101 Page_BatchParameters,
102 Page_COORM_BatchParameters,
108 class JobNamePage: public QWizardPage
113 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
114 virtual ~JobNamePage();
116 virtual bool validatePage();
117 virtual int nextId() const ;
118 virtual void cleanupPage() {}
121 void yacs_schema_button(bool checked);
122 void command_button(bool checked);
123 void python_salome_button(bool checked);
126 BL::JobsManager_QT * _jobs_manager;
127 QLabel * _explanation;
130 QRadioButton * _yacs_schema_button;
131 QRadioButton * _command_button;
132 QRadioButton * _python_salome_button;
136 class ConclusionPage: public QWizardPage
139 ConclusionPage(QWidget * parent);
140 virtual ~ConclusionPage();
142 virtual bool validatePage();
143 virtual int nextId() const ;
144 virtual void cleanupPage() {}
147 class BatchParametersPage: public QWizardPage
152 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
153 virtual ~BatchParametersPage();
155 virtual bool validatePage();
156 virtual int nextId() const;
157 virtual void cleanupPage();
158 virtual void initializePage();
161 BL::SALOMEServices * _salome_services;
162 QString resource_choosed;
166 class COORM_BatchParametersPage: public QWizardPage
171 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
172 virtual ~COORM_BatchParametersPage();
174 virtual bool validatePage();
175 virtual int nextId() const;
176 virtual void cleanupPage();
177 virtual void initializePage();
180 void choose_launcher_file();
183 BL::SALOMEServices * _salome_services;
184 QLineEdit * _launcher_file_text;
185 QString resource_choosed;
188 class FilesPage: public QWizardPage
193 FilesPage(BL::CreateJobWizard * parent);
194 virtual ~FilesPage();
196 virtual int nextId() const;
197 virtual bool validatePage();
198 virtual void cleanupPage() {}
201 void choose_input_files();
202 void remove_input_files();
203 void input_itemSelectionChanged();
204 void choose_local_directory();
206 void add_output_file();
207 void remove_output_files();
208 void output_itemSelectionChanged();
211 QPushButton * _input_files_button;
212 QPushButton * _remove_input_files_button;
213 QListWidget * _input_files_list;
214 QLineEdit * _result_directory;
216 QPushButton * _output_files_button;
217 QPushButton * _remove_output_files_button;
218 QListWidget * _output_files_list;
221 class ResourcePage: public QWizardPage
226 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
227 virtual ~ResourcePage();
229 virtual int nextId() const;
230 virtual bool validatePage();
231 virtual void initializePage();
232 virtual void cleanupPage() {}
235 void itemSelected(QListWidgetItem * item);
238 JM::ResourceCatalog * _resource_list;
239 QLineEdit * _resource_choosed;
240 BL::SALOMEServices * _salome_services;
243 QLineEdit * _ll_value;
244 QGridLayout * _main_layout;
247 class YACSSchemaPage: public QWizardPage
252 YACSSchemaPage(QWidget * parent);
253 virtual ~YACSSchemaPage();
255 virtual bool validatePage();
256 virtual int nextId() const ;
257 virtual void cleanupPage() {}
261 void choose_env_file();
264 QLineEdit * _yacs_file_text;
265 QLineEdit * _line_env_file;
268 class CommandMainPage: public QWizardPage
273 CommandMainPage(QWidget * parent);
274 virtual ~CommandMainPage();
276 virtual bool validatePage();
277 virtual int nextId() const ;
278 virtual void cleanupPage() {}
281 void choose_command_file();
282 void choose_env_file();
285 QLineEdit * _line_command;
286 QLineEdit * _line_env_file;
289 class PythonSalomeMainPage: public QWizardPage
294 PythonSalomeMainPage(QWidget * parent);
295 virtual ~PythonSalomeMainPage();
297 virtual bool validatePage();
298 virtual int nextId() const ;
299 virtual void cleanupPage() {}
302 void choose_PythonSalome_file();
303 void choose_env_file();
306 QLineEdit * _line_PythonSalome;
307 QLineEdit * _line_env_file;