001package jmri.jmrit.logixng;
002
003import javax.script.Bindings;
004
005import jmri.InstanceManager;
006
007/**
008 * Script bindings for LogixNG.
009 *
010 * @author Daniel Bergqvist 2022
011 */
012public class LogixNG_ScriptBindings {
013
014    // This class should never be instanciated.
015    private LogixNG_ScriptBindings() {}
016
017    public static void addScriptBindings(Bindings bindings) {
018        // this should agree with help/en/html/tools/scripting/Start.shtml - this link is wrong and should point to LogixNG documentation
019        bindings.put("logixngs", InstanceManager.getNullableDefault(LogixNG_Manager.class));
020        bindings.put("conditionalngs", InstanceManager.getNullableDefault(ConditionalNG_Manager.class));
021        bindings.put("globalVariables", InstanceManager.getNullableDefault(GlobalVariableManager.class));
022        bindings.put("logixngModules", InstanceManager.getNullableDefault(ModuleManager.class));
023        bindings.put("logixngTables", InstanceManager.getNullableDefault(NamedTableManager.class));
024        bindings.put("analogActions", InstanceManager.getNullableDefault(AnalogActionManager.class));
025        bindings.put("analogExpressions", InstanceManager.getNullableDefault(AnalogExpressionManager.class));
026        bindings.put("digitalActions", InstanceManager.getNullableDefault(DigitalActionManager.class));
027        bindings.put("digitalBooleanActions", InstanceManager.getNullableDefault(DigitalBooleanActionManager.class));
028        bindings.put("digitalExpressions", InstanceManager.getNullableDefault(DigitalExpressionManager.class));
029        bindings.put("stringActions", InstanceManager.getNullableDefault(StringActionManager.class));
030        bindings.put("stringExpressions", InstanceManager.getNullableDefault(StringExpressionManager.class));
031    }
032
033}