Transaction groups triggered expression item updating when trigger is false

Ok, so I’ve been down the rabbit hole and found Ignition’s (undocumented) PyComponentWrapper. I haven’t deciphered it enough to be sure, but it seems to be invoked only for particular situations, based on the string constants in the class file (like “getComponent” and “getComponents”).
To play with this, I constructed a conversion adapter like so:

public class PyComponentAdapter implements PyObjectAdapter {

	public PyComponentAdapter() {}

	@Override
	public boolean canAdapt(Object jObj) {
		return JComponent.class.isInstance(jObj);
	}

	@Override
	public PyObject adapt(Object jObj) {
		return new PyComponentWrapper(jObj);
	}
}

Followed by this initializer in my hook class:

static {
	Py.getAdapter().addPostClass(new PyComponentAdapter());
}

Which yielded this beta version of Simulation Aids. Your first expression above yields True/True with it. Give it a spin. I’m not entirely sure there isn’t a gotcha here, but it appears to work.
I’ll bet PyComponentWrapper could be simplified if this was adopted by IA in the base product.

Edit: See the newer version below. The March 15 version has been removed.

1 Like