Macros allow you to run a series of commands. For example, each SConnector uses start, stop, and status macros to control an executable. "CheckParams" is another macro available to SConnectors that allows the user to check all the parameters (startup and forced) being sent to the executable at runtime. Since SConnectors are defined using inheritance, each SConnector has a set of macros inherited from its parent. These macros are used by default, but can be overridden by defining new macros with the same name.
Each macro has a privilege level which specifies what privileges a user must have to run that macro. For example, if the macro privileges are set to "start" and "status", only users which have either "start" or "status" privileges (or both) on a Sensor which uses the SConnector, may run that macro.
When creating or editing a macro script, take note of the parameter system. For any variables bracketed with "~##" and "##~" (without the quotes, such as ~##numSlots##~ or ~##paramList##~), SCInterface will expect these to be supplied to the script at runtime. When running the script from the Macros page, SCInterface will allow the user to specify values for each parameter before executing the macro. SCInterface supplies values for the dynamic parameters automatically for start, stop, and status scripts.
In the above screenshot, a macro named High Temp Remediation is being added. It will be available to any user that has start, stop, or status privileges on a Sensor that uses the Temperature Network SConnector. This script is an "Action Candidate", which means that it will be made available for users to run, once the temperature has reached at least 120 degrees. Availability of this macro is managed automatically by SCInterface. It will check the condition requirements against the status values returned by the SConnector status macros, and will also check that a user has the appropriate privileges to run the macro.
). Click the edit icon for a macro to edit it.
In the above screenshot, the Temperature Network SConnector macro Num Nodes Connected is being edited. Any user with start, stop, or status privileges will see the results of this macro. It will be run whenever the user checks for the status of their Sensor, and it returns an integer.
Note: The "Status Condition to Meet" field is left blank since this macro is not an action candidate. That field is only used when a macro should be made available based on a certain condition.
) for that macro. You may also view the contents of the macro script by clicking on the "Script" checkbox for that macro.
In the above screenshot, any of the macros that have the delete icon (
) are possible to delete. Checking the "Script" box allows you to see the contents of that script.