From 9d0824403aa06b1cf12ac62b587f4ca07819395b Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 20 Jun 2019 00:03:13 -0700 Subject: begin work on a gui --- evaluator.py | 2 +- gui.py | 35 +++++++++++++++++++++++++++++++++++ main.py | 4 ++-- 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 gui.py 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, _) -- cgit v1.2.3