##// END OF EJS Templates
segun diagrama 2da parte ...
ralonso -
r77:78
parent child
Show More
@@ -256,7 +256,8
256 256 var_lines.append("\n")
257 257
258 258 return var_lines
259
259
260 #---------------------------------------comandos para el proceso de grabacion ------------------------------------------
260 261 def cmd_iso(self):
261 262 var_Rpath_ppath=self.var_Rpath+"/ppath"
262 263 var_Rpath_iso=self.var_Rpath+"/iso"
@@ -268,14 +269,53
268 269 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
269 270 return var_cmd
270 271
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
272 def cmd_burn(self):
273 var_Rpath_iso=self.var_Rpath+"/iso"
274 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
275
276 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
277 var_dev_tmp = self.var_devices[var_index]
278
279 var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
280 return var_cmd
281
282 def remove_iso(self):
283 var_Rpath_iso=self.var_Rpath+"/iso"
284 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
285
286 self.txtInfo.append("Deleting iso file: "+functions.i2s(self.var_disc_n)+".iso")
287
288 if os.path.isfile(file_iso):
289 os.remove(file_iso)
290
291 #Si es el ultimo disco se termina el proceso
292 def is_last_disc_and_copy(self):
293 if self.var_disc_n == self.var_Discs and self.var_copy_n == self.var_Copys:
294 self.function_final()
295 else:
296 next_disc(self)
297
298 #Define cual es el siguiente disco a grabar y que paso seguir
299 def next_disc(self, error = False):
300 if self.var_copy_n == self.var_Copys:
301 self.var_disc_n += 1
302 self.var_copy_n = 1
303 self.var_step = 0
304
305 else:
306 self.var_copy_n += 1
307 self.var_step = 1
308
309 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
310
311 self.txtInfo.append("NEXT DISC: "+str(self.var_disc_n)+" COPY: "+str(self.var_copy_n)
312 +" INDEX: "+str(var_index)+" STEP: "+str(self.var_step))
313 self.txtInfo.append("\n")
314
315 if var_index == 0 :
316 self.function_eject()
317
318 elif self.var_step == 0:
319 self.function_iso()
320 elif self.var_step == 1:
321 self.function_burn()
@@ -52,8 +52,6
52 52 #----------------------------------- expulsa los dispositivos de grabacion --------------------------------------------
53 53
54 54 def eject_devices(self):
55 self.txtInfo.append("Ejecting recording devices")
56 return
57 55 for var_dev in self.var_devices:
58 56 var_cmd = 'eject ' + var_dev
59 57 commands.getstatusoutput(var_cmd)
@@ -32,6 +32,8
32 32
33 33 def setupUi2(self):
34 34
35 self.var_real = False
36
35 37 # Reconocimiento de los dispositivos de grabacion
36 38 # functions2.detect_devices(self) #busca los dispositivos de grabacion
37 39 ####################################
@@ -44,7 +46,8
44 46 self.var_disc_n = 0 # disco actual
45 47 self.var_copy_n = 0 # copia actual
46 48 self.var_burned_discs = 0 #numero de discos ya grabados
47
49
50 self.bool_first_iso = False
48 51 self.var_step = 0 # numero de paso en el proceso
49 52 self.bool_state_burning = False #si es True se puede grabar
50 53 self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco
@@ -56,6 +59,7
56 59 #Revisa si existe el archivo de confirguracion y lo carga
57 60 if os.path.isfile("parameters.conf"):
58 61 functions2.get_parameters_conf(self)
62 self.bool_first_iso = True
59 63 self.txtInfo.append("Parameters were loaded from configuration file")
60 64 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
61 65
@@ -112,6 +116,8
112 116 self.var_copy_n = dlgui.txtCopy.value()
113 117 self.txtInfo.append("Changed parameters")
114 118 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
119 self.bool_first_iso = True
120
115 121
116 122
117 123 def about(self):
@@ -333,7 +339,10
333 339
334 340 #Se bloquean los parametros de configuracion
335 341 functions2.enabled_items1(True, self)
336
342 self.var_disc_n = 1
343 self.var_copy_n = 1
344 self.bool_first_iso = True
345 self.var_burned_discs = 0 #numero de discos grabados
337 346
338 347
339 348 #----------------------------------------------------- Permite reiniciar la configuracion ---------------------------------------------------------------
@@ -352,6 +361,7
352 361 self.btnStartburn.setText("Start Burn")
353 362
354 363
364
355 365 #==============================================================================
356 366 # Acciones de los procesos
357 367 #==============================================================================
@@ -371,15 +381,15
371 381 return
372 382
373 383 if self.process_iso.exitCode() == 0:
374 self.txtInfo.append("Iso file"+function.i2s(self.var_disc_n)+" created successfully \n")
384 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully")
375 385 self.var_step = 1
376 386 self.function_burn()
377 387
378 388 else:
379 self.txtInfo.append("Error creating iso file "+function.i2s(self.var_disc_n)
389 self.txtInfo.append("#####Error creating iso file "+function.i2s(self.var_disc_n)
380 390 +" , code "+QtCore.QString(self.process_iso.exitCode()))
381 self.txtInfo.append("Please check the data \n")
382
391 self.txtInfo.append("Please check the data")
392 self.txtInfo.append("FATAL ERROR")
383 393 #----------------------------------------------------- Funciones del proceso de grabado ---------------------------------------------------------------
384 394
385 395 def readOuput_burn(self):
@@ -390,26 +400,26
390 400
391 401 def finished_burn(self):
392 402 self.txtProgress.clear()
393
403
404 #Si se paro el proceso manualmente se termina
394 405 if not(self.bool_state_burning):
395 406 return
407
408 functions2.make_burning_conf(self) # Si el proceso no ha sido detenido manualmente
409 #crea el archivo burning.conf para el seguimiento de los discos grabados
396 410
397 411 if self.process_burn.exitCode() == 0:
398 self.txtInfo.append("Complete recording, disc: "+self.var_disc_n+" copy: "+self.var_copy_n)
412 self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
399 413 functions2.update_message(1, "COMPLETED", self)
400 414 self.var_step = 2
401 415 self.function_check()
402 416
403 417 else:
404 self.txtInfo.append("Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: "
418 self.txtInfo.append("#######Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: "
405 419 +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode()))
406 420 functions2.update_message(1, "ERROR", self)
407 421
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()
422 functions.is_last_disc_and_copy(self)
413 423
414 424
415 425 #----------------------------------------------------- Funciones del proceso de verificacion ---------------------------------------------------------------
@@ -427,15 +437,15
427 437 return
428 438
429 439 if self.process_check.exitCode() == 0:
430 self.txtInfo.append("Complete checking, disc: "+self.var_disc_n+" copy: "+self.var_copy_n)
440 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
431 441 functions2.update_message(2, "CHECKED", self)
432 442
433 443 else:
434 self.txtInfo.append("Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: "
444 self.txtInfo.append("#######Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: "
435 445 +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode()))
436 446 functions2.update_message(2, "ERROR", self)
437 447
438 self.function_check()
448 functions.is_last_disc_and_copy(self)
439 449
440 450
441 451
@@ -450,105 +460,102
450 460 """
451 461 Se inicia el proceso de grabacion
452 462 """
453 self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
454
455 463 #Verifica que exista algun dispositivo de grabacion seleccionado
456 464 if not(functions2.selected_devices(self)):
457 465 self.txtInfo.append("There is no recording device selected")
458 466 return
459
467
460 468 # #Lista los dispositivos de grabacion a usar
461 469 # for dev in self.var_devices:
462 470 # self.txtInfo.append("recording device :"+dev)
463
464 #Si se ingresaron los DVDs en blanco
465 if self.blank_discs == True:
466 self.btnStartburn.setEnabled(False)
467 self.burning()
471
472 self.bool_state_burning = True
473 functions2.enabled_items2(True, self)
474
475 if self.bool_first_iso == True:
476 self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
477 self.var_step = 4
478 self.function_eject()
468 479 return
469
470 #Si se cargo los parametros de burning.conf
471 if self.var_burned_discs != 0:
472 self.txtInfo.append("BURNED DISC: "+str(self.var_burned_discs))
473 self.var_step = 0
474 self.bool_state_burning = True
475 self.blank_discs = False
476 functions2.enabled_items2(True, self)
477 self.burning()
480
481 if self.var_step == 0:
482 self.function_iso()
478 483 return
479 484
480 #Asigna las variables con los valores iniciales
481 self.var_disc_n = 1 # numero de disco actual para grabacion
482 self.var_copy_n = 1
483 self.var_burned_discs = 0 #numero de discos grabados
484 self.var_step = 0
485 self.bool_state_burning = True
486 self.blank_discs = False
487 functions2.enabled_items2(True, self)
488 self.burning()
489
485 if self.var_step == 1:
486 self.function_burn()
487 return
488
490 489 #----------------------------------------------------- Funcion para el grabado ---------------------------------------------------------------
491
492 def burning(self):
493
494 var_Rpath_ppath=self.var_Rpath+"/ppath"
495 var_Rpath_iso=self.var_Rpath+"/iso"
496
497 #Si ya se grabaron todas las copias del disco
498 if self.var_copy_n > self.var_Copys:
499 #borra la imagen.iso del numero de disco anterior
500 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
501 # self.txtInfo.append("Deleting iso file")
502 # os.remove(file_iso)
503 self.var_copy_n = 1
504 self.var_disc_n += 1 # aumenta numero de disco actual para grabacion
505 self.var_step = 0
506
507 #Si ya se grabaron todos los discos
508 if self.var_disc_n > self.var_Discs:
509 self.bool_state_burning = False
510 self.txtInfo.append("Recording process is complete")
511 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
512 self.on_btnRestart_clicked()
513 self.btnStopburn.setEnabled(False)
514 return
515
516 # self.txtInfo.append("\n"+str(self.var_disc_n)+" "+str(self.var_copy_n)+" "+str(self.var_step))
517
490
491 def function_iso(self):
518 492 #Creacion del archivo.iso para la grabacion
519 493 if self.var_step == 0:
520 494 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
521 self.txtInfo.append("---------Creating iso file number: "+str(self.var_disc_n))
522 var_cmd = functions.cmd_iso(self)
523
495 self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n))
496
497 if self.var_real == True:
498 var_cmd = functions.cmd_iso(self)
499 else:
500 self.txtInfo.append('**function_iso')
501 var_cmd="echo 'function_iso'"
502
503 self.process_iso.start(var_cmd)
504
505 def function_burn(self):
524 506 #Grabacion de los DVDs
525 elif self.var_step == 1:
526
527 functions2.make_burning_conf(self)
528
529 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
530 # self.txtInfo.append("INDEX: "+str(var_index))
531 if var_index == 0 and self.blank_discs == False:
532 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
533 self.blank_discs = True
534 self.btnStartburn.setText("Continue")
535 self.btnStartburn.setEnabled(True)
536 return
537
538 self.blank_discs = False
539
540 self.txtInfo.append("recording disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
507 if self.var_step == 1:
508 self.txtInfo.append("------Recording disc: "+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
541 509 functions2.update_message(1, "BURNING", self)
542
543 var_dev_tmp = self.var_devices[var_index]
544 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
545 var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
546
547 self.var_process.start('echo "comando"')
548 # self.txtInfo.append("CMD: "+var_cmd)
549
550 # self.txtInfo.append("creando iso")
551 # self.var_process.start(var_cmd)
510
511 if self.var_real == True:
512 var_cmd = functions.cmd_burn(self)
513 else:
514 self.txtInfo.append('**function_burn')
515 var_cmd="echo 'function_burn'"
516
517 self.process_burn.start(var_cmd)
518
519 def function_check(self):
520 #Verificacion de los discos
521 if self.var_step == 2:
522 self.txtInfo.append("-----------checking disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
523 functions2.update_message(2, "CHECKING", self)
524
525 if self.var_real == True:
526 var_cmd = functions.cmd_check(self)
527 else:
528 self.txtInfo.append('**function_check')
529 var_cmd="echo 'function_check'"
530
531 self.process_check.start(var_cmd)
532
533 #OK
534 def function_eject(self):
535 self.txtInfo.append("Ejecting recording devices")
536 self.txtInfo.append("Please insert blank discs")
537
538 if self.var_real == True:
539 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
540 else:
541 self.txtInfo.append("**functions2.eject_devices")
542
543 self.btnStartburn.setText("Continue")
544 self.btnStartburn.setEnabled(True)
545
546 if self.bool_first_iso == True:
547 self.bool_first_iso = False
548 self.var_step = 0
549
550 elif self.var_copy_n == 1:
551 self.var_step = 0
552
553 else:
554 self.var_step = 1
555
556 def function_final(self):
557 self.txtInfo.append("Recording process is complete")
558
552 559
553 560
554 561 #----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
@@ -569,7 +576,9
569 576 self.process_check.terminate()
570 577
571 578 self.txtInfo.append("Stopped recording")
572 functions2.enabled_items2(False, self)
579 functions2.enabled_items2(False, self)
580 self.bool_first_iso = True
581
573 582
574 583
575 584 #==============================================================================
@@ -6,7 +6,7
6 6 <rect>
7 7 <x>0</x>
8 8 <y>0</y>
9 <width>621</width>
9 <width>824</width>
10 10 <height>717</height>
11 11 </rect>
12 12 </property>
@@ -1266,8 +1266,8
1266 1266 <rect>
1267 1267 <x>0</x>
1268 1268 <y>0</y>
1269 <width>621</width>
1270 <height>21</height>
1269 <width>824</width>
1270 <height>25</height>
1271 1271 </rect>
1272 1272 </property>
1273 1273 <widget class="QMenu" name="menuFile">
General Comments 0
You need to be logged in to leave comments. Login now