Skip to content

ScriptMode

Andrey edited this page Mar 18, 2017 · 2 revisions

Back to Main page


Script mode in ANTS2 gui

Script engine was coded using Qt framework scripting facility.

It is based on the ECMAScript scripting language, as defined in standard ECMA-262

How to access?

Scripts can be configured and run at the Script window, which can be accessed through the main menu of the Main window or using Window navigator.

What can script do?

  • Load/modify detector configuration
  • Configure and perform simulations
  • Configure and reconstruct LRFs
  • Configue and perform position reconstruction
  • Fill and show histograms and graphs
  • Perform minimization of a user-defined function (which can do all listed above)

How it is organized?

Besides the standard JavaScript commands, the script has access to a set of custom functions, which are distributed between several modules. The functions can be called using the syntax module.function

The list of modules and available functions can be accessed by toggling the Help button.

How to change detector/simulation/reconstruction configuration?

All configuration settings are stored/passed in ANTS2 as a JSON object, which contains a hierarchical structure of key-value pairs.

Configuration can be changed using the Replace(Key, value) function of the config module: This function searches for the Key property of the configuration object and, if found, attempts to replace it with the value provided by the user.

The users can activate a tree-view of the available Keys in the current configuration by triggering the Config button.

Right-clicking a on Key allows to copy it to the clipboard.

A set of script examples can be accessed by clicking the Examples button.


Back to Main page

Clone this wiki locally