コード例 #1
0
 def _get_tab_cont_for_section(self, section):
     tab_container = ControlEmptyWidget()
     tab_container.value = \
         SingleTabWidget(
             su2_cfg_obj=self.su2_cfg_obj, des_sect_name=section,
             tabs_ctrl=self)
     return tab_container
コード例 #2
0
    def _set_srfs_loader(self):
        """
        Setter for surface loader button
        Returns
        -------
        ControlButton

        """

        # self, su2_cfg_obj: SU2Config,
        # surf_loader_but_label: str = 'Load surfaces from su2 mesh',
        # msh_prsng_params_pth: str = 'su2_msh_parsing_params.yaml'

        _srfs_load_butt = \
            SurfLoader(
                su2_cfg_obj=self.su2_cfg_obj,
                surf_loader_but_label='Load surfaces from su2 mesh',
                msh_prsng_params_pth=self.msh_prsng_params_pth)

        load_butt_cont = ControlEmptyWidget()
        load_butt_cont.value = _srfs_load_butt

        # print(type(_srfs_load_butt))
        # print(isinstance(_srfs_load_butt, ControlButton))
        self.ctrld_tab._srfs_load_butt_cont = load_butt_cont  # load_butt_cont
コード例 #3
0
    def _set_new_param_setter(self):
        """
        Sets a button which spawns new parameter creation dialog
        Returns
        -------

        """
        cpc = ConfigParamCreatorButt(su2_cfg_obj=self.su2_cfg_obj,
                                     des_cfg_section=self.fxd_des_section_name,
                                     tabs_ctrl=self.tabs_ctrl)

        cpc_cont = ControlEmptyWidget()
        cpc_cont.value = cpc

        self.ctrld_tab._cfg_param_creator = cpc_cont
コード例 #4
0
    def _get_container_for_widget(self, widget=None):
        """Getter for widget container"""
        container = \
            ControlEmptyWidget(label='Container label')
        if widget is not None:
            container.value = \
                widget

            if isinstance(widget, Iterable):
                sample_widget = widget[0]
                self._set_container_size(container, sample_widget)
            else:
                self._set_container_size(container, widget)

        return container
コード例 #5
0
    def _get_param_ctrl_cont(
            self,
            param_label: str,
            param_ctrl: ControlBase,
            srf_sel_button: ControlButton
        or None = None) -> ControlEmptyWidget:
        """
        Getter for entire 'param ensemble': label, control and on-off param
        edit toogle

        Parameters
        ----------
        param_label: ControlLabel
            control with param label
        param_ctrl: Control Base
            param control

        Returns
        -------
        ControlBaseWidget
            container with entire param control assembly

        """
        param_chckbox = self._get_param_ctrl_toogle(param_ctrl)
        curr_ctrl_groupbox = QGroupBox(param_label)
        self._set_grpbx_stylesheet(curr_ctrl_groupbox)

        vert_layout = QVBoxLayout(curr_ctrl_groupbox)
        first_grpbx_row = QHBoxLayout()
        param_ctrl.form.setMinimumWidth(200)
        param_ctrl.form.setMaximumWidth(200)
        first_grpbx_row.addWidget(param_ctrl.form)
        first_grpbx_row.addWidget(param_chckbox._form)

        vert_layout.addLayout(first_grpbx_row)
        if srf_sel_button is not None:
            srf_sel_button_cont = ControlEmptyWidget()
            srf_sel_button_cont.value = srf_sel_button
            vert_layout.addWidget(srf_sel_button_cont.form)

        curr_ctrl_cont = ControlEmptyWidget()

        curr_ctrl_cont._param_chckbox = param_chckbox
        curr_ctrl_cont.form.layout().addWidget(curr_ctrl_groupbox)  # curr_w

        return curr_ctrl_cont
コード例 #6
0
    def _set_sect_creat_btn(self):
        # su2_cfg_obj: SU2Config = SU2Config(),
        #             tabs_ctrl

        tabs_ctrl = CFGSectionSelWidgetCtrl.ctrld_tabs_w.vert_tab_w_ctrl
        # print('CFGSectionSelWidgetCtrl tabs_ctrl')
        # print(tabs_ctrl)
        # input('CFGSectionSelWidgetCtrl tabs_ctrl')

        self.sect_creat_btn = \
            CFGSectionCreatorButton(
                su2_cfg_obj=self.su2_cfg_obj,
                tabs_ctrl=CFGSectionSelWidgetCtrl.ctrld_tabs_w.vert_tab_w_ctrl,
                sections_list=CFGSectionSelWidgetCtrl.ctrld_widget.sections_chckbox_list)

        btn_cont = ControlEmptyWidget()
        btn_cont.value = self.sect_creat_btn

        CFGSectionSelWidgetCtrl.ctrld_widget.sect_creat_btn = btn_cont
        # self.sect_creat_btn
        pass