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 CreateJobWizard: public QWizard
46 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
47 virtual ~CreateJobWizard();
49 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
51 void clone(const std::string & name);
58 QLineEdit * _nameLineEdit;
59 BL::JobsManager_QT * _jobs_manager;
60 QListWidget * _input_files_list;
61 QListWidget * _output_files_list;
63 BL::JobNamePage * _job_name_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 std::string expected_memory;
86 // Parameters for COORM
87 std::string launcher_file;
88 std::string launcher_args;
90 std::string result_directory;
91 std::list<std::string> input_files_list;
92 std::list<std::string> output_files_list;
94 std::string resource_choosed;
95 std::string batch_queue;
99 std::string ll_jobtype;
104 Page_Command_Main_Definitions,
105 Page_PythonSalome_Main_Definitions,
106 Page_BatchParameters,
107 Page_COORM_BatchParameters,
113 class JobNamePage: public QWizardPage
118 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
119 virtual ~JobNamePage();
121 virtual bool validatePage();
122 virtual int nextId() const ;
123 virtual void cleanupPage() {}
126 void yacs_schema_button(bool checked);
127 void command_button(bool checked);
128 void python_salome_button(bool checked);
131 BL::JobsManager_QT * _jobs_manager;
132 QLabel * _explanation;
135 QRadioButton * _yacs_schema_button;
136 QRadioButton * _command_button;
137 QRadioButton * _python_salome_button;
141 class ConclusionPage: public QWizardPage
144 ConclusionPage(QWidget * parent);
145 virtual ~ConclusionPage();
147 virtual bool validatePage();
148 virtual int nextId() const ;
149 virtual void cleanupPage() {}
152 class BatchParametersPage: public QWizardPage
157 BatchParametersPage(QWidget * parent);
158 virtual ~BatchParametersPage();
160 virtual bool validatePage();
161 virtual int nextId() const;
162 virtual void cleanupPage();
165 Ui::ResourceRequirementsWizardPage * ui;
169 class COORM_BatchParametersPage: public QWizardPage
174 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
175 virtual ~COORM_BatchParametersPage();
177 virtual bool validatePage();
178 virtual int nextId() const;
179 virtual void cleanupPage();
180 virtual void initializePage();
183 void choose_launcher_file();
186 BL::SALOMEServices * _salome_services;
187 QLineEdit * _launcher_file_text;
188 QString resource_choosed;
191 class FilesPage: public QWizardPage
196 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
197 virtual ~FilesPage();
199 virtual void initializePage();
200 virtual int nextId() const;
201 virtual bool validatePage();
202 virtual void cleanupPage() {}
205 void choose_input_files();
206 void remove_input_files();
207 void input_itemSelectionChanged();
208 void choose_local_directory();
210 void add_output_file();
211 void remove_output_files();
212 void output_itemSelectionChanged();
215 Ui::FilesWizardPage * ui;
216 BL::SALOMEServices * _salome_services;
217 QString resource_choosed;
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;