Création interface et éléments
This commit is contained in:
parent
c05b92a03b
commit
2ae5ff094d
149
interface/simulateur_front.py
Normal file
149
interface/simulateur_front.py
Normal file
@ -0,0 +1,149 @@
|
||||
from tkinter import *
|
||||
|
||||
import tkinter as tk
|
||||
|
||||
root = tk.Tk()
|
||||
# Widgets are added here
|
||||
|
||||
#Frame principale
|
||||
frame = tk.Frame(root, width=800, height=400)
|
||||
frame.pack(padx=10, pady=10)
|
||||
|
||||
|
||||
|
||||
#Frames Corps
|
||||
instructions_frame = tk.Frame(frame, width=400, height=400, bg="grey")
|
||||
instructions_frame.pack(padx=5, pady=5, side=tk.LEFT, fill=Y)
|
||||
|
||||
infos_frames = tk.Frame(frame, width=400, height=400, bg="green")
|
||||
infos_frames.pack(padx=5, pady=5, side=tk.RIGHT)
|
||||
|
||||
|
||||
|
||||
#Frame stack
|
||||
stack_frame = tk.Frame(instructions_frame, width=400, height=300)
|
||||
stack_frame.pack(padx=5, pady=5, side=tk.TOP)
|
||||
|
||||
Label(stack_frame, text=f"Stack").pack(pady=5)
|
||||
|
||||
scrollbar = tk.Scrollbar(stack_frame)
|
||||
scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
|
||||
|
||||
mylist = tk.Listbox(stack_frame, yscrollcommand=scrollbar.set, width=50)
|
||||
|
||||
for line in range(30):
|
||||
mylist.insert(tk.END, "This is line number " + str(line))
|
||||
|
||||
mylist.pack(side=tk.LEFT, fill=tk.BOTH)
|
||||
scrollbar.config(command=mylist.yview)
|
||||
|
||||
|
||||
|
||||
|
||||
#Frame instruction suivante
|
||||
single_inst_frame = tk.Frame(instructions_frame, width=400, height=100, bg="grey")
|
||||
single_inst_frame.pack(padx=5, pady=5, side=tk.BOTTOM)
|
||||
|
||||
|
||||
Label(single_inst_frame, text=f"Instruction").pack(pady=5, side=LEFT)
|
||||
Label(single_inst_frame, text=f"instruction+cycle", width=30, bg="white").pack(pady=5, side=LEFT)
|
||||
|
||||
|
||||
|
||||
|
||||
#Frame registres
|
||||
registres_frames = tk.Frame(infos_frames, width=400, height=100, bg="blue")
|
||||
registres_frames.pack(padx=10, pady=10, side=tk.TOP)
|
||||
|
||||
|
||||
#Registre 1
|
||||
registre_1_frame = tk.Frame(registres_frames, width=100, height=100, bg="orange")
|
||||
registre_1_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(registre_1_frame, text=f"R0", width=15, bg="orange").pack(pady=5)
|
||||
Label(registre_1_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Registre 2
|
||||
registre_2_frame = tk.Frame(registres_frames, width=100, height=100, bg="orange")
|
||||
registre_2_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(registre_2_frame, text=f"R1", width=15, bg="orange").pack(pady=5)
|
||||
Label(registre_2_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
#Registre 3
|
||||
registre_3_frame = tk.Frame(registres_frames, width=100, height=100, bg="orange")
|
||||
registre_3_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(registre_3_frame, text=f"R2", width=15, bg="orange").pack(pady=5)
|
||||
Label(registre_3_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
#Registre 4
|
||||
registre_4_frame = tk.Frame(registres_frames, width=100, height=100, bg="ORANGE")
|
||||
registre_4_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(registre_4_frame, text=f"R3", width=15, bg="orange").pack(pady=5)
|
||||
Label(registre_4_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
#Frame annexes
|
||||
annexes_frames = tk.Frame(infos_frames, width=400, height=100, bg="blue")
|
||||
annexes_frames.pack(padx=10, pady=10, side=tk.TOP)
|
||||
|
||||
|
||||
#Annexe 1
|
||||
annexe_1_frame = tk.Frame(annexes_frames, width=100, height=100, bg="orange")
|
||||
annexe_1_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(annexe_1_frame, text=f"EQ", width=15, bg="orange").pack(pady=5)
|
||||
Label(annexe_1_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#RAnnexe 2
|
||||
annexe_2_frame = tk.Frame(annexes_frames, width=100, height=100, bg="orange")
|
||||
annexe_2_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(annexe_2_frame, text=f"LT", width=15, bg="orange").pack(pady=5)
|
||||
Label(annexe_2_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
#Annexe 3
|
||||
annexe_3_frame = tk.Frame(annexes_frames, width=100, height=100, bg="orange")
|
||||
annexe_3_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(annexe_3_frame, text=f"PC", width=15, bg="orange").pack(pady=5)
|
||||
Label(annexe_3_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
#Annexe 4
|
||||
annexe_4_frame = tk.Frame(annexes_frames, width=100, height=100, bg="ORANGE")
|
||||
annexe_4_frame.pack(padx=10, pady=0, side=tk.LEFT)
|
||||
|
||||
Label(annexe_4_frame, text=f"SP", width=15, bg="orange").pack(pady=5)
|
||||
Label(annexe_4_frame, bg="orange").pack(pady=5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#Frame RAM
|
||||
|
||||
|
||||
|
||||
root.mainloop()
|
||||
Loading…
x
Reference in New Issue
Block a user