use of org.eclipse.scanning.api.scan.ScanningException in project gda-core by openGDA.
the class ZebraRunnableDevice method run.
@Override
public void run(IPosition position) throws ScanningException, InterruptedException {
try {
// Reset
EPICS_CONTROLLER.caputWait(resetChannel, 1);
// Arm
EPICS_CONTROLLER.caput(armChannel, 1);
while (EPICS_CONTROLLER.cagetInt(armOutChannel) != 0) {
Thread.sleep(50);
}
} catch (CAException | TimeoutException e) {
final String message = "Error collecting data";
logger.error(message, e);
throw new ScanningException(message, e);
}
}
use of org.eclipse.scanning.api.scan.ScanningException in project gda-core by openGDA.
the class ZebraRunnableDevice method configure.
@Override
public void configure(ZebraModel model) throws ScanningException {
if (StringUtils.isEmpty(basePv)) {
final String message = "Base PV not set";
logger.error(message);
throw new ScanningException(message);
}
// Create Epics channels
try {
resetChannel = EPICS_CONTROLLER.createChannel(basePv + "SYS_RESET.PROC");
armChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_ARM");
armOutChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_ARM_OUT");
gateWidthChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_GATE_WID");
pulseDelayChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_PULSE_DLY");
div1LastChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_DIV1_LAST");
div2LastChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_DIV2_LAST");
div3LastChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_DIV3_LAST");
div4LastChannel = EPICS_CONTROLLER.createChannel(basePv + "PC_DIV4_LAST");
} catch (CAException | TimeoutException e) {
final String message = "Error creating EPICS channel";
logger.error(message, e);
throw new ScanningException(message, e);
}
// Setup exposure time
try {
EPICS_CONTROLLER.caputWait(gateWidthChannel, model.getExposureTime());
EPICS_CONTROLLER.caputWait(pulseDelayChannel, model.getExposureTime());
} catch (TimeoutException | CAException | InterruptedException e) {
final String message = "Error setting exposure time";
logger.error(message, e);
throw new ScanningException(message, e);
}
super.configure(model);
}
use of org.eclipse.scanning.api.scan.ScanningException in project gda-core by openGDA.
the class AreaDetectorRunnableDevice method scanEnd.
/**
* add call to {@link ADDetector#atScanEnd()} so decorators in collection strategy work to restore detector state.
*/
@Override
@ScanEnd
public void scanEnd(ScanInformation info) throws ScanningException {
super.scanEnd(info);
try {
adDetector.atScanEnd();
firstPointInScan = false;
} catch (DeviceException e) {
throw new ScanningException("Error calling atScanEnd", e);
}
}
use of org.eclipse.scanning.api.scan.ScanningException 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.");
}
}
use of org.eclipse.scanning.api.scan.ScanningException in project gda-core by openGDA.
the class MappingTriggerProcessor method process.
@Override
public IdBean process(Triggerable triggerable) {
TriggerableMap map = (TriggerableMap) triggerable;
ScanBean scanBean = map.trigger();
try {
URL url = SpringApplicationContextFacade.getBean(ExperimentController.class).prepareAcquisition(map.getName());
scanBean.getScanRequest().setFilePath(url.getFile());
} catch (ExperimentControllerException e) {
logger.error("Error getting URL for triggered scan - data will not reflect experiment structure", e);
}
try {
if (map.isImportant()) {
scanSubmitter.submitImportantScan(scanBean);
} else {
scanSubmitter.submitScan(scanBean);
}
} catch (ScanningException | EventException e) {
logger.error("Could not submit scan", e);
}
return scanBean;
}
Aggregations