Skip to content

Commit e924551

Browse files
committed
arduibike séparation mise en page grid du reste du code
1 parent 20d8c9c commit e924551

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

Diff for: Arduibike/arduibike.py

+18-13
Original file line numberDiff line numberDiff line change
@@ -137,28 +137,33 @@ def _update_mesures():
137137

138138
# Créeation des widgets DigitalMeter pour le monitoring en continue
139139
frame_mesure_monitor = tk.LabelFrame(win, text = 'Mesures en continu')
140-
digit_tension = DigitalMeter(frame_mesure_monitor, title="Tension \n (en volt)", num_value = 0)
141-
digit_intensity = DigitalMeter(frame_mesure_monitor, title="Intensité \n (en Ampère)", num_value = 0)
142-
digit_power = DigitalMeter(frame_mesure_monitor, title="Puissance \n (en W)", num_value = 0)
143-
frame_mesure_monitor.grid(column=0, row=0, sticky = 'W', padx=8, pady=8)
140+
digit_tension = DigitalMeter(frame_mesure_monitor, title="Tension \n (en volt)", num_value = 0)
141+
digit_intensity = DigitalMeter(frame_mesure_monitor, title="Intensité \n (en Ampère)", num_value = 0)
142+
digit_power = DigitalMeter(frame_mesure_monitor, title="Puissance \n (en W)", num_value = 0)
143+
144144

145145
# Créeation des widgets DigitalMeter pour la mémorisation des mesures
146-
frame_mesure_memo = tk.LabelFrame(win, text = 'Mesures mémorisées')
147-
digit_tension_memo = DigitalMeter(frame_mesure_memo, title="Tension \n (en volt)")
146+
frame_mesure_memo = tk.LabelFrame(win, text = 'Mesures mémorisées')
147+
digit_tension_memo = DigitalMeter(frame_mesure_memo, title="Tension \n (en volt)")
148148
digit_intensity_memo = DigitalMeter(frame_mesure_memo, title="Intensité \n (en Ampère)")
149-
digit_power_memo = DigitalMeter(frame_mesure_memo, title="Puissance \n (en W)", num_value = 0)
150-
frame_mesure_memo.grid(column=1, row=0, sticky = 'W', padx=8, pady=8)
149+
digit_power_memo = DigitalMeter(frame_mesure_memo, title="Puissance \n (en W)", num_value = 0)
150+
151151

152-
# Créeation des bouttons d'actions et
152+
# Créeation des bouttons d'actions
153153
frame_actions = tk.LabelFrame(win, text = 'Actions')
154-
btn_start = tk.Button(frame_actions, text = 'START', command=_start_mesures, width=10)
154+
btn_start = tk.Button(frame_actions, text = 'START', command=_start_mesures, width=10)
155+
btn_memo = tk.Button(frame_actions, text = 'Mémoriser', command=_memo_mesures)
156+
btn_reset = tk.Button(frame_actions, text = 'Reset', command=_reset_mesures)
157+
btn_quit = tk.Button(frame_actions, text = 'Quitter', command=_quit)
158+
# Mise en page des bouttons avec 'grid'
155159
btn_start.grid(column=0, row=0, sticky = 'W', padx=8, pady=8)
156-
btn_memo = tk.Button(frame_actions, text = 'Mémoriser', command=_memo_mesures)
157160
btn_memo.grid(column=1, row=0, sticky = 'W', padx=8, pady=8)
158-
btn_reset = tk.Button(frame_actions, text = 'Reset', command=_reset_mesures)
159161
btn_reset.grid(column=2, row=0, sticky = 'W', padx=8, pady=8)
160-
btn_quit = tk.Button(frame_actions, text = 'Quitter', command=_quit)
161162
btn_quit.grid(column=3, row=0, sticky = 'W', padx=8, pady=8)
163+
164+
# Mise en page des frames widgets DigitalMeter et bar d'actions avec 'grid'
165+
frame_mesure_memo.grid(column=1, row=0, sticky = 'W', padx=8, pady=8)
166+
frame_mesure_monitor.grid(column=0, row=0, sticky = 'W', padx=8, pady=8)
162167
frame_actions.grid(row=1, columnspan=2, padx=8, pady=8, sticky = 'WE')
163168

164169

Diff for: fonction_liste_arguments arbitraires.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# **args permet de recevoir une liste d'aguments
2+
# @see https://docs.python.org/fr/3.7/tutorial/controlflow.html#keyword-arguments
23
def custom_digit(**config_args):
34
config = {
45
'color' : '#000000',

0 commit comments

Comments
 (0)