NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the highlighted step in the Sequence Editor?

Hi all!
 
I am trying to figure out how to programatically change the highlighted step in the sequence editor view.. (creating a TS tool)
 
How can one do that?  I can't find a method or property that does it...I can find step index, get step object references etc...
 
 
Thanks!
0 Kudos
Message 1 of 7
(4,501 Views)

Hi,

Not sure if it can be done, but if it is possible I think you would have to set up the properties found in RunState.InitialSelection

RunState.InitialSelection.SelectedSteps
RunState.InitialSelection.SelectedSequences
RunState.InitialSelection.SelectedFile
RunState.InitialSelection.SelectedPropertyObjectFile
RunState.InitialSelection.SelectedStepGroupByIndex

If you load up an example SequenceFile, then select a couple of steps in the MainSequence.  The select  the menu item View |  Browse Sequence Context...Then expand the tree for RunState etc....

Regards

Ray Farmer

 

Regards
Ray Farmer
0 Kudos
Message 2 of 7
(4,497 Views)
I haven't tried it, but I suspect those properties aren't going to help. I think they only indicate the selection rather than control it.
 
I do want to mention that there will probably be a very general and powerful mechanism for doing things like this in a future version of TestStand.
0 Kudos
Message 3 of 7
(4,492 Views)

Hi,

Creating a New InteractiveArgs and supplying the reference to the NewExecution would be the same as making a selection.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 7
(4,481 Views)
Thanks for the response!

I used the RunState.InitialSelection properties to figure out which steps were selected and was also able to use  Sequence.GetStep to get  a step object reference to a different step, but was not able to figure out how to update the sequence editor display so that it would highlight the selected step in the sequence editor

I use the following methods and properties and assume that the user wishes to run the "edit" step for all steps after the selected step...


Step.Executesubstep with reference to RunState.InitialSelection.SelectedSteps[0] to run the edit step for the selected step

Sequence.GetStepIndex with reference to RunState.InitialSelection.SelectedSequences[0]  and ThisContext.RunState.InitialSelection.SelectedSteps[0]) to get the index of the  selected step

Sequence.Get Step with object RunState.InitialSelection.SelectedSequences[0] to get a step object to a new step

Step.Name to display the name of the slected step in a dialog box (for debugging purposes)

I was trying to create a tool that runs the  "edit"  substep  for all steps in a subsequence consecutively, while highlighted the steps for which the "edit" step was being executed.  I was trying to do this as i have a number of custom step types and find it easier to edit thier properties using my custom edit substep rather than export/import properties tool or by editing the .seq file.....



0 Kudos
Message 5 of 7
(4,466 Views)
Just curious... was this featue implemented in TS 4.x or is it something for a future release?
0 Kudos
Message 6 of 7
(4,308 Views)

To set the selection in 4.0, you can now do the following:

- Get a reference to the ApplicationMgr (if you don't already have one) by calling Engine.GetInternalOption(InternalOption_ApplicationManager)

- Get a reference to the SequenceFileViewMgr (if you don't already have one) that displays the file you want to select steps in by calling ApplicationMgr.GetSequenceViewMgr([your sequence file])

- Use the methods on SequenceFileViewMgr.SelectedSteps to set the selection

 

The changes in 4.0 that enable this are:

a) The SequenceEditor is now like the UIs in that it uses TestStand UI Manager controls such as the ApplicationMgr

b) Engine.GetInternalOption(InternalOption_ApplicationManager) enables you to obtain the ApplicationMgr, even for applications you do not have the source code for (such as the sequence editor)

 

Beyond setting the selection, you can use the manager controls to issue commands and go to specific locations in any application that uses the TestStand UI controls. Refer to the GetCommand method on the ApplicationMgr, SequenceFileViewMgr, and ExecutionViewMgr, and the GotoLocation method on the Locations object.

0 Kudos
Message 7 of 7
(4,289 Views)