Search in sources :

Example 1 with IScannableDeviceService

use of org.eclipse.scanning.api.device.IScannableDeviceService in project gda-core by openGDA.

the class BeamPositionPlotter method getBeamSize.

private double getBeamSize() throws ScanningException {
    if (beamSize < 0 && mappingStageInfo.getBeamSize() != null) {
        try {
            final URI jmsUri = new URI(LocalProperties.getActiveMQBrokerURI());
            final IScannableDeviceService scannableDeviceService = eventService.createRemoteService(jmsUri, IScannableDeviceService.class);
            IScannable<Double> beamScannable = scannableDeviceService.getScannable(mappingStageInfo.getBeamSize());
            if (beamScannable != null)
                beamSize = beamScannable.getPosition();
        } catch (ScanningException e) {
            throw e;
        } catch (Exception e) {
            throw new ScanningException(e);
        }
    }
    return beamSize;
}
Also used : IScannableDeviceService(org.eclipse.scanning.api.device.IScannableDeviceService) ScanningException(org.eclipse.scanning.api.scan.ScanningException) URI(java.net.URI) ScanningException(org.eclipse.scanning.api.scan.ScanningException) DeviceException(gda.device.DeviceException)

Aggregations

DeviceException (gda.device.DeviceException)1 URI (java.net.URI)1 IScannableDeviceService (org.eclipse.scanning.api.device.IScannableDeviceService)1 ScanningException (org.eclipse.scanning.api.scan.ScanningException)1