Call a Java object from Scilab (developer perspective)

Please note this applies only to Scilab >= 5.0. This is a draft.

  1. Create the gateway and update all files to add the new Scilab function (modules/xxx/sci_gateway/gw_xxx.xml modules/xxx/sci_gateway/c/gw_xxx.c modules/xxx/includes/gw_xxx.h)

  2. Watch your Java classes and think what and how you want to plug it to Scilab. Note that only primitive types and string (and all of them in Array) can be managed (please note that this may change in the future). For example, if a method expects a vector of integer, you will need to create a new Java Class which will convert the input (probably an array of integer) into a vector.
  3. Write your gateway code. Check the number of input argument, their type and size.
  4. Write the XML file describing the method you want to map.

    More information on:

  5. Generate the C++ (.cxx & .hxx) wrapper thanks to GIWS with the XML wrote at point 4

  6. In your gateway (store in sci_gateway/cpp), access to the feature using the C++ wrapper.

    Note that you will need to use the directive extern "C" { xxx } to avoid the C++ name mangling.

public: Call a Java object from Scilab (last edited 2011-03-30 16:18:45 by localhost)