Running the new plugin
Now we have completed the development of the two components of a plugin: we have an executable program and we have a file describing the graphical user interface of the plugin.
To run the newly developed plugin from SAInt, we need to launch a session of SAInt, go to the "Tools" tab, and click on the button "Select". We can specify the folder "dist" which contains our executable and the "form.yaml" file.
SAInt will first validate the form, and then activate the button "Execute". The user can now click on "Execute" to launch the plugin. SAInt will generate the violinplot plugin wizard interface, where the required parameters can be filled in, like (for example) in Figure 1.
By clicking "Submit", the parameters are parsed and passed to the executable. A new window, the "Plugin Process [Live]" opens, and the program is run in the background. The user is informed of the results of some of the steps taking place in the code by messages logged in the plugin window. Errors or problems are also logged, as well as a successful run of the plugin.
Because the result of the plugin is an HTML file, the "HTML Files Viewer" is used by SAInt to display the output, like in Figure 2.
To review how install and execute a new plugin check the How-To "Install and Execute a Plugin".
1. Distribute the plugin
When you have finished to develop your plugin, it is time to share it with colleagues and the SAInt user community. You can simply rename the "dist" folder with a more meaningful name better describing your plugin, and zip the folder to be shared with other. The bare minimum is to share the executable "main.exe" and the "form.yaml". It is also a good practice to add "readme.txt" where you provide details of your plugin.
Remember, you can always share your work with the Community of SAInt user by posting your plugin on the SAInt Forum!
2. Possible improvements
The plugin developed in this tutorial is rather basic, and it aims at showcasing the development workflow rather then producing a robust and comprehensive solution. For this reason, for example, we have not incorporated any checks on the validity of the input parameters, as well as on the existence of a valid solution for the scenario where the data are coming from.
Some ideas to improve the plugin are:
-
If the plugin is launched from a SAInt session with an active network ans scenario, such network and scenario should be implicitly used as input parameters and not user specified. This could be achieved by taking advantage of SAInt GUI state parameters.
-
A better default location where to save the the violinplot chart is the folder
.\encoord\SAInt\PluginOutputin the default "Documents" folder of the Windows user. -
The plugin is designed to extract data from the a solved scenario via an expression. But the expression could also be used to collect data from the network. The plugin could be restructured so that the scenario is an optional argument, and based on the specified parameters, the expression is evaluated for scenario or network data.