Is there a way to add in a custom “Gateway Event Script” hook from the module SDK?
I’m writing a module that will stream/gather an entire dataset as a single packet from a device and I’d like a hook to use python to process that data. I was thinking a “onDataReceived” gateway event script would be the easiest way to handle that but I’m open to other suggestions if there’s an easier method.
Sorry, none of that is extensible. I think you’d have to add your own kind of resource and node to the Designer resource tree… and build your own UI for editing.
You would need your own singleton resource type. If you extend com.inductiveautomation.ignition.common.script.ScriptConfig
(ignoring the builtin bean properties), you can also subclass com.inductiveautomation.ignition.designer.scripteditor.GlobalScriptEditor
to register your own com.inductiveautomation.ignition.designer.scripteditor.GlobalScriptEditor.ScriptConfigPanel
- that’ll save you some effort in recreating the UI. That’s how client and session event scripts work.
If I did that I’d still have to set that up as a separate resource in the designer project browser correct?
I might play with it a bit because that might not be the end of the world…
Yeah, you’d have to add your own ‘Tamaki Control’ (or whatever else) node to the project browser.
Another option that the SECS/GEM module uses is to programatically fire a message and require a message handler with a specific name be defined in the gateway event scripts. However, that’s got pretty poor discoverability and isn’t a great paradigm (in my opinion).
It’s not the end of the world. I did it as a global editor for events from my Ethernet/IP module.