Пример #1
0
 def leerBotones(self):
     re.setReset()
     botones.configurarPinesGPIO()
     botones.configurarPinesGPIOBobina()
     global boleto_previo
     print("------Preguntar Botones --------")
     b1, b2 = botones.leerBotonesEntrada()
     f1 = botones.validarBotones(b1, b2)
     f2 = f3 = f4 = f5 = False
     f6 = botones.leerBobina2Subida(
     )  #PREGUNTAR POR LA BOBINA EN EL PIN CORRECTO
     if boleto_previo == True:  #IMprimir cabecera()
         print "Imprimo la cabecera para tener listo el boleto..."
         imprimir.imprimirHeader()
         boleto_previo = False
     else:
         if f1 == True and f2 == False and f3 == False and f4 == False and f5 == False:
             noBolF = folio.saberFolio()
             folioBD = noBolF
             print "Folio:" + noBolF
             noBol = noBolF.replace('GM:', '')
             fechaIn = fechaUTC.fechaConFormato()
             horaEnt = fechaUTC.tiempoConFormato()
             #imprimir.imprimirQR(noBol,str(terminalEnt),str(fechaIn),str(horaEnt))
             imprimir.imprimirQR2(noBol, str(terminalEnt), str(fechaIn),
                                  str(horaEnt))
             print "Bandera f2=True se termino de imprimir"
             print "Se agrega Boleto a la base de datos de la expedidora"
             fechatimestamp = str(fechaIn) + " " + str(horaEnt)
             conectionBD.insertarBoleto(PATH_NOMBRE_PLAZA, terminalEnt,
                                        str(folioBD), fechatimestamp,
                                        'DEFAULT-ESCOM')
             boleto_previo = True  #Se completa la primera face y se puede volver a imprimir unas cabecera.
             f2 = True
         if f2 == True and f3 == False and f4 == False and f5 == False:
             botones.abrir()
             while (f2 == True and f3 == False):
                 f3 = botones.leerBobina2Subida()
             f2 = False
         if f2 == False and f3 == True and f4 == False and f5 == False:
             while (f3 == True and f4 == False):
                 time.sleep(0.5)
                 print "Barrera Abierta"
                 f4 = botones.abrirBarrera()
             f3 = False
         if f2 == False and f3 == False and f4 == True and f5 == False:
             while (f5 == False):
                 time.sleep(0.5)
                 f5 = botones.CerrarBarrera()
             f4 = False
         if f2 == False and f3 == False and f4 == False and f5 == True:
             print "Ya cerre barrera restablesco fs"
             f1 = f2 = f3 = f4 = f5 = False
         if f6 == True:
             print "Abrir barrera por que se echaron pa tràs"
             while (f5 == False):
                 f5 = botones.CerrarBarrera()
     QtCore.QTimer.singleShot(200, self.leerBotones)
Пример #2
0
	def configurarPinesGPIO(self):
		botones.configurarPinesGPIO()
		botones.configurarPinesGPIOBobina()
Пример #3
0
 def alza(self):
     botones.configurarPinesGPIO()
     botones.configurarPinesGPIOBobina()
     botones.abrir()