diff --git a/hexrd/ui/calibration/panel_buffer_dialog.py b/hexrd/ui/calibration/panel_buffer_dialog.py index 38781ea07..05175de69 100644 --- a/hexrd/ui/calibration/panel_buffer_dialog.py +++ b/hexrd/ui/calibration/panel_buffer_dialog.py @@ -35,6 +35,7 @@ def __init__(self, detector, parent=None): def setup_connections(self): self.ui.select_file_button.pressed.connect(self.select_file) self.ui.config_mode.currentIndexChanged.connect(self.update_mode_tab) + self.ui.clear_panel_buffer.clicked.connect(self.clear_panel_buffer) self.ui.accepted.connect(self.on_accepted) self.ui.rejected.connect(self.on_rejected) @@ -160,3 +161,12 @@ def mode(self, v): def update_mode_tab(self): mode_tab = getattr(self.ui, self.mode + '_tab') self.ui.tab_widget.setCurrentWidget(mode_tab) + + def clear_panel_buffer(self): + # Clear the config options on the internal config + detector_config = HexrdConfig().detector(self.detector) + + buffer_default = {'status': 0} + buffer = detector_config.setdefault('buffer', buffer_default) + + buffer['value'] = buffer['value'] = [0., 0.] diff --git a/hexrd/ui/resources/ui/panel_buffer_dialog.ui b/hexrd/ui/resources/ui/panel_buffer_dialog.ui index 9295f7f6c..1ea424b80 100644 --- a/hexrd/ui/resources/ui/panel_buffer_dialog.ui +++ b/hexrd/ui/resources/ui/panel_buffer_dialog.ui @@ -156,6 +156,13 @@ + + + + Clear Panel Buffer + + + @@ -234,5 +241,21 @@ + + clear_panel_buffer + clicked() + detector_panel_buffer + reject() + + + 76 + 273 + + + 238 + 147 + + +