summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-06-20 00:03:13 -0700
committerMarius Peter <blendoit@gmail.com>2019-06-20 00:03:13 -0700
commit9d0824403aa06b1cf12ac62b587f4ca07819395b (patch)
treedf7b87f004ce9843de8c4e7e6b301a7d8dc8a495
parent98eba92ca268fb18886309d535a3a52d38e09ba4 (diff)
begin work on a gui
-rw-r--r--evaluator.py2
-rw-r--r--gui.py35
-rw-r--r--main.py4
3 files changed, 38 insertions, 3 deletions
diff --git a/evaluator.py b/evaluator.py
index 69a589a..824b578 100644
--- a/evaluator.py
+++ b/evaluator.py
@@ -23,7 +23,7 @@ def get_centroid(airfoil):
numerator += _ * area
for _ in airfoil.stringer.x_l:
numerator += _ * area
- denominator
+ # denominator
# z_c =
diff --git a/gui.py b/gui.py
new file mode 100644
index 0000000..f7875e9
--- /dev/null
+++ b/gui.py
@@ -0,0 +1,35 @@
+import tkinter as tk
+from tkinter import ttk
+
+
+class Input:
+ '''User inputs.'''
+
+ def __init__(self, master):
+ ttk.Frame(master).grid(row=0, column=0)
+ ttk.Label(master, text='NACA Number').grid(row=0, sticky='W')
+ ttk.Label(master, text='Chord Length').grid(row=1, sticky='W')
+ ttk.Entry(master).grid(row=0, column=1)
+ ttk.Entry(master).grid(row=1, column=1)
+
+
+class Graph:
+ '''Graph airfoil.'''
+
+ def __init__(self, master):
+ ttk.Frame(master).grid(row=0, column=1)
+
+
+def main():
+ root = tk.Tk()
+ root.title('MAE 154B - Airfoil Design, Evaluation, Optimization')
+ root.geometry('1000x400')
+
+ Input(root)
+ Graph(root)
+ root.mainloop()
+ return None
+
+
+if __name__ == '__main__':
+ main()
diff --git a/main.py b/main.py
index 510d8c5..d6157d3 100644
--- a/main.py
+++ b/main.py
@@ -21,7 +21,7 @@ import random
import time
start_time = time.time()
-CHORD_LENGTH = 100
+CHORD_LENGTH = 10
SEMI_SPAN = 200
# m=Mass
@@ -75,7 +75,7 @@ def main():
af.stringer.print_info(2)
# Plot components with matplotlib
- # creator.plot(af, af.spar, af.stringer)
+ creator.plot(af, af.spar, af.stringer)
# Save component info
af.save_info(SAVE_PATH, _)
Copyright 2019--2024 Marius PETER