def generate_control_surfaces(config=None):
    lofts = {}
    try:
        surface_list = read_control_surface_objects()
        for surface in surface_list:
            lofts.update(
                control_surface_model(name=surface,
                                      config=config,
                                      part_loft=None).get_surface_loft())
    except:
        pass
    try:
        try:
            surface_list = read_control_surface_objects()
            loft_table = update_surface_3d(config)
            for surface in surface_list:
                for name, loft in loft_table.items():
                    if name == get_parent_name(surface):
                        lofts.update({
                            name:
                            control_surface_model(
                                name=surface, config=config,
                                part_loft=loft).get_wing_loft()
                        })
        except:
            lofts = update_surface_3d(config)
    except:
        pass
    return lofts
Example #2
0
 def load_surfaces(self):
     try:
         surface_list = read_control_surface_objects()
         if len(surface_list) == 0:
             self.new_surfaces()
         else:
             for l in surface_list:
                 self.surfaca_tab_ = control_surface_tab(l)
                 self.surfaces.append(self.surfaca_tab_)
                 self.inputArea.addTab(self.surfaca_tab_, l)
                 self.indexes.append(l)
     except :
         self.new_surfaces()
    def __init__(self):
        super().__init__()

        self.selection_ = None
        self.layout = QFormLayout(self)

        self.itemsComboBox = QComboBox()
        self.itemsComboBox.addItems(read_control_surface_objects())
        self.itemsComboBox.currentIndexChanged.connect(self.selectionChanged)
        self.layout.addRow(self.itemsComboBox)
        self.buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)
        self.layout.addRow(self.buttons)
        self.setLayout(self.layout)
def update_control_surfaces(config=None, res=None):
    if res is None:
        res = []
    lofts = {}
    surface_list = read_control_surface_objects()
    loft_table = res[1]
    try:
        for surface in surface_list:
            for name, loft in loft_table.items():
                if name == get_parent_name(surface):
                    lofts.update({
                        name:
                        control_surface_model(
                            name=surface, config=config,
                            part_loft=loft).get_current_loft()
                    })
    except:
        pass
    return lofts
 def accept_inputs(self):
     if self.selection_ is None:
         self.selection_ = read_control_surface_objects()[
             self.itemsComboBox.currentIndex()]
     return (self.selection_)
 def selectionChanged(self, i):
     self.selection_ = read_control_surface_objects()[i]