use of de.prob.animator.command.GetMachineOperationInfos in project prob2 by bendisposto.
the class GetMachineOperationInfosCommandTest method testGetMachineOperationInfosCommand.
@Test
public void testGetMachineOperationInfosCommand() throws IOException, ModelTranslationError {
System.out.println(Main.getProBDirectory());
System.out.println(api.getVersion());
s = api.b_load("src" + File.separator + "test" + File.separator + "resources" + File.separator + "b" + File.separator + "ExampleMachine.mch");
assertNotNull(s);
GetMachineOperationInfos command = new GetMachineOperationInfos();
s.execute(command);
System.out.println(command.getOperationInfos());
OperationInfo operationInfo = command.getOperationInfos().get(0);
assertEquals("Foo", operationInfo.getOperationName());
assertEquals("p1", operationInfo.getParameterNames().get(0));
assertEquals("p2", operationInfo.getParameterNames().get(1));
assertEquals("out1", operationInfo.getOutputParameterNames().get(0));
assertEquals("out2", operationInfo.getOutputParameterNames().get(1));
}
use of de.prob.animator.command.GetMachineOperationInfos in project prob2 by bendisposto.
the class LoadedMachine method getOperations.
private Map<String, OperationInfo> getOperations() {
if (this.machineOperationInfos == null) {
GetMachineOperationInfos command = new GetMachineOperationInfos();
this.stateSpace.execute(command);
this.machineOperationInfos = command.getOperationInfos().stream().collect(Collectors.toMap(OperationInfo::getOperationName, i -> i));
}
return this.machineOperationInfos;
}
Aggregations