Search in sources :

Example 1 with TwoAxisPtychographyModel

use of org.eclipse.scanning.api.points.models.TwoAxisPtychographyModel in project gda-core by openGDA.

the class PtychographySubmitScanSection method getRasterStepModel.

/**
 * Get the {@link TwoAxisGridStepModel} that is configured for this client (for raster scanning).
 * <p>
 * This may already be set in the mapping bean: if not, we need to obtain it from the controller and redraw the GUI
 * accordingly.
 *
 * @return the model, or {@code null} in the (unlikely) event that none is configured in the client.
 */
private TwoAxisGridStepModel getRasterStepModel() {
    final IScanPointGeneratorModel scanPath = getMappingBean().getScanDefinition().getMappingScanRegion().getScanPath();
    if (scanPath instanceof TwoAxisPtychographyModel) {
        return (TwoAxisGridStepModel) scanPath;
    }
    final RegionAndPathController controller = getService(RegionAndPathController.class);
    final TwoAxisGridStepModel model = (TwoAxisGridStepModel) controller.getScanPathListAndLinkPath().stream().filter(TwoAxisGridStepModel.class::isInstance).findFirst().orElse(null);
    if (model != null) {
        controller.changePath(model);
    }
    return model;
}
Also used : RegionAndPathController(uk.ac.diamond.daq.mapping.ui.experiment.RegionAndPathController) TwoAxisGridStepModel(org.eclipse.scanning.api.points.models.TwoAxisGridStepModel) IScanPointGeneratorModel(org.eclipse.scanning.api.points.models.IScanPointGeneratorModel) TwoAxisPtychographyModel(org.eclipse.scanning.api.points.models.TwoAxisPtychographyModel)

Aggregations

IScanPointGeneratorModel (org.eclipse.scanning.api.points.models.IScanPointGeneratorModel)1 TwoAxisGridStepModel (org.eclipse.scanning.api.points.models.TwoAxisGridStepModel)1 TwoAxisPtychographyModel (org.eclipse.scanning.api.points.models.TwoAxisPtychographyModel)1 RegionAndPathController (uk.ac.diamond.daq.mapping.ui.experiment.RegionAndPathController)1