I need help creating a Wait node with a Digital I/O set. Here is a sample of what I have so far.
private void createJobSubTree() {
ProgramNodeFactory programNodeFactory = apiProvider.getProgramAPI().getProgramModel().getProgramNodeFactory();
try {
final TreeNode rootNode = programModel.getRootTreeNode(this);
TreeNode moveJToScrewPresenterTreeNode = folderTreeNode.addChild(moveJToScrewPresenter);
WaitNode waitHere = createWaitNodeIO();
TreeNode waitHereTreeNode = folderTreeNode.addChild(waitHere);
} catch (Exception
e) {
throw new IllegalStateException("Could not add direction and until nodes to program tree", e);
}
}
private WaitNode createWaitNodeIO() throws InvalidExpressionException {
DigitalIO presenterIO = getDigitalIO(getPresenterIOSelection());
WaitNode waitNode = this.programNodeFactory.createWaitNode();
WaitNodeConfigFactory waitConfig = waitNode.getConfigFactory();
DigitalInputWaitNodeConfig ioConfig = waitConfig.createDigitalInputConfig(presenterIO, true);
return waitNode.setConfig(ioConfig);
}
I know I’m missing something before the DigitalInputWaitNodeConfig in the WaitNode class, but I don’t know what.