Python Usage
The base script language of VSE is Python 3.5, so you may import any compatible Python libraries into your VSE script in order to implement custom integrations with your other tools and systems. However, a VSE script cannot be executed in a stand-alone Python console; it can only be executed from within the Net Protocol Suite application or the Python API. Also a standalone Python and pip are installed along application to support third party Python library by VSE. You can find the Python folder in “C:\Users\Public\Documents\LeCroy\Net Protocol Suite\Python”. So, you must use the shipped python to install/update any python library. For example, to install “nose” one should follow the following on a command line:
Windows
C:\
Cd C:\Users\Public\Documents\Lecroy\Net Protocol Suite\Python
Python.exe –m pip install nose
Linux
pip3 install --target=/usr/local/LeCroy/Shared.General/python/python35-x86_64/lib/python3.5 module_name
For example, if you want to install “nose”, you need to replace module_name with nose.
Note: There is a Python known issue in “numpy” that will cause the application to crash at exit if “numpy” is imported directly or indirectly to the VSE script. It has been reported to the Python which you can read more here: https://github.com/numpy/numpy/issues/8097
Note: Importing TLNetAPI.lib in VSE script is not allowed. It means user cannot use API functions inside VSE script.
Global Objects
A script has access to the following pre-defined global objects:
-
Trace: It has various properties and functions related to the entire trace being processed.
-
Output: It enables your script to send feedback/results back to the application.
See the full definitions in Global Objects.
Required Elements
There are a few elements that you must add to any VSE Script.
-
VSE Configuration: You must create a configuration object (CVSEConfig) and set various parameters that control how a trace will be processed. See the full definitions in Classes.
-
“OnItem" Callback: You must define a callback function for handling items. When called, it is passed a CTraceItem object that you will use to extract details about each item. See the full definition in the Trace.ProcessVSE description.
-
Trace.ProcessVSE(…): This is the main function that starts the processing. You must call this function on the global Trace object and pass it your configuration object and your "OnItem" callback. It will handle traversal through the trace according to your configuration settings, and it will call your "OnItem" callback function for each item that matches your configuration settings. See the full definition in the Trace.ProcessVSE description.
-
Output.Result: Set the Result property on the Output global object at the end of your script. This feedback will be sent back to the application so that it can show the script results. See the full definition in Output.
Note: It is supported to call Trace.ProcessVSE multiple times in a single script (possibly with a different configuration and callback each time), thereby enabling you to create complex, multi-pass processing scripts.