Reven can be extended by using scripts and plugins.
A script and a plugin are similar except that a plugin can interact with REVEN Axion's display and can be called whith a shorcut in REVEN Axion.
Here is a quick overview on how to achieve that.
There are two API:
The main one resides in the reven
library. It is used to manipulate the execution data.
This library is accessible from everywhere on the system through a standart Python CLI and the REVEN Axion's python console.
The first step is to connect to an existing Reven instance, for example on port 13370
of the host localhost
:
From there, all functions that permit to communicate with the Reven instance are accessible as members of client
. For example, you can get the names of all runs using run_get_all()
:
In this documentation, code examples assume that there is a valid variable client
that corresponds to a reven_connection
instance, as described above.
The second one resides in the axion_api
library. This API is used to interact with Reven Axion's display.
It is accessible only in the context of REVEN Axion through a plugin or the REVEN Axion's python console.
From there you can, for example, get the selected instruction:
reven
and axion_api
are loaded automatically.reven_connection
instance is already created and is accessible under the name rvn_client
.A script is a standart python program that can use the reven
library but not the axion_api
library.
It can be execute outside REVEN Axion as follows:
Or inside the REVEN Axion's python console as follows:
A plugin can use the axion_api
library to interact with the REVEN Axion's display.
To make and use a plugin through REVEN Axion, process as follows:
Create a file my_plugin.py
in your autoload directory and define the axion_calling
function.
axion_calling
plays the role of the main function for REVEN Axion.
Load your plugin in REVEN Axion through the REVEN Axion's python console as follows:
Remark: 'name'
will be the name of the plugin in REVEN Axion and can be different of name of the plugin file.
To reload the plugin, use:
The axion_calling
function is important because when you use the shortcut define for your plugin, REVEN Axion will try to call this function. If it is not define, nothing will happen.
If you want to learn more, the following reference pages will help you:
Note the Examples section (in the header of this page) contains various python examples as well, which might provide good starting points.