Build a toolbox

If you are a SCILAB advanced user, you might already have developed a lot of scripts for different purposes. At this stage, it might also appear valuable for you to package those scripts into given applications, could be SCILAB libraries that would be automatically loaded at SCILAB start or scripts with Graphical User Interface. In that case, what you would like to do is what we call a TOOLBOX.

SCILAB Toolbox skeleton

To get started you can get inspiration from the toolbox_skeleton, packaged and distributed with Scilab in the contrib directory:

 

Minimal Version

Let us start with the very little you need in order to get your toolbox working:

  • etc/
    • myToolbox.quit
    • myToolbox.start
  • macros/
    • buildmacros.sce
    • myFirstFunction.sci
  • builder.sce
  • cleaner.sce

 

 

.quit

Not so important at first. It defines the actions to perform when we quit the toolbox. You can leave it empty.

.start

This script is executed at startup. You can add a function call at the end of the script.

Macros

This is where you save all your functions written in Scilab (also called macros).

Buildmacros

This script is called by the builder.sce at the root of your toolbox. It generates a binary version of your Scilab functions (.bin).

 Builder

By executing this file, you will build your toolbox.

 

Cleaner 

This is important if you want to carry modifications on your toolbox. You need to clean the previous build. This will result in deleting all the .bin files, as long as the loader and unloader.

Creation and Installation process

With what have been said in mind you are now able to create your own SCILAB toolbox by following those steps :

  1. Create your scripts and put it into the macros folder
  2. Use the toolbox architecture template provided and change information
  3. Execute builder.sce to generate .bin files (bivary code equivalent to your scripts).
  4. Zip the overall folder
  5. Install your toolbox within SCILAB using the command line >> atomsInstall('myToolbox.zip')
  6. Your toolbox will be loaded at SCILAB restart