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("Qt4_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._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.acqParametersChangedSignal.connect(\
             self.handle_path_conflict)
        self._acq_widget.madEnergySelectedSignal.connect(\
             self.mad_energy_selected)
        self._processing_widget.enableProcessingSignal.connect(\
             self._enable_processing_toggled)
    def __init__(self, parent=None, name=None, fl=0):
        """
        Descript. :
        """

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

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

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

        # Internal variables --------------------------------------------------
        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 = 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(6)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)

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

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

        self._acq_widget.madEnergySelectedSignal.connect(\
             self.mad_energy_selected)
        self._processing_widget.enableProcessingSignal.connect(\
             self._run_processing_toggled)
        self._acq_widget.acq_widget_layout.set_max_osc_range_button.clicked.\
             connect(self.set_max_osc_total_range_clicked)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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 = 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 = 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(6)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)

        # 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.create_auto_line_button.clicked.connect(\
             self.create_auto_line_button_clicked)
        self._lines_widget.remove_line_button.clicked.connect(\
             self.remove_line_button_clicked)
        self._lines_widget.overlay_cbox.stateChanged.connect(\
             self.overlay_toggled)
        self._lines_widget.overlay_slider.valueChanged.connect(\
             self.overlay_alpha_changed)
        self._lines_widget.swap_points_button.clicked.connect(\
             self.swap_points_clicked)

        self._acq_widget.acqParametersChangedSignal.\
             connect(self.acq_parameters_changed)
        self._acq_widget.madEnergySelectedSignal.connect(\
             self.mad_energy_selected)
        self._acq_widget.acq_widget_layout.set_max_osc_range_button.clicked.\
             connect(self.set_max_osc_total_range_clicked)

        self._data_path_widget.pathTemplateChangedSignal.\
             connect(self.path_template_changed)

        self._processing_widget.enableProcessingSignal.connect(\
             self._run_processing_toggled)

        # Other ---------------------------------------------------------------
        for col in range(self._lines_widget.lines_treewidget.columnCount()):
            self._lines_widget.lines_treewidget.resizeColumnToContents(col)
        #self._processing_widget.processing_widget.\
        #     run_processing_parallel_cbox.setChecked(False)

        self.enable_widgets(False)
Esempio n. 5
0
    def __init__(self, parent=None, name=None, fl=0):
        CreateTaskBase.__init__(self, parent, name, fl, 'Helical')

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

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

        # Internal variables --------------------------------------------------
        self.init_models()
        self._prev_pos = None
        self._current_pos = None
        self._list_item_map = {}
        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._lines_gbox = QtGui.QGroupBox('Lines', self)
        self._lines_list_widget = QtGui.QListWidget(self._lines_gbox)
        self._lines_list_widget.setFixedWidth(300)
        self._lines_list_widget.setFixedHeight(100)
        self._lines_list_widget.setToolTip(\
             "Select the line(s) to perfrom helical scan on")

        add_button = QtGui.QPushButton("+", self._lines_gbox)
        add_button.setFixedWidth(20)
        add_button.setFixedHeight(20)
        remove_button = QtGui.QPushButton("-", self._lines_gbox)
        remove_button.setFixedWidth(20)
        remove_button.setFixedHeight(20)

        add_button_tool_tip = "Add a line between two saved positions, " \
                              "CTRL click to select more than one position"
        add_button.setToolTip(add_button_tool_tip)
        remove_button_tool_tip = "Remove selected line(s)"
        remove_button.setToolTip(remove_button_tool_tip)

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

        self._data_path_gbox = QtGui.QGroupBox('Data location', self)
        self._data_path_widget = \
            DataPathWidget(self._data_path_gbox,
                           'create_dc_path_widget',
                           data_model=self._path_template,
                           layout='vertical')

        self._processing_gbox = QtGui.QGroupBox('Processing', self)
        self._processing_gbox.setObjectName('processing_gbox')
        self._processing_widget = \
            ProcessingWidget(self._processing_gbox,
                             data_model=self._processing_parameters)

        # Layout --------------------------------------------------------------
        _lines_gbox_gridlayout = QtGui.QGridLayout(self)
        _lines_gbox_gridlayout.addWidget(self._lines_list_widget, 0, 0, 2, 1)
        _lines_gbox_gridlayout.addWidget(add_button, 0, 1)
        _lines_gbox_gridlayout.addWidget(remove_button, 1, 1)
        _lines_gbox_gridlayout.setSpacing(2)
        _lines_gbox_gridlayout.setColumnStretch(2, 10)
        _lines_gbox_gridlayout.setContentsMargins(2, 2, 2, 2)
        self._lines_gbox.setLayout(_lines_gbox_gridlayout)

        _data_path_gbox_layout = QtGui.QVBoxLayout(self)
        _data_path_gbox_layout.addWidget(self._data_path_widget)
        _data_path_gbox_layout.setSpacing(0)
        _data_path_gbox_layout.setContentsMargins(0, 0, 0, 0)
        self._data_path_gbox.setLayout(_data_path_gbox_layout)

        _processing_gbox_layout = QtGui.QVBoxLayout(self)
        _processing_gbox_layout.addWidget(self._processing_widget)
        _processing_gbox_layout.setSpacing(0)
        _processing_gbox_layout.setContentsMargins(0, 0, 0, 0)
        self._processing_gbox.setLayout(_processing_gbox_layout)

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

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

        # Qt signal/slot connections ------------------------------------------
        add_button.clicked.connect(self.add_clicked)

        remove_button.clicked.connect(self.remove_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)

        QtCore.QObject.connect(self._lines_list_widget,
                               QtCore.SIGNAL("selectionChanged()"),
                               self.list_box_selection_changed)

        QtCore.QObject.connect(self._data_path_widget,
                               QtCore.SIGNAL("pathTemplateChanged"),
                               self.handle_path_conflict)
Esempio n. 6
0
    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("Qt4_create_discrete_widget")

        # 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_gbox = QtGui.QGroupBox('Data location', self)
        self._data_path_gbox.setObjectName('data_path_gbox')
        self._data_path_widget = \
            DataPathWidget(self._data_path_gbox,
                           'create_dc_path_widget',
                           data_model=self._path_template,
                           layout='vertical')

        self._processing_gbox = QtGui.QGroupBox('Processing', self)
        self._processing_gbox.setObjectName('processing_gbox')
        self._processing_widget = \
            ProcessingWidget(self._processing_gbox,
                             data_model=self._processing_parameters)

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

        self._processing_gbox_layout = QtGui.QVBoxLayout(self)
        self._processing_gbox_layout.addWidget(self._processing_widget)
        self._processing_gbox_layout.setSpacing(0)
        self._processing_gbox_layout.setContentsMargins(0, 0, 0, 0)
        self._processing_gbox.setLayout(self._processing_gbox_layout)

        self.main_layout = QtGui.QVBoxLayout(self)
        self.main_layout.addWidget(self._acq_widget)
        self.main_layout.addWidget(self._data_path_gbox)
        self.main_layout.addWidget(self._processing_gbox)
        self.main_layout.addSpacing(10)
        self.main_layout.setSpacing(0)
        self.main_layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.main_layout)

        # SizePolicies --------------------------------------------------------
        """self._acq_widget.setSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Fixed)
        self._data_path_gbox.setSizePolicy(QtGui.QSizePolicy.Expanding,
                           QtGui.QSizePolicy.Expanding)
        self._processing_gbox.setSizePolicy(QtGui.QSizePolicy.Expanding,
                           QtGui.QSizePolicy.Expanding)"""

        # Qt signal/slot connections ------------------------------------------
        self._processing_gbox.toggled.connect(self._use_processing_toggled)
        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.connect(self._acq_widget, QtCore.SIGNAL('mad_energy_selected'),
                     self.mad_energy_selected)

        self.connect(self._acq_widget, QtCore.SIGNAL("pathTemplateChanged"),
                     self.handle_path_conflict)

        self.connect(self._data_path_widget,
                     QtCore.SIGNAL("pathTemplateChanged"),
                     self.handle_path_conflict)