Example #1
0
    def __init__(self, parent=None, name="energy_scan_tab_widget"):
        QtGui.QWidget.__init__(self, parent)

        if name is not None:
            self.setObjectName(name)

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

        # Internal variables --------------------------------------------------
        self.energy_scan_model = queue_model_objects.EnergyScan()
        self._tree_view_item = None

        # Graphic elements ----------------------------------------------------
        _top_widget = QtGui.QWidget(self)
        _parameters_widget = QtGui.QWidget(_top_widget)

        self.periodic_table_widget = PeriodicTableWidget(_parameters_widget)

        self.data_path_widget = DataPathWidget(_parameters_widget)
        # LNLS
        # self.data_path_widget.data_path_layout.file_name_label.setText('')
        # self.data_path_widget.data_path_layout.file_name_label.hide()
        # self.data_path_widget.data_path_layout.file_name_value_label.hide()

        # ---------------------------------------------------------------------
        # LNLS
        self.data_path_widget.setFixedHeight(140)
        # ---------------------------------------------------------------------

        _snapshot_widget = QtGui.QWidget(self)

        # Snapshot of current position
        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)

        # Graphics
        self.scan_plot_widget = TwoAxisPlotWidget(self, True)
        self.result_plot_widget = TwoAxisPlotWidget(self, False)

        # Layout -------------------------------------------------------------
        _parameters_widget_layout = QtGui.QVBoxLayout()
        _parameters_widget_layout.addWidget(self.periodic_table_widget)
        _parameters_widget_layout.addWidget(self.data_path_widget)
        _parameters_widget_layout.addStretch(0)
        _parameters_widget_layout.setSpacing(2)
        _parameters_widget_layout.setContentsMargins(0, 0, 0, 0)
        _parameters_widget.setLayout(_parameters_widget_layout)

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

        _top_widget_hlayout = QtGui.QHBoxLayout(self)
        _top_widget_hlayout.addWidget(_parameters_widget)
        _top_widget_hlayout.addWidget(_snapshot_widget)
        _top_widget_hlayout.addStretch(0)
        _top_widget_hlayout.setSpacing(2)
        _top_widget_hlayout.setContentsMargins(0, 0, 0, 0)
        _top_widget.setLayout(_top_widget_hlayout)

        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(_top_widget)
        _main_vlayout.addWidget(self.scan_plot_widget)
        _main_vlayout.addWidget(self.result_plot_widget)
        _main_vlayout.setSpacing(5)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        _main_vlayout.addStretch(0)

        self.setLayout(_main_vlayout)

        # SizePolicies --------------------------------------------------------
        self.scan_plot_widget.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                            QtGui.QSizePolicy.Expanding)
        self.result_plot_widget.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                              QtGui.QSizePolicy.Expanding)

        # Qt signal/slot connections ------------------------------------------
        #qt.QObject.connect(self.periodic_table_widget, qt.PYSIGNAL('edgeSelected'),
        #                   self.element_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)
    def __init__(self, parent=None, name="energy_scan_tab_widget"):
        QtGui.QWidget.__init__(self, parent)

        if name is not None:
            self.setObjectName(name)

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

        # Internal variables --------------------------------------------------
        self.energy_scan_model = queue_model_objects.EnergyScan()
        self._tree_view_item = None

        # Graphic elements ----------------------------------------------------
        _top_widget = QtGui.QWidget(self)
        _parameters_widget = QtGui.QWidget(_top_widget)
        self.periodic_table_widget = PeriodicTableWidget(_parameters_widget)
        self.data_path_widget = DataPathWidget(_parameters_widget)
        self.data_path_widget.data_path_layout.file_name_label.setText('')
        self.data_path_widget.data_path_layout.file_name_value_label.hide()
        self.snapshot_widget = SnapshotWidget(self)

        self.scan_actual_plot_widget = PymcaPlotWidget(self, True)
        self.scan_result_plot_widget = PymcaPlotWidget(self, False)
        self.chooch_plot_widget = PymcaPlotWidget(self, False)
        #self.scan_actual_plot_widget = TwoAxisPlotWidget(self, True)
        #self.chooch_plot_widget = TwoAxisPlotWidget(self, False)

        # Layout -------------------------------------------------------------
        _parameters_widget_layout = QtGui.QVBoxLayout()
        _parameters_widget_layout.addWidget(self.periodic_table_widget)
        _parameters_widget_layout.addWidget(self.data_path_widget)
        _parameters_widget_layout.addStretch(0)
        _parameters_widget_layout.setSpacing(2)
        _parameters_widget_layout.setContentsMargins(0, 0, 0, 0)
        _parameters_widget.setLayout(_parameters_widget_layout)

        _top_widget_hlayout = QtGui.QHBoxLayout(self)
        _top_widget_hlayout.addWidget(_parameters_widget)
        _top_widget_hlayout.addWidget(self.snapshot_widget)
        _top_widget_hlayout.addStretch(0)
        _top_widget_hlayout.setSpacing(2)
        _top_widget_hlayout.setContentsMargins(0, 0, 0, 0)
        _top_widget.setLayout(_top_widget_hlayout)

        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(_top_widget)
        _main_vlayout.addWidget(self.scan_actual_plot_widget)
        _main_vlayout.addWidget(self.scan_result_plot_widget)
        _main_vlayout.addWidget(self.chooch_plot_widget)
        _main_vlayout.setSpacing(5)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        #_main_vlayout.addStretch(0)

        self.setLayout(_main_vlayout)

        # SizePolicies --------------------------------------------------------
        self.scan_actual_plot_widget.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                                   QtGui.QSizePolicy.Expanding)
        self.chooch_plot_widget.setSizePolicy(QtGui.QSizePolicy.Fixed,
                                              QtGui.QSizePolicy.Expanding)

        # Qt signal/slot connections ------------------------------------------
        #qt.QObject.connect(self.periodic_table_widget, qt.PYSIGNAL('edgeSelected'),
        #                   self.element_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)

        # Other ---------------------------------------------------------------
        self.scan_actual_plot_widget.hide()
        self.scan_result_plot_widget.hide()
Example #3
0
    def __init__(self, parent=None, name="energy_scan_tab_widget"):
        QtGui.QWidget.__init__(self, parent)

        if name is not None:
            self.setObjectName(name)

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

        # Internal variables --------------------------------------------------
        self.energy_scan_model = queue_model_objects.EnergyScan()
        self._tree_view_item = None

        # Graphic elements ----------------------------------------------------
        _top_widget = QtGui.QWidget(self)
        _parameters_widget = QtGui.QWidget(_top_widget)
        self.periodic_table_widget = PeriodicTableWidget(_parameters_widget)
        self.data_path_widget = DataPathWidget(_parameters_widget)
        self.data_path_widget.data_path_layout.file_name_label.setText('')
        self.data_path_widget.data_path_layout.file_name_value_label.hide()
        self.position_widget = uic.loadUi(
            os.path.join(os.path.dirname(__file__),
                         'ui_files/Qt4_snapshot_widget_layout.ui'))
        self.position_widget.setFixedSize(450, 340)

        self.scan_plot_widget = TwoAxisPlotWidget(self)
        self.scan_plot_widget.set_real_time_plot(True)
        self.result_plot_widget = TwoAxisPlotWidget(self)
        """self.scan_plot_widget = ScanPlotWidget(self)
        self.scan_plot_widget.setRealTimePlot(True)
        self.result_plot_widget = ScanPlotWidget(self)
        self.result_plot_widget.setRealTimePlot(False)
        self.scan_plot_widget.setFixedHeight(200)
        self.result_plot_widget.setFixedHeight(200)"""

        # Layout -------------------------------------------------------------
        _parameters_widget_layout = QtGui.QVBoxLayout()
        _parameters_widget_layout.addWidget(self.periodic_table_widget)
        _parameters_widget_layout.addWidget(self.data_path_widget)
        _parameters_widget_layout.addStretch(0)
        _parameters_widget_layout.setSpacing(2)
        _parameters_widget_layout.setContentsMargins(0, 0, 0, 0)
        _parameters_widget.setLayout(_parameters_widget_layout)

        _top_widget_hlayout = QtGui.QHBoxLayout(self)
        _top_widget_hlayout.addWidget(_parameters_widget)
        _top_widget_hlayout.addWidget(self.position_widget)
        _top_widget_hlayout.addStretch(0)
        _top_widget_hlayout.setSpacing(2)
        _top_widget_hlayout.setContentsMargins(0, 0, 0, 0)
        _top_widget.setLayout(_top_widget_hlayout)

        _main_vlayout = QtGui.QVBoxLayout(self)
        _main_vlayout.addWidget(_top_widget)
        _main_vlayout.addWidget(self.scan_plot_widget)
        _main_vlayout.addWidget(self.result_plot_widget)
        _main_vlayout.setSpacing(2)
        _main_vlayout.setContentsMargins(2, 2, 2, 2)
        _main_vlayout.addStretch(0)

        self.setLayout(_main_vlayout)

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

        # Qt signal/slot connections ------------------------------------------
        #qt.QObject.connect(self.periodic_table_widget, qt.PYSIGNAL('edgeSelected'),
        #                   self.element_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)

        #qt.QObject.connect(qt.qApp, qt.PYSIGNAL('tab_changed'),
        #                   self.tab_changed)

        # Other ---------------------------------------------------------------

        Qt4_widget_colors.set_widget_color(self.periodic_table_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)
        Qt4_widget_colors.set_widget_color(self.position_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)
        Qt4_widget_colors.set_widget_color(self.data_path_widget,
                                           Qt4_widget_colors.GROUP_BOX_GRAY)