|
| 1 | +""" |
| 2 | +CEASIOMpy: Conceptual Aircraft Design Software |
| 3 | +
|
| 4 | +Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland |
| 5 | +
|
| 6 | +GUI Interface of Aeroframe. |
| 7 | +""" |
| 8 | + |
| 9 | +# ============================================================================== |
| 10 | +# IMPORTS |
| 11 | +# ============================================================================== |
| 12 | + |
| 13 | +import streamlit as st |
| 14 | + |
1 | 15 | from ceasiompy.utils.moduleinterfaces import CPACSInOut
|
2 | 16 |
|
3 |
| -from ceasiompy import log |
4 | 17 | from ceasiompy.PyAVL import (
|
5 | 18 | AVL_PLOT_XPATH,
|
6 |
| - AVL_VORTEX_DISTR_XPATH, |
| 19 | + AVL_DISTR_XPATH, |
7 | 20 | AVL_AEROMAP_UID_XPATH,
|
| 21 | + AVL_NCHORDWISE_XPATH, |
| 22 | + AVL_NSPANWISE_XPATH, |
8 | 23 | )
|
9 |
| -from ceasiompy.utils.commonxpaths import ( |
10 |
| - CEASIOMPY_XPATH, |
11 |
| - AEROPERFORMANCE_XPATH, |
| 24 | +from ceasiompy.AeroFrame import ( |
| 25 | + INCLUDE_GUI, |
12 | 26 | FRAMAT_MATERIAL_XPATH,
|
13 | 27 | FRAMAT_SECTION_XPATH,
|
14 | 28 | FRAMAT_MESH_XPATH,
|
15 |
| - AEROFRAME_SETTINGS |
| 29 | + AEROFRAME_SETTINGS, |
16 | 30 | )
|
17 |
| -from pathlib import Path |
18 |
| - |
19 |
| -import streamlit as st |
20 |
| -# ===== Module Status ===== |
21 |
| -# True if the module is active |
22 |
| -# False if the module is disabled (not working or not ready) |
23 |
| -MODULE_STATUS = True |
24 | 31 |
|
25 |
| -RESULTS_DIR = Path("Results", "AeroFrame_new") |
26 |
| - |
27 |
| -# ===== CPACS inputs and outputs ===== |
| 32 | +# ============================================================================== |
| 33 | +# VARIABLE |
| 34 | +# ============================================================================== |
28 | 35 |
|
29 | 36 | cpacs_inout = CPACSInOut()
|
30 | 37 |
|
31 |
| -# ----- Input ----- |
| 38 | +# ============================================================================== |
| 39 | +# CALL |
| 40 | +# ============================================================================== |
32 | 41 |
|
33 | 42 | cpacs_inout.add_input(
|
34 | 43 | var_name="aeromap_uid",
|
|
37 | 46 | unit=None,
|
38 | 47 | descr="Name of the aero map to calculate",
|
39 | 48 | xpath=AVL_AEROMAP_UID_XPATH,
|
40 |
| - gui=True, |
| 49 | + gui=INCLUDE_GUI, |
41 | 50 | gui_name="__AEROMAP_SELECTION",
|
42 | 51 | gui_group="Aeromap settings",
|
43 | 52 | )
|
|
48 | 57 | default_value=["equal", "cosine", "sine"],
|
49 | 58 | unit=None,
|
50 | 59 | descr=("Select the type of distribution"),
|
51 |
| - xpath=AVL_VORTEX_DISTR_XPATH + "/Distribution", |
52 |
| - gui=True, |
| 60 | + xpath=AVL_DISTR_XPATH, |
| 61 | + gui=INCLUDE_GUI, |
53 | 62 | gui_name="Choice of distribution",
|
54 | 63 | gui_group="AVL: Vortex Lattice Spacing Distributions",
|
55 | 64 | )
|
|
60 | 69 | default_value=8,
|
61 | 70 | unit=None,
|
62 | 71 | descr="Select the number of chordwise vortices",
|
63 |
| - xpath=AVL_VORTEX_DISTR_XPATH + "/Nchordwise", |
64 |
| - gui=True, |
| 72 | + xpath=AVL_NCHORDWISE_XPATH, |
| 73 | + gui=INCLUDE_GUI, |
65 | 74 | gui_name="Number of chordwise vortices",
|
66 | 75 | gui_group="AVL: Vortex Lattice Spacing Distributions",
|
67 | 76 | )
|
|
72 | 81 | default_value=30,
|
73 | 82 | unit=None,
|
74 | 83 | descr="Select the number of spanwise vortices",
|
75 |
| - xpath=AVL_VORTEX_DISTR_XPATH + "/Nspanwise", |
76 |
| - gui=True, |
| 84 | + xpath=AVL_NSPANWISE_XPATH, |
| 85 | + gui=INCLUDE_GUI, |
77 | 86 | gui_name="Number of spanwise vortices",
|
78 | 87 | gui_group="AVL: Vortex Lattice Spacing Distributions",
|
79 | 88 | )
|
|
85 | 94 | unit=None,
|
86 | 95 | descr="Select to save geometry and results plots",
|
87 | 96 | xpath=AVL_PLOT_XPATH,
|
88 |
| - gui=True, |
| 97 | + gui=INCLUDE_GUI, |
89 | 98 | gui_name="Save AVL plots",
|
90 | 99 | gui_group="Plots",
|
| 100 | + test_value=False, |
| 101 | + expanded=False, |
91 | 102 | )
|
92 | 103 |
|
93 | 104 | cpacs_inout.add_input(
|
|
97 | 108 | unit=None,
|
98 | 109 | descr="Enter number of nodes for the beam mesh.",
|
99 | 110 | xpath=FRAMAT_MESH_XPATH + "/NumberNodes",
|
100 |
| - gui=True, |
| 111 | + gui=INCLUDE_GUI, |
101 | 112 | gui_name="Number of beam nodes",
|
102 | 113 | gui_group="FramAT: Mesh properties",
|
103 | 114 | )
|
|
109 | 120 | unit=None,
|
110 | 121 | descr="Enter the Young modulus of the wing material in GPa.",
|
111 | 122 | xpath=FRAMAT_MATERIAL_XPATH + "/YoungModulus",
|
112 |
| - gui=True, |
| 123 | + gui=INCLUDE_GUI, |
113 | 124 | gui_name="Young modulus [GPa]",
|
114 | 125 | gui_group="FramAT: Material properties",
|
115 | 126 | )
|
|
121 | 132 | unit=None,
|
122 | 133 | descr="Enter the shear modulus of the wing material in GPa.",
|
123 | 134 | xpath=FRAMAT_MATERIAL_XPATH + "/ShearModulus",
|
124 |
| - gui=True, |
| 135 | + gui=INCLUDE_GUI, |
125 | 136 | gui_name="Shear modulus [GPa]",
|
126 | 137 | gui_group="FramAT: Material properties",
|
127 | 138 | )
|
|
133 | 144 | unit=None,
|
134 | 145 | descr="Enter the density of the wing material in kg/m³.",
|
135 | 146 | xpath=FRAMAT_MATERIAL_XPATH + "/Density",
|
136 |
| - gui=True, |
| 147 | + gui=INCLUDE_GUI, |
137 | 148 | gui_name="Material density [kg/m³]",
|
138 | 149 | gui_group="FramAT: Material properties",
|
139 | 150 | )
|
|
145 | 156 | unit=None,
|
146 | 157 | descr="Enter the area of the cross-section in m².",
|
147 | 158 | xpath=FRAMAT_SECTION_XPATH + "/Area",
|
148 |
| - gui=True, |
| 159 | + gui=INCLUDE_GUI, |
149 | 160 | gui_name="Cross-section area [m²]",
|
150 | 161 | gui_group="FramAT: Cross-section properties",
|
151 | 162 | )
|
|
158 | 169 | descr="Enter the second moment of area of the cross-section \
|
159 | 170 | about the horizontal axis, in m⁴.",
|
160 | 171 | xpath=FRAMAT_SECTION_XPATH + "/Ix",
|
161 |
| - gui=True, |
| 172 | + gui=INCLUDE_GUI, |
162 | 173 | gui_name="Second moment of area Ix [m⁴]",
|
163 | 174 | gui_group="FramAT: Cross-section properties",
|
164 | 175 | )
|
|
171 | 182 | descr="Enter the second moment of area of the cross-section \
|
172 | 183 | about the vertical axis, in m⁴",
|
173 | 184 | xpath=FRAMAT_SECTION_XPATH + "/Iy",
|
174 |
| - gui=True, |
| 185 | + gui=INCLUDE_GUI, |
175 | 186 | gui_name="Second moment of area Iy [m⁴]",
|
176 | 187 | gui_group="FramAT: Cross-section properties",
|
177 | 188 | )
|
|
183 | 194 | unit=None,
|
184 | 195 | descr="Enter the maximum number of iterations of the aeroelastic-loop.",
|
185 | 196 | xpath=AEROFRAME_SETTINGS + "/MaxNumberIterations",
|
186 |
| - gui=True, |
| 197 | + gui=INCLUDE_GUI, |
187 | 198 | gui_name="Maximum number of iterations",
|
188 | 199 | gui_group="AeroFrame: Convergence settings",
|
189 | 200 | )
|
|
195 | 206 | unit=None,
|
196 | 207 | descr="Enter the tolerance for convergence of the wing deformation.",
|
197 | 208 | xpath=AEROFRAME_SETTINGS + "/Tolerance",
|
198 |
| - gui=True, |
| 209 | + gui=INCLUDE_GUI, |
199 | 210 | gui_name="Tolerance",
|
200 | 211 | gui_group="AeroFrame: Convergence settings",
|
201 | 212 | )
|
202 |
| - |
203 |
| -# ----- Output ----- |
204 |
| - |
205 |
| -cpacs_inout.add_output( |
206 |
| - var_name="output", |
207 |
| - default_value=None, |
208 |
| - unit="1", |
209 |
| - descr="Description of the output", |
210 |
| - xpath=CEASIOMPY_XPATH + "/test/myOutput", |
211 |
| -) |
212 |
| - |
213 |
| -cpacs_inout.add_output( |
214 |
| - var_name="aeromap_avl", # name to change... |
215 |
| - # var_type=CPACS_aeroMap, # no type pour output, would it be useful? |
216 |
| - default_value=None, |
217 |
| - unit="-", |
218 |
| - descr="aeroMap with aero coefficients calculated by AVL", |
219 |
| - xpath=AEROPERFORMANCE_XPATH + "/aeroMap/aeroPerformanceMap", |
220 |
| -) |
221 |
| - |
222 |
| -# ================================================================================================= |
223 |
| -# MAIN |
224 |
| -# ================================================================================================= |
225 |
| - |
226 |
| -if __name__ == "__main__": |
227 |
| - log.info("Nothing to be executed.") |
0 commit comments