diff --git a/frontend-prototype/frontend-prototype.py b/frontend-prototype/frontend-prototype.py new file mode 100644 index 0000000..d7a3db9 --- /dev/null +++ b/frontend-prototype/frontend-prototype.py @@ -0,0 +1,55 @@ +import tkinter as tk +import os +from time import sleep + +def get_files(path): + files = [] + for file in os.listdir(path): + if os.path.isfile(os.path.join(path, file)): + if file.endswith(".txt"): + files.append(file.replace(".txt", "")) + return files + +def start_test(): + to_test = clicked.get() + print(f"Testing {to_test}") + label_test_status.config(text=f"Starting test of {to_test}") + label_test_status.config(text=f"Test of {to_test} complete") + f = open("../test_results" + os.sep + "test_results_" + to_test + ".txt", "w") + f.write("Test results for " + to_test + "\n") + f.close() + + +# Create the main window +root = tk.Tk() +root.title("Frontend Prototype") + +root.geometry("400x400") + +def show(): + label.config(text= clicked.get()) + +options = get_files("../test_chips") + +clicked = tk.StringVar() +clicked.set(options[0]) + +# Create a dropdown menu +drop = tk.OptionMenu(root, clicked, *options) +drop.pack() + +button = tk.Button(root, text="Select", command=show).pack() + +# Create a label widget +label = tk.Label(root, text="Select a circuit to test") +label.pack() + +# Button to start test +button_test = tk.Button(root, text="Start Test", command=start_test) +button_test.pack() + +label_test_status = tk.Label(root, text="Click 'Start Test' to begin testing") +label_test_status.pack() + +# Run the application +root.mainloop() \ No newline at end of file diff --git a/test_chips/2inputAND.txt b/test_chips/2inputAND.txt new file mode 100644 index 0000000..e69de29 diff --git a/test_chips/2inputNAND.txt b/test_chips/2inputNAND.txt new file mode 100644 index 0000000..e69de29 diff --git a/test_chips/2inputNOR.txt b/test_chips/2inputNOR.txt new file mode 100644 index 0000000..e69de29 diff --git a/test_chips/hexconverter.txt b/test_chips/hexconverter.txt new file mode 100644 index 0000000..e69de29 diff --git a/test_results/test_results_hexconverter.txt b/test_results/test_results_hexconverter.txt new file mode 100644 index 0000000..e8394d5 --- /dev/null +++ b/test_results/test_results_hexconverter.txt @@ -0,0 +1 @@ +Test results for hexconverter