当前位置: 首页>>代码示例>>Python>>正文


Python Qt4_create_task_base.CreateTaskBase类代码示例

本文整理汇总了Python中Qt4_create_task_base.CreateTaskBase的典型用法代码示例。如果您正苦于以下问题:Python CreateTaskBase类的具体用法?Python CreateTaskBase怎么用?Python CreateTaskBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CreateTaskBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: single_item_selection

    def single_item_selection(self, tree_item):
        """
        Descript. :
        """
        CreateTaskBase.single_item_selection(self, tree_item)
        escan_model = tree_item.get_model()

        if isinstance(tree_item, Qt4_queue_item.EnergyScanQueueItem):
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            if escan_model.get_path_template():
                self._path_template = escan_model.get_path_template()

            self._data_path_widget.update_data_model(self._path_template)

            # -----------------------------------------------------------------
            # LNLS
            self._periodic_table_widget.set_current_element_edge(\
                 tree_item.get_model().element_symbol,
                 tree_item.get_model().edge)
            # -----------------------------------------------------------------
        elif not(isinstance(tree_item, Qt4_queue_item.SampleQueueItem) or \
                     isinstance(tree_item, Qt4_queue_item.DataCollectionGroupQueueItem)):
            self.setDisabled(True)
开发者ID:douglasbeniz,项目名称:mxcube,代码行数:27,代码来源:Qt4_create_energy_scan_widget.py

示例2: single_item_selection

    def single_item_selection(self, tree_item):
        """
        Descript. :
        """

        CreateTaskBase.single_item_selection(self, tree_item)
        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            self._init_models()
            self._acq_widget.update_data_model(self._acquisition_parameters, self._path_template)
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.AdvancedQueueItem):
            advanced = tree_item.get_model()
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            # sample_data_model = self.get_sample_item(tree_item).get_model()
            # self._acq_widget.disable_inverse_beam(True)

            self._path_template = advanced.get_path_template()
            self._data_path_widget.update_data_model(self._path_template)

            data_collection = advanced.reference_image_collection

            self._acquisition_parameters = data_collection.acquisitions[0].acquisition_parameters
            self._acq_widget.update_data_model(self._acquisition_parameters, self._path_template)
            self.get_acquisition_widget().use_osc_start(True)
        else:
            self.setDisabled(True)
开发者ID:JieNanMAXIV,项目名称:mxcube,代码行数:31,代码来源:Qt4_create_advanced_widget.py

示例3: __init__

    def __init__(self, parent=None, name=None, fl=0):
        CreateTaskBase.__init__(self, parent, name, fl, "Helical")

        if not name:
            self.setObjectName("create_helical_widget")
        self.init_models()

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
        self._lines_map = {}

        # Graphic elements ----------------------------------------------------
        self._lines_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__), "ui_files/Qt4_helical_line_widget_layout.ui")
        )

        self._acq_widget = AcquisitionWidget(
            self,
            "acquisition_widget",
            layout="vertical",
            acq_params=self._acquisition_parameters,
            path_template=self._path_template,
        )

        self._data_path_widget = DataPathWidget(
            self, "create_dc_path_widget", data_model=self._path_template, layout="vertical"
        )

        self._processing_widget = ProcessingWidget(self, data_model=self._processing_parameters)

        # Layout --------------------------------------------------------------
        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(self._lines_widget)
        _main_vlayout.addWidget(self._acq_widget)
        _main_vlayout.addWidget(self._data_path_widget)
        _main_vlayout.addWidget(self._processing_widget)
        _main_vlayout.addStretch(0)
        _main_vlayout.setSpacing(2)
        _main_vlayout.setContentsMargins(0, 0, 0, 0)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self._lines_widget.lines_treewidget.itemSelectionChanged.connect(self.lines_treewidget_selection_changed)
        self._lines_widget.create_line_button.clicked.connect(self.create_line_button_clicked)
        self._lines_widget.remove_line_button.clicked.connect(self.remove_line_button_clicked)

        self._data_path_widget.data_path_layout.prefix_ledit.textChanged.connect(self._prefix_ledit_change)
        self._data_path_widget.data_path_layout.run_number_ledit.textChanged.connect(self._run_number_ledit_change)
        self._data_path_widget.pathTemplateChangedSignal.connect(self.handle_path_conflict)

        self._acq_widget.madEnergySelectedSignal.connect(self.mad_energy_selected)
        self._acq_widget.acqParametersChangedSignal.connect(self.handle_path_conflict)

        self._processing_widget.enableProcessingSignal.connect(self._enable_processing_toggled)

        # Other ---------------------------------------------------------------
        for col in range(self._lines_widget.lines_treewidget.columnCount()):
            self._lines_widget.lines_treewidget.resizeColumnToContents(col)
开发者ID:hzb-mx,项目名称:mxcube,代码行数:60,代码来源:Qt4_create_helical_widget.py

示例4: init_models

 def init_models(self):
     CreateTaskBase.init_models(self)
     self.xrf_spectrum_model = queue_model_objects.XRFSpectrum()
     self._path_template.start_num = 1
     self._path_template.num_files = 1
     self._path_template.suffix = 'raw'
     self._path_template.compression = False
开发者ID:MartinSavko,项目名称:mxcube,代码行数:7,代码来源:Qt4_create_xrf_spectrum_widget.py

示例5: single_item_selection

    def single_item_selection(self, tree_item):
        """
        Descript. :
        """
        CreateTaskBase.single_item_selection(self, tree_item)
        self.setDisabled(True)

        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.XrayImagingQueueItem):
            data_model= tree_item.get_model()

            self._path_template = data_model.get_path_template()
            self._data_path_widget.update_data_model(self._path_template)

            self._acquisition_parameters = data_model.acquisition.acquisition_parameters
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                               self._path_template)

            self._xray_imaging_parameters = data_model.xray_imaging_parameters
            self._xray_imaging_parameters_widget.update_data_model(data_model)
    

            self.setDisabled(False)
开发者ID:vrey01,项目名称:mxcube,代码行数:26,代码来源:Qt4_create_xray_imaging_widget.py

示例6: init_models

 def init_models(self):
     """
     Descript. :
     """
     CreateTaskBase.init_models(self)
     self._energy_scan_result = queue_model_objects.EnergyScanResult()
     self._processing_parameters = queue_model_objects.ProcessingParameters()
开发者ID:milanprica,项目名称:mxcube,代码行数:7,代码来源:Qt4_create_discrete_widget.py

示例7: __init__

    def __init__(self, parent = None,name = None, fl = 0):
        """
        Descript. :
        """
 
        CreateTaskBase.__init__(self, parent, name, fl, 'Energy scan')

        if not name:
            self.setObjectName("create_energy_scan_widget")

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._periodic_table_widget = PeriodicTableWidget(self)
        self._data_path_widget = DataPathWidget(self, 
             data_model = self._path_template, layout = 'vertical')

        # Layout --------------------------------------------------------------
        self.main_layout = QtGui.QVBoxLayout(self)
        self.main_layout.addWidget(self._periodic_table_widget)
        self.main_layout.addWidget(self._data_path_widget)
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.main_layout.setSpacing(6)
        self.main_layout.addStretch(10)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self._periodic_table_widget.elementEdgeSelectedSignal.\
             connect(self.acq_parameters_changed)
        self._data_path_widget.pathTemplateChangedSignal.\
             connect(self.acq_parameters_changed)
开发者ID:milanprica,项目名称:mxcube,代码行数:35,代码来源:Qt4_create_energy_scan_widget.py

示例8: single_item_selection

    def single_item_selection(self, tree_item):
        """
        Descript. :
        """
        CreateTaskBase.single_item_selection(self, tree_item)
        if isinstance(tree_item, Qt4_queue_item.SampleQueueItem):
            self._init_models()
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                                self._path_template)            
        elif isinstance(tree_item, Qt4_queue_item.BasketQueueItem):
            self.setDisabled(False)
        elif isinstance(tree_item, Qt4_queue_item.DataCollectionQueueItem):
            data_collection = tree_item.get_model()
            if tree_item.get_model().is_executed():
                self.setDisabled(True)
            else:
                self.setDisabled(False)

            # sample_data_model = self.get_sample_item(tree_item).get_model()
            #self._acq_widget.disable_inverse_beam(True)
            #self._graphics_manager_hwobj.de_select_all()
            self._graphics_manager_hwobj.select_shape(data_collection.grid)

            self._path_template = data_collection.get_path_template()
            self._data_path_widget.update_data_model(self._path_template)

            self._acquisition_parameters = data_collection.acquisitions[0].\
                                           acquisition_parameters
            self._acq_widget.update_data_model(self._acquisition_parameters,
                                               self._path_template)
            self.get_acquisition_widget().use_osc_start(True)
        else:
            self.setDisabled(True)
开发者ID:jordiandreu,项目名称:mxcube,代码行数:33,代码来源:Qt4_create_advanced_widget.py

示例9: __init__

    def __init__(self, parent=None,name=None, fl=0):
        """
        Descript. :
        """
 
        CreateTaskBase.__init__(self, parent, name, fl, 'Energy scan')

        if not name:
            self.setObjectName("create_energy_scan_widget")

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._periodic_table_widget = PeriodicTableWidget(self)
        self._data_path_widget = DataPathWidget(self, 
             data_model = self._path_template, layout = 'vertical')

        _parameters_gbox = QGroupBox('Parameters', self)
        self._adjust_transmission_cbox = QCheckBox(\
             "Adjust transmission", _parameters_gbox)
        self._adjust_transmission_cbox.setChecked(False)
        self._adjust_transmission_cbox.setEnabled(True)
        self._max_transmission_label = QLabel("Maximum transmission:")
        self._max_transmission_ledit = QLineEdit("20", _parameters_gbox)
        self._max_transmission_ledit.setFixedWidth(80)
        self._max_transmission_ledit.setEnabled(False)

        # Layout --------------------------------------------------------------
        _parameters_gbox_hlayout = QGridLayout(_parameters_gbox)
        _parameters_gbox_hlayout.addWidget(self._adjust_transmission_cbox, 0, 0)
        _parameters_gbox_hlayout.addWidget(self._max_transmission_label, 1, 0) 
        _parameters_gbox_hlayout.addWidget(self._max_transmission_ledit, 1, 1)
        _parameters_gbox_hlayout.setColumnStretch(2, 1)
        _parameters_gbox_hlayout.setSpacing(2)

        _main_vlayout = QVBoxLayout(self)
        _main_vlayout.addWidget(self._periodic_table_widget)
        _main_vlayout.addWidget(self._data_path_widget)
        _main_vlayout.addWidget(_parameters_gbox)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        _main_vlayout.setSpacing(6)
        _main_vlayout.addStretch(10)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        #self._periodic_table_widget.elementEdgeSelectedSignal.connect(\
        #     self.acq_parameters_changed)
        self._data_path_widget.pathTemplateChangedSignal.connect(\
             self.path_template_changed)
        self._adjust_transmission_cbox.stateChanged.connect(\
             self.adjust_transmission_state_changed)
        self._max_transmission_ledit.textEdited.connect(\
             self.max_transmission_value_changed)

        self._data_path_widget.data_path_layout.compression_cbox.setVisible(False)
开发者ID:vrey01,项目名称:mxcube,代码行数:59,代码来源:Qt4_create_energy_scan_widget.py

示例10: init_models

 def init_models(self):
     """
     Descript. :
     """
     CreateTaskBase.init_models(self)
     self.enery_scan = queue_model_objects.EnergyScan()
     self._path_template.start_num = 1
     self._path_template.num_files = 1
     self._path_template.suffix = 'raw'
开发者ID:douglasbeniz,项目名称:mxcube,代码行数:9,代码来源:Qt4_create_energy_scan_widget.py

示例11: set_beamline_setup

    def set_beamline_setup(self, bl_setup_hwobj):
        """
        In plate mode osciallation is start is in the middle of grid
        """
        CreateTaskBase.set_beamline_setup(self, bl_setup_hwobj)

        if bl_setup_hwobj.diffractometer_hwobj.in_plate_mode():
            self._acq_widget.acq_widget_layout.osc_start_label.\
                 setText("Oscillation middle:")
开发者ID:jordiandreu,项目名称:mxcube,代码行数:9,代码来源:Qt4_create_advanced_widget.py

示例12: __init__

    def __init__(self, parent = None, name = None, fl = 0):
        CreateTaskBase.__init__(self, parent, name, QtCore.Qt.WindowFlags(fl), 'XRF-scan')
 
        if name is not None:
            self.setObjectName(name)

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
	self.count_time = None

        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._data_path_gbox = QtGui.QGroupBox('Data location', self)
        self._data_path_widget = DataPathWidget(self._data_path_gbox, 
                                               data_model = self._path_template,
                                               layout = 'vertical')

	_parameters_gbox = QtGui.QGroupBox('Parameters', self)
	_count_time_label = QtGui.QLabel("Count time (sec.):", _parameters_gbox)
	self.count_time_ledit = QtGui.QLineEdit("1", _parameters_gbox)
        self.count_time_ledit.setMaximumWidth(75)

        # Layout --------------------------------------------------------------
        self._data_path_gbox_vlayout = QtGui.QVBoxLayout(self)
        self._data_path_gbox_vlayout.addWidget(self._data_path_widget)
        self._data_path_gbox_vlayout.setSpacing(0)
        self._data_path_gbox_vlayout.setContentsMargins(0, 0, 0, 0)
        self._data_path_gbox.setLayout(self._data_path_gbox_vlayout)

        _parameters_gbox_hlayout = QtGui.QHBoxLayout(self)
        _parameters_gbox_hlayout.addWidget(_count_time_label)
        _parameters_gbox_hlayout.addWidget(self.count_time_ledit)
        _parameters_gbox_hlayout.addStretch(0)
        _parameters_gbox_hlayout.setSpacing(2)
        _parameters_gbox_hlayout.setContentsMargins(0, 0, 0, 0)
        _parameters_gbox.setLayout(_parameters_gbox_hlayout)

        _main_vlayout = QtGui.QVBoxLayout(self)
	_main_vlayout.addWidget(self._data_path_gbox)
	_main_vlayout.addWidget(_parameters_gbox)
        _main_vlayout.setSpacing(2)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        _main_vlayout.addStretch(0)
        self.setLayout(_main_vlayout)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self._data_path_widget.data_path_layout.run_number_ledit.textChanged.\
             connect(self._run_number_ledit_change)
        
        self.connect(self._data_path_widget,
                     QtCore.SIGNAL("pathTemplateChanged"),
                     self.handle_path_conflict)
开发者ID:olofsvensson,项目名称:mxcube,代码行数:56,代码来源:Qt4_create_xrf_scan_widget.py

示例13: __init__

    def __init__(self, parent=None, name=None, fl=0):
        """
        Descript. :
        """

        CreateTaskBase.__init__(self, parent, name, 
            QtCore.Qt.WindowFlags(fl), "Standart")

        if not name:
            self.setObjectName("create_discrete_widget")
        self.init_models()

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
        self.previous_energy = None
        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._acq_widget =  AcquisitionWidget(self, "acquisition_widget",
             layout='vertical', acq_params=self._acquisition_parameters,
             path_template=self._path_template)

        self._data_path_widget = DataPathWidget(self, 'create_dc_path_widget',
            data_model=self._path_template, layout='vertical')

        self._processing_widget = ProcessingWidget(self,
             data_model=self._processing_parameters)
       
        # Layout --------------------------------------------------------------
        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(self._acq_widget)
        _main_vlayout.addWidget(self._data_path_widget)
        _main_vlayout.addWidget(self._processing_widget)
        _main_vlayout.addStretch(0)
        _main_vlayout.setSpacing(2)
        _main_vlayout.setContentsMargins(0,0,0,0)

        # SizePolicies --------------------------------------------------------
        
        # Qt signal/slot connections ------------------------------------------
        self._acq_widget.acqParametersChangedSignal.\
             connect(self.acq_parameters_changed)
        self._data_path_widget.pathTemplateChangedSignal.\
             connect(self.acq_parameters_changed)

        self._acq_widget.madEnergySelectedSignal.connect(\
             self.mad_energy_selected)
        self._processing_widget.enableProcessingSignal.connect(\
             self._run_processing_toggled)

        # Other ---------------------------------------------------------------
        self._processing_widget.processing_widget.\
             run_processing_parallel_cbox.hide()
开发者ID:milanprica,项目名称:mxcube,代码行数:54,代码来源:Qt4_create_discrete_widget.py

示例14: __init__

    def __init__(self, parent = None, name = None, fl = 0):
        CreateTaskBase.__init__(self, parent, name, 
            Qt.WindowFlags(fl), 'XRF spectrum')
 
        if name is not None:
            self.setObjectName(name)

        # Hardware objects ----------------------------------------------------

        # Internal variables --------------------------------------------------
        self.count_time = None

        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._data_path_widget = DataPathWidget(self, 
             data_model = self._path_template, layout = 'vertical')

        _parameters_gbox = QGroupBox('Parameters', self)
        _count_time_label = QLabel("Count time (sec.):", _parameters_gbox)
        self.count_time_ledit = QLineEdit("1", _parameters_gbox)
        #self.count_time_ledit.setMaximumWidth(75)
        self.adjust_transmission_cbox = QCheckBox(\
             "Adjust transmission", _parameters_gbox)
        self.adjust_transmission_cbox.setChecked(True)
        

        # Layout --------------------------------------------------------------
        _parameters_gbox_hlayout = QHBoxLayout(_parameters_gbox)
        _parameters_gbox_hlayout.addWidget(_count_time_label)
        _parameters_gbox_hlayout.addWidget(self.count_time_ledit) 
        _parameters_gbox_hlayout.addWidget(self.adjust_transmission_cbox)
        _parameters_gbox_hlayout.addStretch(0)
        _parameters_gbox_hlayout.setSpacing(2)
        _parameters_gbox_hlayout.setContentsMargins(0, 0, 0, 0)

        _main_vlayout = QVBoxLayout(self)
        _main_vlayout.addWidget(self._data_path_widget)
        _main_vlayout.addWidget(_parameters_gbox)
        _main_vlayout.setSpacing(6)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        _main_vlayout.addStretch(0)

        # SizePolicies --------------------------------------------------------

        # Qt signal/slot connections ------------------------------------------
        self._data_path_widget.pathTemplateChangedSignal.\
             connect(self.path_template_changed)
        self.adjust_transmission_cbox.stateChanged.connect(\
             self.adjust_transmission_state_changed)

        # Other ---------------------------------------------------------------
        self._data_path_widget.data_path_layout.compression_cbox.setVisible(False)
开发者ID:vrey01,项目名称:mxcube,代码行数:53,代码来源:Qt4_create_xrf_spectrum_widget.py

示例15: init_models

    def init_models(self):
        """
        Descript. :
        """
        CreateTaskBase.init_models(self)

        self._xray_imaging_parameters = queue_model_objects.XrayImagingParameters()

        if self._beamline_setup_hwobj is not None:
            self._acquisition_parameters = self._beamline_setup_hwobj.\
                get_default_acquisition_parameters("default_imaging_values")
            self._path_template.suffix = 'tiff'
开发者ID:vrey01,项目名称:mxcube,代码行数:12,代码来源:Qt4_create_xray_imaging_widget.py


注:本文中的Qt4_create_task_base.CreateTaskBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。