Beispiel #1
0
 def popup(s):
     popup_.run(s, 2000)
Beispiel #2
0
 def popup(s):
     popup_.run(s)
    def start():
        if not dict_config["started"]:
            # results_r1.clear()
            # results_r2.clear()
            # results_saldo.clear()
            # graph_x.clear()
            dict_config["started"] = True
            # ------------------------------------------------------
            # Button Start
            # ------------------------------------------------------
            btMenu = Button(TelaInicial,
                            width=76,
                            text=constants.btAfterAguarde,
                            command=start,
                            bg=constants.buttonStopColor,
                            fg=constants.letterColor,
                            activebackground=constants.buttonStopColorActive)
            btMenu.place(x=402, y=579, anchor=CENTER)
        else:
            while (dict_config["started"] and int(dict_config["episode"]) <=
                   int(dict_config["episodes"])):
                dicTeam = {
                    "partida": constants.btModoMatchFast,
                    "team1": {
                        "teamName": constants.addressTeamArName,
                        "path": constants.addressTeamArSystem
                    },
                    "team2": {
                        "teamName": constants.addressTeamResName,
                        "path": constants.addressTeamResSystem
                    }
                }
                countMatch(dict_config["episode"])
                TelaInicial.update_idletasks()

                r1, r2 = start_.run(dicTeam)
                if r1 != constants.ERROR and r2 != constants.ERROR:

                    results_r1.append(int(r1))
                    results_r2.append(int(r2))
                    results_saldo.append(int(r1) - int(r2))
                    graph_x.append(int(dict_config["episode"]))

                    graphLive()
                    progress_bar.set(int(dict_config["episode"]))

                    ep = str(dict_config["episode"])
                    r1 = str(r1)
                    r2 = str(r2)

                    while len(ep) < 3:
                        ep += ' '
                    while len(r1) < 2:
                        r1 += ' '
                    while len(r2) < 2:
                        r2 += ' '

                    listbox_1.insert(END, " Partida " + ep)
                    listbox_2.insert(END, r1)
                    listbox_3.insert(END, r2)

                    listbox_1.see(listbox_1.size())
                    listbox_2.see(listbox_2.size())
                    listbox_3.see(listbox_3.size())
                    dict_config["episode"] += 1
                else:
                    popup_.run(constants.msgReiniciarPartida, 2000)
                TelaInicial.update_idletasks()

        TelaInicial.update_idletasks()
        TelaInicial.after_idle(verify())
Beispiel #4
0
    def start():
        if not dict_config["started"]:
            threading.Thread(target=start_monitor).start()
            dict_config["started"] = True
            # ------------------------------------------------------
            # Button Aguarde
            # ------------------------------------------------------
            btMenu = Button(
                TelaInicial, 
                width=76, 
                text=constants.btAfterAguarde, 
                command=start,
                bg=constants.buttonStopColor, 
                fg=constants.letterColor,
                activebackground=constants.buttonStopColorActive
            )
            btMenu.place(
                x=402, 
                y=581, 
                anchor=CENTER
            )
            start()
        else:
            results_r1.clear()
            results_r2.clear()
            results_saldo.clear()
            graph_x.clear()

            global soma_saldo
            global soma_gols_feitos
            global soma_gols_sofridos

            BEGIN_TIME = 0
            END_TIME = 0
            TEMPO_RESTANTE = int(dict_config["episodes"]) * 1.5

            soma_saldo = 0
            soma_gols_feitos = 0
            soma_gols_sofridos = 0
            while(dict_config["started"] and int(dict_config["episode"]) <= int(dict_config["episodes"])):
                dicTeam = {
                    "partida" : constants.btModoMatchFast,
                    "team1" : {
                        "teamName" : constants.addressTeamArName,
                        "path" : constants.addressTeamArSystem
                    },
                    "team2" : {
                        "teamName" : constants.addressTeamResName,
                        "path" : constants.addressTeamResSystem
                    }
                }

                # global BEGIN_TIME
                # global END_TIME
                # global TEMPO_RESTANTE

                countMatch(dict_config["episode"], TEMPO_RESTANTE)
                TelaInicial.update_idletasks()

                BEGIN_TIME = time.time()
                r1, r2 = start_.run(dicTeam)
                END_TIME = time.time() - BEGIN_TIME

                TEMPO_RESTANTE = int(dict_config["episodes"]) - int(dict_config["episode"])
                TEMPO_RESTANTE = TEMPO_RESTANTE * END_TIME / 60

                if r1 != constants.ERROR and r2 != constants.ERROR:

                    results_r1.append(int(r1))
                    results_r2.append(int(r2))
                    results_saldo.append(int(r1)-int(r2))

                    soma_saldo += (int(r1)-int(r2))
                    soma_gols_feitos += (int(r1))
                    soma_gols_sofridos += (int(r2))

                    graph_x.append(int(dict_config["episode"]))

                    graphLive()
                    progress_bar.set(int(dict_config["episode"]))

                    ep = str(dict_config["episode"])
                    r1 = str(r1)
                    r2 = str(r2)

                    while len(ep) < 3:
                        ep += ' '
                    while len(r1) < 2:
                        r1 += ' '
                    while len(r2) < 2:
                        r2 += ' '

                    listbox_1.insert(END, " Partida " + ep)
                    listbox_2.insert(END, r1)
                    listbox_3.insert(END, r2)

                    listbox_1.see(listbox_1.size())
                    listbox_2.see(listbox_2.size())
                    listbox_3.see(listbox_3.size())
                    dict_config["episode"] += 1
                else:
                    popup_.run(constants.msgReiniciarPartida, 2000)
                TelaInicial.update_idletasks()

        TelaInicial.update_idletasks()
        TelaInicial.after_idle(verify())
Beispiel #5
0
 def configPopup():
     msg = constants.msgConfigTeam
     popup_.run(msg, 8000)
Beispiel #6
0
 def setParamsPopup():
     msg = constants.msgSetParms
     popup_.run(msg, 2000)
     if int(dict_config["matriz"]) == 2:
         msg = constants.msgCriarMatriz
         popup_.run(msg, 2000)
Beispiel #7
0
 def sucess():
     msg = constants.msgSucess
     popup_.run(msg, 1000)
 def showMessage():
     popup_.run("Aguarde o final da partida ..")
 def msg():
     msg = 'Selecione uma opção!'
     popup_.run(msg, 2000)