Search in sources :

Example 1 with DeviceInformation

use of org.eclipse.scanning.api.event.scan.DeviceInformation in project gda-core by openGDA.

the class TimeSeriesScanView method createView.

@PostConstruct
public void createView(Composite parent, MPart part) {
    parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    parent.setBackgroundMode(SWT.INHERIT_DEFAULT);
    viewComposite = new Composite(parent, SWT.NONE);
    GridLayoutFactory.fillDefaults().applyTo(viewComposite);
    try {
        final List<DeviceInformation<?>> malcolmDeviceInfos = getMalcolmDeviceInfos();
        if (malcolmDeviceInfos.isEmpty()) {
            // no malcolm devices, show an error label
            createErrorLabel(viewComposite, "No malcolm devices found");
        } else {
            // normal case, show the view controls
            createViewControls(viewComposite, part, malcolmDeviceInfos);
        }
    } catch (ScanningException e) {
        logger.error("Could not get malcolm devices", e);
        createErrorLabel(parent, "Could not get malcolm devices.");
    }
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ScanningException(org.eclipse.scanning.api.scan.ScanningException) DeviceInformation(org.eclipse.scanning.api.event.scan.DeviceInformation) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 DeviceInformation (org.eclipse.scanning.api.event.scan.DeviceInformation)1 ScanningException (org.eclipse.scanning.api.scan.ScanningException)1 Composite (org.eclipse.swt.widgets.Composite)1