Special Variables

These are special Python variables that can be used in specific areas of GainSeeker.

See Python commands for other commands you can use with GainSeeker.

 

Variable

Applies to

Description

cancelsubmit

PC Collect inspection

This variable can be set to one of these values:

  • False (the default value) : When the user clicks Submit, data records for the sub-inspection are stored in the GainSeeker database and the sub-inspection data entry window is closed.

  • True : When the user clicks Submit, the sub-inspection data entry window remains open and data records for the sub-inspection are not stored in the GainSeeker database. The sub-inspection cannot be submitted until this variable is set to False .

You can set this variable in any script in the sub-inspection.

Each time a sub-inspection is opened, this variable is reset to False .

newstat

Custom statistics

Set this variable equal to the final desired value of the custom statistic you are creating or editing.

testid

PC Collect inspection

The testid variable identifies which test in an inspection triggered the execution of a Python Design.

  • When a Python Design is triggered by a Formula test with FormulaMode property = Pre, this variable returns the value "[PRE]".

  • When a Python Design is triggered by a Formula test with FormulaMode property = Post, this variable returns the value "[POST]".

  • When a Python Design is triggered by a Formula test with FormulaMode property = Click, this variable returns the TestID property of the Formula test button that was clicked.

  • When a Python Design is triggered by a Formula test with FormulaMode property = OnChange, this variable returns the TestID property of the test whose value changed.

  • When a Python Design is triggered by a Formula test with FormulaMode property = Cancel, this variable returns the value "[CANCEL]".

Example

For the above scenario, you could use the following code in a Formula test (where the FormulaMode property is set to Post):

if inspect.cursubi.passfail(1).value == 1 and inspect.cursubi.trace(2).value == "" :

disp.message("Please complete the required traceability.")  #This reminds the operator to complete the traceability.

cancelsubmit = True  #This will prevent the operator from submitting the sub-inspection.

else:

cancelsubmit = False  #This will allow the operator to submit the sub-inspection.