RCAIDE-GUI 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- common_widgets/__init__.py +6 -0
- common_widgets/animated_toggle.py +141 -0
- common_widgets/color.py +17 -0
- common_widgets/data_entry_widget.py +337 -0
- common_widgets/image_widget.py +21 -0
- common_widgets/unit_picker_widget.py +48 -0
- main.py +168 -0
- rcaide_gui-1.0.0.dist-info/METADATA +96 -0
- rcaide_gui-1.0.0.dist-info/RECORD +170 -0
- rcaide_gui-1.0.0.dist-info/WHEEL +5 -0
- rcaide_gui-1.0.0.dist-info/entry_points.txt +2 -0
- rcaide_gui-1.0.0.dist-info/top_level.txt +5 -0
- rcaide_io.py +818 -0
- tabs/__init__.py +10 -0
- tabs/aircraft_configs/__init__.py +3 -0
- tabs/aircraft_configs/aircraft_configs.py +301 -0
- tabs/analysis/__init__.py +4 -0
- tabs/analysis/analysis.py +92 -0
- tabs/analysis/widgets/__init__.py +13 -0
- tabs/analysis/widgets/aeroacoustics_widget.py +158 -0
- tabs/analysis/widgets/aerodynamics_widget.py +108 -0
- tabs/analysis/widgets/analysis_data_widget.py +29 -0
- tabs/analysis/widgets/atmosphere_widget.py +49 -0
- tabs/analysis/widgets/costs_widget.py +35 -0
- tabs/analysis/widgets/energy_widget.py +32 -0
- tabs/analysis/widgets/geometry_widget.py +55 -0
- tabs/analysis/widgets/planets_widget.py +34 -0
- tabs/analysis/widgets/propulsion_widget.py +53 -0
- tabs/analysis/widgets/stability_widget.py +34 -0
- tabs/analysis/widgets/weights_widget.py +94 -0
- tabs/geometry/__init__.py +6 -0
- tabs/geometry/aircraft_configs.py +232 -0
- tabs/geometry/frames/__init__.py +15 -0
- tabs/geometry/frames/booms/__init__.py +5 -0
- tabs/geometry/frames/booms/boom_frame.py +238 -0
- tabs/geometry/frames/cargo_bays/__init__.py +5 -0
- tabs/geometry/frames/cargo_bays/cargo_bay_frame.py +159 -0
- tabs/geometry/frames/default_frame.py +23 -0
- tabs/geometry/frames/energy_network/__init__.py +2 -0
- tabs/geometry/frames/energy_network/turbofan_network/__init__.py +3 -0
- tabs/geometry/frames/energy_network/turbofan_network/frames/__init__.py +1 -0
- tabs/geometry/frames/energy_network/turbofan_network/widgets/__init__.py +1 -0
- tabs/geometry/frames/fuselages/__init__.py +5 -0
- tabs/geometry/frames/fuselages/fuselage_frame.py +294 -0
- tabs/geometry/frames/geometry_frame.py +91 -0
- tabs/geometry/frames/landing_gears/__init__.py +5 -0
- tabs/geometry/frames/landing_gears/landing_gear_frame.py +189 -0
- tabs/geometry/frames/nacelles/__init__.py +1 -0
- tabs/geometry/frames/powertrain/__init__.py +6 -0
- tabs/geometry/frames/powertrain/converters/__init__.py +5 -0
- tabs/geometry/frames/powertrain/converters/converter_frame.py +137 -0
- tabs/geometry/frames/powertrain/distributors/__init__.py +5 -0
- tabs/geometry/frames/powertrain/distributors/distributor_frame.py +143 -0
- tabs/geometry/frames/powertrain/nacelles/__init__.py +5 -0
- tabs/geometry/frames/powertrain/nacelles/nacelle_frame.py +283 -0
- tabs/geometry/frames/powertrain/powertrain_frame.py +259 -0
- tabs/geometry/frames/powertrain/propulsors/__init__.py +5 -0
- tabs/geometry/frames/powertrain/propulsors/propulsor_frame.py +146 -0
- tabs/geometry/frames/powertrain/sources/__init__.py +6 -0
- tabs/geometry/frames/powertrain/sources/energy_source_frame.py +147 -0
- tabs/geometry/frames/vehicle_frame.py +171 -0
- tabs/geometry/frames/wings/__init__.py +5 -0
- tabs/geometry/frames/wings/wings_frame.py +457 -0
- tabs/geometry/geometry.py +513 -0
- tabs/geometry/widgets/__init__.py +12 -0
- tabs/geometry/widgets/booms/__init__.py +6 -0
- tabs/geometry/widgets/booms/boom_section_widget.py +109 -0
- tabs/geometry/widgets/cargo_bays/__init__.py +1 -0
- tabs/geometry/widgets/fuselages/__init__.py +8 -0
- tabs/geometry/widgets/fuselages/cabin_class_widget.py +188 -0
- tabs/geometry/widgets/fuselages/cabin_widget.py +217 -0
- tabs/geometry/widgets/fuselages/fuselage_section_widget.py +190 -0
- tabs/geometry/widgets/geometry_data_widget.py +25 -0
- tabs/geometry/widgets/landing_gears/__init__.py +6 -0
- tabs/geometry/widgets/nacelles/__init__.py +1 -0
- tabs/geometry/widgets/powertrain/__init__.py +9 -0
- tabs/geometry/widgets/powertrain/converters/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/converters/turboelectric_generator_widget.py +74 -0
- tabs/geometry/widgets/powertrain/distributors/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/distributors/fuel_line_widget.py +81 -0
- tabs/geometry/widgets/powertrain/modulators/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/modulators/esc_widget.py +58 -0
- tabs/geometry/widgets/powertrain/nacelles/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/nacelles/nacelle_section_widget.py +115 -0
- tabs/geometry/widgets/powertrain/powertrain_connector_widget.py +136 -0
- tabs/geometry/widgets/powertrain/powertrain_widget.py +206 -0
- tabs/geometry/widgets/powertrain/propulsors/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/propulsors/turbofan_widget.py +462 -0
- tabs/geometry/widgets/powertrain/sources/__init__.py +6 -0
- tabs/geometry/widgets/powertrain/sources/fuel_tank_widget.py +103 -0
- tabs/geometry/widgets/powertrain/sources/source_selector_widget.py +35 -0
- tabs/geometry/widgets/wings/__init__.py +7 -0
- tabs/geometry/widgets/wings/wing_cs_widget.py +198 -0
- tabs/geometry/widgets/wings/wing_section_widget.py +298 -0
- tabs/home/__init__.py +3 -0
- tabs/home/home.py +585 -0
- tabs/mission/__init__.py +4 -0
- tabs/mission/mission.py +1124 -0
- tabs/mission/widgets/__init__.py +3 -0
- tabs/mission/widgets/flight_controls_widget.py +186 -0
- tabs/mission/widgets/mission_analysis_widget.py +166 -0
- tabs/mission/widgets/mission_segment_helper.py +358 -0
- tabs/mission/widgets/mission_segment_widget.py +358 -0
- tabs/solve/__init__.py +4 -0
- tabs/solve/plots/__init__.py +12 -0
- tabs/solve/plots/aeroacoustics/__init__.py +6 -0
- tabs/solve/plots/aeroacoustics/plot_2D_noise_contour.py +184 -0
- tabs/solve/plots/aeroacoustics/plot_3D_noise_contour.py +219 -0
- tabs/solve/plots/aeroacoustics/plot_noise_certification_contour.py +115 -0
- tabs/solve/plots/aeroacoustics/plot_noise_level.py +118 -0
- tabs/solve/plots/aerodynamics/__init__.py +10 -0
- tabs/solve/plots/aerodynamics/plot_aerodynamic_coefficients.py +156 -0
- tabs/solve/plots/aerodynamics/plot_aerodynamic_forces.py +155 -0
- tabs/solve/plots/aerodynamics/plot_aircraft_aerodynamics.py +136 -0
- tabs/solve/plots/aerodynamics/plot_drag_components.py +157 -0
- tabs/solve/plots/aerodynamics/plot_lift_distribution.py +107 -0
- tabs/solve/plots/aerodynamics/plot_rotor_conditions.py +255 -0
- tabs/solve/plots/aerodynamics/plot_rotor_disc_performance.py +144 -0
- tabs/solve/plots/aerodynamics/plot_rotor_performance.py +124 -0
- tabs/solve/plots/common/__init__.py +4 -0
- tabs/solve/plots/common/plot_style.py +71 -0
- tabs/solve/plots/common/set_axes.py +55 -0
- tabs/solve/plots/create_plot_widgets.py +34 -0
- tabs/solve/plots/emissions/__init__.py +3 -0
- tabs/solve/plots/emissions/plot_emissions.py +167 -0
- tabs/solve/plots/energy/__init__.py +12 -0
- tabs/solve/plots/energy/plot_altitude_sfc_weight.py +134 -0
- tabs/solve/plots/energy/plot_battery_cell_conditions.py +154 -0
- tabs/solve/plots/energy/plot_battery_degradation.py +157 -0
- tabs/solve/plots/energy/plot_battery_module_C_rates.py +139 -0
- tabs/solve/plots/energy/plot_battery_module_conditions.py +157 -0
- tabs/solve/plots/energy/plot_battery_pack_conditions.py +164 -0
- tabs/solve/plots/energy/plot_battery_ragone_diagram.py +97 -0
- tabs/solve/plots/energy/plot_battery_temperature.py +136 -0
- tabs/solve/plots/energy/plot_electric_propulsor_efficiencies.py +136 -0
- tabs/solve/plots/energy/plot_propulsor_throttles.py +119 -0
- tabs/solve/plots/mission/__init__.py +5 -0
- tabs/solve/plots/mission/plot_aircraft_velocities.py +145 -0
- tabs/solve/plots/mission/plot_flight_conditions.py +236 -0
- tabs/solve/plots/mission/plot_flight_trajectory.py +172 -0
- tabs/solve/plots/stability/__init__.py +5 -0
- tabs/solve/plots/stability/plot_flight_forces_and_moments.py +163 -0
- tabs/solve/plots/stability/plot_lateral_stability.py +151 -0
- tabs/solve/plots/stability/plot_longitudinal_stability.py +173 -0
- tabs/solve/plots/thermal_management/__init__.py +7 -0
- tabs/solve/plots/thermal_management/plot_air_cooled_conditions.py +152 -0
- tabs/solve/plots/thermal_management/plot_cross_flow_heat_exchanger_conditions.py +185 -0
- tabs/solve/plots/thermal_management/plot_reservoir_conditions.py +141 -0
- tabs/solve/plots/thermal_management/plot_thermal_management_performance.py +105 -0
- tabs/solve/plots/thermal_management/plot_wavy_channel_conditions.py +161 -0
- tabs/solve/plots/weights/__init__.py +4 -0
- tabs/solve/plots/weights/plot_load_diagram.py +163 -0
- tabs/solve/plots/weights/plot_weight_breakdown.py +164 -0
- tabs/solve/solve.py +1498 -0
- tabs/style_sheet.py +114 -0
- tabs/tab_widget.py +14 -0
- tabs/visualize_geometry/__init__.py +4 -0
- tabs/visualize_geometry/core_3d_viewer.py +253 -0
- tabs/visualize_geometry/features/__init__.py +10 -0
- tabs/visualize_geometry/features/axes_gizmo.py +173 -0
- tabs/visualize_geometry/features/background.py +161 -0
- tabs/visualize_geometry/features/blueprint.py +685 -0
- tabs/visualize_geometry/features/camera.py +364 -0
- tabs/visualize_geometry/features/drag_aircraft.py +219 -0
- tabs/visualize_geometry/features/grid.py +194 -0
- tabs/visualize_geometry/features/measurement.py +367 -0
- tabs/visualize_geometry/features/screenshot.py +91 -0
- tabs/visualize_geometry/geometry_helper_functions.py +3 -0
- tabs/visualize_geometry/visualize_geometry.py +731 -0
- utilities.py +257 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/visualize_geometry/features/background.py
|
|
2
|
+
|
|
3
|
+
# RCAIDE-GUI Imports
|
|
4
|
+
from tabs.visualize_geometry.visualize_geometry import VisualizeGeometryWidget
|
|
5
|
+
|
|
6
|
+
# PyQt imports
|
|
7
|
+
from PyQt6.QtWidgets import QPushButton, QMenu, QColorDialog
|
|
8
|
+
from PyQt6.QtGui import QAction, QColor
|
|
9
|
+
|
|
10
|
+
class BackgroundManager:
|
|
11
|
+
"""Manage background mode and menu checkmarks (dark / light / custom)."""
|
|
12
|
+
def __init__(self, widget):
|
|
13
|
+
# keep a reference to the widget so we can access renderer & window
|
|
14
|
+
self.widget = widget
|
|
15
|
+
self.current_mode = "dark" # default
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def renderer(self):
|
|
19
|
+
# return the renderer if it exists, else None
|
|
20
|
+
return getattr(self.widget, "renderer", None)
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def window(self):
|
|
24
|
+
# return the render window so we can call Render()
|
|
25
|
+
try:
|
|
26
|
+
return self.widget.vtkWidget.GetRenderWindow()
|
|
27
|
+
except Exception:
|
|
28
|
+
return None
|
|
29
|
+
|
|
30
|
+
def _set_mode(self, mode: str):
|
|
31
|
+
"""Set renderer background and update menu checkmarks."""
|
|
32
|
+
r = self.renderer
|
|
33
|
+
w = self.window
|
|
34
|
+
if r is None or w is None:
|
|
35
|
+
return
|
|
36
|
+
|
|
37
|
+
if mode == "dark":
|
|
38
|
+
r.GradientBackgroundOn()
|
|
39
|
+
r.SetBackground(0.05, 0.08, 0.15)
|
|
40
|
+
r.SetBackground2(0.12, 0.18, 0.28)
|
|
41
|
+
|
|
42
|
+
elif mode == "light":
|
|
43
|
+
r.GradientBackgroundOn()
|
|
44
|
+
r.SetBackground(0.85, 0.90, 0.98)
|
|
45
|
+
r.SetBackground2(1.0, 1.0, 1.0)
|
|
46
|
+
|
|
47
|
+
elif mode == "custom":
|
|
48
|
+
# Custom color is handled by set_custom_color() which calls _set_mode("custom")
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
# update menu checkmarks if actions exist
|
|
52
|
+
actions = getattr(self.widget, "_bg_actions", None) or {}
|
|
53
|
+
for m, act in actions.items():
|
|
54
|
+
act.setCheckable(True)
|
|
55
|
+
act.setChecked(m == mode)
|
|
56
|
+
|
|
57
|
+
# remember mode and force a redraw
|
|
58
|
+
self.current_mode = mode
|
|
59
|
+
w.Render()
|
|
60
|
+
|
|
61
|
+
def set_dark_mode(self):
|
|
62
|
+
# switch to dark mode
|
|
63
|
+
self._set_mode("dark")
|
|
64
|
+
|
|
65
|
+
def set_light_mode(self):
|
|
66
|
+
# switch to light mode
|
|
67
|
+
self._set_mode("light")
|
|
68
|
+
|
|
69
|
+
def set_custom_color(self):
|
|
70
|
+
# set a single custom background color chosen by the user
|
|
71
|
+
r = self.renderer
|
|
72
|
+
w = self.window
|
|
73
|
+
if r is None or w is None:
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
# ask user for a color (default is dark)
|
|
77
|
+
color = QColorDialog.getColor(QColor(20, 20, 20), self.widget, "Choose Background Color")
|
|
78
|
+
if not color.isValid():
|
|
79
|
+
return
|
|
80
|
+
|
|
81
|
+
# turn off gradient and apply the chosen color
|
|
82
|
+
r.GradientBackgroundOff()
|
|
83
|
+
r.SetBackground(color.redF(), color.greenF(), color.blueF())
|
|
84
|
+
|
|
85
|
+
# mark "custom" in the menu and redraw
|
|
86
|
+
actions = getattr(self.widget, "_bg_actions", None) or {}
|
|
87
|
+
for m, act in actions.items():
|
|
88
|
+
act.setCheckable(True)
|
|
89
|
+
act.setChecked(m == "custom")
|
|
90
|
+
|
|
91
|
+
self.current_mode = "custom"
|
|
92
|
+
w.Render()
|
|
93
|
+
|
|
94
|
+
def _add_background_menu(self):
|
|
95
|
+
"""Add Background menu once to the toolbar."""
|
|
96
|
+
# require toolbar
|
|
97
|
+
if not hasattr(self, "toolbar") or self.toolbar is None:
|
|
98
|
+
return
|
|
99
|
+
|
|
100
|
+
# Prevent duplicates
|
|
101
|
+
if getattr(self, "_background_menu_added", False):
|
|
102
|
+
return
|
|
103
|
+
self._background_menu_added = True
|
|
104
|
+
|
|
105
|
+
# create or reuse a small helper that talks to the renderer
|
|
106
|
+
if not hasattr(self, "bg_manager") or self.bg_manager is None:
|
|
107
|
+
self.bg_manager = BackgroundManager(self)
|
|
108
|
+
|
|
109
|
+
# add a simple button to the toolbar
|
|
110
|
+
btn = QPushButton("🌄 Background")
|
|
111
|
+
self.toolbar.addSeparator()
|
|
112
|
+
self.toolbar.addWidget(btn)
|
|
113
|
+
|
|
114
|
+
# create a menu to hold actions
|
|
115
|
+
menu = QMenu(btn)
|
|
116
|
+
|
|
117
|
+
# actions for each mode
|
|
118
|
+
act_dark = QAction("Dark Mode", menu) # dark gradient
|
|
119
|
+
act_light = QAction("Light Mode", menu) # light gradient
|
|
120
|
+
act_custom = QAction("Custom Color…", menu) # pick solid color
|
|
121
|
+
|
|
122
|
+
# wire actions to the manager
|
|
123
|
+
act_dark.triggered.connect(self.bg_manager.set_dark_mode)
|
|
124
|
+
act_light.triggered.connect(self.bg_manager.set_light_mode)
|
|
125
|
+
act_custom.triggered.connect(self.bg_manager.set_custom_color)
|
|
126
|
+
|
|
127
|
+
# keep actions on the widget so we can update checkmarks later
|
|
128
|
+
# stored under `self._bg_actions` for easy access from the manager
|
|
129
|
+
self._bg_actions = {"dark": act_dark, "light": act_light, "custom": act_custom}
|
|
130
|
+
|
|
131
|
+
# make each action checkable and add it to the menu
|
|
132
|
+
for act in self._bg_actions.values():
|
|
133
|
+
act.setCheckable(True)
|
|
134
|
+
menu.addAction(act)
|
|
135
|
+
|
|
136
|
+
# attach the menu to the toolbar button
|
|
137
|
+
btn.setMenu(menu)
|
|
138
|
+
|
|
139
|
+
# set default mode now so the UI matches renderer
|
|
140
|
+
self.bg_manager.set_dark_mode()
|
|
141
|
+
|
|
142
|
+
# Activate Patch
|
|
143
|
+
def _patch_update_toolbar_for_background_menu():
|
|
144
|
+
"""Wrap update_toolbar once so the background menu is added."""
|
|
145
|
+
# don't apply more than once
|
|
146
|
+
if getattr(VisualizeGeometryWidget, "_bg_update_toolbar_patched", False):
|
|
147
|
+
return
|
|
148
|
+
|
|
149
|
+
old_update_toolbar = VisualizeGeometryWidget.update_toolbar
|
|
150
|
+
|
|
151
|
+
def wrapped_update_toolbar(self, *args, **kwargs):
|
|
152
|
+
# keep original toolbar behavior
|
|
153
|
+
old_update_toolbar(self, *args, **kwargs)
|
|
154
|
+
# then ensure the background menu is attached (won't duplicate)
|
|
155
|
+
_add_background_menu(self) # idempotent
|
|
156
|
+
|
|
157
|
+
VisualizeGeometryWidget.update_toolbar = wrapped_update_toolbar
|
|
158
|
+
VisualizeGeometryWidget._bg_update_toolbar_patched = True
|
|
159
|
+
|
|
160
|
+
_patch_update_toolbar_for_background_menu()
|
|
161
|
+
# patch applied above so the background menu is ready when toolbars are built
|