use of org.eclipse.scanning.api.points.models.IScanPathModel in project gda-core by openGDA.
the class DescriptiveFilenameFactory method getFilenameDescriptor.
/**
* Generates the shape/path descriptor text for the supplied mapping bean
*
* @param bean The mapping bean containing the {@link IMappingScanRegionShape} and {@link IScanPathModel} to
* be described
* @return The corresponding descriptive text.
*/
private final String getFilenameDescriptor(final IMappingExperimentBean bean) {
IMappingScanRegionShape region = bean.getScanDefinition().getMappingScanRegion().getRegion();
IScanPathModel path = bean.getScanDefinition().getMappingScanRegion().getScanPath();
if (!regionLookup.containsKey(region.getClass()) || !pathLookup.containsKey(path.getClass())) {
throw new IllegalArgumentException("Unknown region or path");
}
StringBuilder descriptor = new StringBuilder("S");
descriptor.append(regionLookup.get(region.getClass()).id);
descriptor.append(regionLookup.get(region.getClass()).paramSupplier.apply(region));
descriptor.append("P");
descriptor.append(pathLookup.get(path.getClass()).id);
descriptor.append(pathLookup.get(path.getClass()).paramSupplier.apply(path));
descriptor.append(pathLookup.get(path.getClass()).mutatorSupplier.apply(path));
return descriptor.toString();
}
Aggregations