04-02-2009 06:26 AM
Hi,
I have some steps and corresponding variables added to Templates of insertion palette. Each of these steps are pre-configured with the parameter values with numbers, strings, bool values and also variables (which are added to Templates). On adding this step from templates to any sequence file, the parameter values for variables will appear in red indicating the variables do not exist in the current sequence context.
The question is, Is there a way by which the variables can be automatically added to the sequence file when the step is added from Templates?
Any help and advice would be greatly appreciated.
Software: TestStand versions used 4.0, 4.0.1, 4.1
Thanks
Mrm
04-02-2009 09:40 AM - edited 04-02-2009 09:44 AM
If you make the step a custom step type, you could add an OnNewStep substep that inserts whatever you want. This is how the flow control steps automatically insert their matching end steps. Without a custom step type, I can't think of an event you could hook into. I supposed you could install an SDK timer in the UI thread that polls for changecount modifications in all open files, but that would be an awkward unsupported hack.
04-03-2009 07:06 AM - edited 04-03-2009 07:13 AM
Hi James,
Each step added in template is different, in terms of functions called but to the same DLL, can custom step be created in such cases, i have steps of the order of few hundreds.
I'm having few more questions with this approach being followed to add the variables
Thanks for the new approach suggested, OnNewStep was new to me.
Regards
Mrm
04-03-2009 09:23 AM
The templates are accessed by Engine.GetTemplatesFile().Data.
The templates are just a hierarchy o PropertyObjects, so PropertyObject.Clone should work.