use of uk.ac.diamond.daq.mapping.ui.experiment.MappingExperimentView in project gda-core by openGDA.
the class MappingXanesTemplateHandler method loadTemplate.
private void loadTemplate(String templatePath) {
final IMappingExperimentBean template;
try {
final byte[] bytes = Files.readAllBytes(Paths.get(templatePath));
final String json = new String(bytes, "UTF-8");
final IMarshallerService marshaller = getService(IMarshallerService.class);
template = marshaller.unmarshal(json, MappingExperimentBean.class);
} catch (Exception e) {
logger.error("Error loading template", e);
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Mapping template", "Could not load map template. Map parameters have not been changed.");
return;
}
final IMappingExperimentBeanProvider beanProvider = getService(IMappingExperimentBeanProvider.class);
final IMappingExperimentBean currentBean = beanProvider.getMappingExperimentBean();
template.getScanDefinition().setMappingScanRegion(currentBean.getScanDefinition().getMappingScanRegion());
beanProvider.setMappingExperimentBean(template);
final MappingExperimentView view = (MappingExperimentView) getService(EPartService.class).findPart(MappingExperimentView.ID).getObject();
view.updateControls();
}
use of uk.ac.diamond.daq.mapping.ui.experiment.MappingExperimentView in project gda-core by openGDA.
the class SubmitScanToScriptSection method selectOuterScannable.
/**
* Select or deselect a scannable in OuterScannablesSection
* <p>
* The relevant scannable will be made visible in the outer scannable section if it is not already visible.
*
* @param scannableName
* name of the scannable to select/deselect
* @param select
* <code>true</code> to select the motor, <code>false</code> to deselect it
*/
protected void selectOuterScannable(String scannableName, boolean select) {
final MappingExperimentView mappingView = getMappingView();
final OuterScannablesSection outerScannablesSection = mappingView.getSection(OuterScannablesSection.class);
if (outerScannablesSection == null) {
logger.error("OuterScannablesSection not found");
return;
}
outerScannablesSection.showScannable(scannableName, select);
mappingView.updateControls();
}
Aggregations