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;
}
Aggregations