-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Gavin-Furtado/Experimenting
Preliminary GUI updates
- Loading branch information
Showing
3 changed files
with
49 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,60 @@ | ||
''' | ||
https://www.youtube.com/watch?v=Miydkti_QVE | ||
https://www.youtube.com/playlist?list=PLfZw_tZWahjxJl81b1S-vYQwHs_9ZT77f | ||
https://www.youtube.com/watch?v=0H19QzbBqC4 | ||
''' | ||
|
||
import tkinter | ||
import customtkinter as ctk | ||
# from tkinter import simpledialog | ||
import kf_algorithm | ||
|
||
def RunProgram(): | ||
try: | ||
val_1 = int(sample_size.get()) | ||
kf_algorithm.main(val_1) | ||
except ValueError: | ||
tkinter.messagebox.showerror('Error','Please Enter a valid number') | ||
|
||
|
||
|
||
# def get_numbers(): | ||
# num1 = simpledialog.askfloat("Enter Number 1", "Enter the first number:") | ||
# num2 = simpledialog.askfloat("Enter Number 2", "Enter the second number:") | ||
# num3 = simpledialog.askfloat("Enter Number 3", "Enter the third number:") | ||
# if num1 is not None and num2 is not None and num3 is not None: | ||
# print("Numbers entered:", num1, num2, num3) | ||
# else: | ||
# print("User canceled") | ||
# Apperance settings | ||
ctk.set_appearance_mode('System') | ||
ctk.set_default_color_theme('blue') | ||
|
||
# # Create main window | ||
# root = tk.Tk() | ||
# root.title("Number Input") | ||
# App frame | ||
app = ctk.CTk() | ||
app.geometry('720x480') | ||
app.title('Kalman Filter Algorithm') | ||
|
||
# # Create button to get numbers | ||
# button = tk.Button(root, text="Enter Numbers", command=get_numbers) | ||
# button.pack(pady=10) | ||
font_1 = ctk.CTkFont(family='Calibri',size=14, weight='bold') | ||
|
||
# # Run the application | ||
# root.mainloop() | ||
#Adding UI elements | ||
# Sample Size | ||
label_1=ctk.CTkLabel(app, text="Sample Size",font=font_1) | ||
label_1.pack(padx=10,pady=10) | ||
label_1.place(relx=0.1,rely=0.1,anchor=tkinter.CENTER) | ||
|
||
ctk.set_appearance_mode('system') | ||
ctk.set_default_color_theme('drak-blue') | ||
sample_size = ctk.CTkEntry(app,width=200, height=30) | ||
sample_size.pack(padx=10,pady=10) | ||
sample_size.place(relx=0.3,rely=0.1,anchor=tkinter.CENTER) | ||
|
||
root = ctk.CTk() | ||
root.geometry('600x400') | ||
# Noise Mean | ||
# label_2 = ctk.CTkLabel(app,text='Mean value of Noise') | ||
|
||
def parameters(): | ||
print('Please enter the values') | ||
|
||
frame=ctk.CTkFrame(master=root) | ||
frame.pack(pady=20, padx=60, fill='both', expand=True) | ||
# Noise Standard Deviation | ||
|
||
label = ctk.CTkLabel(master=frame, text='Kalman estimation') | ||
label.pack(pady=12, padx=10) | ||
|
||
number_of_samples = ctk.CTkEntry(master=frame, placeholder_text='Number of Samples') | ||
number_of_samples.pack(pady=12,padx=10) | ||
|
||
button = ctk.CTkButton(master=frame, text='Run Kalman Filter') | ||
number_of_samples.pack(pady=12,padx=10) | ||
# Plot Button | ||
plot = ctk.CTkButton(app, text="Plot Graph", corner_radius=32, command=RunProgram, | ||
fg_color='#0096C7',hover_color='#00B4D8',border_color='#023E8A', | ||
border_width=1.5, font=font_1) | ||
plot.pack(padx=10,pady=10) | ||
plot.place(relx=0.5,rely=0.8,anchor=tkinter.CENTER) | ||
|
||
root.mainloop() | ||
# Run app | ||
app.mainloop() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters