Search in sources :

Example 1 with EditDetectorModelDialog

use of org.eclipse.scanning.device.ui.device.EditDetectorModelDialog in project gda-core by openGDA.

the class DetectorsSection method editDetectorParameters.

private void editDetectorParameters(final IScanModelWrapper<IDetectorModel> detectorParameters) {
    try {
        if (detectorParameters.getModel() instanceof IMalcolmModel && getRunnableDeviceService().getRunnableDevice(detectorParameters.getModel().getName()).getDeviceState() == DeviceState.OFFLINE) {
            MessageDialog.openError(getShell(), "Malcolm Device " + detectorParameters.getModel().getName(), "Cannot edit malcolm device " + detectorParameters.getModel().getName() + " as it is offline.");
            return;
        }
    } catch (ScanningException e) {
        logger.error("Cannot get malcolm device", e);
    }
    final Dialog editModelDialog = new EditDetectorModelDialog(getShell(), getRunnableDeviceService(), detectorParameters.getModel(), detectorParameters.getName());
    editModelDialog.create();
    if (editModelDialog.open() == Window.OK) {
        dataBindingContext.updateTargets();
    }
}
Also used : ScanningException(org.eclipse.scanning.api.scan.ScanningException) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) EditDetectorModelDialog(org.eclipse.scanning.device.ui.device.EditDetectorModelDialog) Dialog(org.eclipse.jface.dialogs.Dialog) IMalcolmModel(org.eclipse.scanning.api.device.models.IMalcolmModel) EditDetectorModelDialog(org.eclipse.scanning.device.ui.device.EditDetectorModelDialog)

Example 2 with EditDetectorModelDialog

use of org.eclipse.scanning.device.ui.device.EditDetectorModelDialog in project gda-core by openGDA.

the class FocusScanSetupPage method editDetectorParameters.

private void editDetectorParameters(IScanModelWrapper<IDetectorModel> detectorModelWrapper) {
    final EditDetectorModelDialog editDialog = new EditDetectorModelDialog(getShell(), getRunnableDeviceService(), detectorModelWrapper.getModel(), detectorModelWrapper.getName());
    editDialog.create();
    editDialog.open();
// The dialog updates the model live, using , so we don't have to do anything here
}
Also used : EditDetectorModelDialog(org.eclipse.scanning.device.ui.device.EditDetectorModelDialog)

Aggregations

EditDetectorModelDialog (org.eclipse.scanning.device.ui.device.EditDetectorModelDialog)2 Dialog (org.eclipse.jface.dialogs.Dialog)1 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)1 IMalcolmModel (org.eclipse.scanning.api.device.models.IMalcolmModel)1 ScanningException (org.eclipse.scanning.api.scan.ScanningException)1