Exemplo n.º 1
0
def inicio(c):
    global ventana2, Labeli, Labelt, img0, img1, imgF, row, cont
    instruction = None
    img0 = PhotoImage(file="00.gif")  # Reads photos
    img00 = PhotoImage(file="0000.gif")
    imgF = PhotoImage(file="FF.gif")

    if c:
        ventana2 = Toplevel(ventana)
        ventana2.title("MANITOR")
        ventana2.configure(bg="white")
        ventana2.geometry("1000x600+5+40")

        Labelt = Label(
            ventana2,
            text='BIENVENIDO ',  # ventana2 TEXTO
            fg="black",
            bg="white",
            font=("Helvetica 36 "))
        ventana2.columnconfigure(0, weight=1)
        Labelt.grid(row=1, column=0)
        Labeli = Label(ventana2, image=img00)  # ventana2 IMAGEN
        Labeli.grid(row=2, column=0)

    else:
        Labelt.config(text='BIENVENIDO ')
        Labeli.image = img00
        Labeli.config(image=img00)
    ventana.iconify()  # Turns window into an icon

    row = row + 1
    cont = cont + 1
    while 1:

        queue = Queue()
        Labelt.config(text='BIENVENIDO \n  Por favor moje sus manos con agua')
        worksheet.write_datetime(row, col, date_time, f2)
        worksheet.write_datetime(row, col + 1, date_time, f3)
        worksheet.write(row, col + 2, cont, f6)
        worksheet.write(row, col + 3, 'NUEVA PERSONA', f4)
        ventana2.update()
        video000()

        def jabon():
            def cero(q):
                analysisRegion = 1
                print regionCoord
                tipoMovimiento = BByOFfile.BByOF(2, lower, upper, regionCoord,
                                                 analysisRegion, 10)
                q.put([tipoMovimiento])

            Labelt.config(text='Deposite jabón en la mano')
            global row
            row = row + 1
            worksheet.write(row, col + 3, 'jabon', f5)
            ventana2.update()
            c = threading.Thread(target=cero, args=(queue, ))
            c.start()
            video00()

            if c.isAlive():
                c.join()
            instruction = queue.get()
            instruction = falseType(instruction[0], Labelt, Labeli, img0, imgF)
            if not instruction:
                jabon()

        jabon()

        ######################## instruccion 1

        def primero1():
            def primero(q):
                analysisRegion = 2
                tipoMovimiento = BByOFfile.BByOF(2, lower, upper, regionCoord,
                                                 analysisRegion, 10)
                q.put([tipoMovimiento])

            p = Thread(target=primero, args=(queue, ))
            p.start()
            Labelt.config(text='Frote las palmas de las manos \n entre sí')
            global row
            row = row + 1
            worksheet.write(row, col + 3, 'instruccion1', f5)
            ventana2.update()
            ventana2.update()
            video1()

            if p.isAlive():
                p.join()
            instruction = queue.get()
            instruction = falseType(instruction[0], Labelt, Labeli, img0, imgF)
            if not instruction:
                primero1()

        primero1()

        ########################## instruccion2

        ##        def segundo(q):
        ##            analysisRegion = 2
        ##            tipoMovimiento=BByOFfileO.BByOF(2,lower,upper,regionCoord,analysisRegion,10)
        ##            q.put([tipoMovimento])
        ##
        ##        s=Thread(target=segundo, args=(queue,))
        ##        s.start()
        ##        Labelt.config(text='Frote la palma de la mano derecha \n contra el dorso de la mano izquierda  \n entrelazando los dedos y viceversa')
        ##        ventana2.update()
        ##        video2()
        ##
        ##        if s.isAlive():
        ##            s.join()
        ##        instruction=queue.get()
        ##        instruction=falseType(instruction[0],Labelt,Labeli,img0,imgF)
        ##        if not instruction:
        ##            inicio(0)

        ######################## fin instrucciones

        Labeli = Label(ventana2, image=img00)
        Labeli.grid(row=2, column=0)
        Labelt.config(text='Sus manos son seguras')
        row = row + 1
        worksheet.write_datetime(row, col, date_time, f2)
        worksheet.write_datetime(row, col + 1, date_time, f3)
        worksheet.write(row, col + 3, 'TERMINO')
        ventana2.update()
        ventana2.after(2000)
def inicio(c):
    global ventana2, Labeli, Labelt, img0, img1, imgF, row, cont
    instruction=None
    img0=PhotoImage(file="00.gif") # Reads photos
    img00=PhotoImage(file="0000.gif")
    imgF=PhotoImage(file="FF.gif")

    if c:  
        ventana2=Toplevel(ventana)
        ventana2.title("MANITOR")
        ventana2.configure(bg="white")
        ventana2.geometry("1000x600+5+40")
    
        Labelt=Label(ventana2,text='BIENVENIDO ', # ventana2 TEXTO
                fg="black",bg="white",font=("Helvetica 36 "))
        ventana2.columnconfigure(0,weight=1)
        Labelt.grid(row=1,column=0)
        Labeli=Label(ventana2,image=img00) # ventana2 IMAGEN
        Labeli.grid(row=2,column=0)
                
    else:
        Labelt.config(text='BIENVENIDO ')
        Labeli.image = img00
        Labeli.config(image=img00)
    ventana.iconify() # Turns window into an icon
    
    row=row+1
    cont=cont+1

    

    
    while 1:
        
        nuevoUsuario = detectUser.newUser(3,lower,upper)
        
    
        Labelt.config(text='BIENVENIDO \n  Por favor moje sus manos con agua')
        worksheet.write_datetime(row, col, date_time,f2)
        worksheet.write_datetime(row, col+1, date_time,f3)
        worksheet.write(row, col +2, cont, f6)
        worksheet.write(row, col +3, 'NUEVA PERSONA',f4)
        ventana2.update()
        video000()


        jabon()        

        primero1()
            
####################### fin instrucciones

        Labeli=Label(ventana2,image=img00)
        Labeli.grid(row=2,column=0)
        Labelt.config(text='Sus manos son seguras')
        row=row+1
        worksheet.write_datetime(row, col, date_time, f2)
        worksheet.write_datetime(row, col+1, date_time,f3)
        worksheet.write(row, col +3, 'TERMINO')
        ventana2.update()
        ventana2.after(2000)
def no_click():
    popup = Toplevel()
    popup.resizable(False,False)
    ttk.Label(popup, text='请选择文件!').pack(pady=25)
    center_window(popup, 300, 100)
    popup.after(2500,lambda:popup.destroy())