-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
69 lines (62 loc) · 2.57 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import streamlit as st
#Import other modules in this Streamlit script
import geometry
import wind
import wind_multipliers
from enum_vals import Regions, Cases, Directions, Significance, Wind_angle, Structure_type, Frame
render_hc = st.sidebar.checkbox("Render hand calcs", value=True)
loadcase = Cases[st.sidebar.selectbox("Select loadcase:",[l.name for l in Cases])]
def main():
if loadcase is Cases.FAT:
Wind_mult = wind_multipliers.Wind_multipliers(render_hc)
Wind = wind.Wind(Wind_mult,loadcase)
Geom = geometry.Geometry(Wind)
Geom.st_geom_picker()
if Geom.structure_type is Structure_type.RHS:
#TODO - Add API calls
st.warning("Not yet implemented, try selecting SIGNS")
pass
if Geom.structure_type is Structure_type.CHS:
Geom.calc_drag_CHS_AASHTO()
Geom.calc_wind_pressure_sign_fat()
if Geom.structure_type is Structure_type.SIGN:
Geom.calc_drag_sign_AASHTO()
Geom.calc_wind_pressure_sign_fat()
#plot_sign = Geom.st_plot_wind_pressure()
#st.bokeh_chart(plot_sign,False)
else:
Wind_mult = wind_multipliers.Wind_multipliers(render_hc)
Wind_mult.st_region_inputs()
Wind_mult.st_terrain_inputs()
Wind_mult.terrain_multiplier()
Wind_mult.st_wind_multipliers_input()
Wind_mult.st_wind_direction_inputs()
Wind_mult.calc_wind_direction_multiplier()
Wind_mult.render_multipliers()
Wind = wind.Wind(Wind_mult,loadcase)
Wind.st_wind_speed_inputs()
Wind.calc_regional_wind_speed()
Wind.st_display_regional_wind_speed()
Wind.calc_site_wind_speed()
Geom = geometry.Geometry(Wind)
Geom.st_geom_picker()
if Geom.structure_type is Structure_type.RHS:
Geom.calc_drag_RHS_AS1170()
Geom.calc_wind_pressure_RHS()
plot_RHS = Geom.st_RHS_plotting()
st.bokeh_chart(plot_RHS,False)
elif Geom.structure_type is Structure_type.CHS:
Geom.calc_drag_CHS_AS1170()
if Geom.frame_type is Frame.NONE:
Geom.calc_wind_pressure_CHS()
else:
Geom.calc_drag_frame_CHS_AS1170()
Geom.calc_wind_pressure_CHS()
elif Geom.structure_type is Structure_type.SIGN:
Geom.calc_drag_sign_AS1170()
Geom.calc_solidity_factor()
Geom.calc_wind_pressure_sign()
plot_sign = Geom.st_plot_wind_pressure()
st.bokeh_chart(plot_sign,False)
if __name__ == '__main__':
main()