use of org.eclipse.scanning.api.script.IScriptService in project gda-core by openGDA.
the class TomographyConfigurationDialog method performDryRun.
private void performDryRun() {
try {
// Put calibration data etc. into script context
final IScriptService scriptService = getService(IScriptService.class);
final IMarshallerService marshallerService = getService(IMarshallerService.class);
final ScanRequest scanRequest = getScanRequest(mappingView.getBean());
final TomographyParams tomoParams = new TomographyParams();
tomoParams.setTomographyCalibration(new TomographyCalibrationData(xCalibration, zCalibration));
populateScriptService(scriptService, marshallerService, scanRequest, tomoParams);
// Run script
final JythonServerFacade jythonServerFacade = JythonServerFacade.getInstance();
setDryRunEnabled(false);
logger.info("Running tomography scan");
jythonServerFacade.runScript(tomoScript);
while (jythonServerFacade.getScriptStatus() == RUNNING) {
Thread.sleep(500);
}
logger.info("Finished running tomography scan");
} catch (Exception e) {
logger.error("Error running tomography scan", e);
} finally {
setDryRunEnabled(true);
}
}
Aggregations