@Test public void testScanRequestWithROI() throws Exception { BoundingBox bbox = new BoundingBox(); bbox.setFastAxisStart(0); bbox.setSlowAxisStart(1); bbox.setFastAxisLength(10); bbox.setSlowAxisLength(11); GridModel gmodel = new GridModel(); gmodel.setFastAxisName("myFast"); gmodel.setSlowAxisName("mySlow"); gmodel.setBoundingBox(bbox); gmodel.setFastAxisPoints(3); gmodel.setSlowAxisPoints(4); CircularROI croi = new CircularROI(); ScanRequest<IROI> request = new ScanRequest<>(); CompoundModel cmodel = new CompoundModel(); cmodel.setData(gmodel, croi); request.setCompoundModel(cmodel); assertEquals( // Concise. "mscan(grid(('myFast', 'mySlow'), (0.0, 1.0), (10.0, 12.0), count=(3, 4), snake=False, roi=circ((0.0, 0.0), 1.0)))", pyExpress(request, false)); assertEquals( // Verbose. "mscan(path=[grid(axes=('myFast', 'mySlow'), start=(0.0, 1.0), stop=(10.0, 12.0), count=(3, 4), snake=False, roi=[circ(origin=(0.0, 0.0), radius=1.0)])])", pyExpress(request, true)); }
public void validate(CompoundModel model) throws Exception { if (model.getModels() == null || model.getModels().isEmpty()) { throw new ModelValidationException("There are no models defined.", model, "models"); } final IValidatorService vservice = new ValidatorService(); for (Object mod : model.getModels()) vservice.validate(mod); }