NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I detect a step's "Record Results" setting from C-Sharp

We have developed a C# GUI application to hand-hold a user through the execution of a test (so he doesn't need to know how to run Test Stand).  After a test is complete we walk the results tree, and I want to know if the "Record Results" check box is selected for each step.  Is there a call I can make to get this info?

0 Kudos
Message 1 of 12
(4,229 Views)

Not sure what you mean by "results tree"??  If you are talking about Locals.ResultList then you won't have any entries for steps with Record Results unchecked.  Because that's what unchecking that box does- it tells the step to not put anything in Locals.ResultList.

 

Use Step.RecordResult to determine if the box is checked.  True means it is.  False means it isn't.

 

Hope this helps some,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 12
(4,227 Views)

You are quite correct.  I've mis-interpreted someone's comments and started down the wrong path.

 

What about the Result Filtering Expression under the Configure->ReportOptions... menu selection - Is the rule specified in the Result Filtering Expression automatically applied to the ResultsList?

 

0 Kudos
Message 3 of 12
(4,215 Views)

Report Options are used by the process model so they do not affect what gets put in Locals.ResultList.  The Report Options just determine how to present the data collected.

 

Hope this clarifies!

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 12
(4,206 Views)

Thanks.

 

So if my C# code is parsing the Locals.ResultsList I would need to retrieve the Result Filtering Expression and perform the comparison against Step.Result myself.

 

From C# how do I access the Result Filtering Expression string?

0 Kudos
Message 5 of 12
(4,202 Views)

Generally it's a bad idea for the UI to generate and filter results.  That is the purpose of the process model.  However, if you are determined on doing it then you can see how it's done in the Sequential Model.  Basically any of the sequences that say report have something to do with generating the report.  For instance the TestReport sequence builds the body of the report.  You can follow it's flow and see how things are done.  Also, the source code for modelsupport2.dll is available in the <TestStand>/Components/Models/TestStandModels folder if you need to look through the code.  It's in C.

 

Also in the Process Model you will find a SequenceFilePostResultListEntry sequence.  It's purplish.  Every time an entry gets put in ResultList then this sequence executes.  You can follow that to see how they deal with it there.  It depends on the type of report.

 

Hope this points you in the right direction.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 12
(4,200 Views)

So ther is no way to get the Results Filtering Expression string using a call through AxApplicationMgr.GetEngine() or some other set of TestStand API calls?

0 Kudos
Message 7 of 12
(4,194 Views)

RunState.Root.Locals.ReportOptions.ResultFilterExpression

 

You have to have an execution.  Otherwise you could go parse that ini file I referenced earlier.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 8 of 12
(4,188 Views)

Great!

 

So I have updated my code to retrieve the ResultFilterExpression using code like this: 

string data = mySequenceContext.AsPropertyObject().GetValString(
    "RunState.Root.Locals.ReportOptions.ResultFilterExpression",
     PropertyOptions.PropOption_NoOptions);

and it results in a string containing:

    • True
    • Result.Status != "Passed" && Result.Status != "Done" && Result.Status != "Skipped"
    • Result.Status == "Passed" || Result.Status == "Done"
    • or a customized string

Does TestStand have a built in way to evaluate this string, or do I need to develop a parser to interpret which Result.Status values are used?

0 Kudos
Message 9 of 12
(4,153 Views)

Hi tlaford,

 

Could you elaborate a little bit on your results? How are you getting each instance of the results? For example, what action/sequence/setting cause you to receive the "true" result? Could you post a couple of screen shots here? 

 

Sorry for all the questions here. Some clearification will go a long way here.  

 

Regards,

 

Josh L.

 

 

Applications Engineer
National Instruments
0 Kudos
Message 10 of 12
(4,135 Views)