Пример #1
0
 def imprimir(self, boton):
     """
     Imprime la información en pantalla.
     """
     from formularios import reports
     from informes import geninformes
     txt = "LOTE: %s\n" % (self.wids['e_codigo'].get_text())
     txt += "PRODUCTO: %s\n\n" % (self.wids['e_nombre'].get_text())
     txt += "\nCaracterísticas del lote:\n"
     txt += "    DTEX: %s\n" % (self.wids['e_dtex'].get_text())
     txt += "    Tenacidad: %s\n" % (self.wids['e_tenacidad'].get_text())
     txt += "    Alargamiento: %s\n" % (self.wids['e_elongacion'].get_text())
     txt += "    Corte: %s\n" % (self.wids['e_corte'].get_text())
     txt += "    Grasa: %s\n" % (self.wids['e_grasa'].get_text())
     txt += "    Encogimiento: %s\n" % (self.wids['e_encogimiento'].get_text())
     txt += "    Color: %s\n" % (self.wids['e_color'].get_text())
     txt += "    Humedad: %s\n" % (self.wids['e_rizo'].get_text())
     loteCem = self.loteCem
     try:
         dtex = loteCem.bigbags[0].articulos[0].productoVenta.camposEspecificosBala.dtex
         tolerancia = loteCem.tolerancia
         mediatitulo = loteCem.mediatitulo
     except:
         utils.dialogo_info(titulo = 'ERROR', 
                            texto = 'Ocurrió un error buscando el tipo de fibra.', 
                            padre = self.wids['ventana'])
         dtex = 0
         tolerancia = 0
         mediatitulo = 0
     difmax = dtex * tolerancia
     diferencia = abs(mediatitulo - dtex)
     if round(diferencia, 2) > difmax:
         ok = False
     else:
         ok = True
     txt += "    Media de título: %s (%s)\n" % (self.wids['e_media'].get_text(), 
                                                ok and "dentro del %s%% de tolerancia" % utils.float2str(self.wids['sp_tolerancia'].get_value(), 0) 
                                                or "no cumple el %s%% de tolerancia" % utils.float2str(self.wids['sp_tolerancia'].get_value(), 0)
                                                )
     txt += "    Desviación típica: %s\n" % (self.wids['e_desvtipica'].get_text())
     txt += "\nResultados de las pruebas:\n"
     model = self.wids['tv_pruebas'].get_model()
     for fila in model:
         txt += "    %s\n" % (fila[0])
         txt += "        Título (dtex): %s\n" % (fila[1])
         txt += "        Alargamiento (%%): %s\n" % (fila[2])
         txt += "        Tenacidad (cN/tex): %s\n" % (fila[3])
         txt += "        Grasa (%%): %s\n" % (fila[4])
         txt += "        Encogimiento (%%): %s\n" % (fila[5])
         txt += "        Humedad (%%): %s\n" % (fila[6])
     buff = self.wids['txt_observaciones'].get_buffer()
     txt += "\nObervaciones: %s\n" % buff.get_text(buff.get_start_iter(), buff.get_end_iter())
     reports.abrir_pdf(geninformes.texto_libre(txt, "Resultados de laboratorio: %s" % (self.objeto and self.objeto.codigo or "")))
Пример #2
0
 def imprimir(self, boton):
     """
     Imprime la información en pantalla.
     """
     from formularios import reports
     txt = "PARTIDA: %s\n" % (self.wids['e_numpartida'].get_text())
     txt += "PRODUCTO: %s\n\n" % (self.wids['e_nombre'].get_text())
     txt += "Lote y materia prima consumida:\n"
     model = self.wids['tv_lotes'].get_model()
     for fila in model:
         txt += "    %s\n" % (fila[0])
     txt += "\nMuestras relacionadas:\n"
     model = self.wids['tv_muestras'].get_model()
     for fila in model:
         txt += "    %s %s\n" % (fila[0], fila[1])
     txt += "\nCaracterísticas de la partida:\n"
     txt += "    Gramaje: %s\n" % (self.wids['e_gramaje'].get_text())
     txt += "    Resistencia longitudinal: %s\n" % (
         self.wids['e_rlongitudinal'].get_text())
     txt += "    Resistencia transversal: %s\n" % (
         self.wids['e_rtransversal'].get_text())
     txt += "    CBR: %s\n" % (self.wids['e_cbr'].get_text())
     txt += "    Cono: %s\n" % (self.wids['e_cono'].get_text())
     txt += "    Espesor: %s\n" % (self.wids['e_espesor'].get_text())
     txt += "    Alargamiento longitudinal: %s\n" % (
         self.wids['e_alongitudinal'].get_text())
     txt += "    Alargamiento transversal: %s\n" % (
         self.wids['e_atransversal'].get_text())
     txt += "    Permeabilidad: %s\n" % (
         self.wids['e_permeabilidad'].get_text())
     txt += "    Porometría: %s\n" % (self.wids['e_porometria'].get_text())
     txt += "    Piramidal: %s\n" % (self.wids['e_piramidal'].get_text())
     txt += "\nResultados de las pruebas:\n"
     model = self.wids['tv_pruebas'].get_model()
     for fila in model:
         txt += "    %s\n" % (fila[0])
         txt += "        Gramaje (gr/m²): %s\n" % (fila[1])
         txt += "        Resistencia longitudinal (kN/m): %s\n" % (fila[2])
         txt += "        Alargamiento longitudinal (%%): %s\n" % (fila[3])
         txt += "        Resistencia transversal (kN/m): %s\n" % (fila[4])
         txt += "        Alargamiento transversal (%%): %s\n" % (fila[5])
         txt += "        CBR (kN): %s\n" % (fila[6])
         txt += "        Cono: %s\n" % (fila[7])
         txt += "        Espesor (mm): %s\n" % (fila[8])
         txt += "        Permeabilidad (m/s): %s\n" % (fila[9])
         txt += "        Porometría (µm): %s\n" % (fila[10])
         txt += "        Piramidal (kN): %s\n\n" % (fila[11])
     buff = self.wids['txt_observaciones'].get_buffer()
     txt += "\nObervaciones: %s\n" % buff.get_text(
         buff.get_start_iter(), buff.get_end_iter())
     reports.abrir_pdf(geninformes.texto_libre(txt, 
         "Resultados de laboratorio: %s" % (
             self.objeto and self.objeto.codigo or "")))