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
utilities.py
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import math
|
|
3
|
+
from PyQt6.QtWidgets import QLayout, QMessageBox, QFrame, QScrollArea, QVBoxLayout, QWidget
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def show_popup(message, parent):
|
|
7
|
+
"""Display a pop-up message for 2 seconds."""
|
|
8
|
+
popup = QMessageBox(parent)
|
|
9
|
+
popup.setWindowTitle("Info")
|
|
10
|
+
popup.setText(message)
|
|
11
|
+
# This line seemed to make it impossible to close the popup
|
|
12
|
+
# popup.setStandardButtons(QMessageBox.StandardButton.NoButton)
|
|
13
|
+
popup.setStyleSheet("QLabel{min-width: 300px;}")
|
|
14
|
+
popup.show()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def create_line_bar():
|
|
18
|
+
"""Create a line bar to separate the widgets."""
|
|
19
|
+
line_bar = QFrame()
|
|
20
|
+
line_bar.setFrameShape(QFrame.Shape.HLine)
|
|
21
|
+
line_bar.setFrameShadow(QFrame.Shadow.Sunken)
|
|
22
|
+
|
|
23
|
+
return line_bar
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def create_scroll_area(widget: QWidget, set_layout=True):
|
|
27
|
+
widget.scroll_area = QScrollArea()
|
|
28
|
+
widget.scroll_area.setWidgetResizable(True)
|
|
29
|
+
scroll_content = QWidget()
|
|
30
|
+
widget.scroll_area.setWidget(scroll_content)
|
|
31
|
+
widget.main_layout = QVBoxLayout(scroll_content)
|
|
32
|
+
layout_scroll = QVBoxLayout()
|
|
33
|
+
layout_scroll.addWidget(widget.scroll_area)
|
|
34
|
+
layout_scroll.setContentsMargins(0, 0, 0, 0)
|
|
35
|
+
if set_layout:
|
|
36
|
+
widget.setLayout(layout_scroll)
|
|
37
|
+
|
|
38
|
+
return layout_scroll
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def set_data(obj: dict, key: str, data):
|
|
42
|
+
key_list = key.split(".")
|
|
43
|
+
key = key_list[0]
|
|
44
|
+
key_list = key_list[1:]
|
|
45
|
+
|
|
46
|
+
if len(key_list) > 0:
|
|
47
|
+
set_data(obj[key], ".".join(key_list), data)
|
|
48
|
+
return
|
|
49
|
+
|
|
50
|
+
obj[key] = data
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def clear_layout(layout: QLayout):
|
|
54
|
+
"""Clear all widgets from the layout."""
|
|
55
|
+
while layout.count():
|
|
56
|
+
item = layout.takeAt(0)
|
|
57
|
+
|
|
58
|
+
assert item is not None
|
|
59
|
+
widget = item.widget()
|
|
60
|
+
if widget is not None:
|
|
61
|
+
# Remove widget
|
|
62
|
+
widget.deleteLater()
|
|
63
|
+
else:
|
|
64
|
+
sublayout = item.layout()
|
|
65
|
+
if sublayout is not None:
|
|
66
|
+
# Recursively clear sublayout
|
|
67
|
+
clear_layout(sublayout)
|
|
68
|
+
|
|
69
|
+
def convert_name(name: str):
|
|
70
|
+
return name.replace(" ", "_").lower()
|
|
71
|
+
|
|
72
|
+
# Full Unit System for all unit conversions in the app
|
|
73
|
+
class Units:
|
|
74
|
+
|
|
75
|
+
# Length Units
|
|
76
|
+
class Length:
|
|
77
|
+
METER = ("m", lambda x: x)
|
|
78
|
+
CENTIMETER = ("cm", lambda x: x * 0.01)
|
|
79
|
+
MILLIMETER = ("mm", lambda x: x * 0.001)
|
|
80
|
+
INCH = ("in", lambda x: x * 0.0254)
|
|
81
|
+
FOOT = ("ft", lambda x: x * 0.3048)
|
|
82
|
+
MILE = ("mi", lambda x: x * 1609.344)
|
|
83
|
+
NAUTICAL_MILE = ("nmi", lambda x: x * 1852.0)
|
|
84
|
+
KILOMETER = ("km", lambda x: x * 1000)
|
|
85
|
+
DECIMETER = ("dm", lambda x: x * 0.1)
|
|
86
|
+
YARD = ("yd", lambda x: x * 0.9144)
|
|
87
|
+
unit_list = [METER, CENTIMETER, MILLIMETER, INCH, FOOT, NAUTICAL_MILE,
|
|
88
|
+
KILOMETER, DECIMETER, YARD, MILE]
|
|
89
|
+
|
|
90
|
+
# Area Units
|
|
91
|
+
class Area:
|
|
92
|
+
SQUARE_METER = ("m\u00b2", lambda x: x)
|
|
93
|
+
SQUARE_CENTIMETER = ("cm\u00b2", lambda x: x * 0.0001)
|
|
94
|
+
SQUARE_MILLIMETER = ("mm\u00b2", lambda x: x * 0.000001)
|
|
95
|
+
SQUARE_INCH = ("in\u00b2", lambda x: x * 0.00064516)
|
|
96
|
+
SQUARE_FOOT = ("ft\u00b2", lambda x: x * 0.092903)
|
|
97
|
+
SQUARE_KILOMETER = ("km\u00b2", lambda x: x * 1e6)
|
|
98
|
+
SQUARE_YARD = ("yd\u00b2", lambda x: x * 0.83612736)
|
|
99
|
+
SQUARE_MILE = ("mi\u00b2", lambda x: x * 2.589988e6)
|
|
100
|
+
|
|
101
|
+
unit_list = [SQUARE_METER, SQUARE_CENTIMETER,
|
|
102
|
+
SQUARE_MILLIMETER, SQUARE_INCH, SQUARE_FOOT, SQUARE_KILOMETER, SQUARE_YARD, SQUARE_MILE]
|
|
103
|
+
|
|
104
|
+
# Volume Units
|
|
105
|
+
class Volume:
|
|
106
|
+
CUBIC_METER = ("m\u00b3", lambda x: x)
|
|
107
|
+
CUBIC_CENTIMETER = ("cm\u00b3", lambda x: x * 0.000001)
|
|
108
|
+
CUBIC_MILLIMETER = ("mm\u00b3", lambda x: x * 0.000000001)
|
|
109
|
+
CUBIC_INCH = ("in\u00b3", lambda x: x * 0.0000163871)
|
|
110
|
+
CUBIC_FOOT = ("ft\u00b3", lambda x: x * 0.0283168)
|
|
111
|
+
LITER = ("L", lambda x: x * 1e-3)
|
|
112
|
+
MILLILITER = ("mL", lambda x: x * 1e-6)
|
|
113
|
+
GALLON = ("gal", lambda x: x * 3.785411784e-3)
|
|
114
|
+
QUART = ("qt", lambda x: x * 0.946352946e-3)
|
|
115
|
+
PINT = ("pt", lambda x: x * 0.473176473e-3)
|
|
116
|
+
|
|
117
|
+
unit_list = [CUBIC_METER, CUBIC_CENTIMETER,
|
|
118
|
+
CUBIC_MILLIMETER, CUBIC_INCH, CUBIC_FOOT, LITER, MILLILITER, GALLON, QUART, PINT]
|
|
119
|
+
|
|
120
|
+
# Temperature Units
|
|
121
|
+
class Temperature:
|
|
122
|
+
KELVIN = ("K", lambda x: x)
|
|
123
|
+
CELSIUS = ("\u00B0C", lambda x: x + 273.15)
|
|
124
|
+
FAHRENHEIT = ("\u00B0F", lambda x: (x - 32.0) * 5.0 / 9.0 + 273.15)
|
|
125
|
+
RANKINE = ("\u00B0R", lambda x: x / 1.8)
|
|
126
|
+
|
|
127
|
+
unit_list = [KELVIN, CELSIUS, FAHRENHEIT, RANKINE]
|
|
128
|
+
|
|
129
|
+
# Mass Units
|
|
130
|
+
class Mass:
|
|
131
|
+
KILOGRAM = ("kg", lambda x: x)
|
|
132
|
+
GRAM = ("g", lambda x: x * 0.001)
|
|
133
|
+
MILLIGRAM = ("mg", lambda x: x * 0.000001)
|
|
134
|
+
OUNCE = ("oz", lambda x: x * 0.0283495)
|
|
135
|
+
POUND = ("lb", lambda x: x * 0.453592)
|
|
136
|
+
METRIC_TON = ("t", lambda x: x * 1000.0)
|
|
137
|
+
SLUG = ("slug", lambda x: x * 14.5939)
|
|
138
|
+
|
|
139
|
+
unit_list = [KILOGRAM, GRAM, MILLIGRAM, OUNCE, POUND, METRIC_TON, SLUG]
|
|
140
|
+
|
|
141
|
+
# Time Units
|
|
142
|
+
class Time:
|
|
143
|
+
MILLISECOND = ("ms", lambda x: x * 0.001)
|
|
144
|
+
MICROSECOND = ("µs", lambda x: x * 0.000001)
|
|
145
|
+
SECOND = ("s", lambda x: x)
|
|
146
|
+
MINUTE = ("min", lambda x: x * 60.0)
|
|
147
|
+
HOUR = ("h", lambda x: x * 3600.0)
|
|
148
|
+
DAY = ("d", lambda x: x * 86400.0)
|
|
149
|
+
WEEK = ("wk", lambda x: x * 604800.0)
|
|
150
|
+
MONTH = ("mo", lambda x: x * 2629800.0)
|
|
151
|
+
YEAR = ("yr", lambda x: x * 31557600.0)
|
|
152
|
+
|
|
153
|
+
unit_list = [SECOND, MINUTE, HOUR, DAY, MILLISECOND, MICROSECOND, WEEK, MONTH, YEAR]
|
|
154
|
+
|
|
155
|
+
# Velocity Units
|
|
156
|
+
class Velocity:
|
|
157
|
+
METER_PER_SECOND = ("m/s", lambda x: x)
|
|
158
|
+
KILOMETER_PER_HOUR = ("km/h", lambda x: x / 3.6)
|
|
159
|
+
MILE_PER_HOUR = ("mph", lambda x: x * 0.44704)
|
|
160
|
+
KNOT = ("kts", lambda x: x * 0.514444)
|
|
161
|
+
FOOT_PER_SECOND = ("ft/s", lambda x: x * 0.3048)
|
|
162
|
+
FOOT_PER_MINUTE = ("ft/min", lambda x: x * 0.3048 / 60.0)
|
|
163
|
+
KILOMETER_PER_SECOND = ("km/s", lambda x: x * 1000.0)
|
|
164
|
+
|
|
165
|
+
unit_list = [METER_PER_SECOND, KNOT, FOOT_PER_SECOND, FOOT_PER_MINUTE, KILOMETER_PER_SECOND]
|
|
166
|
+
|
|
167
|
+
# Acceleration Units
|
|
168
|
+
class Acceleration:
|
|
169
|
+
METER_PER_SECOND_SQUARED = ("m/s\u00b2", lambda x: x)
|
|
170
|
+
KNOTS_PER_SECOND = ("kts/s", lambda x: x * 0.514444)
|
|
171
|
+
STANDARD_GRAVITY = ("g", lambda x: x * 9.80665)
|
|
172
|
+
FOOT_PER_SECOND_SQUARED = ("ft/s\u00b2", lambda x: x * 0.3048)
|
|
173
|
+
|
|
174
|
+
unit_list = [METER_PER_SECOND_SQUARED, KNOTS_PER_SECOND, STANDARD_GRAVITY, FOOT_PER_SECOND_SQUARED]
|
|
175
|
+
|
|
176
|
+
# Force Units
|
|
177
|
+
class Force:
|
|
178
|
+
NEWTON = ("N", lambda x: x)
|
|
179
|
+
KILONEWTON = ("kN", lambda x: x * 1000.0)
|
|
180
|
+
MEGANEWTON = ("MN", lambda x: x * 1000000.0)
|
|
181
|
+
POUND_FORCE = ("lbf", lambda x: x * 4.448221615)
|
|
182
|
+
|
|
183
|
+
unit_list = [NEWTON, KILONEWTON, MEGANEWTON, POUND_FORCE]
|
|
184
|
+
|
|
185
|
+
# Energy Units
|
|
186
|
+
class Energy:
|
|
187
|
+
JOULE = ("J", lambda x: x)
|
|
188
|
+
KILOJOULE = ("kJ", lambda x: x * 1000.0)
|
|
189
|
+
WATT_HOUR = ("Wh", lambda x: x * 3600.0)
|
|
190
|
+
KILOWATT_HOUR = ("kWh", lambda x: x * 3600000.0)
|
|
191
|
+
BTU = ("BTU", lambda x: x * 1055.06)
|
|
192
|
+
CALORIE = ("cal", lambda x: x * 4.184)
|
|
193
|
+
KILOCALORIE = ("kcal", lambda x: x * 4184)
|
|
194
|
+
|
|
195
|
+
unit_list = [JOULE, KILOJOULE, WATT_HOUR,
|
|
196
|
+
KILOWATT_HOUR, CALORIE, KILOCALORIE, BTU]
|
|
197
|
+
|
|
198
|
+
# Current Units
|
|
199
|
+
class Current:
|
|
200
|
+
AMPERE = ("A", lambda x: x)
|
|
201
|
+
MILLIAMPERE = ("mA", lambda x: x * 0.001)
|
|
202
|
+
MICROAMPERE = ("µA", lambda x: x * 0.000001)
|
|
203
|
+
|
|
204
|
+
unit_list = [AMPERE, MILLIAMPERE, MICROAMPERE]
|
|
205
|
+
|
|
206
|
+
# Pressure Units
|
|
207
|
+
class Pressure:
|
|
208
|
+
PASCAL = ("Pa", lambda x: x)
|
|
209
|
+
KILOPASCAL = ("kPa", lambda x: x * 1000.0)
|
|
210
|
+
MEGAPASCAL = ("MPa", lambda x: x * 1000000.0)
|
|
211
|
+
BAR = ("bar", lambda x: x * 100000.0)
|
|
212
|
+
ATMOSPHERE = ("atm", lambda x: x * 101325.0)
|
|
213
|
+
POUND_PER_SQUARE_INCH = ("psi", lambda x: x * 6894.757293)
|
|
214
|
+
MILLIBAR = ("mbar", lambda x: x * 100.0)
|
|
215
|
+
POUND_PER_SQUARE_FOOT = ("psf", lambda x: x * 47.8802589)
|
|
216
|
+
|
|
217
|
+
unit_list = [PASCAL, KILOPASCAL, MEGAPASCAL,
|
|
218
|
+
BAR, ATMOSPHERE, POUND_PER_SQUARE_INCH, MILLIBAR, POUND_PER_SQUARE_FOOT]
|
|
219
|
+
|
|
220
|
+
# Unitless Units
|
|
221
|
+
class Unitless:
|
|
222
|
+
NONE = ("", lambda x: x)
|
|
223
|
+
PERCENT = ("%", lambda x: x / 100.0)
|
|
224
|
+
|
|
225
|
+
unit_list = [NONE, PERCENT]
|
|
226
|
+
|
|
227
|
+
class Count:
|
|
228
|
+
UNIT = ("Unit", lambda x: x)
|
|
229
|
+
unit_list = [UNIT]
|
|
230
|
+
|
|
231
|
+
class Angle:
|
|
232
|
+
RADIAN = ("rad", lambda x: x)
|
|
233
|
+
DEGREE = ("deg", lambda x: np.deg2rad(x))
|
|
234
|
+
|
|
235
|
+
unit_list = [RADIAN, DEGREE]
|
|
236
|
+
|
|
237
|
+
# Intertia Units
|
|
238
|
+
class Intertia:
|
|
239
|
+
KILOGRAM_PER_SQUARE_METER = ("kg/m\u00b2", lambda x: x)
|
|
240
|
+
POUND_PER_SQUARE_FOOT = ("slug/ft\u00b2", lambda x: x * 1.35581795)
|
|
241
|
+
|
|
242
|
+
unit_list = [KILOGRAM_PER_SQUARE_METER, POUND_PER_SQUARE_FOOT]
|
|
243
|
+
|
|
244
|
+
class Position:
|
|
245
|
+
pass
|
|
246
|
+
|
|
247
|
+
class Boolean:
|
|
248
|
+
pass
|
|
249
|
+
|
|
250
|
+
class Heading:
|
|
251
|
+
pass
|
|
252
|
+
|
|
253
|
+
class File:
|
|
254
|
+
pass
|
|
255
|
+
|
|
256
|
+
class String:
|
|
257
|
+
pass
|