Index: bk_manager/trunk/functions/functions.py
===================================================================
diff --git a/bk_manager/trunk/functions/functions.py b/bk_manager/trunk/functions/functions.py
--- a/bk_manager/trunk/functions/functions.py (revision 77)
+++ b/bk_manager/trunk/functions/functions.py (revision 78)
@@ -256,7 +256,8 @@
var_lines.append("\n")
return var_lines
-
+
+#---------------------------------------comandos para el proceso de grabacion ------------------------------------------
def cmd_iso(self):
var_Rpath_ppath=self.var_Rpath+"/ppath"
var_Rpath_iso=self.var_Rpath+"/iso"
@@ -268,14 +269,53 @@
var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
return var_cmd
-
-def next_var_disc(self, error = False):
- pass
-# if self.var_copy_n < self.var_Copys:
-# self.var_copy_n += 1
-# self.var_step == 1:
-#
-# if self.var_disc_n < self.var_Discs:
-
- pass
-
+def cmd_burn(self):
+ var_Rpath_iso=self.var_Rpath+"/iso"
+ file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
+
+ var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
+ var_dev_tmp = self.var_devices[var_index]
+
+ var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
+ return var_cmd
+
+def remove_iso(self):
+ var_Rpath_iso=self.var_Rpath+"/iso"
+ file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
+
+ self.txtInfo.append("Deleting iso file: "+functions.i2s(self.var_disc_n)+".iso")
+
+ if os.path.isfile(file_iso):
+ os.remove(file_iso)
+
+#Si es el ultimo disco se termina el proceso
+def is_last_disc_and_copy(self):
+ if self.var_disc_n == self.var_Discs and self.var_copy_n == self.var_Copys:
+ self.function_final()
+ else:
+ next_disc(self)
+
+#Define cual es el siguiente disco a grabar y que paso seguir
+def next_disc(self, error = False):
+ if self.var_copy_n == self.var_Copys:
+ self.var_disc_n += 1
+ self.var_copy_n = 1
+ self.var_step = 0
+
+ else:
+ self.var_copy_n += 1
+ self.var_step = 1
+
+ var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
+
+ self.txtInfo.append("NEXT DISC: "+str(self.var_disc_n)+" COPY: "+str(self.var_copy_n)
+ +" INDEX: "+str(var_index)+" STEP: "+str(self.var_step))
+ self.txtInfo.append("\n")
+
+ if var_index == 0 :
+ self.function_eject()
+
+ elif self.var_step == 0:
+ self.function_iso()
+ elif self.var_step == 1:
+ self.function_burn()
Index: bk_manager/trunk/functions/functions2.py
===================================================================
diff --git a/bk_manager/trunk/functions/functions2.py b/bk_manager/trunk/functions/functions2.py
--- a/bk_manager/trunk/functions/functions2.py (revision 77)
+++ b/bk_manager/trunk/functions/functions2.py (revision 78)
@@ -52,8 +52,6 @@
#----------------------------------- expulsa los dispositivos de grabacion --------------------------------------------
def eject_devices(self):
- self.txtInfo.append("Ejecting recording devices")
- return
for var_dev in self.var_devices:
var_cmd = 'eject ' + var_dev
commands.getstatusoutput(var_cmd)
Index: bk_manager/trunk/ui/MainWindow.py
===================================================================
diff --git a/bk_manager/trunk/ui/MainWindow.py b/bk_manager/trunk/ui/MainWindow.py
--- a/bk_manager/trunk/ui/MainWindow.py (revision 77)
+++ b/bk_manager/trunk/ui/MainWindow.py (revision 78)
@@ -32,6 +32,8 @@
def setupUi2(self):
+ self.var_real = False
+
# Reconocimiento de los dispositivos de grabacion
# functions2.detect_devices(self) #busca los dispositivos de grabacion
####################################
@@ -44,7 +46,8 @@
self.var_disc_n = 0 # disco actual
self.var_copy_n = 0 # copia actual
self.var_burned_discs = 0 #numero de discos ya grabados
-
+
+ self.bool_first_iso = False
self.var_step = 0 # numero de paso en el proceso
self.bool_state_burning = False #si es True se puede grabar
self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco
@@ -56,6 +59,7 @@
#Revisa si existe el archivo de confirguracion y lo carga
if os.path.isfile("parameters.conf"):
functions2.get_parameters_conf(self)
+ self.bool_first_iso = True
self.txtInfo.append("Parameters were loaded from configuration file")
self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
@@ -112,6 +116,8 @@
self.var_copy_n = dlgui.txtCopy.value()
self.txtInfo.append("Changed parameters")
self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
+ self.bool_first_iso = True
+
def about(self):
@@ -333,7 +339,10 @@
#Se bloquean los parametros de configuracion
functions2.enabled_items1(True, self)
-
+ self.var_disc_n = 1
+ self.var_copy_n = 1
+ self.bool_first_iso = True
+ self.var_burned_discs = 0 #numero de discos grabados
#----------------------------------------------------- Permite reiniciar la configuracion ---------------------------------------------------------------
@@ -352,6 +361,7 @@
self.btnStartburn.setText("Start Burn")
+
#==============================================================================
# Acciones de los procesos
#==============================================================================
@@ -371,15 +381,15 @@
return
if self.process_iso.exitCode() == 0:
- self.txtInfo.append("Iso file"+function.i2s(self.var_disc_n)+" created successfully \n")
+ self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully")
self.var_step = 1
self.function_burn()
else:
- self.txtInfo.append("Error creating iso file "+function.i2s(self.var_disc_n)
+ self.txtInfo.append("#####Error creating iso file "+function.i2s(self.var_disc_n)
+" , code "+QtCore.QString(self.process_iso.exitCode()))
- self.txtInfo.append("Please check the data \n")
-
+ self.txtInfo.append("Please check the data")
+ self.txtInfo.append("FATAL ERROR")
#----------------------------------------------------- Funciones del proceso de grabado ---------------------------------------------------------------
def readOuput_burn(self):
@@ -390,26 +400,26 @@
def finished_burn(self):
self.txtProgress.clear()
-
+
+ #Si se paro el proceso manualmente se termina
if not(self.bool_state_burning):
return
+
+ functions2.make_burning_conf(self) # Si el proceso no ha sido detenido manualmente
+ #crea el archivo burning.conf para el seguimiento de los discos grabados
if self.process_burn.exitCode() == 0:
- self.txtInfo.append("Complete recording, disc: "+self.var_disc_n+" copy: "+self.var_copy_n)
+ self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
functions2.update_message(1, "COMPLETED", self)
self.var_step = 2
self.function_check()
else:
- self.txtInfo.append("Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: "
+ self.txtInfo.append("#######Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: "
+function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode()))
functions2.update_message(1, "ERROR", self)
- functions.next_var_disc(self, True)
- if self.var_step == 0:
- self.function_iso()
- elif self.var_step == 1:
- self.function_burn()
+ functions.is_last_disc_and_copy(self)
#----------------------------------------------------- Funciones del proceso de verificacion ---------------------------------------------------------------
@@ -427,15 +437,15 @@
return
if self.process_check.exitCode() == 0:
- self.txtInfo.append("Complete checking, disc: "+self.var_disc_n+" copy: "+self.var_copy_n)
+ self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
functions2.update_message(2, "CHECKED", self)
else:
- self.txtInfo.append("Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: "
+ self.txtInfo.append("#######Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: "
+function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode()))
functions2.update_message(2, "ERROR", self)
- self.function_check()
+ functions.is_last_disc_and_copy(self)
@@ -450,105 +460,102 @@
"""
Se inicia el proceso de grabacion
"""
- self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
-
#Verifica que exista algun dispositivo de grabacion seleccionado
if not(functions2.selected_devices(self)):
self.txtInfo.append("There is no recording device selected")
return
-
+
# #Lista los dispositivos de grabacion a usar
# for dev in self.var_devices:
# self.txtInfo.append("recording device :"+dev)
-
- #Si se ingresaron los DVDs en blanco
- if self.blank_discs == True:
- self.btnStartburn.setEnabled(False)
- self.burning()
+
+ self.bool_state_burning = True
+ functions2.enabled_items2(True, self)
+
+ if self.bool_first_iso == True:
+ self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
+ self.var_step = 4
+ self.function_eject()
return
-
- #Si se cargo los parametros de burning.conf
- if self.var_burned_discs != 0:
- self.txtInfo.append("BURNED DISC: "+str(self.var_burned_discs))
- self.var_step = 0
- self.bool_state_burning = True
- self.blank_discs = False
- functions2.enabled_items2(True, self)
- self.burning()
+
+ if self.var_step == 0:
+ self.function_iso()
return
- #Asigna las variables con los valores iniciales
- self.var_disc_n = 1 # numero de disco actual para grabacion
- self.var_copy_n = 1
- self.var_burned_discs = 0 #numero de discos grabados
- self.var_step = 0
- self.bool_state_burning = True
- self.blank_discs = False
- functions2.enabled_items2(True, self)
- self.burning()
-
+ if self.var_step == 1:
+ self.function_burn()
+ return
+
#----------------------------------------------------- Funcion para el grabado ---------------------------------------------------------------
-
- def burning(self):
-
- var_Rpath_ppath=self.var_Rpath+"/ppath"
- var_Rpath_iso=self.var_Rpath+"/iso"
-
- #Si ya se grabaron todas las copias del disco
- if self.var_copy_n > self.var_Copys:
- #borra la imagen.iso del numero de disco anterior
- file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
-# self.txtInfo.append("Deleting iso file")
-# os.remove(file_iso)
- self.var_copy_n = 1
- self.var_disc_n += 1 # aumenta numero de disco actual para grabacion
- self.var_step = 0
-
- #Si ya se grabaron todos los discos
- if self.var_disc_n > self.var_Discs:
- self.bool_state_burning = False
- self.txtInfo.append("Recording process is complete")
- functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
- self.on_btnRestart_clicked()
- self.btnStopburn.setEnabled(False)
- return
-
-# self.txtInfo.append("\n"+str(self.var_disc_n)+" "+str(self.var_copy_n)+" "+str(self.var_step))
-
+
+ def function_iso(self):
#Creacion del archivo.iso para la grabacion
if self.var_step == 0:
self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
- self.txtInfo.append("---------Creating iso file number: "+str(self.var_disc_n))
- var_cmd = functions.cmd_iso(self)
-
+ self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n))
+
+ if self.var_real == True:
+ var_cmd = functions.cmd_iso(self)
+ else:
+ self.txtInfo.append('**function_iso')
+ var_cmd="echo 'function_iso'"
+
+ self.process_iso.start(var_cmd)
+
+ def function_burn(self):
#Grabacion de los DVDs
- elif self.var_step == 1:
-
- functions2.make_burning_conf(self)
-
- var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
-# self.txtInfo.append("INDEX: "+str(var_index))
- if var_index == 0 and self.blank_discs == False:
- functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
- self.blank_discs = True
- self.btnStartburn.setText("Continue")
- self.btnStartburn.setEnabled(True)
- return
-
- self.blank_discs = False
-
- self.txtInfo.append("recording disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
+ if self.var_step == 1:
+ self.txtInfo.append("------Recording disc: "+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
functions2.update_message(1, "BURNING", self)
-
- var_dev_tmp = self.var_devices[var_index]
- file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
- var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
-
- self.var_process.start('echo "comando"')
-# self.txtInfo.append("CMD: "+var_cmd)
-
-# self.txtInfo.append("creando iso")
-# self.var_process.start(var_cmd)
+
+ if self.var_real == True:
+ var_cmd = functions.cmd_burn(self)
+ else:
+ self.txtInfo.append('**function_burn')
+ var_cmd="echo 'function_burn'"
+
+ self.process_burn.start(var_cmd)
+
+ def function_check(self):
+ #Verificacion de los discos
+ if self.var_step == 2:
+ self.txtInfo.append("-----------checking disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
+ functions2.update_message(2, "CHECKING", self)
+
+ if self.var_real == True:
+ var_cmd = functions.cmd_check(self)
+ else:
+ self.txtInfo.append('**function_check')
+ var_cmd="echo 'function_check'"
+
+ self.process_check.start(var_cmd)
+
+ #OK
+ def function_eject(self):
+ self.txtInfo.append("Ejecting recording devices")
+ self.txtInfo.append("Please insert blank discs")
+
+ if self.var_real == True:
+ functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
+ else:
+ self.txtInfo.append("**functions2.eject_devices")
+
+ self.btnStartburn.setText("Continue")
+ self.btnStartburn.setEnabled(True)
+
+ if self.bool_first_iso == True:
+ self.bool_first_iso = False
+ self.var_step = 0
+
+ elif self.var_copy_n == 1:
+ self.var_step = 0
+
+ else:
+ self.var_step = 1
+
+ def function_final(self):
+ self.txtInfo.append("Recording process is complete")
+
#----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
@@ -569,7 +576,9 @@
self.process_check.terminate()
self.txtInfo.append("Stopped recording")
- functions2.enabled_items2(False, self)
+ functions2.enabled_items2(False, self)
+ self.bool_first_iso = True
+
#==============================================================================
Index: bk_manager/trunk/ui/MainWindow.ui
===================================================================
diff --git a/bk_manager/trunk/ui/MainWindow.ui b/bk_manager/trunk/ui/MainWindow.ui
--- a/bk_manager/trunk/ui/MainWindow.ui (revision 77)
+++ b/bk_manager/trunk/ui/MainWindow.ui (revision 78)
@@ -6,7 +6,7 @@
0
0
- 621
+ 824
717
@@ -1266,8 +1266,8 @@
0
0
- 621
- 21
+ 824
+ 25