1 // Copyright (C) 2009-2012 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;
72 std::string maximum_duration;
73 std::string expected_memory;
76 std::string result_directory;
77 std::list<std::string> input_files_list;
78 std::list<std::string> output_files_list;
80 std::string resource_choosed;
81 std::string batch_queue;
85 std::string ll_jobtype;
90 Page_Command_Main_Definitions,
91 Page_PythonSalome_Main_Definitions,
98 class JobNamePage: public QWizardPage
103 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
104 virtual ~JobNamePage();
106 virtual bool validatePage();
107 virtual int nextId() const ;
108 virtual void cleanupPage() {}
111 void yacs_schema_button(bool checked);
112 void command_button(bool checked);
113 void python_salome_button(bool checked);
116 BL::JobsManager_QT * _jobs_manager;
117 QLabel * _explanation;
120 QRadioButton * _yacs_schema_button;
121 QRadioButton * _command_button;
122 QRadioButton * _python_salome_button;
126 class ConclusionPage: public QWizardPage
129 ConclusionPage(QWidget * parent);
130 virtual ~ConclusionPage();
132 virtual bool validatePage();
133 virtual int nextId() const ;
134 virtual void cleanupPage() {}
137 class BatchParametersPage: public QWizardPage
142 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
143 virtual ~BatchParametersPage();
145 virtual bool validatePage();
146 virtual int nextId() const;
147 virtual void cleanupPage();
148 virtual void initializePage();
151 BL::SALOMEServices * _salome_services;
152 QString resource_choosed;
155 class FilesPage: public QWizardPage
160 FilesPage(BL::CreateJobWizard * parent);
161 virtual ~FilesPage();
163 virtual int nextId() const;
164 virtual bool validatePage();
165 virtual void cleanupPage() {}
168 void choose_input_files();
169 void remove_input_files();
170 void input_itemSelectionChanged();
171 void choose_local_directory();
173 void add_output_file();
174 void remove_output_files();
175 void output_itemSelectionChanged();
178 QPushButton * _input_files_button;
179 QPushButton * _remove_input_files_button;
180 QListWidget * _input_files_list;
181 QLineEdit * _result_directory;
183 QPushButton * _output_files_button;
184 QPushButton * _remove_output_files_button;
185 QListWidget * _output_files_list;
188 class ResourcePage: public QWizardPage
193 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
194 virtual ~ResourcePage();
196 virtual int nextId() const;
197 virtual bool validatePage();
198 virtual void initializePage();
199 virtual void cleanupPage() {}
202 void itemSelected(QListWidgetItem * item);
205 JM::ResourceCatalog * _resource_list;
206 QLineEdit * _resource_choosed;
207 BL::SALOMEServices * _salome_services;
210 QLineEdit * _ll_value;
211 QGridLayout * _main_layout;
214 class YACSSchemaPage: public QWizardPage
219 YACSSchemaPage(QWidget * parent);
220 virtual ~YACSSchemaPage();
222 virtual bool validatePage();
223 virtual int nextId() const ;
224 virtual void cleanupPage() {}
228 void choose_env_file();
231 QLineEdit * _yacs_file_text;
232 QLineEdit * _line_env_file;
235 class CommandMainPage: public QWizardPage
240 CommandMainPage(QWidget * parent);
241 virtual ~CommandMainPage();
243 virtual bool validatePage();
244 virtual int nextId() const ;
245 virtual void cleanupPage() {}
248 void choose_command_file();
249 void choose_env_file();
252 QLineEdit * _line_command;
253 QLineEdit * _line_env_file;
256 class PythonSalomeMainPage: public QWizardPage
261 PythonSalomeMainPage(QWidget * parent);
262 virtual ~PythonSalomeMainPage();
264 virtual bool validatePage();
265 virtual int nextId() const ;
266 virtual void cleanupPage() {}
269 void choose_PythonSalome_file();
270 void choose_env_file();
273 QLineEdit * _line_PythonSalome;
274 QLineEdit * _line_env_file;