Functions operating on Plugin Handles.
More...
|
tuple | NotifyEvent = CFUNCTYPE(None) |
| Plugin function event type definition This is a helper object that a client can use as an argument to a tellurium plugin. More...
|
|
Functions operating on Plugin Handles.
def python.telplugins_c_api.assignOnFinishedEvent |
( |
|
pluginHandle, |
|
|
|
pluginEvent, |
|
|
|
userData1 = None , |
|
|
|
userData2 = None |
|
) |
| |
Assigns a plugins OnFinishedEvent function.
Plugin dependent. Intended usage is to report back on plugin finalization.
- Parameters
-
pluginHandle | Handle to a plugin |
pluginEvent | Function pointer to event routine |
userData1 | void* pointer to user data. |
userData2 | void* pointer to user data. |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.assignOnProgressEvent |
( |
|
pluginHandle, |
|
|
|
pluginEvent, |
|
|
|
userData1 = None , |
|
|
|
userData2 = None |
|
) |
| |
Assigns a plugins OnProgressEvent function.
Plugin dependent. Intended usage is to report back progress
- Parameters
-
pluginHandle | Handle to a pluginevent routine |
userData1 | void* pointer to user data. |
userData2 | void* pointer to user data. |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.assignOnStartedEvent |
( |
|
pluginHandle, |
|
|
|
pluginEvent, |
|
|
|
userData1 = None , |
|
|
|
userData2 = None |
|
) |
| |
Assigns a plugins OnStartedEvent function.Plugin dependent.
Intended usage is to report back on plugin initialization.
- Parameters
-
pluginHandle | Handle to a plugin |
pluginEvent | Function pointer to OnEvent routine |
userData1 | void* pointer to user data. |
userData2 | void* pointer to user data. |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.assignRoadRunnerInstance |
( |
|
pluginHandle, |
|
|
|
rrHandle |
|
) |
| |
Assign a roadrunner instance handle for the plugin to use.
A plugin may use an externally created roadrunner instance for its internal work.
- Parameters
-
pluginHandle | Handle to a plugin |
rrHandle | Handle to a roadrunner instance |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.displayPluginManual |
( |
|
pluginHandle) | |
|
If a plugin has a built-in PDF manual, display it.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns False if the plugin has no manual
def python.telplugins_c_api.executePlugin |
( |
|
pluginHandle) | |
|
The executePlugin function is called to start the plugin so that it can carry out its function.
The call is plugin dependent meaning that it could result in a calculation, starting up a GUI etc.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns true or false indicating success/failure
- Note
- The execute function is a regular blocking function, meaning it won't return to the caller until the task is complete. If the plugin is asked to carry out a lengthy calculation, consider using the executePluginEx function that has the option to execute the plugin code in the background (in a thread);
def python.telplugins_c_api.executePluginEx |
( |
|
pluginHandle, |
|
|
|
inAThread = False |
|
) |
| |
The executePluginEx is similar to the executePlugin function, except it takes one extra argument.
- Parameters
-
pluginHandle | Handle to a plugin |
inAThread | bool indicating if the plugin should be executed in the background (in a thread) |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.getPluginAuthor |
( |
|
pluginHandle) | |
|
Get the author of a Plugin.
This is assigned by the pluging developer
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a string if successful, None otherwise
def python.telplugins_c_api.getPluginCategory |
( |
|
pluginHandle) | |
|
Get the Category of a Plugin.
This is assigned by the pluging developer
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a string if successful, None otherwise
1 name = telPlugins.getPluginCategory(pluginHandle)
def python.telplugins_c_api.getPluginCopyright |
( |
|
pluginHandle) | |
|
Get the plugin copyright.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a string if successful, None otherwise
def python.telplugins_c_api.getPluginDescription |
( |
|
pluginHandle) | |
|
Get the Description of a Plugin.
This is assigned by the pluging developer
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a string if successful, None otherwise
1 name = telPlugins.getPluginDescription(pluginHandle)
def python.telplugins_c_api.getPluginHint |
( |
|
pluginHandle) | |
|
Get a plugins Hint.
A plugins hint is a short description on what the plugin is doing.This is assigned by the pluging developer
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a string if successful, None otherwise
1 name = telPlugins.getPluginHint(pluginHandle)
def python.telplugins_c_api.getPluginInfo |
( |
|
pluginHandle) | |
|
Returns information about a Plugin.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns information as a string for the plugin, None otherwise
def python.telplugins_c_api.getPluginManualAsPDF |
( |
|
pluginHandle) | |
|
Get Plugin manual as PDF.
A plugin may embedd a help manual as a PDF. Use the function getPluginManualNrOfBytes to get the exact length of this string.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns the plugin's manual pdf file as a unsigned char*. If not available, returns None.
3 manual = cast(ptr, POINTER(c_char * numOfBytes))[0]
5 print 'This plugin does not have a manual.'
7 outFName = getPluginName (pluginHandle) +
'.pdf'
8 with open(outFName,
'wb')
as output:
10 os.system(
'start ' + outFName)
def python.telplugins_c_api.getPluginManualNrOfBytes |
( |
|
pluginHandle) | |
|
Get the byte size for the PDF manual.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns the number of bytes in the plugin's manual pdf file as an unsigned int.
def python.telplugins_c_api.getPluginName |
( |
|
pluginHandle) | |
|
Get the name of a Plugin.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns the internal name of a plugin. None otherwise
1 name = telPlugins.getPluginName(pluginHandle)
def python.telplugins_c_api.getPluginResult |
( |
|
pluginHandle) | |
|
Returns a plugins result, as a string.
This is plugin dependent, and a plugin designer may, or may not, implement this function. See the plugin documentation for details.
- Note
- If a plugin wants to returns specific result, e.g. an Array, or a a float, these are better communicated through the use of Plugin properties.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a plugins result if available. None otherwise
def python.telplugins_c_api.getPluginStatus |
( |
|
pluginHandle) | |
|
Get status information from a plugin.
This call is plugin dependent, see the plugin documentation for details
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns plugin status if available, as a string. None otherwise
def python.telplugins_c_api.getPluginVersion |
( |
|
pluginHandle) | |
|
Get the plugin version.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns a string if successful, None otherwise
def python.telplugins_c_api.isBeingTerminated |
( |
|
pluginHandle) | |
|
Check if the work of a plugin is currently being terminated.
This function is useful when a plugin is executed in a thread.
- Parameters
-
pluginHandle | Handle to the plugin |
- Returns
- Returns true or false indicating if the work within the plugin is in the process of being terminated
def python.telplugins_c_api.isPluginWorking |
( |
|
pluginHandle) | |
|
Check if a plugin is actively working.
This function is used when the work in the plugin is executed in a thread (see executeEx). The isPluginWorking will return true as long work is being active and false when the work is done. This is useful in UI environments. Also, see the various event types on how to get status back from a plugin during its execution.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns true or false indicating if the plugin is busy or not
def python.telplugins_c_api.resetPlugin |
( |
|
pluginHandle) | |
|
Reset a Plugin.
Plugin dependent. A reset function should bring the internal state of a plugin to a known state
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.terminateWork |
( |
|
pluginHandle) | |
|
Terminate any work that is in progress in a plugin.
If the plugins worker is executed in a thread, this function will signal the internals of the plugin to terminate. This function is used when a plugins work is executed in a thread.
- Parameters
-
pluginHandle | Handle to a plugin |
- Returns
- Returns true or false indicating success/failure
def python.telplugins_c_api.wasTerminated |
( |
|
pluginHandle) | |
|
Query a plugin if work was terminated succesfully.
This function may be used in combination with the terminateWork, and isBeingTerminated functions.
- Parameters
-
pluginHandle | Handle to the plugin |
- Returns
- Returns true or false indicating if the work in the plugin was terminated or not
tuple NotifyEvent = CFUNCTYPE(None) |
Plugin function event type definition This is a helper object that a client can use as an argument to a tellurium plugin.
The exact number of plugins functions required arguments, and their type, is plugin dependent. A client of the the plugin needs to get this information from the plugin specific documentation. An example of using NotifyEvent is shown below. The NotifyEvent takes no arguments.
1 def myPluginFunction():
2 print 'The plugin can call this function!'