*ARCHIVED* development moved to aircraft-studio.
1
# This file is part of Marius Peter's airfoil analysis package (this program).
2
#
3
# This program is free software: you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation, either version 3 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16
from tools import creator, evaluator, generator
17
# import creator
18
# import evaluator
19
# import generator
20
import tkinter as tk
21
import tkinter. as ttk
22
23
from matplotlib.backends.backend_tkagg import (
24
FigureCanvasTkAgg, NavigationToolbar2Tk)
25
26
27
classMainWindow(tk.Frame):
28
"""Main editor window."""
29
30
def__init__(self,*args,**kwargs):
31
tk..__init__(self,*,**)
32
root = tk.()
33
root.('MAE 154B - Airfoil Design, Evaluation, Optimization')
34
35
# self.button = tk.Button(self, text="Create new window",
36
# command=self.create_window)
37
# self.button.pack(side="top")
38
frame_1 = ttk.()
39
l_naca, e_naca = (,'naca')
40
l_chord, e_chord = (,'chord')
41
l_semi_span, e_semi_span = (,'semi_span')
42
af = generator.()
43
# Graph window
44
frame_2 = ttk.()
45
fig, ax = creator.(,False)
46
plot = (,)
47
# plot.draw()
48
toolbar = (,)
49
# toolbar.update()
50
51
l_naca.(row=0,column=0)
52
e_naca.(row=0,column=1,padx=4)
53
# b_naca.grid(row=0, column=2)
54
l_chord.(row=1,column=0)
55
e_chord.(row=1,column=1,padx=4)
56
l_semi_span.(row=2,column=0,padx=4)
57
e_semi_span.(row=2,column=1,padx=4)
58
frame_1.(side=.LEFT)
59
# Graph window
60
plot.().(expand=1,fill=.BOTH)
61
toolbar.()
62
frame_2.(side=.LEFT)
63
64
defcreate_window(self):
65
self. += 1
66
window = tk.(self)
67
window.("Window #%s"%self.)
68
label = tk.(,text="This is window #%s"%self.)
69
label.(side="top",fill="both",expand=True,padx=100,pady=100)
70
71
72
defnew_field(parent,name):
73
"""Add a new user input field."""
74
75
label = ttk.(,text=)
76
entry = ttk.()
77
return label, entry
78
79
80
defset_naca(name):
81
naca_num = name.()
82
print()
83
84
85
defset_chord(name):
86
chord = name.()
87
print()
88
89
90
defset_semi_span(name):
91
semi_span = name.()
92
print()
93
94
95
# plot.get_tk_widget().pack()
96
().()
97