IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

GUI Python Discussion :

Probl�me d'affichage dans mon interface - newbie


Sujet :

GUI Python

  1. #1
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut Probl�me d'affichage dans mon interface - newbie
    Bonjour � tous,
    Voil� j'ai demand� � un membre fiver de me faire une interface graphique sur un projet mais il m'a plant� sur la fin. il reste un bug d'affichage que je n'arrive pas � r�soudre.

    Nom : image_2024-02-02_184425015.png
Affichages : 258
Taille : 462,0 Ko

    je ne connais pas le code python pour cela que je m'en remet � vous : Pouvez-vous m'aider SVP merci

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    import tkinter as tk
    from tkinter import ttk
    from PIL import Image,ImageTk
    import cv2
    import imageio
    import pyglet
    #pyglet.font.add_file('digital-7.ttf')
    import pyrebase
    import firebase_admin
    from firebase_admin import credentials
    from firebase_admin import storage
     
    config = {
      "apiKey": "",
      "authDomain": "",
      "databaseURL": "https:///",
      "storageBucket": ""
    }
     
    firebase_storage = pyrebase.initialize_app(config)
    database = firebase_storage.database()
    T_Red=0
    T_Blue=0
    ProjectBucket = database.child("game")
    ProjectBucket.child("Next_Round").set(0)
    ProjectBucket = database.child("game")
    ProjectBucket.child("Start_Game").set(0)
    ProjectBucket = database.child("game")
    bluebutton = ProjectBucket.child("blueteam").get().val()
     
    ProjectBucket = database.child("game")
    R = ProjectBucket.child("Round").get().val()
     
    ProjectBucket = database.child("game")
    redbutton = ProjectBucket.child("RedTeam").get().val()
     
    ProjectBucket = database.child("game")
    G_time = ProjectBucket.child("Set_Timer").get().val()
    print(G_time)
    # Set initial values for blue and red teams
    t=0
    b=0
    l=1
    if l==1:
        def update_timer():
            print("update loop")
            l=1
            if l==1:
                global timer_seconds, current_round, timer_running
                timer_label.config(text=f"{timer_seconds // 70}:{timer_seconds % 60:02}")
                # Update the current round label
                round_label.config(text=str(current_round))
                if timer_seconds > 0 and timer_running:
                    timer_seconds -= 1
                    bluebutton = ProjectBucket.child("game").child("blueteam").get().val()
                    redbutton = ProjectBucket.child("game").child("RedTeam").get().val()
                    print(redbutton)
                    if redbutton==1:
                        ProjectBucket.child("game").child("RedTeam").set(0)
                        increase_score_1()
                    if bluebutton == 1:
                        ProjectBucket.child("game").child("blueteam").set(0)
                        increase_score_2()
                    window.after(1000, update_timer)
                elif timer_seconds == 0:
                    declare_winner()
        def declare_winner():
            global current_round
            bc = "white"
            score_1 =T_Blue
            score_2 = T_Red
            if score_2 > score_1:
                winner_text = "Team Blue"
                winner_color = "blue"
                update_winning_rounds(team_blue_wins_label)
            elif score_1 > score_2:
                winner_text = "Team red"
                winner_color = "red"
                update_winning_rounds(team_red_wins_label)
            else:
                winner_text = f"Round is tie"
                winner_color = "black"
     
            # Create a label for the winner and place it based on the current set
            winner_label_set = tk.Label(window, text=winner_text, fg=winner_color, font=('digital-7 40 bold'), bg=bc)
            winner_label_set.place(relx=0.43, rely=0.855, width=300, height=70)  # Adjust the position for each set
     
            # Save the label reference in a list for later cleanup
            winner_labels.append(winner_label_set)
     
            # Save the result for the overall winner
            round_results.append(winner_color)
     
            # Display the winner's status
            window.update_idletasks()  # Ensure the label is updated before the next line
            reset_button.config(state=tk.NORMAL)  # Enable the "Reset Scores" button
            start_button.config(state=tk.NORMAL)  # Enable the "Start Timer" button
     
            # Check for overall winner after all sets
            if current_round == R:
                overall_winner = max(set(round_results), key=round_results.count)
                overall_winner_label.config(text=f"Overall Winner: {overall_winner}", fg="green")
                overall_winner_label.place(relx=0.4, rely=0.82, width=30, height=80)  # Adjust the position for the overall winner
                # Display the video window based on the overall winner
                display_video(overall_winner)
     
        def display_video(winner):
            video_window = tk.Toplevel()
            video_window.title("Video Display")
     
            if winner == "blue":
                video_path = "blue.mp4"  # Replace with the actual path of the video for Team Blue
            elif winner == "red":
                video_path = "red.mp4"  # Replace with the actual path of the video for Team Red
            else:
                video_path = "tie.mp4"  # Replace with the actual path of the video for Tie
            cap = cv2.VideoCapture(video_path)
            while True:
                ret, frame = cap.read()
                if not ret:
                    break
     
                # Display the frame
                cv2.imshow("Video Display", frame)
     
                # Break the loop when the user closes the window
                if cv2.waitKey(25) & 0xFF == ord("q"):
                    break
            # Release the video capture
            cap.release()
            # Close all OpenCV windows
            cv2.destroyAllWindows()
            video_window.destroy()
            current_wins=0
            window.destroy()
     
     
        def update_winning_rounds(winning_label):
            current_wins = int(winning_label.cget("text"))
            current_wins += 1
            winning_label.config(text=str(current_wins))
        def reset_scores():
            global timer_seconds, timer_running, current_round
            global T_Red
            global T_Blue
            T_Blue=0
            T_Red=0
            score_var_1.set("0")
            score_var_2.set("0")
     
            # Destroy previous winner labels
            for label in winner_labels:
                label.destroy()
     
            # Reset the timer and current round
            timer_seconds = G_time  # Set the timer to 1 minute for each round
            update_timer_label()  # Update the timer label
            timer_running = False
     
            current_round += 1
            if current_round > R:
                current_round = 1  # Reset to 1 after the 3rd round
            # Update the current round label
            round_label.config(text=str(current_round))
            start_button.config(state=tk.NORMAL)
            reset_button.config(state=tk.DISABLED)
     
            update_combined_score_label()
     
     
        # Add this function to update the timer label
        def update_timer_label():
            timer_label.config(text=f"{timer_seconds // 75}:{timer_seconds % 60:02}")
     
        def increase_score_2():
            global T_Red
            if timer_running:
                T_Red=T_Red+1
                # current_score = int(score_var_1.get())
                # new_score = current_score + 1
                # score_var_1.set(new_score)
                update_combined_score_label()
     
        def increase_score_1():
            if timer_running:
                global T_Blue
                T_Blue=T_Blue+1
                # current_score = int(score_var_2.get())
                # new_score = current_score + 1
                # score_var_2.set(new_score)
                update_combined_score_label()
                print(T_Blue)
     
        def update_combined_score_label():
            combined_score_label.config(text=f"{T_Blue} : {T_Red}")
     
        def start_timer():
            global timer_running
            if not timer_running:
                timer_running = True
                update_timer()
        def stop_timer():
            global timer_running
            timer_running = False
        while True:
            # Create the main window
            window = tk.Tk()
            #window.geometry("1024x768")
            #window.attributes('-fullscreen', True)
            window.title("Drone Soccer - Scoreboard")
            background_image = Image.open("Backg.jpeg")        
            background_image = background_image.resize((window.winfo_screenwidth(), window.winfo_screenheight()), Image.LANCZOS)
            background_photo = ImageTk.PhotoImage(background_image)
     
            canvas = tk.Canvas(window, width=window.winfo_screenwidth(), height=window.winfo_screenheight())
            canvas.pack(fill="both", expand=True)
     
            canvas.create_image(0, 0, image=background_photo, anchor="nw")
            score_var_1 = tk.StringVar()
            score_var_2 = tk.StringVar()
            score_var_1.set("0")
            score_var_2.set("0")
            combined_score_label = tk.Label(window, text="0 : 0", font=('digital-7 250 bold'), bg="white", fg="black")
            combined_score_label.place(relx=0.25, rely=0.38,  width=800, height=400)
            button_style = {"font": ("Arial", 12), "fg": "white", "width": 15, "height": 2}
     
     
            reset_button = tk.Button(window, text="Start Next Round", command=reset_scores, bg="lightgray", fg="black", font=("Arial", 24))
            reset_button.place_forget()
     
            style = ttk.Style()
            style.configure("TButton", padding=10, font=("Arial", 24), foreground="black", background="green", borderwidth=8, relief=tk.RAISED)
     
            start_button = ttk.Button(window, text="Start Timer", command=start_timer, style="TButton")
            #start_button.place(relx=0.83, rely=0.85)
            start_button.place_forget()
            timer_seconds = G_time
            current_round = 0
     
            timer_label = tk.Label(window, text="0:00", font=('digital-7 80 bold'), bg="white", fg="red")
            timer_label.place(relx=0.43, rely=0.13, width=230, height=70)
     
     
            round_label = tk.Label(window, text=str(current_round), bg="white", font=('digital-7 80 bold'), fg="black")
            round_label.place(relx=0.27, rely=0.13, width=100, height=80)
            winner_labels = []
            round_results = []
     
            team_blue_wins_label = tk.Label(window, text="0", font=('digital-7 80 bold'), bg="white", fg="Black")
            team_blue_wins_label.place(relx=0.856, rely=0.41, width=100, height=100)
     
            team_red_wins_label = tk.Label(window, text="0", font=('digital-7 80 bold'), bg="white", fg="Black")
            team_red_wins_label.place(relx=0.07, rely=0.42, width=100, height=80)
     
            overall_winner_label = tk.Label(window, text="Overall Winner: ", font=("Arial", 25), fg="green")
            overall_winner_label.place_forget()
            timer_running = False
            while True:
                window.update_idletasks()
                window.update()
     
                ProjectBucket = database.child("game")
                G_time = ProjectBucket.child("Set_Timer").get().val()
                ProjectBucket = database.child("game")
                R = ProjectBucket.child("Round").get().val()
                ProjectBucket = database.child("game")
                Stop = ProjectBucket.child("Stop_Timer").get().val()
                if Stop == 1:
                    ProjectBucket = database.child("game")
                    ProjectBucket.child("Stop_Timer").set(0)
                    stop_timer()
                ProjectBucket = database.child("game")
                Next_Round = ProjectBucket.child("Next_Round").get().val()
                if Next_Round == 1:
                    ProjectBucket = database.child("game")
                    ProjectBucket.child("Next_Round").set(0)
                    reset_scores()
                ProjectBucket = database.child("game")
                Start_Game = ProjectBucket.child("Start_Game").get().val()
                if Start_Game == 1:
                    ProjectBucket = database.child("game")
                    ProjectBucket.child("Start_Game").set(0)
                    start_timer()
     
                #window.mainloop()

  2. #2
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Bonsoir,

    Recontactez le il vous doit un r�sultat correct !

    En plus, j'ai pas l'habitude de critiquer le travail d'un professionnel, mais c'est juste honteux de bosser de cette mani�re.

  3. #3
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    J'ai essay� mais a part de la mauvaise volont� et me disant qu'il faut changer la r�solution de mon �cran car chez lui ca fonctionne.... jle zappe car j'en peu plus l�.

  4. #4
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Contactez l'assistance feever,

    S'il ne leur r�pond pas, il y a des chances qu'il le d�gage de la plateforme.

    N'h�sitez pas aussi � mettre une tr�s mauvaise note et une remarque n�gative. �a le fera sans doute r�agir et en plus c'est m�rit�...

    S�rieusement ce code ne donne pas du tout envie de s'y aventurer.

    Si c'est pas indiscret vous avez pay� combien pour ce travail ?

  5. #5
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    J'ai l'intention de le faire mais �a ne va rien r�soudre.
    J'ai pay� 250$.
    Mais si vous avez une id�e pour r�soudre le probl�me car cela fait 1 bon mois que je ne n'avance plus dans mon projet.

  6. #6
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    J'essaye demain si j'ai un peu de temps, ce soir je suis pas pr�t 😅.

  7. #7
    Membre actif
    Homme Profil pro
    Animateur Num�rique
    Inscrit en
    F�vrier 2013
    Messages
    143
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activit� : Animateur Num�rique
    Secteur : Arts - Culture

    Informations forums :
    Inscription : F�vrier 2013
    Messages : 143
    Par d�faut
    Citation Envoy� par fred1599 Voir le message
    J'essaye demain si j'ai un peu de temps, ce soir je suis pas pr�t 😅.
    Bon courage

  8. #8
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Bonjour,

    Peux-tu m'expliquer ce qu'est cens� faire cette application ? As-tu un cahier des charges ?

    Peux-tu partager tous les fichiers images, vid�os, bref tout ce qu'il faut pour le test total ?

    Quand je vois juste ces deux lignes, je sais m�me pas comment �a peut fonctionner

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    while True:        
        # Create the main window
        window = tk.Tk()
    Quand je modifie un score, je rentre dans une boucle infinie (ce qui n'est pas �tonnant), le programme se bloque l'application n'est plus utilisable.

    � mon sens tu devrais te faire rembourser !

  9. #9
    Expert �minent
    Homme Profil pro
    Architecte technique retrait�
    Inscrit en
    Juin 2008
    Messages
    21 741
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activit� : Architecte technique retrait�
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 741
    Par d�faut
    Citation Envoy� par fred1599 Voir le message
    Quand je vois juste ces deux lignes, je sais m�me pas comment �a peut fonctionner

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    while True:        
        # Create the main window
        window = tk.Tk()
    Surprenant � lire mais tant qu'on ne sort pas du while True imbriqu�, cela ne bouclera pas.

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  10. #10
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    Merci de prendre le temps pour m'aider. D�sol� je n'ai pas eu la notif poir r�pondre plus vite.
    Le "soft" est un programme pour g�rer le score d'un jeu de drone.
    2 �quipes doivent s'affronter dans une ar�ne
    Pendant 3min (dur�e d'une partie)
    Une partie se fait en 3 set, la premi�re �quipe qui remporte 2 parties � gagner.
    Pour incr�menter le score ou a l'inverse le decrementer , 2 t�l�commandes �quip� d'une pcb /esp32 / 2 boutons sont reli�s � firebase (ce que je voulais pas au passage car je voulais que le projet soit autonome et non d�pendant du wifi - passont car je l'ai d�couvert apr�s).
    Voila pour le cahier des charges

    Je tente d'envoyer le dossier plus tard car la jsuis pas chez moi mais sur mon tel.

  11. #11
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    Citation Envoy� par fred1599 Voir le message
    Bonjour,

    Peux-tu m'expliquer ce qu'est cens� faire cette application ? As-tu un cahier des charges ?

    Peux-tu partager tous les fichiers images, vid�os, bref tout ce qu'il faut pour le test total ?

    Quand je vois juste ces deux lignes, je sais m�me pas comment �a peut fonctionner

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    while True:        
        # Create the main window
        window = tk.Tk()
    Quand je modifie un score, je rentre dans une boucle infinie (ce qui n'est pas �tonnant), le programme se bloque l'application n'est plus utilisable.

    � mon sens tu devrais te faire rembourser !
    Voici le we https://we.tl/t-FSID4HaGsa

  12. #12
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Voil� ce que j'arrive � avoir pour le moment, je n'ai pas de bug d'affichage,

    Nom : Capture d��cran_2024-02-03_14-23-42.png
Affichages : 190
Taille : 258,4 Ko

    je me suis pas occup� de la base de donn�es (firebase que je ne connais pas).

    Pour incr�menter le score ou a l'inverse le decrementer , 2 t�l�commandes �quip� d'une pcb /esp32 / 2 boutons sont reli�s � firebase
    Tu peux m'expliquer rapidement comment �a fonctionne ? Si je comprend bien, on ne s'occupe que de la partie affichage et de la r�cup�ration des valeurs dans la base de donn�es ?

  13. #13
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    Nom : Capture d��cran_2024-02-03_14-23-42.png
Affichages : 190
Taille : 258,4 Ko

    je me suis pas occup� de la base de donn�es (firebase que je ne connais pas).

    Tu peux m'expliquer rapidement comment �a fonctionne ? Si je comprend bien, on ne s'occupe que de la partie affichage et de la r�cup�ration des valeurs dans la base de donn�es ?[/QUOTE]

    Je viens de d�couvrir qu'il avait fait un fichier config un autre fichier py en //.
    La base de donn�e est dans firebase si j'ai bien compris.

  14. #14
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Tu n'es pas oblig� d'afficher � nouveau l'image.

    Je viens de d�couvrir qu'il avait fait un fichier config un autre fichier py en //.
    La base de donn�e est dans firebase si j'ai bien compris.
    Non mais �a c'est �vident, je veux conna�tre le fonctionnement lors de l'appui sur le bouton et la communication avec firebase, comment s'est �crit dans la base de donn�es lors de l'appui sur le bouton ?

    Pour incr�menter le score ou a l'inverse le decrementer , 2 t�l�commandes �quip� d'une pcb /esp32 / 2 boutons sont reli�s � firebase
    Comment se fait cette communication, car dans le code de d�part, on ne d�tecte pas l'appui sur un bouton de t�l�commande. Il initialise la base de donn�es, il r�cup�re les valeurs de la base de donn�es, mais par contre je ne vois rien sur comment transformer un appui sur le bouton pour le r�cup�rer dans le code. Tiens � la rigueur, demande au dev comment s'est fait...

    Je viens de d�couvrir qu'il avait fait un fichier config un autre fichier py en //
    C'est quoi cet autre fichier python, tu l'as ?

  15. #15
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    Le code des esp32 situ� dans les t�l�commandes est reli� a firebase. La base de donn�es score est donc aliment�e comme �a.

  16. #16
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10

  17. #17
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Bonjour,

    Merci pour les fichiers, donc en gros si je comprend bien c'est une interface qui configure le nombre de sets, le timer etc... mais quand le jeu commence, quand les drones combattent, comment les scores sont ajout�s (manuellement ?), parce-que je vois une histoire de LED, mais je ne vois rien concernant la r�cup�ration de l'�tat de la LED.

  18. #18
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    Pour incr�menter il y a 2 t�l�commandes avec pcb/ esp32 / 2 boutons... 1 pour +1 et l'autre- 1 et sa passe par firebase.

  19. #19
    Expert confirm�
    Avatar de fred1599
    Homme Profil pro
    Lead Dev Python
    Inscrit en
    Juillet 2006
    Messages
    4 062
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Meurthe et Moselle (Lorraine)

    Informations professionnelles :
    Activit� : Lead Dev Python
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2006
    Messages : 4 062
    Par d�faut
    Bonjour,

    Ok, je n'aurai jamais la r�ponse, bref, je vais juste me concentrer sur ton script de base pr�sent� pr�c�demment, mais tu n'as rien pour communiquer entre ton esp32 et firebase.

    Peut-�tre que ce module serait int�ressant pour cette communication.

    Voici l'interface : https://we.tl/t-qALAGct82d

    J'ai pas g�r� la partie firebase ni vid�os, j'ai juste impl�ment� une solide base pour l'interface pr�sent� au premier post. On ex�cute python � partir du fichier main.py

  20. #20
    Membre du Club
    Homme Profil pro
    maker
    Inscrit en
    F�vrier 2024
    Messages
    10
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 48
    Localisation : France, Essonne (�le de France)

    Informations professionnelles :
    Activit� : maker

    Informations forums :
    Inscription : F�vrier 2024
    Messages : 10
    Par d�faut
    Merci c'est d�j� beaucoup pour ton aide sur l'affichage.

Discussions similaires

  1. Probl�me d'affichage dans mon formulaire
    Par samus535 dans le forum IHM
    R�ponses: 5
    Dernier message: 28/01/2008, 19h05
  2. Probl�me d'affichage dans mon code
    Par naima2005 dans le forum Applets
    R�ponses: 3
    Dernier message: 02/12/2007, 11h52
  3. R�ponses: 4
    Dernier message: 04/07/2007, 13h42
  4. Afficher ma table dans mon interface
    Par 9tita dans le forum Composants
    R�ponses: 9
    Dernier message: 02/06/2007, 11h00
  5. Probl�me d'affichage dans mon �tat
    Par gontrand16 dans le forum Access
    R�ponses: 6
    Dernier message: 05/07/2006, 20h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo