def show_default_values(self, root_location_x=0, root_location_y=0, root_location_z=0, dihedral=0, sweep=0, twist=0, span=0, taper_ratio=1, chord=0, profile=airfoil_profiles()[0]): self.span_text.setText(str(span)) self.chord_length_text.setText(str(chord)) self.sweep_angle_text.setText(str(sweep)) self.twist_angle_text.setText(str(twist)) self.dihedral_angle_text.setText(str(dihedral)) self.taper_ratio_text.setText(str(taper_ratio)) self.wing_profile_combo.setCurrentIndex( airfoil_profiles().index(profile)) self.Wing_postion_x_text.setText(str(root_location_x)) self.Wing_postion_y_text.setText(str(root_location_y)) self.Wing_postion_z_text.setText(str(root_location_z))
def accept_inputs(self): if self.wing_profile_selection is None: self.wing_profile_selection = airfoil_profiles()[ self.wing_profile_combo.currentIndex()]
def wing_profile_selectionChanged(self, i): self.wing_profile_selection = airfoil_profiles()[i]
def __init__(self, text, surface_type_, design_type_): super().__init__() layout = QFormLayout(self) self.text = text self.surface_type_ = surface_type_ self.design_type_ = design_type_ self.tab_ = self ################################################################################## self.span_label = QLabel("Span") self.span_text = QLineEdit() layout.addRow(self.span_label, self.span_text) ############################################################################## self.chord_length_label = QLabel("Chord Length") self.chord_length_text = QLineEdit() layout.addRow(self.chord_length_label, self.chord_length_text) self.sweep_angle_label = QLabel("Sweep Angle(⁰)") self.sweep_angle_text = QLineEdit() layout.addRow(self.sweep_angle_label, self.sweep_angle_text) ################################################################################## self.twist_angle_label = QLabel("Twist Angle(⁰)") self.twist_angle_text = QLineEdit() layout.addRow(self.twist_angle_label, self.twist_angle_text) ############################################################################### ############################################################################### self.dihedral_angle_label = QLabel("Dihedral Angle(⁰)") self.dihedral_angle_text = QLineEdit() layout.addRow(self.dihedral_angle_label, self.dihedral_angle_text) ################################################################################## ################################################################################## self.taper_ratio_label = QLabel("Taper Ratio") self.taper_ratio_text = QLineEdit() layout.addRow(self.taper_ratio_label, self.taper_ratio_text) ################################################################################## self.wing_profile_label = QLabel("Airfoil Profile") self.wing_profile_combo = QComboBox() self.wing_profile_combo.addItems(airfoil_profiles()) self.wing_profile_selection = None self.wing_profile_combo.currentIndexChanged.connect( self.wing_profile_selectionChanged) layout.addRow(self.wing_profile_label, self.wing_profile_combo) ################################################################################## self.Wing_postion_tlabel = QLabel("Tailplane Leading Edge Position") layout.addWidget(self.Wing_postion_tlabel) self.Wing_postion_x_label = QLabel("X") self.Wing_postion_x_text = QLineEdit() layout.addRow(self.Wing_postion_x_label, self.Wing_postion_x_text) self.Wing_postion_y_label = QLabel("Y") self.Wing_postion_y_text = QLineEdit() layout.addRow(self.Wing_postion_y_label, self.Wing_postion_y_text) self.Wing_postion_z_label = QLabel("Z") self.Wing_postion_z_text = QLineEdit() layout.addRow(self.Wing_postion_z_label, self.Wing_postion_z_text) self.zero_all_text_fields()
from Utils.database.geometry.lifting_database import airfoil_profiles print(airfoil_profiles())
def create_widget(self): layout = self.layout ########################################################################## ################################################################################## self.span_label = QLabel("Span") self.span_text = QLineEdit() layout.addRow(self.span_label, self.span_text) ################################################### ########################################################################## ################################################################################## self.chord_length_label = QLabel("Chord Length") self.chord_length_text = QLineEdit() layout.addRow(self.chord_length_label, self.chord_length_text) ################################################################################## ############################################################################## self.sweep_angle_label = QLabel("Sweep Angle(⁰)") self.sweep_angle_text = QLineEdit() layout.addRow(self.sweep_angle_label, self.sweep_angle_text) ################################################################################## self.twist_angle_label = QLabel("Twist Angle(⁰)") self.twist_angle_text = QLineEdit() layout.addRow(self.twist_angle_label, self.twist_angle_text) ############################################################################### ############################################################################### self.dihedral_angle_label = QLabel("Dihedral Angle(⁰)") self.dihedral_angle_text = QLineEdit() layout.addRow(self.dihedral_angle_label, self.dihedral_angle_text) ################################################################################## ################################################################################## self.taper_ratio_label = QLabel("Taper Ratio") self.taper_ratio_text = QLineEdit() layout.addRow(self.taper_ratio_label, self.taper_ratio_text) ################################################################################## # ########################################################################################## self.wing_profile_label = QLabel("Airfoil Profile") self.wing_profile_combo = QComboBox() self.wing_profile_combo.addItems(airfoil_profiles()) self.wing_profile_selection = None self.wing_profile_combo.currentIndexChanged.connect( self.wing_profile_selectionChanged) self.layout.addRow(self.wing_profile_label, self.wing_profile_combo) ########################################################################################## self.Wing_postion_tlabel = QLabel( "Wing Position(The Reference is ths middle of the center of the fuselage!!" ) layout.addWidget(self.Wing_postion_tlabel) self.Wing_postion_x_label = QLabel("X") self.Wing_postion_x_text = QLineEdit() layout.addRow(self.Wing_postion_x_label, self.Wing_postion_x_text) self.Wing_postion_y_label = QLabel("Y") self.Wing_postion_y_text = QLineEdit() layout.addRow(self.Wing_postion_y_label, self.Wing_postion_y_text) self.Wing_postion_z_label = QLabel("Z") self.Wing_postion_z_text = QLineEdit() layout.addRow(self.Wing_postion_z_label, self.Wing_postion_z_text) self.winglet_vbox = QVBoxLayout() self.winglet_tlabel = QLabel( "Winglet Center Translation(Enter Zero Into all the fields Below If you wont add a winglet)" ) layout.addWidget(self.winglet_tlabel) self.winglet_center_translation_x_label = QLabel("X") self.winglet_center_translation_x_text = QLineEdit() layout.addRow(self.winglet_center_translation_x_label, self.winglet_center_translation_x_text) self.winglet_center_translation_y_label = QLabel("Y") self.winglet_center_translation_y_text = QLineEdit() layout.addRow(self.winglet_center_translation_y_label, self.winglet_center_translation_y_text) self.winglet_center_translation_z_label = QLabel("Z") self.winglet_center_translation_z_text = QLineEdit() layout.addRow(self.winglet_center_translation_z_label, self.winglet_center_translation_z_text) self.winglet_rotation_label = QLabel("Winglet Rotation") self.winglet_rotation_text = QLineEdit() layout.addRow(self.winglet_rotation_label, self.winglet_rotation_text) self.winglet_width_label = QLabel("Winglet Width") self.winglet_width_text = QLineEdit() layout.addRow(self.winglet_width_label, self.winglet_width_text) self.zero_all_text_fields() return layout
def create_widget(self): self.inputArea = QTabWidget() self.layout = QFormLayout() self.wing_profile_label = QLabel("Airfoil") self.wing_profile_combo = QComboBox() self.wing_profile_combo.addItems(airfoil_profiles()) self.wing_profile_combo.currentIndexChanged.connect( self.wing_profile_selectionChanged) self.layout.addRow(self.wing_profile_label, self.wing_profile_combo) self.rotation_label = QLabel("Rotation(XYZ)") self.layout.addRow(self.rotation_label) self.rotation_x_label = QLabel("X") self.rotation_x_text = QLineEdit() self.layout.addRow(self.rotation_x_label, self.rotation_x_text) self.rotation_y_label = QLabel("Y") self.rotation_y_text = QLineEdit() self.layout.addRow(self.rotation_y_label, self.rotation_y_text) self.rotation_z_label = QLabel("Z") self.rotation_z_text = QLineEdit() self.layout.addRow(self.rotation_z_label, self.rotation_z_text) self.typeCheck = QCheckBox("Curve Extrusion") self.typeCheck.toggled.connect(self.surfaceType_Checked) self.layout.addRow(self.typeCheck) self.XZsymmetryCheck = QCheckBox("Mirror Boom About XZ Plane") self.XZsymmetryCheck.toggled.connect(self.xz_mirror_Checked) self.layout.addRow(self.XZsymmetryCheck) self.YZsymmetryCheck = QCheckBox("Mirror Boom About YZ Plane") self.YZsymmetryCheck.toggled.connect(self.yz_mirror_Checked) self.layout.addRow(self.YZsymmetryCheck) self.XYsymmetryCheck = QCheckBox("Mirror Boom About XY Plane") self.XYsymmetryCheck.toggled.connect(self.xy_mirror_Checked) self.layout.addRow(self.XYsymmetryCheck) self.root_le_position_label = QLabel("Root Leading Edge Position") self.layout.addWidget(self.root_le_position_label) self.root_le_position_x_label = QLabel("X") self.root_le_position_x_text = QLineEdit() self.layout.addRow(self.root_le_position_x_label, self.root_le_position_x_text) self.root_le_position_y_label = QLabel("Y") self.root_le_position_y_text = QLineEdit() self.layout.addRow(self.root_le_position_y_label, self.root_le_position_y_text) self.root_le_position_z_label = QLabel("Z") self.root_le_position_z_text = QLineEdit() self.layout.addRow(self.root_le_position_z_label, self.root_le_position_z_text) widget = QWidget() widget.setLayout(self.layout) self.inputArea.addTab(widget, "Design Overview") ################################################################################## self.inputArea.addTab(self.lifting_surface_pane, "Preview") ################################################################################## ################################################################################## self.layout = QFormLayout() self.section_1_label = QLabel("Section 1") self.layout.addRow(self.section_1_label) self.section_1_chord_label = QLabel("Chord Length") self.section_1_chord_text = QLineEdit() self.layout.addRow(self.section_1_chord_label, self.section_1_chord_text) self.section_1_x_label = QLabel("X") self.section_1_x_text = QLineEdit() self.layout.addRow(self.section_1_x_label, self.section_1_x_text) self.section_1_y_label = QLabel("Y") self.section_1_y_text = QLineEdit() self.layout.addRow(self.section_1_y_label, self.section_1_y_text) self.section_1_z_label = QLabel("Z") self.section_1_z_text = QLineEdit() self.layout.addRow(self.section_1_z_label, self.section_1_z_text) self.section_1_twist_label = QLabel("Twist(⁰)") self.section_1_twist_angle_text = QLineEdit() self.layout.addRow(self.section_1_twist_label, self.section_1_twist_angle_text) ############################################################################### widget = QWidget() widget.setLayout(self.layout) self.inputArea.addTab(widget, "Section One") ############################################Y##################################### ################################################################################## ############################################################################## ################################################################################## ################################################################################## self.layout = QFormLayout() self.section_2_label = QLabel("Section 2") self.layout.addRow(self.section_2_label) self.section_2_chord_label = QLabel("Chord Length") self.section_2_chord_text = QLineEdit() self.layout.addRow(self.section_2_chord_label, self.section_2_chord_text) self.section_2_x_label = QLabel("X") self.section_2_x_text = QLineEdit() self.layout.addRow(self.section_2_x_label, self.section_2_x_text) self.section_2_y_label = QLabel("Y") self.section_2_y_text = QLineEdit() self.layout.addRow(self.section_2_y_label, self.section_2_y_text) self.section_2_z_label = QLabel("Z") self.section_2_z_text = QLineEdit() self.layout.addRow(self.section_2_z_label, self.section_2_z_text) self.section_2_twist_label = QLabel("Twist(⁰)") self.section_2_twist_angle_text = QLineEdit() self.layout.addRow(self.section_2_twist_label, self.section_2_twist_angle_text) widget = QWidget() widget.setLayout(self.layout) self.inputArea.addTab(widget, "Section Two") ############################################################################### ################################################################################## ################################################################################## self.layout = QFormLayout() self.section_3_label = QLabel("Section 3") self.layout.addRow(self.section_3_label) self.section_3_chord_label = QLabel("Chord Length") self.section_3_chord_text = QLineEdit() self.layout.addRow(self.section_3_chord_label, self.section_3_chord_text) self.section_3_x_label = QLabel("X") self.section_3_x_text = QLineEdit() self.layout.addRow(self.section_3_x_label, self.section_3_x_text) self.section_3_y_label = QLabel("Y") self.section_3_y_text = QLineEdit() self.layout.addRow(self.section_3_y_label, self.section_3_y_text) self.section_3_z_label = QLabel("Z") self.section_3_z_text = QLineEdit() self.layout.addRow(self.section_3_z_label, self.section_3_z_text) self.section_3_twist_label = QLabel("Twist(⁰)") self.section_3_twist_angle_text = QLineEdit() self.layout.addRow(self.section_3_twist_label, self.section_3_twist_angle_text) widget = QWidget() widget.setLayout(self.layout) self.inputArea.addTab(widget, "Section Three") ############################################################################### ################################################################################## ################################################################################## ################################################################################## self.layout = QFormLayout() self.section_4_label = QLabel("Section 4") self.layout.addRow(self.section_4_label) self.section_4_chord_label = QLabel("Chord Length") self.section_4_chord_text = QLineEdit() self.layout.addRow(self.section_4_chord_label, self.section_4_chord_text) self.section_4_x_label = QLabel("X") self.section_4_x_text = QLineEdit() self.layout.addRow(self.section_4_x_label, self.section_4_x_text) self.section_4_y_label = QLabel("Y") self.section_4_y_text = QLineEdit() self.layout.addRow(self.section_4_y_label, self.section_4_y_text) self.section_4_z_label = QLabel("Z") self.section_4_z_text = QLineEdit() self.layout.addRow(self.section_4_z_label, self.section_4_z_text) self.section_4_twist_label = QLabel("Twist(⁰)") self.section_4_twist_angle_text = QLineEdit() self.layout.addRow(self.section_4_twist_label, self.section_4_twist_angle_text) widget = QWidget() widget.setLayout(self.layout) self.inputArea.addTab(widget, "Section Four") ############################################################################### ################################################################################## ################################################################################## self.layout = QFormLayout() self.section_5_label = QLabel("Section 5") self.layout.addRow(self.section_5_label) self.section_5_chord_label = QLabel("Chord Length") self.section_5_chord_text = QLineEdit() self.layout.addRow(self.section_5_chord_label, self.section_5_chord_text) self.section_5_x_label = QLabel("X") self.section_5_x_text = QLineEdit() self.layout.addRow(self.section_5_x_label, self.section_5_x_text) self.section_5_y_label = QLabel("Y") self.section_5_y_text = QLineEdit() self.layout.addRow(self.section_5_y_label, self.section_5_y_text) self.section_5_z_label = QLabel("Z") self.section_5_z_text = QLineEdit() self.layout.addRow(self.section_5_z_label, self.section_5_z_text) self.section_5_twist_label = QLabel("Twist(⁰)") self.section_5_twist_angle_text = QLineEdit() self.layout.addRow(self.section_5_twist_label, self.section_5_twist_angle_text) widget = QWidget() widget.setLayout(self.layout) self.inputArea.addTab(widget, "Section Five") ############################################################################### # ########################################################################################## ########################################################################################## self.zero_all_text_fields() self.layout = QFormLayout() self.layout.addRow(self.inputArea) return self.layout
def show_default_values(self, name="", profile_=airfoil_profiles()[0], surfaceType_=False, rot_x_=0, rot_y_=0, rot_z_=0, xz_mirror_=False, xy_mirror_=False, yz_mirror_=False, root_le_pos_x_=0, root_le_pos_y_=0, root_le_pos_z_=0, section_1_x_=0, section_2_x_=0, section_3_x_=0, section_4_x_=0, section_5_x_=0, section_1_y_=0, section_2_y_=0, section_3_y_=0, section_4_y_=0, section_5_y_=0, section_1_z_=0, section_2_z_=0, section_3_z_=0, section_4_z_=0, section_5_z_=0, section_1_chord_=0, section_2_chord_=0, section_3_chord_=0, section_4_chord_=0, section_5_chord_=0, section_1_twist_angle_=0, section_2_twist_angle_=0, section_3_twist_angle_=0, section_4_twist_angle_=0, section_5_twist_angle_=0): self.root_le_position_x_text.setText(str(root_le_pos_x_)) self.root_le_position_y_text.setText(str(root_le_pos_y_)) self.root_le_position_z_text.setText(str(root_le_pos_z_)) self.XYsymmetryCheck.setChecked(xy_mirror_) self.xy_mirror_ = xy_mirror_ if surfaceType_ is None: self.typeCheck.setChecked(False) self.surface_curve_type_ = False else: self.typeCheck.setChecked(surfaceType_) self.surface_curve_type_ = surfaceType_ self.XZsymmetryCheck.setChecked(xz_mirror_) self.xz_mirror_ = xz_mirror_ self.wing_profile_combo.setCurrentIndex( airfoil_profiles().index(profile_) if profile_ is not None else 1) self.YZsymmetryCheck.setChecked(yz_mirror_) self.yz_mirror_ = yz_mirror_ self.rotation_x_text.setText(str(rot_x_)) self.rotation_y_text.setText(str(rot_y_)) self.rotation_z_text.setText(str(rot_z_)) self.section_1_x_text.setText(str(section_1_x_)) self.section_1_y_text.setText(str(section_1_y_)) self.section_1_z_text.setText(str(section_1_z_)) self.section_1_chord_text.setText(str(section_1_chord_)) self.section_1_twist_angle_text.setText(str(section_1_twist_angle_)) self.section_2_x_text.setText(str(section_2_x_)) self.section_2_y_text.setText(str(section_2_y_)) self.section_2_z_text.setText(str(section_2_z_)) self.section_2_chord_text.setText(str(section_2_chord_)) self.section_2_twist_angle_text.setText(str(section_2_twist_angle_)) self.section_3_x_text.setText(str(section_3_x_)) self.section_3_y_text.setText(str(section_3_y_)) self.section_3_z_text.setText(str(section_3_z_)) self.section_3_chord_text.setText(str(section_3_chord_)) self.section_3_twist_angle_text.setText(str(section_3_twist_angle_)) self.section_4_x_text.setText(str(section_4_x_)) self.section_4_y_text.setText(str(section_4_y_)) self.section_4_z_text.setText(str(section_4_z_)) self.section_4_chord_text.setText(str(section_4_chord_)) self.section_4_twist_angle_text.setText(str(section_4_twist_angle_)) self.section_5_x_text.setText(str(section_5_x_)) self.section_5_y_text.setText(str(section_5_y_)) self.section_5_z_text.setText(str(section_5_z_)) self.section_5_chord_text.setText(str(section_5_chord_)) self.section_5_twist_angle_text.setText(str(section_5_twist_angle_))