Search in sources :

Example 16 with IScanPathModel

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();
}
Also used : IMappingScanRegionShape(uk.ac.diamond.daq.mapping.api.IMappingScanRegionShape) IScanPathModel(org.eclipse.scanning.api.points.models.IScanPathModel)

Aggregations

IScanPathModel (org.eclipse.scanning.api.points.models.IScanPathModel)16 Test (org.junit.Test)13 IMappingScanRegionShape (uk.ac.diamond.daq.mapping.api.IMappingScanRegionShape)3 TwoAxisGridPointsModel (org.eclipse.scanning.api.points.models.TwoAxisGridPointsModel)2 TwoAxisGridStepModel (org.eclipse.scanning.api.points.models.TwoAxisGridStepModel)2 GridDataFactory (org.eclipse.jface.layout.GridDataFactory)1 ComboViewer (org.eclipse.jface.viewers.ComboViewer)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 LabelProvider (org.eclipse.jface.viewers.LabelProvider)1 AxialArrayModel (org.eclipse.scanning.api.points.models.AxialArrayModel)1 AxialPointsModel (org.eclipse.scanning.api.points.models.AxialPointsModel)1 AxialStepModel (org.eclipse.scanning.api.points.models.AxialStepModel)1 IScanPointGeneratorModel (org.eclipse.scanning.api.points.models.IScanPointGeneratorModel)1 TwoAxisGridPointsRandomOffsetModel (org.eclipse.scanning.api.points.models.TwoAxisGridPointsRandomOffsetModel)1 TwoAxisLinePointsModel (org.eclipse.scanning.api.points.models.TwoAxisLinePointsModel)1 TwoAxisLineStepModel (org.eclipse.scanning.api.points.models.TwoAxisLineStepModel)1 TwoAxisLissajousModel (org.eclipse.scanning.api.points.models.TwoAxisLissajousModel)1 TwoAxisPointSingleModel (org.eclipse.scanning.api.points.models.TwoAxisPointSingleModel)1 TwoAxisSpiralModel (org.eclipse.scanning.api.points.models.TwoAxisSpiralModel)1 Image (org.eclipse.swt.graphics.Image)1