@@ -249,8 +249,8 | |||||
249 | var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1] |
|
249 | var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1] | |
250 | var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1] |
|
250 | var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1] | |
251 |
|
251 | |||
252 |
var_lines.append(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" |
|
252 | var_lines.append(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+"-" | |
253 |
+var_last_file[-5:-2]+" "+var_date_first_file+" |
|
253 | +var_last_file[-5:-2]+" "+var_date_first_file+"-"+var_date_last_file+"\n") | |
254 | #Nos aseguramos que sea un mutiplo de 5 |
|
254 | #Nos aseguramos que sea un mutiplo de 5 | |
255 | while (len(var_lines) % 5) != 0: |
|
255 | while (len(var_lines) % 5) != 0: | |
256 | var_lines.append("\n") |
|
256 | var_lines.append("\n") | |
@@ -267,3 +267,15 | |||||
267 | var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel |
|
267 | var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel | |
268 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso |
|
268 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso | |
269 | return var_cmd |
|
269 | return var_cmd | |
|
270 | ||||
|
271 | ||||
|
272 | def next_var_disc(self, error = False): | |||
|
273 | pass | |||
|
274 | # if self.var_copy_n < self.var_Copys: | |||
|
275 | # self.var_copy_n += 1 | |||
|
276 | # self.var_step == 1: | |||
|
277 | # | |||
|
278 | # if self.var_disc_n < self.var_Discs: | |||
|
279 | ||||
|
280 | pass | |||
|
281 |
@@ -20,7 +20,6 | |||||
20 | if var_output[0] != 0: |
|
20 | if var_output[0] != 0: | |
21 | self.txtInfo.append("No recording devices") |
|
21 | self.txtInfo.append("No recording devices") | |
22 | else: |
|
22 | else: | |
23 | # self.txtInfo.append("dispositivos encontrados") |
|
|||
24 | var_devices = var_output[1].split('\n') |
|
23 | var_devices = var_output[1].split('\n') | |
25 |
|
24 | |||
26 | var_tmp=[] |
|
25 | var_tmp=[] | |
@@ -90,6 +89,8 | |||||
90 | self.lstDcapacity.setCurrentIndex(4) |
|
89 | self.lstDcapacity.setCurrentIndex(4) | |
91 | self.txtDcapacity.setValue(100.0) |
|
90 | self.txtDcapacity.setValue(100.0) | |
92 | self.txtDcapacity.setReadOnly(False) |
|
91 | self.txtDcapacity.setReadOnly(False) | |
|
92 | ||||
|
93 | def set_devices_test(self): | |||
93 | self.txtDeviceA.setText("/dev/scd0") |
|
94 | self.txtDeviceA.setText("/dev/scd0") | |
94 | self.txtDeviceB.setText("/dev/scd1") |
|
95 | self.txtDeviceB.setText("/dev/scd1") | |
95 | self.txtDeviceC.setText("/dev/scd2") |
|
96 | self.txtDeviceC.setText("/dev/scd2") | |
@@ -112,7 +113,6 | |||||
112 | var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar |
|
113 | var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar | |
113 | # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial |
|
114 | # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial | |
114 | # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final |
|
115 | # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final | |
115 |
|
||||
116 | var_file.close() |
|
116 | var_file.close() | |
117 |
|
117 | |||
118 | #----------------------------------------------------- carga parameters.conf --------------------------------------------------------------- |
|
118 | #----------------------------------------------------- carga parameters.conf --------------------------------------------------------------- | |
@@ -138,7 +138,6 | |||||
138 | var_file.close() |
|
138 | var_file.close() | |
139 |
|
139 | |||
140 |
|
140 | |||
141 |
|
||||
142 | #-------------------------- actualiza el valor de las variables con los parametros seleccionados ----------------------------- |
|
141 | #-------------------------- actualiza el valor de las variables con los parametros seleccionados ----------------------------- | |
143 |
|
142 | |||
144 | def set_vars(self): |
|
143 | def set_vars(self): | |
@@ -197,12 +196,21 | |||||
197 |
|
196 | |||
198 | #---------------------------------------------- Actualiza estado en los labels ------------------------------------------------------- |
|
197 | #---------------------------------------------- Actualiza estado en los labels ------------------------------------------------------- | |
199 |
|
198 | |||
200 | def update_message(type, self): |
|
199 | def update_message(type, message, self, index=0): | |
201 |
|
200 | if index == 0: | ||
202 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) |
|
201 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) | |
|
202 | else: | |||
|
203 | var_index = index | |||
|
204 | ||||
|
205 | var_message = message | |||
|
206 | # var_message = "BURNING" | |||
|
207 | # var_message = "COMPLETED" | |||
|
208 | # var_message = "ERROR" | |||
|
209 | # var_message = "CHECKING" | |||
|
210 | # var_message = "CHECKED" | |||
203 |
|
211 | |||
204 | if type == 1: |
|
212 | if type == 1: | |
205 | var_message = "BURNING" |
|
213 | ||
206 | if var_index == 0: |
|
214 | if var_index == 0: | |
207 | self.txtBstatusA.setText(var_message) |
|
215 | self.txtBstatusA.setText(var_message) | |
208 | self.txtBdiscA.setText(str(self.var_disc_n)) |
|
216 | self.txtBdiscA.setText(str(self.var_disc_n)) | |
@@ -222,21 +230,19 | |||||
222 | self.txtBstatusD.setText(var_message) |
|
230 | self.txtBstatusD.setText(var_message) | |
223 | self.txtBdiscD.setText(str(self.var_disc_n)) |
|
231 | self.txtBdiscD.setText(str(self.var_disc_n)) | |
224 | self.txtBcopyD.setText(str(self.var_copy_n)) |
|
232 | self.txtBcopyD.setText(str(self.var_copy_n)) | |
225 |
|
233 | |||
226 | if type == 2: |
|
234 | if type == 2: | |
227 | var_message = "COMPLETED" |
|
235 | ||
228 | if var_index == 0: |
|
236 | if var_index == 0: | |
229 |
self.txt |
|
237 | self.txtCHstatusA.setText(var_message) | |
230 |
|
238 | |||
231 | if var_index == 1: |
|
239 | if var_index == 1: | |
232 |
self.txt |
|
240 | self.txtCHstatusB.setText(var_message) | |
233 |
|
241 | |||
234 | if var_index == 2: |
|
242 | if var_index == 2: | |
235 |
self.txt |
|
243 | self.txtCHstatusC.setText(var_message) | |
236 |
|
244 | |||
237 | if var_index == 3: |
|
245 | if var_index == 3: | |
238 |
self.txt |
|
246 | self.txtCHstatusD.setText(var_message) | |
239 |
|
247 | |||
240 |
|
248 | |||
241 |
|
||||
242 |
|
@@ -15,6 +15,7 | |||||
15 | import sys |
|
15 | import sys | |
16 | import os |
|
16 | import os | |
17 | #import subprocess |
|
17 | #import subprocess | |
|
18 | import time | |||
18 | import commands |
|
19 | import commands | |
19 | from functions import functions |
|
20 | from functions import functions | |
20 | from functions import functions2 |
|
21 | from functions import functions2 | |
@@ -27,38 +28,38 | |||||
27 | def __init__(self, parent = None): |
|
28 | def __init__(self, parent = None): | |
28 | QMainWindow.__init__(self, parent) |
|
29 | QMainWindow.__init__(self, parent) | |
29 | self.setupUi(self) |
|
30 | self.setupUi(self) | |
30 |
|
||||
31 | self.setupUi2() |
|
31 | self.setupUi2() | |
32 | #sys.stdout = self #redirige salida estandar |
|
|||
33 |
|
32 | |||
34 | def setupUi2(self): |
|
33 | def setupUi2(self): | |
35 |
|
34 | |||
|
35 | # Reconocimiento de los dispositivos de grabacion | |||
36 | # functions2.detect_devices(self) #busca los dispositivos de grabacion |
|
36 | # functions2.detect_devices(self) #busca los dispositivos de grabacion | |
37 |
|
37 | #################################### | ||
|
38 | functions2.set_devices_test(self) ############ | |||
|
39 | #################################### | |||
|
40 | ||||
|
41 | #Inicialiazacion de variables | |||
38 | self.var_Discs = 0 #Numero de discos del proyecto |
|
42 | self.var_Discs = 0 #Numero de discos del proyecto | |
39 | self.var_Copys = 0 #Numero de copias |
|
43 | self.var_Copys = 0 #Numero de copias | |
40 | self.var_disc_n = 0 |
|
44 | self.var_disc_n = 0 # disco actual | |
41 | self.var_copy_n = 0 |
|
45 | self.var_copy_n = 0 # copia actual | |
42 | self.var_burned_discs = 0 |
|
46 | self.var_burned_discs = 0 #numero de discos ya grabados | |
43 |
|
47 | |||
44 | self.var_list=[] |
|
48 | self.var_step = 0 # numero de paso en el proceso | |
45 | self.var_sublist=[] |
|
49 | self.bool_state_burning = False #si es True se puede grabar | |
46 |
|
50 | self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco | ||
47 | self.var_devices=[] |
|
51 | ||
48 |
|
52 | self.var_list=[] # Lista de DOYs | ||
49 | self.var_step = 0 |
|
53 | self.var_sublist=[] # Sub-lista de DOYs seleccionados | |
50 | self.bool_state_burning = False |
|
54 | self.var_devices=[] #Lista de dispositivos seleccionados | |
51 | self.blank_discs = False |
|
55 | ||
52 |
|
56 | #Revisa si existe el archivo de confirguracion y lo carga | ||
53 |
|
||||
54 | #Revisa si existe el archivo de confirguracion |
|
|||
55 | if os.path.isfile("parameters.conf"): |
|
57 | if os.path.isfile("parameters.conf"): | |
56 | functions2.get_parameters_conf(self) |
|
58 | functions2.get_parameters_conf(self) | |
57 | self.txtInfo.append("Parameters were loaded from configuration file") |
|
59 | self.txtInfo.append("Parameters were loaded from configuration file") | |
58 | self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) |
|
60 | self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) | |
59 |
|
61 | |||
60 | else: |
|
62 | else: | |
61 | # self.txtInfo.append("Elija los parametros de configuracion") |
|
|||
62 | functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas |
|
63 | functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas | |
63 |
|
64 | |||
64 | functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados |
|
65 | functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados | |
@@ -74,29 +75,30 | |||||
74 | functions2.get_burning_conf(self) |
|
75 | functions2.get_burning_conf(self) | |
75 | self.txtInfo.append("Current disc: "+str(self.var_disc_n)) |
|
76 | self.txtInfo.append("Current disc: "+str(self.var_disc_n)) | |
76 | self.txtInfo.append("Current copy: "+str(self.var_copy_n)) |
|
77 | self.txtInfo.append("Current copy: "+str(self.var_copy_n)) | |
|
78 | self.txtInfo.append("Burned discs: "+str(self.var_burned_discs)) | |||
77 | self.btnStartburn.setText("Continue") |
|
79 | self.btnStartburn.setText("Continue") | |
78 |
|
80 | |||
79 | self.txtDeviceA.setText("/dev/scd0") |
|
81 | ||
80 | self.txtDeviceB.setText("/dev/scd1") |
|
|||
81 | self.txtDeviceC.setText("/dev/scd2") |
|
|||
82 | self.txtDeviceD.setText("/dev/scd3") |
|
|||
83 |
|
82 | |||
84 | self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters) |
|
83 | self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters) | |
85 | self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about) |
|
84 | self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about) | |
86 |
|
85 | |||
87 |
self. |
|
86 | self.process_iso = QtCore.QProcess() | |
88 |
self.connect(self. |
|
87 | self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_iso) | |
89 |
self.connect(self. |
|
88 | self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardError()'), self.readError_iso) | |
90 |
self.connect(self. |
|
89 | self.connect(self.process_iso, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_iso) | |
91 |
|
90 | |||
92 |
self. |
|
91 | self.process_burn = QtCore.QProcess() | |
93 |
self.connect(self. |
|
92 | self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_burn) | |
94 |
self.connect(self. |
|
93 | self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardError()'), self.readError_burn) | |
95 |
self.connect(self. |
|
94 | self.connect(self.process_burn, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_burn) | |
96 |
|
95 | |||
97 | def write(self, txt): |
|
96 | self.process_check = QtCore.QProcess() | |
98 | self.txtInfo.append(str(txt)) |
|
97 | self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check) | |
99 |
|
98 | self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check) | ||
|
99 | self.connect(self.process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check) | |||
|
100 | ||||
|
101 | ||||
100 | def changeParameters(self): |
|
102 | def changeParameters(self): | |
101 | dlg=QtGui.QDialog() |
|
103 | dlg=QtGui.QDialog() | |
102 | dlgui=Ui_Parameters() |
|
104 | dlgui=Ui_Parameters() | |
@@ -118,44 +120,10 | |||||
118 | dlgui_about.setupUi(dlg_about) |
|
120 | dlgui_about.setupUi(dlg_about) | |
119 | dlg_about.exec_() |
|
121 | dlg_about.exec_() | |
120 |
|
122 | |||
121 | #----------------------------------------------------- Funciones del proceso --------------------------------------------------------------- |
|
123 | ||
122 |
|
124 | #============================================================================== | ||
123 | def readOuput(self): |
|
125 | # Manejo de los eventos | |
124 | # self.txtInfo.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput())) |
|
126 | #============================================================================== | |
125 | pass |
|
|||
126 |
|
||||
127 | def readError(self): |
|
|||
128 | self.txtInfo.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError())) |
|
|||
129 |
|
||||
130 | def finished(self): |
|
|||
131 | self.txtInfo.insertPlainText("\nprocess completed"+QtCore.QString(self.var_process.exitCode())+"\n") |
|
|||
132 |
|
||||
133 |
|
||||
134 | if self.var_process.exitCode() != 0: |
|
|||
135 | self.txtInfo.append("ERROR") |
|
|||
136 |
|
||||
137 | if self.bool_state_burning: |
|
|||
138 | if self.var_step == 0: |
|
|||
139 | self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada |
|
|||
140 |
|
||||
141 | elif self.var_step == 1: |
|
|||
142 | functions2.update_message(2, self) |
|
|||
143 | self.var_copy_n += 1 |
|
|||
144 |
|
||||
145 | self.burning() |
|
|||
146 |
|
||||
147 |
|
||||
148 | #----------------------------------------------------- Funciones del proceso de verificacion --------------------------------------------------------------- |
|
|||
149 |
|
||||
150 | def readOuput_check(self): |
|
|||
151 | self.txtInfo.insertPlainText("stdout check: " + QtCore.QString(self.var_process_check.readAllStandardOutput())) |
|
|||
152 |
|
||||
153 | def readError_check(self): |
|
|||
154 | self.txtInfo.setText("stderr check: " + QtCore.QString(self.var_process_check.readAllStandardError())) |
|
|||
155 |
|
||||
156 | def finished_check(self): |
|
|||
157 | self.txtInfo.append("check process completed "+QtCore.QString(self.var_process_check.exitCode())+"\n") |
|
|||
158 |
|
||||
159 |
|
127 | |||
160 | #----------------------------------------------------- Obtencion de la ruta de los datos --------------------------------------------------------------- |
|
128 | #----------------------------------------------------- Obtencion de la ruta de los datos --------------------------------------------------------------- | |
161 |
|
129 | |||
@@ -305,9 +273,35 | |||||
305 | self.var_lstDcapacity = self.lstDcapacity.currentIndex() |
|
273 | self.var_lstDcapacity = self.lstDcapacity.currentIndex() | |
306 | self.var_Dcapacity = self.txtDcapacity.value() |
|
274 | self.var_Dcapacity = self.txtDcapacity.value() | |
307 |
|
275 | |||
308 |
|
276 | #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- | ||
309 | #============================================================================== |
|
277 | ||
310 | # Botones para la generacion de los archivos de configuracion y el proceso de grabacion |
|
278 | @pyqtSignature("") | |
|
279 | def on_btnTdevA_clicked(self): | |||
|
280 | var_dev = str(self.txtDeviceA.text()) | |||
|
281 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |||
|
282 | commands.getstatusoutput(var_cmd) | |||
|
283 | ||||
|
284 | @pyqtSignature("") | |||
|
285 | def on_btnTdevB_clicked(self): | |||
|
286 | var_dev = str(self.txtDeviceB.text()) | |||
|
287 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |||
|
288 | commands.getstatusoutput(var_cmd) | |||
|
289 | ||||
|
290 | @pyqtSignature("") | |||
|
291 | def on_btnTdevC_clicked(self): | |||
|
292 | var_dev = str(self.txtDeviceC.text()) | |||
|
293 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |||
|
294 | commands.getstatusoutput(var_cmd) | |||
|
295 | ||||
|
296 | @pyqtSignature("") | |||
|
297 | def on_btnTdevD_clicked(self): | |||
|
298 | var_dev = str(self.txtDeviceD.text()) | |||
|
299 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |||
|
300 | commands.getstatusoutput(var_cmd) | |||
|
301 | ||||
|
302 | ||||
|
303 | #============================================================================== | |||
|
304 | # Botones para la generacion de los archivos de configuracion | |||
311 | #============================================================================== |
|
305 | #============================================================================== | |
312 |
|
306 | |||
313 | #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- |
|
307 | #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- | |
@@ -358,6 +352,96 | |||||
358 | self.btnStartburn.setText("Start Burn") |
|
352 | self.btnStartburn.setText("Start Burn") | |
359 |
|
353 | |||
360 |
|
354 | |||
|
355 | #============================================================================== | |||
|
356 | # Acciones de los procesos | |||
|
357 | #============================================================================== | |||
|
358 | ||||
|
359 | #------------------------------------------------ Funciones del proceso de creacion del iso ------------------------------------------------------ | |||
|
360 | ||||
|
361 | def readOuput_iso(self): | |||
|
362 | self.txtProgress.setText("stdout iso: " + QtCore.QString(self.process_iso.readAllStandardOutput())) | |||
|
363 | ||||
|
364 | def readError_iso(self): | |||
|
365 | self.txtProgress.setText("stderr iso: " + QtCore.QString(self.process_iso.readAllStandardError())) | |||
|
366 | ||||
|
367 | def finished_iso(self): | |||
|
368 | self.txtProgress.clear() | |||
|
369 | ||||
|
370 | if not(self.bool_state_burning): | |||
|
371 | return | |||
|
372 | ||||
|
373 | if self.process_iso.exitCode() == 0: | |||
|
374 | self.txtInfo.append("Iso file"+function.i2s(self.var_disc_n)+" created successfully \n") | |||
|
375 | self.var_step = 1 | |||
|
376 | self.function_burn() | |||
|
377 | ||||
|
378 | else: | |||
|
379 | self.txtInfo.append("Error creating iso file "+function.i2s(self.var_disc_n) | |||
|
380 | +" , code "+QtCore.QString(self.process_iso.exitCode())) | |||
|
381 | self.txtInfo.append("Please check the data \n") | |||
|
382 | ||||
|
383 | #----------------------------------------------------- Funciones del proceso de grabado --------------------------------------------------------------- | |||
|
384 | ||||
|
385 | def readOuput_burn(self): | |||
|
386 | self.txtProgress.setText("stdout burn: " + QtCore.QString(self.process_burn.readAllStandardOutput())) | |||
|
387 | ||||
|
388 | def readError_burn(self): | |||
|
389 | self.txtProgress.setText("stderr burn: " + QtCore.QString(self.process_burn.readAllStandardError())) | |||
|
390 | ||||
|
391 | def finished_burn(self): | |||
|
392 | self.txtProgress.clear() | |||
|
393 | ||||
|
394 | if not(self.bool_state_burning): | |||
|
395 | return | |||
|
396 | ||||
|
397 | if self.process_burn.exitCode() == 0: | |||
|
398 | self.txtInfo.append("Complete recording, disc: "+self.var_disc_n+" copy: "+self.var_copy_n) | |||
|
399 | functions2.update_message(1, "COMPLETED", self) | |||
|
400 | self.var_step = 2 | |||
|
401 | self.function_check() | |||
|
402 | ||||
|
403 | else: | |||
|
404 | self.txtInfo.append("Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: " | |||
|
405 | +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode())) | |||
|
406 | functions2.update_message(1, "ERROR", self) | |||
|
407 | ||||
|
408 | functions.next_var_disc(self, True) | |||
|
409 | if self.var_step == 0: | |||
|
410 | self.function_iso() | |||
|
411 | elif self.var_step == 1: | |||
|
412 | self.function_burn() | |||
|
413 | ||||
|
414 | ||||
|
415 | #----------------------------------------------------- Funciones del proceso de verificacion --------------------------------------------------------------- | |||
|
416 | ||||
|
417 | def readOuput_check(self): | |||
|
418 | self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_check.readAllStandardOutput())) | |||
|
419 | ||||
|
420 | def readError_check(self): | |||
|
421 | self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_check.readAllStandardError())) | |||
|
422 | ||||
|
423 | def finished_check(self): | |||
|
424 | self.txtProgress.clear() | |||
|
425 | ||||
|
426 | if not(self.bool_state_burning): | |||
|
427 | return | |||
|
428 | ||||
|
429 | if self.process_check.exitCode() == 0: | |||
|
430 | self.txtInfo.append("Complete checking, disc: "+self.var_disc_n+" copy: "+self.var_copy_n) | |||
|
431 | functions2.update_message(2, "CHECKED", self) | |||
|
432 | ||||
|
433 | else: | |||
|
434 | self.txtInfo.append("Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: " | |||
|
435 | +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode())) | |||
|
436 | functions2.update_message(2, "ERROR", self) | |||
|
437 | ||||
|
438 | self.function_check() | |||
|
439 | ||||
|
440 | ||||
|
441 | ||||
|
442 | #============================================================================== | |||
|
443 | # Botones para el proceso de grabacion | |||
|
444 | #============================================================================== | |||
361 |
|
445 | |||
362 | #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- |
|
446 | #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- | |
363 |
|
447 | |||
@@ -366,7 +450,8 | |||||
366 | """ |
|
450 | """ | |
367 | Se inicia el proceso de grabacion |
|
451 | Se inicia el proceso de grabacion | |
368 | """ |
|
452 | """ | |
369 |
|
|
453 | self.txtInfo.append("BUTTON: on_btnStartburn_clicked") | |
|
454 | ||||
370 | #Verifica que exista algun dispositivo de grabacion seleccionado |
|
455 | #Verifica que exista algun dispositivo de grabacion seleccionado | |
371 | if not(functions2.selected_devices(self)): |
|
456 | if not(functions2.selected_devices(self)): | |
372 | self.txtInfo.append("There is no recording device selected") |
|
457 | self.txtInfo.append("There is no recording device selected") | |
@@ -402,6 +487,7 | |||||
402 | functions2.enabled_items2(True, self) |
|
487 | functions2.enabled_items2(True, self) | |
403 | self.burning() |
|
488 | self.burning() | |
404 |
|
489 | |||
|
490 | #----------------------------------------------------- Funcion para el grabado --------------------------------------------------------------- | |||
405 |
|
491 | |||
406 | def burning(self): |
|
492 | def burning(self): | |
407 |
|
493 | |||
@@ -452,7 +538,7 | |||||
452 | self.blank_discs = False |
|
538 | self.blank_discs = False | |
453 |
|
539 | |||
454 | self.txtInfo.append("recording disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n)) |
|
540 | self.txtInfo.append("recording disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n)) | |
455 | functions2.update_message(1, self) |
|
541 | functions2.update_message(1, "BURNING", self) | |
456 |
|
542 | |||
457 | var_dev_tmp = self.var_devices[var_index] |
|
543 | var_dev_tmp = self.var_devices[var_index] | |
458 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" |
|
544 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" | |
@@ -473,37 +559,26 | |||||
473 | Slot documentation goes here. |
|
559 | Slot documentation goes here. | |
474 | """ |
|
560 | """ | |
475 | self.bool_state_burning = False |
|
561 | self.bool_state_burning = False | |
476 | self.var_process.terminate() #Termina el proceso, si puede |
|
562 | ||
477 | # self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona |
|
563 | if self.var_step == 0: | |
|
564 | self.process_iso.terminate() #Termina el proceso, si puede | |||
|
565 | # self.process_iso.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona | |||
|
566 | elif self.var_step == 1: | |||
|
567 | self.process_burn.terminate() | |||
|
568 | elif self.var_step == 2: | |||
|
569 | self.process_check.terminate() | |||
|
570 | ||||
478 | self.txtInfo.append("Stopped recording") |
|
571 | self.txtInfo.append("Stopped recording") | |
479 | functions2.enabled_items2(False, self) |
|
572 | functions2.enabled_items2(False, self) | |
480 |
|
573 | |||
481 |
|
574 | |||
482 | #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- |
|
575 | #============================================================================== | |
483 |
|
576 | # Proceso verificacion manual | ||
484 | @pyqtSignature("") |
|
577 | #============================================================================== | |
485 | def on_btnTdevA_clicked(self): |
|
578 | ||
486 | var_dev = str(self.txtDeviceA.text()) |
|
579 | ||
487 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
580 | #----------------------------------------------------- Proceso de verificaion manual --------------------------------------------------------------- | |
488 | commands.getstatusoutput(var_cmd) |
|
581 | ||
489 |
|
||||
490 | @pyqtSignature("") |
|
|||
491 | def on_btnTdevB_clicked(self): |
|
|||
492 | var_dev = str(self.txtDeviceB.text()) |
|
|||
493 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
|||
494 | commands.getstatusoutput(var_cmd) |
|
|||
495 |
|
||||
496 | @pyqtSignature("") |
|
|||
497 | def on_btnTdevC_clicked(self): |
|
|||
498 | var_dev = str(self.txtDeviceC.text()) |
|
|||
499 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
|||
500 | commands.getstatusoutput(var_cmd) |
|
|||
501 |
|
||||
502 | @pyqtSignature("") |
|
|||
503 | def on_btnTdevD_clicked(self): |
|
|||
504 | var_dev = str(self.txtDeviceD.text()) |
|
|||
505 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
|||
506 | commands.getstatusoutput(var_cmd) |
|
|||
507 |
|
582 | |||
508 | @pyqtSignature("") |
|
583 | @pyqtSignature("") | |
509 | def on_btnTDpath_clicked(self): |
|
584 | def on_btnTDpath_clicked(self): |
@@ -6,7 +6,7 | |||||
6 | <rect> |
|
6 | <rect> | |
7 | <x>0</x> |
|
7 | <x>0</x> | |
8 | <y>0</y> |
|
8 | <y>0</y> | |
9 |
<width> |
|
9 | <width>621</width> | |
10 | <height>717</height> |
|
10 | <height>717</height> | |
11 | </rect> |
|
11 | </rect> | |
12 | </property> |
|
12 | </property> | |
@@ -259,6 +259,9 | |||||
259 | </item> |
|
259 | </item> | |
260 | <item> |
|
260 | <item> | |
261 | <widget class="QSpinBox" name="txtBspeedA"> |
|
261 | <widget class="QSpinBox" name="txtBspeedA"> | |
|
262 | <property name="readOnly"> | |||
|
263 | <bool>true</bool> | |||
|
264 | </property> | |||
262 | <property name="minimum"> |
|
265 | <property name="minimum"> | |
263 | <number>1</number> |
|
266 | <number>1</number> | |
264 | </property> |
|
267 | </property> | |
@@ -313,6 +316,9 | |||||
313 | </item> |
|
316 | </item> | |
314 | <item> |
|
317 | <item> | |
315 | <widget class="QSpinBox" name="txtBspeedB"> |
|
318 | <widget class="QSpinBox" name="txtBspeedB"> | |
|
319 | <property name="readOnly"> | |||
|
320 | <bool>true</bool> | |||
|
321 | </property> | |||
316 | <property name="minimum"> |
|
322 | <property name="minimum"> | |
317 | <number>1</number> |
|
323 | <number>1</number> | |
318 | </property> |
|
324 | </property> | |
@@ -367,6 +373,9 | |||||
367 | </item> |
|
373 | </item> | |
368 | <item> |
|
374 | <item> | |
369 | <widget class="QSpinBox" name="txtBspeedC"> |
|
375 | <widget class="QSpinBox" name="txtBspeedC"> | |
|
376 | <property name="readOnly"> | |||
|
377 | <bool>true</bool> | |||
|
378 | </property> | |||
370 | <property name="minimum"> |
|
379 | <property name="minimum"> | |
371 | <number>1</number> |
|
380 | <number>1</number> | |
372 | </property> |
|
381 | </property> | |
@@ -421,6 +430,9 | |||||
421 | </item> |
|
430 | </item> | |
422 | <item> |
|
431 | <item> | |
423 | <widget class="QSpinBox" name="txtBspeedD"> |
|
432 | <widget class="QSpinBox" name="txtBspeedD"> | |
|
433 | <property name="readOnly"> | |||
|
434 | <bool>true</bool> | |||
|
435 | </property> | |||
424 | <property name="minimum"> |
|
436 | <property name="minimum"> | |
425 | <number>1</number> |
|
437 | <number>1</number> | |
426 | </property> |
|
438 | </property> | |
@@ -1179,23 +1191,6 | |||||
1179 | </item> |
|
1191 | </item> | |
1180 | </layout> |
|
1192 | </layout> | |
1181 | </item> |
|
1193 | </item> | |
1182 | <item> |
|
|||
1183 | <widget class="QWidget" name="widget_2" native="true"> |
|
|||
1184 | <property name="sizePolicy"> |
|
|||
1185 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
|
|||
1186 | <horstretch>0</horstretch> |
|
|||
1187 | <verstretch>0</verstretch> |
|
|||
1188 | </sizepolicy> |
|
|||
1189 | </property> |
|
|||
1190 | <property name="maximumSize"> |
|
|||
1191 | <size> |
|
|||
1192 | <width>500</width> |
|
|||
1193 | <height>16777215</height> |
|
|||
1194 | </size> |
|
|||
1195 | </property> |
|
|||
1196 | <layout class="QGridLayout" name="gridLayout_2"/> |
|
|||
1197 | </widget> |
|
|||
1198 | </item> |
|
|||
1199 | </layout> |
|
1194 | </layout> | |
1200 | </widget> |
|
1195 | </widget> | |
1201 | </widget> |
|
1196 | </widget> | |
@@ -1204,6 +1199,16 | |||||
1204 | <widget class="QTextEdit" name="txtInfo"> |
|
1199 | <widget class="QTextEdit" name="txtInfo"> | |
1205 | <property name="readOnly"> |
|
1200 | <property name="readOnly"> | |
1206 | <bool>true</bool> |
|
1201 | <bool>true</bool> | |
|
1202 | </property> | |||
|
1203 | </widget> | |||
|
1204 | </item> | |||
|
1205 | <item> | |||
|
1206 | <widget class="QLineEdit" name="txtProgress"> | |||
|
1207 | <property name="sizePolicy"> | |||
|
1208 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | |||
|
1209 | <horstretch>0</horstretch> | |||
|
1210 | <verstretch>0</verstretch> | |||
|
1211 | </sizepolicy> | |||
1207 | </property> |
|
1212 | </property> | |
1208 | </widget> |
|
1213 | </widget> | |
1209 | </item> |
|
1214 | </item> | |
@@ -1261,8 +1266,8 | |||||
1261 | <rect> |
|
1266 | <rect> | |
1262 | <x>0</x> |
|
1267 | <x>0</x> | |
1263 | <y>0</y> |
|
1268 | <y>0</y> | |
1264 |
<width> |
|
1269 | <width>621</width> | |
1265 |
<height>2 |
|
1270 | <height>21</height> | |
1266 | </rect> |
|
1271 | </rect> | |
1267 | </property> |
|
1272 | </property> | |
1268 | <widget class="QMenu" name="menuFile"> |
|
1273 | <widget class="QMenu" name="menuFile"> |
@@ -2,8 +2,8 | |||||
2 |
|
2 | |||
3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/About.ui' |
|
3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/About.ui' | |
4 | # |
|
4 | # | |
5 |
# Created: Mon May 24 |
|
5 | # Created: Mon May 24 22:39:27 2010 | |
6 |
# by: PyQt4 UI code generator 4. |
|
6 | # by: PyQt4 UI code generator 4.7.2 | |
7 | # |
|
7 | # | |
8 | # WARNING! All changes made in this file will be lost! |
|
8 | # WARNING! All changes made in this file will be lost! | |
9 |
|
9 |
@@ -2,8 +2,8 | |||||
2 |
|
2 | |||
3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' |
|
3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' | |
4 | # |
|
4 | # | |
5 |
# Created: Mon May 24 |
|
5 | # Created: Mon May 24 22:39:26 2010 | |
6 |
# by: PyQt4 UI code generator 4. |
|
6 | # by: PyQt4 UI code generator 4.7.2 | |
7 | # |
|
7 | # | |
8 | # WARNING! All changes made in this file will be lost! |
|
8 | # WARNING! All changes made in this file will be lost! | |
9 |
|
9 | |||
@@ -12,7 +12,7 | |||||
12 | class Ui_MainWindow(object): |
|
12 | class Ui_MainWindow(object): | |
13 | def setupUi(self, MainWindow): |
|
13 | def setupUi(self, MainWindow): | |
14 | MainWindow.setObjectName("MainWindow") |
|
14 | MainWindow.setObjectName("MainWindow") | |
15 |
MainWindow.resize( |
|
15 | MainWindow.resize(621, 717) | |
16 | self.centralwidget = QtGui.QWidget(MainWindow) |
|
16 | self.centralwidget = QtGui.QWidget(MainWindow) | |
17 | self.centralwidget.setObjectName("centralwidget") |
|
17 | self.centralwidget.setObjectName("centralwidget") | |
18 | self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget) |
|
18 | self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget) | |
@@ -154,6 +154,7 | |||||
154 | self.txtDeviceA.setObjectName("txtDeviceA") |
|
154 | self.txtDeviceA.setObjectName("txtDeviceA") | |
155 | self.verticalLayout_11.addWidget(self.txtDeviceA) |
|
155 | self.verticalLayout_11.addWidget(self.txtDeviceA) | |
156 | self.txtBspeedA = QtGui.QSpinBox(self.grpDevA) |
|
156 | self.txtBspeedA = QtGui.QSpinBox(self.grpDevA) | |
|
157 | self.txtBspeedA.setReadOnly(True) | |||
157 | self.txtBspeedA.setMinimum(1) |
|
158 | self.txtBspeedA.setMinimum(1) | |
158 | self.txtBspeedA.setProperty("value", 16) |
|
159 | self.txtBspeedA.setProperty("value", 16) | |
159 | self.txtBspeedA.setObjectName("txtBspeedA") |
|
160 | self.txtBspeedA.setObjectName("txtBspeedA") | |
@@ -182,6 +183,7 | |||||
182 | self.txtDeviceB.setObjectName("txtDeviceB") |
|
183 | self.txtDeviceB.setObjectName("txtDeviceB") | |
183 | self.verticalLayout_12.addWidget(self.txtDeviceB) |
|
184 | self.verticalLayout_12.addWidget(self.txtDeviceB) | |
184 | self.txtBspeedB = QtGui.QSpinBox(self.grpDevB) |
|
185 | self.txtBspeedB = QtGui.QSpinBox(self.grpDevB) | |
|
186 | self.txtBspeedB.setReadOnly(True) | |||
185 | self.txtBspeedB.setMinimum(1) |
|
187 | self.txtBspeedB.setMinimum(1) | |
186 | self.txtBspeedB.setProperty("value", 16) |
|
188 | self.txtBspeedB.setProperty("value", 16) | |
187 | self.txtBspeedB.setObjectName("txtBspeedB") |
|
189 | self.txtBspeedB.setObjectName("txtBspeedB") | |
@@ -210,6 +212,7 | |||||
210 | self.txtDeviceC.setObjectName("txtDeviceC") |
|
212 | self.txtDeviceC.setObjectName("txtDeviceC") | |
211 | self.verticalLayout_13.addWidget(self.txtDeviceC) |
|
213 | self.verticalLayout_13.addWidget(self.txtDeviceC) | |
212 | self.txtBspeedC = QtGui.QSpinBox(self.grpDevC) |
|
214 | self.txtBspeedC = QtGui.QSpinBox(self.grpDevC) | |
|
215 | self.txtBspeedC.setReadOnly(True) | |||
213 | self.txtBspeedC.setMinimum(1) |
|
216 | self.txtBspeedC.setMinimum(1) | |
214 | self.txtBspeedC.setProperty("value", 16) |
|
217 | self.txtBspeedC.setProperty("value", 16) | |
215 | self.txtBspeedC.setObjectName("txtBspeedC") |
|
218 | self.txtBspeedC.setObjectName("txtBspeedC") | |
@@ -238,6 +241,7 | |||||
238 | self.txtDeviceD.setObjectName("txtDeviceD") |
|
241 | self.txtDeviceD.setObjectName("txtDeviceD") | |
239 | self.verticalLayout_14.addWidget(self.txtDeviceD) |
|
242 | self.verticalLayout_14.addWidget(self.txtDeviceD) | |
240 | self.txtBspeedD = QtGui.QSpinBox(self.grpDevD) |
|
243 | self.txtBspeedD = QtGui.QSpinBox(self.grpDevD) | |
|
244 | self.txtBspeedD.setReadOnly(True) | |||
241 | self.txtBspeedD.setMinimum(1) |
|
245 | self.txtBspeedD.setMinimum(1) | |
242 | self.txtBspeedD.setProperty("value", 16) |
|
246 | self.txtBspeedD.setProperty("value", 16) | |
243 | self.txtBspeedD.setObjectName("txtBspeedD") |
|
247 | self.txtBspeedD.setObjectName("txtBspeedD") | |
@@ -536,23 +540,20 | |||||
536 | self.btnCHstart.setObjectName("btnCHstart") |
|
540 | self.btnCHstart.setObjectName("btnCHstart") | |
537 | self.horizontalLayout_20.addWidget(self.btnCHstart) |
|
541 | self.horizontalLayout_20.addWidget(self.btnCHstart) | |
538 | self.verticalLayout_4.addLayout(self.horizontalLayout_20) |
|
542 | self.verticalLayout_4.addLayout(self.horizontalLayout_20) | |
539 | self.widget_2 = QtGui.QWidget(self.tabStatus) |
|
|||
540 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) |
|
|||
541 | sizePolicy.setHorizontalStretch(0) |
|
|||
542 | sizePolicy.setVerticalStretch(0) |
|
|||
543 | sizePolicy.setHeightForWidth(self.widget_2.sizePolicy().hasHeightForWidth()) |
|
|||
544 | self.widget_2.setSizePolicy(sizePolicy) |
|
|||
545 | self.widget_2.setMaximumSize(QtCore.QSize(500, 16777215)) |
|
|||
546 | self.widget_2.setObjectName("widget_2") |
|
|||
547 | self.gridLayout_2 = QtGui.QGridLayout(self.widget_2) |
|
|||
548 | self.gridLayout_2.setObjectName("gridLayout_2") |
|
|||
549 | self.verticalLayout_4.addWidget(self.widget_2) |
|
|||
550 | self.tabWidget.addTab(self.tabStatus, "") |
|
543 | self.tabWidget.addTab(self.tabStatus, "") | |
551 | self.verticalLayout.addWidget(self.tabWidget) |
|
544 | self.verticalLayout.addWidget(self.tabWidget) | |
552 | self.txtInfo = QtGui.QTextEdit(self.centralwidget) |
|
545 | self.txtInfo = QtGui.QTextEdit(self.centralwidget) | |
553 | self.txtInfo.setReadOnly(True) |
|
546 | self.txtInfo.setReadOnly(True) | |
554 | self.txtInfo.setObjectName("txtInfo") |
|
547 | self.txtInfo.setObjectName("txtInfo") | |
555 | self.verticalLayout.addWidget(self.txtInfo) |
|
548 | self.verticalLayout.addWidget(self.txtInfo) | |
|
549 | self.txtProgress = QtGui.QLineEdit(self.centralwidget) | |||
|
550 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | |||
|
551 | sizePolicy.setHorizontalStretch(0) | |||
|
552 | sizePolicy.setVerticalStretch(0) | |||
|
553 | sizePolicy.setHeightForWidth(self.txtProgress.sizePolicy().hasHeightForWidth()) | |||
|
554 | self.txtProgress.setSizePolicy(sizePolicy) | |||
|
555 | self.txtProgress.setObjectName("txtProgress") | |||
|
556 | self.verticalLayout.addWidget(self.txtProgress) | |||
556 | self.horizontalLayout_2 = QtGui.QHBoxLayout() |
|
557 | self.horizontalLayout_2 = QtGui.QHBoxLayout() | |
557 | self.horizontalLayout_2.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint) |
|
558 | self.horizontalLayout_2.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint) | |
558 | self.horizontalLayout_2.setObjectName("horizontalLayout_2") |
|
559 | self.horizontalLayout_2.setObjectName("horizontalLayout_2") | |
@@ -575,7 +576,7 | |||||
575 | self.verticalLayout.addLayout(self.horizontalLayout_2) |
|
576 | self.verticalLayout.addLayout(self.horizontalLayout_2) | |
576 | MainWindow.setCentralWidget(self.centralwidget) |
|
577 | MainWindow.setCentralWidget(self.centralwidget) | |
577 | self.menubar = QtGui.QMenuBar(MainWindow) |
|
578 | self.menubar = QtGui.QMenuBar(MainWindow) | |
578 |
self.menubar.setGeometry(QtCore.QRect(0, 0, |
|
579 | self.menubar.setGeometry(QtCore.QRect(0, 0, 621, 21)) | |
579 | self.menubar.setObjectName("menubar") |
|
580 | self.menubar.setObjectName("menubar") | |
580 | self.menuFile = QtGui.QMenu(self.menubar) |
|
581 | self.menuFile = QtGui.QMenu(self.menubar) | |
581 | self.menuFile.setObjectName("menuFile") |
|
582 | self.menuFile.setObjectName("menuFile") |
@@ -2,8 +2,8 | |||||
2 |
|
2 | |||
3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/Parameters.ui' |
|
3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/Parameters.ui' | |
4 | # |
|
4 | # | |
5 |
# Created: Mon May 24 |
|
5 | # Created: Mon May 24 22:39:28 2010 | |
6 |
# by: PyQt4 UI code generator 4. |
|
6 | # by: PyQt4 UI code generator 4.7.2 | |
7 | # |
|
7 | # | |
8 | # WARNING! All changes made in this file will be lost! |
|
8 | # WARNING! All changes made in this file will be lost! | |
9 |
|
9 |
General Comments 0
You need to be logged in to leave comments.
Login now