Ejemplo n.º 1
0
    def __init__(self, parent=None, name="advanced_parameters_widget"):
        QtGui.QWidget.__init__(self, parent)

        # Hardware objects ----------------------------------------------------
        self._queue_model_hwobj = None
        self._beamline_setup_hwobj = None

        # Internal values -----------------------------------------------------
        self._data_collection = None
        self._tree_view_item = None

        # Properties ----------------------------------------------------------

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        _dc_parameters_widget = QtGui.QWidget(self)
        self._data_path_widget = DataPathWidget(_dc_parameters_widget)
        self._acq_widget = AcquisitionWidget(_dc_parameters_widget,
                                             layout='horizontal')

        # Layout --------------------------------------------------------------
        _dc_parameters_widget_layout = QtGui.QVBoxLayout(_dc_parameters_widget)
        _dc_parameters_widget_layout.addWidget(self._data_path_widget)
        _dc_parameters_widget_layout.addWidget(self._acq_widget)
        _dc_parameters_widget_layout.setSpacing(2)
        _dc_parameters_widget_layout.addStretch(10)
        _dc_parameters_widget_layout.setContentsMargins(0, 0, 0, 0)

        _main_hlayout = QtGui.QHBoxLayout(self)
        _main_hlayout.addWidget(_dc_parameters_widget)
        _main_hlayout.setSpacing(2)
        _main_hlayout.setContentsMargins(2, 2, 2, 2)
        _main_hlayout.addStretch(0)

        # 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)

        # Ohter ---------------------------------------------------------------
        self._acq_widget.use_osc_start(False)
        self._acq_widget.acq_widget_layout.mad_cbox.hide()
        self._acq_widget.acq_widget_layout.energies_combo.hide()
        self._acq_widget.acq_widget_layout.num_images_ledit.setEnabled(False)
        self._acq_widget.acq_widget_layout.inverse_beam_cbx.hide()
        self._acq_widget.acq_widget_layout.shutterless_cbx.hide()
        self._acq_widget.acq_widget_layout.subwedge_size_label.hide()
        self._acq_widget.acq_widget_layout.subwedge_size_ledit.hide()
Ejemplo n.º 2
0
    def __init__(self, parent=None, name="parameter_widget"):

        QWidget.__init__(self, parent)
        if name is not None:
            self.setObjectName(name)

        # Properties ----------------------------------------------------------

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Hardware objects ----------------------------------------------------
        self._beamline_setup_hwobj = None

        # Internal variables --------------------------------------------------
        self._data_collection = None
        self.add_dc_cb = None
        self._tree_view_item = None

        # Graphic elements ----------------------------------------------------
        _dc_parameters_widget = QWidget(self)
        self._data_path_widget = DataPathWidget(_dc_parameters_widget)
        self._acq_widget = AcquisitionWidget(_dc_parameters_widget,
                                             layout='horizontal')
        self._processing_widget = ProcessingWidget(_dc_parameters_widget)

        # Layout --------------------------------------------------------------
        _dc_parameters_widget_layout = QVBoxLayout(_dc_parameters_widget)
        _dc_parameters_widget_layout.addWidget(self._data_path_widget)
        _dc_parameters_widget_layout.addWidget(self._acq_widget)
        _dc_parameters_widget_layout.addWidget(self._processing_widget)
        _dc_parameters_widget_layout.setContentsMargins(0, 0, 0, 0)
        _dc_parameters_widget_layout.setSpacing(2)
        _dc_parameters_widget_layout.addStretch(10)

        _main_hlayout = QHBoxLayout(self)
        _main_hlayout.addWidget(_dc_parameters_widget)
        _main_hlayout.setContentsMargins(0, 0, 0, 0)
        _main_hlayout.setSpacing(2)
        _main_hlayout.addStretch(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._acq_widget.madEnergySelectedSignal.\
             connect(self.mad_energy_selected)
        self._acq_widget.acqParametersChangedSignal.\
             connect(self.acq_parameters_changed)
    def __init__(self, parent=None, name=None, fl=0):
        CreateTaskBase.__init__(self, parent, name, Qt.WindowFlags(fl),
                                'XrayImaging')

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

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

        # Internal variables --------------------------------------------------
        self._xray_imaging_parameters = None
        self._processing_parameters = None
        self.init_models()

        # Graphic elements ----------------------------------------------------
        self._xray_imaging_parameters_widget = XrayImagingParametersWidget(\
             self, 'xray_imaging_widget',
             xray_imaging_params=self._xray_imaging_parameters)

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

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

        # Layout --------------------------------------------------------------
        _main_vlayout = QVBoxLayout(self)
        _main_vlayout.addWidget(self._xray_imaging_parameters_widget)
        _main_vlayout.addWidget(self._acq_widget)
        _main_vlayout.addWidget(self._data_path_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)

        # Other ---------------------------------------------------------------
        self._acq_widget.use_osc_start(False)
        self._acq_widget.use_kappa(False)
Ejemplo n.º 4
0
    def __init__(self,parent = None,name = None,fl = 0):
        QtGui.QWidget.__init__(self, parent, QtCore.Qt.WindowFlags(fl))

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

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

        # Internal variables --------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.group_box = QtGui.QGroupBox("Reference images", self)
        self.tool_box = QtGui.QToolBox(self.group_box)
        self.page_widget = QtGui.QWidget(self.tool_box)
        self.path_widget = DataPathWidget(self.page_widget)
        self.acq_groupbox = QtGui.QGroupBox("Acquisition", self.page_widget)
        self.acq_widget = AcquisitionWidget(self.acq_groupbox, 'horizontal')
        self.acq_widget.acq_widget.inverse_beam_cbx.hide()
        self.acq_widget.acq_widget.shutterless_cbx.hide()
        self.acq_widget.acq_widget.subwedge_size_label.hide()
        self.acq_widget.acq_widget.subwedge_size_ledit.hide()
        #self.acq_widget.acq_widget.setFixedHeight(130)
        self.tool_box.addItem(self.page_widget, "Acquisition parameters")

        # Layout --------------------------------------------------------------
        _acq_groupbox_layout = QtGui.QVBoxLayout(self)
        _acq_groupbox_layout.addWidget(self.acq_widget)
        _acq_groupbox_layout.setSpacing(0)
        _acq_groupbox_layout.setContentsMargins(0, 0, 0, 0)
        self.acq_groupbox.setLayout(_acq_groupbox_layout)

        _page_widget_layout = QtGui.QVBoxLayout(self)
        _page_widget_layout.addWidget(self.path_widget)
        _page_widget_layout.addWidget(self.acq_groupbox)
        _page_widget_layout.addStretch(0)
        _page_widget_layout.setSpacing(0)
        _page_widget_layout.setContentsMargins(0, 0, 0, 0)  
        self.page_widget.setLayout(_page_widget_layout)
        
        _group_box_vlayout = QtGui.QVBoxLayout(self)
        _group_box_vlayout.addWidget(self.tool_box)
        _group_box_vlayout.setSpacing(0)
        _group_box_vlayout.setContentsMargins(0, 0, 0, 0)
        self.group_box.setLayout(_group_box_vlayout)

        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(self.group_box)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(_main_vlayout)

        Qt4_widget_colors.set_widget_color(self, Qt4_widget_colors.GROUP_BOX_GRAY) 
Ejemplo n.º 5
0
    def __init__(self, parent=None, name=None, fl=0):
        QWidget.__init__(self, parent, Qt.WindowFlags(fl))

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

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

        # Internal variables --------------------------------------------------

        # Graphic elements ----------------------------------------------------
        self.group_box = QGroupBox("Reference images", self)
        self.tool_box = QToolBox(self.group_box)
        self.page_widget = QWidget(self.tool_box)
        self.path_widget = DataPathWidget(self.page_widget)
        self.acq_widget = AcquisitionWidget(self.page_widget, 'horizontal')
        self.acq_widget.acq_widget_layout.shutterless_cbx.hide()
        #self.acq_widget.acq_widget_layout.setFixedHeight(130)
        self.tool_box.addItem(self.page_widget, "Acquisition parameters")

        # Layout --------------------------------------------------------------
        _page_widget_layout = QVBoxLayout(self.page_widget)
        _page_widget_layout.addWidget(self.path_widget)
        _page_widget_layout.addWidget(self.acq_widget)
        _page_widget_layout.addStretch(0)
        _page_widget_layout.setSpacing(0)
        _page_widget_layout.setContentsMargins(0, 0, 0, 0)

        _group_box_vlayout = QVBoxLayout(self.group_box)
        _group_box_vlayout.addWidget(self.tool_box)
        _group_box_vlayout.setSpacing(0)
        _group_box_vlayout.setContentsMargins(0, 0, 0, 0)

        _main_vlayout = QVBoxLayout(self)
        _main_vlayout.addWidget(self.group_box)
        _main_vlayout.setSpacing(0)
        _main_vlayout.setContentsMargins(0, 0, 0, 0)
Ejemplo n.º 6
0
    def __init__(self, parent=None, name=None, fl=0):
        CreateTaskBase.__init__(self, parent, name, QtCore.Qt.WindowFlags(fl),
                                'Advanced')

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

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

        # Internal variables --------------------------------------------------
        self.init_models()
        self._advanced_methods = None
        self._grid_map = {}

        # Graphic elements ----------------------------------------------------
        self._advanced_methods_widget = uic.loadUi(os.path.join(\
            os.path.dirname(__file__), "ui_files/Qt4_advanced_methods_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')

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

        # 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._advanced_methods_widget.grid_treewidget.itemSelectionChanged.\
             connect(self.grid_treewidget_item_selection_changed)
        self._advanced_methods_widget.draw_grid_button.clicked.\
             connect(self.draw_grid_button_clicked)
        self._advanced_methods_widget.remove_grid_button.clicked.\
             connect(self.remove_grid_button_clicked)
        self._advanced_methods_widget.hor_spacing_ledit.textChanged.\
             connect(self.spacing_changed)
        self._advanced_methods_widget.ver_spacing_ledit.textChanged.\
             connect(self.spacing_changed)

        self._advanced_methods_widget.move_right_button.clicked.\
             connect(lambda : self.move_grid("right"))
        self._advanced_methods_widget.move_left_button.clicked.\
             connect(lambda : self.move_grid("left"))
        self._advanced_methods_widget.move_up_button.clicked.\
             connect(lambda : self.move_grid("up"))
        self._advanced_methods_widget.move_down_button.clicked.\
             connect(lambda : self.move_grid("down"))

        self._advanced_methods_widget.overlay_cbox.toggled.\
             connect(self.overlay_toggled)
        self._advanced_methods_widget.overlay_slider.valueChanged.\
             connect(self.overlay_alpha_changed)
        self._advanced_methods_widget.move_to_grid_button.clicked.\
             connect(self.move_to_grid)

        # Other ---------------------------------------------------------------
        self._acq_widget.use_osc_start(False)
        self._acq_widget.use_kappa(False)
        self._acq_widget.use_kappa_phi(False)
        self._acq_widget.acq_widget_layout.num_images_label.setEnabled(False)
        self._acq_widget.acq_widget_layout.num_images_ledit.setEnabled(False)
        for col in range(self._advanced_methods_widget.\
                         grid_treewidget.columnCount()):
            self._advanced_methods_widget.grid_treewidget.\
                 resizeColumnToContents(col)
    def __init__(self, parent=None, name="advanced_parameters_widget"):
        QtGui.QWidget.__init__(self, parent)

        # Hardware objects ----------------------------------------------------
        self._queue_model_hwobj = None
        self._beamline_setup_hwobj = None

        # Internal values -----------------------------------------------------
        self._data_collection = None
        self._tree_view_item = None

        # Properties ----------------------------------------------------------

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Graphic elements ----------------------------------------------------
        _dc_parameters_widget = QtGui.QWidget(self)
        self._data_path_widget = DataPathWidget(_dc_parameters_widget)
        self._acq_widget = AcquisitionWidget(_dc_parameters_widget,
                                             layout='horizontal')
        #self._acq_widget.setFixedHeight(170)
        _snapshot_widget = QtGui.QWidget(self)
        self.position_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__),
                         'ui_files/Qt4_snapshot_widget_layout.ui'))

        # Layout --------------------------------------------------------------
        _dc_parameters_widget_layout = QtGui.QVBoxLayout(_dc_parameters_widget)
        _dc_parameters_widget_layout.addWidget(self._data_path_widget)
        _dc_parameters_widget_layout.addWidget(self._acq_widget)
        _dc_parameters_widget_layout.setSpacing(2)
        _dc_parameters_widget_layout.addStretch(10)
        _dc_parameters_widget_layout.setContentsMargins(0, 0, 0, 0)

        _snapshots_vlayout = QtGui.QVBoxLayout(_snapshot_widget)
        _snapshots_vlayout.addWidget(self.position_widget)
        _snapshots_vlayout.setContentsMargins(0, 0, 0, 0)
        _snapshots_vlayout.setSpacing(2)
        _snapshots_vlayout.addStretch(10)

        _main_hlayout = QtGui.QHBoxLayout(self)
        _main_hlayout.addWidget(_dc_parameters_widget)
        _main_hlayout.addWidget(_snapshot_widget)
        _main_hlayout.setSpacing(2)
        _main_hlayout.setContentsMargins(2, 2, 2, 2)
        _main_hlayout.addStretch(0)

        # 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._acq_widget.madEnergySelectedSignal.connect(\
             self.mad_energy_selected)
        self._acq_widget.acqParametersChangedSignal.connect(\
             self.handle_path_conflict)

        # Ohter ---------------------------------------------------------------
        self._acq_widget.use_osc_start(False)
        self._acq_widget.acq_widget_layout.mad_cbox.hide()
        self._acq_widget.acq_widget_layout.energies_combo.hide()
        self._acq_widget.acq_widget_layout.num_images_ledit.setEnabled(False)
        self._acq_widget.acq_widget_layout.inverse_beam_cbx.hide()
        self._acq_widget.acq_widget_layout.shutterless_cbx.hide()
        self._acq_widget.acq_widget_layout.subwedge_size_label.hide()
        self._acq_widget.acq_widget_layout.subwedge_size_ledit.hide()
Ejemplo n.º 8
0
    def __init__(self, parent=None, name="parameter_widget"):

        QtGui.QWidget.__init__(self, parent)
        if name is not None:
            self.setObjectName(name)

        # Properties ----------------------------------------------------------

        # Signals ------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Hardware objects ----------------------------------------------------
        self._beamline_setup_hwobj = None

        # Internal variables --------------------------------------------------
        self._data_collection = None
        self.add_dc_cb = None
        self._tree_view_item = None

        # Graphic elements ----------------------------------------------------
        _dc_parameters_widget = QtGui.QWidget(self)
        self.caution_pixmap = Qt4_Icons.load("Caution2.png")
        self.path_widget = DataPathWidget(_dc_parameters_widget)
        self.acq_widget = AcquisitionWidget(_dc_parameters_widget,
                                            layout='horizontal')
        #self.acq_widget.setFixedHeight(170)
        self.processing_widget = ProcessingWidget(_dc_parameters_widget)
        self.position_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__),
                         'ui_files/Qt4_snapshot_widget_layout.ui'))
        #self.position_widget.setMinimumSize(310, 210)

        # Layout --------------------------------------------------------------
        _dc_parameters_widget_layout = QtGui.QVBoxLayout(self)
        _dc_parameters_widget_layout.addWidget(self.path_widget)
        _dc_parameters_widget_layout.addWidget(self.acq_widget)
        _dc_parameters_widget_layout.addWidget(self.processing_widget)
        _dc_parameters_widget_layout.setSpacing(2)
        _dc_parameters_widget_layout.addStretch(0)
        _dc_parameters_widget_layout.setContentsMargins(0, 0, 0, 0)
        _dc_parameters_widget.setLayout(_dc_parameters_widget_layout)

        _main_hlayout = QtGui.QHBoxLayout(self)
        _main_hlayout.addWidget(_dc_parameters_widget)
        _main_hlayout.addWidget(self.position_widget)
        _main_hlayout.setSpacing(2)
        _main_hlayout.setContentsMargins(0, 0, 0, 0)
        _main_hlayout.addStretch(0)
        self.setLayout(_main_hlayout)

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

        # Qt signal/slot connections ------------------------------------------
        self.path_widget.data_path_layout.prefix_ledit.textChanged.connect(
            self._prefix_ledit_change)
        self.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("path_template_changed"),
                     self.handle_path_conflict)

        #QtCore.QObject.connect(QtGui.QApplication, QtCore.SIGNAL('tab_changed'),
        #                       self.tab_changed)

        # Other ---------------------------------------------------------------
        Qt4_widget_colors.set_widget_color(self.path_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)
        Qt4_widget_colors.set_widget_color(self.acq_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)
        Qt4_widget_colors.set_widget_color(self.processing_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)
        Qt4_widget_colors.set_widget_color(self.position_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)
    def __init__(self, parent=None, name="parameter_widget"):

        QtGui.QWidget.__init__(self, parent)
        if name is not None:
            self.setObjectName(name)

        # Properties ----------------------------------------------------------

        # Signals -------------------------------------------------------------

        # Slots ---------------------------------------------------------------

        # Hardware objects ----------------------------------------------------
        self._beamline_setup_hwobj = None

        # Internal variables --------------------------------------------------
        self._data_collection = None
        self.add_dc_cb = None
        self._tree_view_item = None

        # Graphic elements ----------------------------------------------------
        _dc_parameters_widget = QtGui.QWidget(self)
        self._data_path_widget = DataPathWidget(_dc_parameters_widget)
        self._acq_widget = AcquisitionWidget(_dc_parameters_widget,
                                             layout='horizontal')
        #self._acq_widget.setFixedHeight(170)
        self._processing_widget = ProcessingWidget(_dc_parameters_widget)
        _snapshot_widget = QtGui.QWidget(self)
        self.position_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__),
                         'ui_files/Qt4_snapshot_widget_layout.ui'))
        # LNLS
        self.position_widget.setFixedSize(450, 340)

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

        _snapshots_vlayout = QtGui.QVBoxLayout(_snapshot_widget)
        _snapshots_vlayout.addWidget(self.position_widget)
        _snapshots_vlayout.setContentsMargins(0, 0, 0, 0)
        _snapshots_vlayout.setSpacing(2)
        # LNLS
        # _snapshots_vlayout.addStretch(10)
        _snapshots_vlayout.addStretch(0)
        _snapshot_widget.setLayout(_snapshots_vlayout)
        # ----

        _main_hlayout = QtGui.QHBoxLayout(self)
        _main_hlayout.addWidget(_dc_parameters_widget)
        _main_hlayout.addWidget(_snapshot_widget)
        _main_hlayout.setContentsMargins(0, 0, 0, 0)
        _main_hlayout.setSpacing(2)
        _main_hlayout.addStretch(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._acq_widget.madEnergySelectedSignal.connect(
            self.mad_energy_selected)
        self._acq_widget.acqParametersChangedSignal.connect(\
             self.acq_parameters_changed)
Ejemplo n.º 10
0
    def __init__(self, parent=None, name=None, fl=0):
        CreateTaskBase.__init__(self, parent, name, QtCore.Qt.WindowFlags(fl),
                                'Advanced')

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

        # Hardware objects ----------------------------------------------------
        self.__mini_diff_hwobj = None

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

        self.__current_motor_positions = {}
        self.__list_items = {}
        self.__grid_list = []

        self.__beam_info = {}
        self.__spacing = [0, 0]

        # Graphic elements ----------------------------------------------------
        self.mesh_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__),
                         'ui_files/Qt4_mesh_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_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')

        # 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)

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

        # 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.connect(self._data_path_widget,
                     QtCore.SIGNAL("pathTemplateChanged"),
                     self.handle_path_conflict)

        self.mesh_widget.draw_button.clicked.connect(self.draw_button_clicked)
        self.mesh_widget.remove_button.clicked.connect(
            self.delete_drawing_clicked)
        self.mesh_widget.hor_spacing_ledit.textChanged.connect(self.set_hspace)
        self.mesh_widget.ver_spacing_ledit.textChanged.connect(self.set_vspace)
        self.mesh_widget.mesh_treewidget.currentItemChanged.connect(\
             self.mesh_treewidget_current_item_changed)
        self.mesh_widget.visibility_button.clicked.\
             connect(self.toggle_visibility_grid)