11-30-2012 07:25 PM
Hi,
I'm trying to programmatically access the report file directory in teststand 2012, the location of which changed vs. 2010. I found one at:
RunState.Root.Locals.ModelPluginConfiguration.Plugins[0].PluginSpecific.Options.Directory
But the "[0]" tells me it's 0 probably because the report is the first item in the result processing list, and if that ever changed, my code would break. Is there another location besides the above that holds the report directory?
Thanks
David J.
12-03-2012 10:52 PM
Hey David,
I managed to find another post which had a similar question,
http://forums.ni.com/t5/NI-TestStand/TestStand-2012-Report-File-Location-variable/td-p/2154742
I think this is what you're referring to and should help you out.
12-05-2012 10:24 AM
The problem about using [0] is that you are also under the assumption that someone has NOT reordered the list of plugins in the Result Processor list. To fix that you could check for the name of the Plugin instead of the index.
To do this you could utilize the ModelPluginConfiguration callback.
Foreach { Parameters.ModelPluginConfiguration.Plugins }
if { Locals.Plugin.Base.DisplayNameExpression == "\"Report\"" }
Then obtain the ReportFilePath
}
Now, if someone decides to delete the Report plugin, then that is another story.
Is there someway to prevent someone from DELETING a Plugin from the Results Processor window? I imagine privileges probably wouldn't allow a technician or operator to do this, but an admin probably still could. When it is deleted, it does not appear in the Configuration List, I would assume.
Thanks,
PH