use of org.eclipse.scanning.api.points.models.IScanPathModel in project gda-core by openGDA.
the class ScanpathTest method createModelCreatesCorrectModelForRasterWithVerticalMutator.
@Test
public void createModelCreatesCorrectModelForRasterWithVerticalMutator() throws Exception {
pathParams = Arrays.asList(0.5, 6.5);
mutators.put(Mutator.VERTICAL, Arrays.asList(blankArray));
IScanPathModel model = GRID_STEP.createModel(scannables, pathParams, bboxParams, mutators);
assertThat(model, is(instanceOf(TwoAxisGridStepModel.class)));
TwoAxisGridStepModel rModel = (TwoAxisGridStepModel) model;
assertThat(rModel.getScannableNames(), contains("name1", "name2"));
assertThat(rModel.getBoundingBox().getxAxisStart(), is(1.0));
assertThat(rModel.getBoundingBox().getyAxisStart(), is(2.0));
assertThat(rModel.getBoundingBox().getxAxisLength(), is(3.0));
assertThat(rModel.getBoundingBox().getyAxisLength(), is(4.0));
assertThat(rModel.getxAxisStep(), is(0.5));
assertThat(rModel.getyAxisStep(), is(6.5));
assertThat(rModel.getBoundingBox().getyAxisStart(), is(2.0));
assertThat(rModel.isAlternating(), is(false));
assertThat(rModel.isContinuous(), is(false));
assertThat(rModel.getOrientation(), is(Orientation.VERTICAL));
}
use of org.eclipse.scanning.api.points.models.IScanPathModel in project gda-core by openGDA.
the class ScanpathTest method createModelCreatesCorrectModelForOneDStep.
@Test
public void createModelCreatesCorrectModelForOneDStep() throws Exception {
pathParams = Arrays.asList(2, 3, 0.5);
IScanPathModel model = AXIS_STEP.createModel(axialScannables, pathParams, blineParams, mutators);
assertThat(model, is(instanceOf(AxialStepModel.class)));
AxialStepModel sModel = (AxialStepModel) model;
assertThat(sModel.getScannableNames(), contains("name1"));
assertThat(sModel.getStart(), is(2.0));
assertThat(sModel.getStop(), is(3.0));
assertThat(sModel.getStep(), is(0.5));
assertThat(sModel.getUnits(), is(equalTo(List.of("Deg"))));
}
use of org.eclipse.scanning.api.points.models.IScanPathModel in project gda-core by openGDA.
the class ScanpathTest method createModelCreatesCorrectModelForOneDEqualSpacing.
@Test
public void createModelCreatesCorrectModelForOneDEqualSpacing() throws Exception {
pathParams = Arrays.asList(-2, 2, 5);
IScanPathModel model = AXIS_POINTS.createModel(axialScannables, pathParams, bboxParams, mutators);
assertThat(model, is(instanceOf(AxialPointsModel.class)));
AxialPointsModel eModel = (AxialPointsModel) model;
assertThat(eModel.getScannableNames(), contains("name1"));
assertThat(eModel.getStart(), is(-2.0));
assertThat(eModel.getStop(), is(2.0));
assertThat(eModel.getPoints(), is(5));
}
use of org.eclipse.scanning.api.points.models.IScanPathModel in project gda-core by openGDA.
the class ScanpathTest method createModelCreatesCorrectModelForTwoDStep.
@Test
public void createModelCreatesCorrectModelForTwoDStep() throws Exception {
pathParams = Arrays.asList(0.5);
IScanPathModel model = LINE_STEP.createModel(scannables, pathParams, blineParams, mutators);
assertThat(model, is(instanceOf(TwoAxisLineStepModel.class)));
TwoAxisLineStepModel sModel = (TwoAxisLineStepModel) model;
assertThat(sModel.getScannableNames(), contains("name1", "name2"));
assertThat(sModel.getBoundingLine().getxStart(), is(1.0));
assertThat(sModel.getBoundingLine().getyStart(), is(2.0));
assertThat(sModel.getBoundingLine().getLength(), is(5.0));
assertThat(Math.rint(Math.toDegrees(sModel.getBoundingLine().getAngle())), is(53.0));
assertThat(sModel.getStep(), is(0.5));
assertThat(sModel.isContinuous(), is(false));
assertThat(sModel.getUnits(), is(equalTo(List.of("Deg", "mm"))));
}
use of org.eclipse.scanning.api.points.models.IScanPathModel in project gda-core by openGDA.
the class ScanpathTest method createModelsCorrectModelForLissajous.
@Test
public void createModelsCorrectModelForLissajous() throws Exception {
pathParams = Arrays.asList(5, 6.0, 7.0);
IScanPathModel model = LISSAJOUS.createModel(scannables, pathParams, bboxParams, mutators);
assertThat(model, is(instanceOf(TwoAxisLissajousModel.class)));
TwoAxisLissajousModel lModel = (TwoAxisLissajousModel) model;
assertThat(lModel.getScannableNames(), contains("name1", "name2"));
assertThat(lModel.getBoundingBox().getxAxisStart(), is(1.0));
assertThat(lModel.getBoundingBox().getyAxisStart(), is(2.0));
assertThat(lModel.getBoundingBox().getxAxisLength(), is(3.0));
assertThat(lModel.getBoundingBox().getyAxisLength(), is(4.0));
assertThat(lModel.getPoints(), is(5));
assertThat(lModel.getA(), is(6.0));
assertThat(lModel.getB(), is(7.0));
assertThat(lModel.getBoundingBox().getyAxisStart(), is(2.0));
assertThat(lModel.isContinuous(), is(false));
}
Aggregations