use of org.eclipse.scanning.api.event.scan.ProcessingRequest in project gda-core by openGDA.
the class ScanRequestFactory method createScanRequest.
public ScanRequest createScanRequest(IRunnableDeviceService runnableDeviceService) throws ScanningException {
// Populate the {@link ScanRequest} with the assembled objects
var scanRequest = new ScanRequest();
scanRequest.setTemplateFilePaths(new HashSet<>());
prepareScanRequestAccordingToScanType(scanRequest);
Optional.ofNullable(getAcquisition().getAcquisitionLocation()).map(URL::getPath).ifPresent(scanRequest::setFilePath);
try {
scanRequest.setCompoundModel(createCompoundModel());
} catch (GDAException e) {
throw new ScanningException("Cannot create compound model", e);
}
parseAcquisitionEngine(scanRequest, runnableDeviceService);
addPosition(createStartPosition(), scanRequest::setStartPosition);
addPosition(createEndPosition(), scanRequest::setEnd);
scanRequest.setMonitorNamesPerPoint(parseMonitorNamesPerPoint());
scanRequest.setProcessingRequest(new ProcessingRequest());
scanRequest.getProcessingRequest().setRequest(new HashMap<>());
for (ProcessingRequestPair<?> request : getAcquisitionConfiguration().getProcessingRequest()) {
getProcessingRequestHandlerService().handle(request, scanRequest);
}
return scanRequest;
}
Aggregations