(Deprecated) use vcPythonProcessHandler
vcRslProcessHandler
vcRslProcessHandler is a behavior that allows you to define a custom robot statement written in Python. The process handler must to be connected to a robot's executor in order to be called using a vcRslProcessStatement object.
Inherits: vcBehaviour
Properties
Name | Type | Access | Description |
Icon | vcBitmap | RW | Defines an icon for the process when referenced by a process statement in the GUI. |
Process | String | RW | Defines the name and id of process. |
Script | String | RW | Defines the executable Python code of process. |
Methods
Name | Return Type | Parameters | Description |
condition | None | Function condition [Real timeout] | Runs a conditional test that stops process execution until a given function returns a True value.
The given function can either be a lambda function or one defined in Script. Evaluation of condition is done continuously. |
delay | None | Real time | Executes timed delay during process execution. |
getApplication | vcApplication | None | Returns the application object. |
getComponent | vcComponent | None | Returns the component containing the process handler. |
getSimulation | vcSimulation | None | Returns the simulation object. |
getTrigger | vcBehaviour | None | Returns the object triggering an event in Script; otherwise returns None.
This method is only useful in a condition function passed to condition() and triggerCondition() methods. Note: A trigger, for example, is a signal or action connected to process handler. |
resumeRun | None | None | Resumes the execution of a suspended OnRun() function. |
suspendRun | None | None | Stops the execution of an OnRun() function. |
triggerCondition | None | Function condition, [Real timeout] | Runs a conditional test, triggered during a simulation, that stops process execution until a given function returns a True value.
The given function can either be a lambda function or one defined in Script. Evaluation of condition is done each time a trigger of process handler occurs during a simulation. |
Events
Name | Parameters | Description |
OnContinue | None | Triggered when a simulation resumes running after being stopped. |
OnDestroy | None | Triggered when an object is destroyed in 3D world. |
OnEvaluate | None | Triggered when component feature tree of process handler is rebuilt. |
OnStatementExecute | vcRslProgramExecutor executor, vcRslProcessStatement process_statement | Triggered when process statement referring to this process handler is executed during a simulation.
Time consuming methods, for example delay() and condition(), may only be executed in this event handler or in functions called from this event handler. Note: A process handler can only be executed at one given time, so multiple calls to the same process will return immediately. |
OnFinalize | None | Triggered when layout or component is being loaded in 3D world.
The event occurs, for example, when copying a component, or loading a layout of components. The event is triggered before the needed components are attached to the 3D world. |
OnReset | None | Triggered when simulation is reset. |
OnSignal | vcSignal signal | Triggered when the value of a signal connected to process handler is changing. |
OnStart | None | Triggered at the start of a running simulation. |
OnStatementAdd |
vcRslProcessStatement statement |
Triggered when a process statement referring to this process handler is created in robot program.
Generally, this is used to initialize a vcRslProcessStatement object referring to this process handler with new properties and initial values. |
OnStatementDialog | vcRslProcessStatement statement | Triggered when there is an attempt to access properties dialog of process statement referring to this process handler.
In this case, you need to return True to use standard properties dialog; otherwise return False. |
OnStatementModified | vcRslProcessStatement statement | Triggered after properties dialog of process statement referring to this process handler is closed. |
OnStatementRemove | vcRslProcessStatement statement | Triggered when reference to process handler in a process statement is removed. |
OnStop | None | Triggered when simulation is stopped. |
Notes:
- OnStatementAdd and OnStatementRemove are allowed to change the process name of a statement, but doing so will not cause any further calls to either event handler.
- OnStatementAdd and OnStatementRemove must not destroy a given statement.