예제 #1
0
 def restore_from_state(self, settings, data_sources):
     """Restores the widget to the same state as when the settings were generated"""
     self.actionPlotSettings.setChecked(settings['actionPlotSettings'])
     self.actionPlotSettings.triggered.emit(self.actionPlotSettings.isChecked())
     self.settingsWidget.ui.x_label.setText(settings['x_label'][1:])
     self.settingsWidget.ui.y_label.setText(settings['y_label'][1:])
     self.settingsWidget.ui.x_label_auto.setChecked(settings['x_label_auto'])
     self.settingsWidget.ui.x_label_auto.toggled.emit(settings['x_label_auto'])
     self.settingsWidget.ui.y_label_auto.setChecked(settings['y_label_auto'])
     self.settingsWidget.ui.y_label_auto.toggled.emit(settings['y_label_auto'])
     self.settingsWidget.ui.colormap_min.setText(settings['colormap_min'])
     self.settingsWidget.ui.colormap_max.setText(settings['colormap_max'])
     self.settingsWidget.ui.colormap_max.editingFinished.emit()
     transpose = self.settingsWidget.ui.transpose
     transpose.setCurrentIndex(transpose.findText(settings['transpose']))
     flipy = self.settingsWidget.ui.flipy
     flipy.setCurrentIndex(flipy.findText(settings['flipy']))
     flipx = self.settingsWidget.ui.flipx
     flipx.setCurrentIndex(flipx.findText(settings['flipx']))
     self.plot.getView().getViewBox().setState(settings['viewbox'])
     self.actionX_axis.setChecked(settings['x_view'])
     self.actionX_axis.triggered.emit(settings['x_view'])
     self.actionY_axis.setChecked(settings['y_view'])
     self.actionY_axis.triggered.emit(settings['y_view'])
     self.actionHistogram.setChecked(settings['histogram_view'])
     self.actionHistogram.triggered.emit(settings['histogram_view'])
     self.actionCrosshair.setChecked(settings['crosshair'])
     self.actionCrosshair.triggered.emit(settings['crosshair'])
     self.plot.getHistogramWidget().item.gradient.restoreState(settings['gradient_mode'])
     
     return DataWindow.restore_from_state(self, settings, data_sources)
예제 #2
0
    def restore_from_state(self, settings, data_sources):
        """Restores the widget to the same state as when the settings were generated"""
        self.actionPlotSettings.setChecked(settings["actionPlotSettings"])
        self.actionPlotSettings.triggered.emit(self.actionPlotSettings.isChecked())
        self.settingsWidget.ui.x_label.setText(settings["x_label"][1:])
        self.settingsWidget.ui.y_label.setText(settings["y_label"][1:])
        self.settingsWidget.ui.x_label_auto.setChecked(settings["x_label_auto"])
        self.settingsWidget.ui.x_label_auto.toggled.emit(settings["x_label_auto"])
        self.settingsWidget.ui.y_label_auto.setChecked(settings["y_label_auto"])
        self.settingsWidget.ui.y_label_auto.toggled.emit(settings["y_label_auto"])
        self.settingsWidget.ui.colormap_min.setText(settings["colormap_min"])
        self.settingsWidget.ui.colormap_max.setText(settings["colormap_max"])
        self.settingsWidget.ui.colormap_max.editingFinished.emit()
        transpose = self.settingsWidget.ui.transpose
        transpose.setCurrentIndex(transpose.findText(settings["transpose"]))
        flipy = self.settingsWidget.ui.flipy
        flipy.setCurrentIndex(flipy.findText(settings["flipy"]))
        self.plot.getView().getViewBox().setState(settings["viewbox"])
        self.actionX_axis.setChecked(settings["x_view"])
        self.actionX_axis.triggered.emit(settings["x_view"])
        self.actionY_axis.setChecked(settings["y_view"])
        self.actionY_axis.triggered.emit(settings["y_view"])
        self.actionHistogram.setChecked(settings["histogram_view"])
        self.actionHistogram.triggered.emit(settings["histogram_view"])

        return DataWindow.restore_from_state(self, settings, data_sources)
예제 #3
0
 def restore_from_state(self, settings, data_sources):
     self.plot.getViewBox().setState(settings['viewbox'])
     self.actionX_axis.setChecked(settings['x_view'])
     self.actionX_axis.triggered.emit(settings['x_view'])
     self.actionY_axis.setChecked(settings['y_view'])
     self.actionY_axis.triggered.emit(settings['y_view'])
     self.actionLines.setChecked(settings['lines'])
     self.actionPoints.setChecked(settings['points'])
     self.actionLegend_Box.setChecked(settings['legend'])
     self.actionLegend_Box.triggered.emit(settings['legend'])
     return DataWindow.restore_from_state(self, settings, data_sources)
예제 #4
0
 def restore_from_state(self, settings, data_sources):
     self._settings_diag.restore_from_state(settings)
     self.plot.getViewBox().setState(settings['viewbox'])
     self.actionX_axis.setChecked(settings['x_view'])
     self.actionX_axis.triggered.emit(settings['x_view'])
     self.actionY_axis.setChecked(settings['y_view'])
     self.actionY_axis.triggered.emit(settings['y_view'])
     self.actionLines.setChecked(settings['lines'])
     self.actionPoints.setChecked(settings['points'])
     self.actionLegend_Box.setChecked(settings['legend'])
     self.actionLegend_Box.triggered.emit(settings['legend'])
     return DataWindow.restore_from_state(self, settings, data_sources)
예제 #5
0
 def restore_from_state(self, settings, data_sources):
     self._settings_diag.restore_from_state(settings)
     self.plot.getViewBox().setState(settings['viewbox'])
     self.actionX_axis.setChecked(settings['x_view'])
     self.actionX_axis.triggered.emit(settings['x_view'])
     self.actionY_axis.setChecked(settings['y_view'])
     self.actionY_axis.triggered.emit(settings['y_view'])
     self.actionLines.setChecked(settings['lines'])
     self.actionPoints.setChecked(settings['points'])
     self.actionLegend_Box.setChecked(settings['legend'])
     self.actionLegend_Box.triggered.emit(settings['legend'])
     plot_item = self.plot.getPlotItem()
     plot_item.ctrl.xGridCheck.setChecked(settings['grid_x'])
     plot_item.ctrl.xGridCheck.toggled.emit(settings['grid_x'])
     plot_item.ctrl.yGridCheck.setChecked(settings['grid_y'])
     plot_item.ctrl.yGridCheck.toggled.emit(settings['grid_y'])
     plot_item.ctrl.gridAlphaSlider.setValue(settings['grid_alpha'])
     return DataWindow.restore_from_state(self, settings, data_sources)
예제 #6
0
    def restore_from_state(self, settings, data_sources):
        """Restores the widget to the same state as when the settings were generated"""
        self.actionPlotSettings.setChecked(settings['actionPlotSettings'])
        self.actionPlotSettings.triggered.emit(
            self.actionPlotSettings.isChecked())
        self.settingsWidget.ui.x_label.setText(settings['x_label'][1:])
        self.settingsWidget.ui.y_label.setText(settings['y_label'][1:])
        self.settingsWidget.ui.x_label_auto.setChecked(
            settings['x_label_auto'])
        self.settingsWidget.ui.x_label_auto.toggled.emit(
            settings['x_label_auto'])
        self.settingsWidget.ui.y_label_auto.setChecked(
            settings['y_label_auto'])
        self.settingsWidget.ui.y_label_auto.toggled.emit(
            settings['y_label_auto'])
        self.settingsWidget.ui.colormap_min.setText(settings['colormap_min'])
        self.settingsWidget.ui.colormap_max.setText(settings['colormap_max'])
        self.settingsWidget.ui.colormap_max.editingFinished.emit()
        transpose = self.settingsWidget.ui.transpose
        transpose.setCurrentIndex(transpose.findText(settings['transpose']))
        flipy = self.settingsWidget.ui.flipy
        flipy.setCurrentIndex(flipy.findText(settings['flipy']))
        flipx = self.settingsWidget.ui.flipx
        flipx.setCurrentIndex(flipx.findText(settings['flipx']))
        self.plot.getView().getViewBox().setState(settings['viewbox'])
        self.actionX_axis.setChecked(settings['x_view'])
        self.actionX_axis.triggered.emit(settings['x_view'])
        self.actionY_axis.setChecked(settings['y_view'])
        self.actionY_axis.triggered.emit(settings['y_view'])
        self.actionHistogram.setChecked(settings['histogram_view'])
        self.actionHistogram.triggered.emit(settings['histogram_view'])
        self.actionCrosshair.setChecked(settings['crosshair'])
        self.actionCrosshair.triggered.emit(settings['crosshair'])
        self.plot.getHistogramWidget().item.gradient.restoreState(
            settings['gradient_mode'])

        return DataWindow.restore_from_state(self, settings, data_sources)