10-30-2019 05:12 AM - edited 10-30-2019 05:14 AM
I am developing some test sequences where I need to change the report options programmatically and modfiy the report headers. To do this the first thing I would consider is just overriding the "ReportOptions" and "ModifyReportHeader" callbacks from within the sequence. However since I have multiple sequences I would like to Modify the callbacks at a higher level.
I have created a Custom Process Model, which is stored in a relative path to the test sequences. However the "ReportOptions" and "ModifyReportHeader" callbacks in that (from what I understand) are just placeholders and any changes to them have no impact during execution.
What actually get called and executed are the "ReportOptions" and "ModifyReportHeader" callbacks in "NI_ReportGenerator.seq". Therefore I created a Custom "NI_ReportGenerator.seq" which I have stored in the same folder as the Custom Process Model, however I can't quite figure out how to call the Custom "NI_ReportGenerator.seq" that I have created.
Any ideas on how I can call the Custom "NI_ReportGenerator.seq" or what is the best way to modify the report options and report header at a upper level so it reflects on all the test sequences?
A little background as to why I need a Custom Process Model and Custom "NI_ReportGenerator.seq" and for them to be relative to the test sequences. The test sequences are going to be deployed on to a system which already has other test sequences that may use the TestStand Standard Process Models and Model Plugins, so to prevent any interference with them I would like to deploy everything related to these test sequence in its own contained package.
10-30-2019 11:47 AM - edited 10-30-2019 11:48 AM
To run, a copy of the report generator would have to have instances configured in the Result Processing dialog box, just like the regular report generator.
I don't have bandwidth to create an example at the moment (maybe a PSE will jump in?), but I think the best solution would be to create an "addon", which is just a plugin placed in the ModelPlugins\Addons\ directory. Addons always run and don't need to be configured. Your addon wouldn't need to be based on an existing plugin, and it would only need one entry point.
The default report generator calls the ReportOptions callback in the Model Plugin - Begin entry point, so your addon could just define a later entry point to change the settings, Maybe Model Plugin - UUT Start?
In that entry point, your plugin would iterate through Parameters.ModelPluginConfiguration.Plugins looking for plugin instances with a Base.SequenceFileName of "NI_ReportGenerator.seq". Each of those is a configured instance of the default report generator. You could then change the report settings under PluginSpecific.Options. You could even make those changes conditional on the current client file being one of the files you want different settings for. How you would determine which client files fall in that group is up to you. Perhaps based on location under a specific folder?
10-31-2019 05:13 AM
Hi James,
Thanks for your reply! Much appreciated.
I am unfamiliar with "addons" in TestStand.
I am not sure how this "addon" gets invoked by the process model? Would I need to:
I also feel having to place the plugin ModelPlugins\Addons\ directory would go against what I am trying to achieve in trying to deploy this solution contained in itself, and could impact other test programs on the system especially if I am having to update the Result Processing configurations.
Regards
Kewal
10-31-2019 05:51 AM
Also while I see how this works with regards to "ReportOptions", I can't see how this can be applied for "ModifyReportHeader" as I don't believe there is any any point where the "addon" could be called where it can modify the data used in "ModifyReportHeader" before it is used to generate the report.