Skip to content

Generate Vitess modules via mcstas2vitess

Peter Willendrup edited this page Sep 1, 2017 · 3 revisions

Generating Vitess modules from McStas components - mcstas2vitess tool

The mcstas2vitess.pl tool allows to generate a Vitess module from an existing McStas component.

usage:

mcstas2vitess.pl Componentfile.comp [as_a_source]

(First input is a component file that has to exist in . and if a second input is set, the module will become a "source" in Vitess.)

If the component has string input, a 'vif' file must be defined, where the chosen Vitess input parameter name and the string type is defined, like this:

filename -S string

(Meaning that the McStas component input string 'filename' will be transferred to the Vitess module via the -S parameter and is of type string.)

Currently, the 'vif' format only support strings, but it could be envisioned to enrich the format to support e.g. lists etc.

Once mcstas2vitess.pl has run, an special instrument file is written where the component is "wrapped" inside a set of Vitess_input and Vitess_output compnents, and the file is compiled (internally, not using the mcrun tool). This means that if your component relies on external libraries, you should define these in your MCSTAS_CFLAGS variable.

The output of mcstas2vitess.pl after a sucessful run is e.g.

Wrote executable Vitess Module file 'mcstas_powdern_Darwin_x86_64' for placement in your vitess/MODULES folder.


Wrote Vitess Module Tcl GUI file 'mcstas_powdern.tcl' for inclusion in your vitess/GUI/usermodule.tcl script.

mcstas2vitess: Convertion has been performed

To use a generated module with Vitess, copy the module file to vitess/MODULES and attach the generated .tcl snippet at the end of your vitess/GUI/usermodule.tcl script.

Clone this wiki locally