def __init__(self, controller, parent=None): super(MapSpecificOptions, self).__init__(parent) self.setupUi(self) self._controller = controller self._current_map = None self.colormap.addItems( ['-- Use global --'] + self._controller.get_config().get_available_colormaps()) self.colormap.currentIndexChanged.connect(self._update_colormap) self.data_clipping_min.valueChanged.connect(self._update_clipping_min) self.data_clipping_max.valueChanged.connect(self._update_clipping_max) self.data_scale_min.valueChanged.connect(self._update_scale_min) self.data_scale_max.valueChanged.connect(self._update_scale_max) self.data_set_use_scale.stateChanged.connect(self._set_use_scale) self.use_data_scale_min.stateChanged.connect( self._set_use_data_scale_min) self.use_data_scale_max.stateChanged.connect( self._set_use_data_scale_max) self.data_set_use_clipping.stateChanged.connect(self._set_use_clipping) self.use_data_clipping_min.stateChanged.connect( self._set_use_data_clipping_min) self.use_data_clipping_max.stateChanged.connect( self._set_use_data_clipping_max) self._title_timer = TimedUpdate(self._update_map_title) self.map_title.textChanged.connect( lambda v: self._title_timer.add_delayed_callback(500, v)) self._colorbar_label_timer = TimedUpdate(self._update_colorbar_label) self.data_colorbar_label.textChanged.connect( lambda v: self._colorbar_label_timer.add_delayed_callback(500, v)) self.info_Clipping.set_collapse(True)
def __init__(self, controller, parent=None): super().__init__(parent) self.setupUi(self) self._controller = controller current_model = self._controller.get_model() self._current_map = None self.colormap.addItems( ['-- Use global --'] + current_model.get_config().get_available_colormaps()) self.colormap.currentIndexChanged.connect(self._update_colormap) self.data_clipping_min.valueChanged.connect(self._update_clipping_min) self.data_clipping_max.valueChanged.connect(self._update_clipping_max) self.data_scale_min.valueChanged.connect(self._update_scale_min) self.data_scale_max.valueChanged.connect(self._update_scale_max) self.data_set_use_scale.stateChanged.connect(self._set_use_scale) self.use_data_scale_min.stateChanged.connect( self._set_use_data_scale_min) self.use_data_scale_max.stateChanged.connect( self._set_use_data_scale_max) self.data_set_use_clipping.stateChanged.connect(self._set_use_clipping) self.use_data_clipping_min.stateChanged.connect( self._set_use_data_clipping_min) self.use_data_clipping_max.stateChanged.connect( self._set_use_data_clipping_max) self._title_timer = TimedUpdate(self._update_map_title) self.map_title.textChanged.connect( lambda: self._title_timer.add_delayed_callback(500)) self.map_title.setFixedHeight( QFontMetrics(self.map_title.font()).lineSpacing() * 3) self._colorbar_label_timer = TimedUpdate(self._update_colorbar_label) self.data_colorbar_label.textChanged.connect( lambda: self._colorbar_label_timer.add_delayed_callback(500)) self.data_colorbar_label.setFixedHeight( QFontMetrics(self.data_colorbar_label.font()).lineSpacing() * 3) self.info_Clipping.set_collapse(True) self._auto_enable_scale_min = False self._auto_enable_scale_max = False self._auto_enable_clipping_min = False self._auto_enable_clipping_max = False self.reset() self._update_scaling_delays()
def __init__(self, parent): super(ScientificNumberScroller, self).__init__(parent) self.setupUi(self) self.mantissa.valueChanged.connect(self._value_changed_cb) self.exponent.valueChanged.connect(self._value_changed_cb) self._timer = TimedUpdate(self._signal_new_value) self._update_delay = 0
def __init__(self, controller, parent=None): super(TabGeneral, self).__init__(parent) self.setupUi(self) self._controller = controller self._controller.new_data.connect(self.set_new_data) self._controller.new_config.connect(self.set_new_config) self.general_display_order.setDragDropMode(QAbstractItemView.InternalMove) self.general_display_order.setSelectionMode(QAbstractItemView.SingleSelection) self.general_colormap.addItems(self._controller.get_config().get_available_colormaps()) self.general_rotate.addItems(['0', '90', '180', '270']) self.general_rotate.setCurrentText(str(self._controller.get_config().rotate)) self.general_DisplayOrder.set_collapse(True) self.general_Miscellaneous.set_collapse(True) self.general_Zoom.set_collapse(True) self.general_Font.set_collapse(True) self.general_dimension.valueChanged.connect(lambda v: self._controller.apply_action(SetDimension(v))) self.general_slice_index.valueChanged.connect(lambda v: self._controller.apply_action(SetSliceIndex(v))) self.general_volume_index.valueChanged.connect(lambda v: self._controller.apply_action(SetVolumeIndex(v))) self.general_colormap.currentIndexChanged.connect( lambda i: self._controller.apply_action(SetColormap(self.general_colormap.itemText(i)))) self.general_rotate.currentIndexChanged.connect( lambda i: self._controller.apply_action(SetRotate(int(self.general_rotate.itemText(i))))) self._map_selection_timer = TimedUpdate(self._update_maps_to_show) self.general_map_selection.itemSelectionChanged.connect( lambda: self._map_selection_timer.add_delayed_callback(500)) self.general_deselect_all_maps.clicked.connect(self._deleselect_all_maps) self.general_invert_map_selection.clicked.connect(self._invert_map_selection) self.general_zoom_x_0.valueChanged.connect(self._update_zoom) self.general_zoom_x_1.valueChanged.connect(self._update_zoom) self.general_zoom_y_0.valueChanged.connect(self._update_zoom) self.general_zoom_y_1.valueChanged.connect(self._update_zoom) self.plot_title.textEdited.connect(lambda txt: self._controller.apply_action(SetPlotTitle(txt))) self.general_zoom_reset.clicked.connect(lambda: self._controller.apply_action(SetZoom(Zoom.no_zoom()))) self.general_zoom_fit.clicked.connect(self._zoom_fit) self.general_display_order.items_reordered.connect(self._reorder_maps) self.general_show_axis.clicked.connect(lambda: self._controller.apply_action( SetShowAxis(self.general_show_axis.isChecked()))) self.general_colorbar_nmr_ticks.valueChanged.connect( lambda v: self._controller.apply_action(SetColorBarNmrTicks(v))) self.general_font_family.addItems(Font.font_names()) self.general_font_family.currentTextChanged.connect( lambda v: self._controller.apply_action(SetFont(self._controller.get_config().font.get_updated(family=v)))) self.general_font_size.valueChanged.connect( lambda: self._controller.apply_action( SetFont(self._controller.get_config().font.get_updated(size=self.general_font_size.value())))) self.general_interpolation.addItems(self._controller.get_config().get_available_interpolations()) self.general_interpolation.currentTextChanged.connect( lambda v: self._controller.apply_action(SetInterpolation(v))) self.general_flipud.clicked.connect(lambda: self._controller.apply_action( SetFlipud(self.general_flipud.isChecked()))) self.mask_name.currentIndexChanged.connect(self._update_mask_name)
def __init__(self, *args): super(TextConfigEditor, self).__init__(*args) self._timer = TimedUpdate(self._timer_event) self.textChanged.connect(lambda: self._timer.add_delayed_callback(400))