Create/Update Custom Data Type from Python Enum Dialog Box

On the Module tab for a Python step, click Create/Update Custom Data Type , located next to the parameter in the Type column of the Parameters table, to launch the Create/Update Custom Data Type from Enum dialog box.

The Create/Update Custom Data Type button appears only when you set the step or Python Adapter to use Python 3 and configure a parameter to use the Enum parameter type.

The dialog box contains the following options:

  • Path to Python Module —The relative or absolute path to the Python module containing the enum definition. Click Browse to browse for a Python module. Click View to open the module in a text editor.

    TestStand uses the Python search paths when attempting to resolve relative paths. TestStand uses the Python version and virtual environment path you specify in the Python Adapter Configuration dialog box to determine the Python search paths unless you specify a version in the step settings.

  • Select an enum from Python Module —Displays enums defined in the Python module you specify. Depending on which enum you select, the list box in the Create and Update tabs updates to reflect the key-value pairs for the enum.

When you want to create a new custom enumeration data type for an enumerated parameter, select the Create tab. It contains the following options:

  • Type Name —The name of the new custom data type.
  • List Box —Includes the following information:
    • Items —The names of the elements in the Python enum.
    • Values —The numeric value of each item.
  • Create Custom Data Type in File —The file in which TestStand creates the new data type. By default, TestStand creates the new data type in the current sequence file.

When you want to update an existing custom enumeration data type, select the Update tab. It contains the following options:

  • Select Type —The names of the existing custom enumeration data types. Select a type to update.
  • List Box —Includes the following information:
    • Items —The names of the elements in the Python enum, as well as the elements in the TestStand enumeration data type.

      Black text indicates that the updated enumeration data type will retain the item. Red strikethrough text indicates that the item is present in the TestStand type but absent in the specified Python enum, and updating the enumeration data type removes the item.

    • New Values —The new numeric value of each item the updated type retains.
    • Old Values —The old numeric value of every item the updated type retains or removes.

See Also

Python Adapter Configuration Dialog Box

Search Directories

Using Enumerations in TestStand