Application Indicator Functions

Application Indicator functions let you update the active state of customizable indicators that are part of the Buttons & Indicators module. These AeroScript functions run on the Automation1-iSMC. But they are handled through a connected Automation1-MDK application known as Automation1 MachineApps. Before you use these functions, you must connect an Automation1 MachineApps application that registers for this callback to the controller. If a MachineApp uses the Buttons & Indicators module with a button or indicator that you can control with AeroScript, it automatically registers for the necessary callbacks. To see if a MachineApp is registered to handle those callbacks, use the example program that follows.

Program Example

// Returns true if a MachineApp is registered to handle
// the callbacks used by the Buttons & Indicators module.
// You can use this to see if a MachineApp with a button
// or an indicator that you can control through AeroScript is open.
var $isRegisteredByAMachineApp as integer
$isRegisteredByAMachineApp = AppButtonSetStateIsRegistered() ||
AppIndicatorOnIsRegistered() || AppIndicatorOffIsRegistered()

Enable Application Indicators

Use the AppIndicatorOn() function to turn on all indicators with the specified ID or name. You can specify the display text, animation, animation cycle duration, foreground color, and background color for the indicator. Before you use this function, you can use the AppIndicatorOnIsRegistered() function to see if it is registered with an Automation1 Studio, Automation1 MachineApps, or a custom .NET application.

For the animation type argument, refer to the descriptions that follow:

  • Solid displays the indicator background as the $backgroundColor1 color and the $displayText as the $foregroundColor1 color.
  • Flash cycles between two display states - the indicator background as the $backgroundColor1 color for the $duration in milliseconds and the indicator background as transparent for the $duration in milliseconds. The $displayText is displayed as the $foregroundColor1 color for both cycles.
  • Two Color Flash cycles between two display states - the indicator background as the $backgroundColor1 color with the $displayText as the $foregroundColor1 for the $duration in milliseconds and the indicator background as the $backgroundColor2 color with the $displayText is as the $foregroundColor2 for the $duration in milliseconds.
  • Color Sweep cycles between two display states - the indicator background as the $backgroundColor1 color with the $displayText as the $foregroundColor1 for the $duration in milliseconds and the indicator background as the $backgroundColor2 color with the $displayText is as the $foregroundColor2 for the $duration in milliseconds. This animation gradually transitions between the two colors.

All colors can be specified in one of the formats that follow:

  • A hexadecimal string formatted as #RRGGBB. The first two characters are the red channel value, the next two characters are the green channel value, and the final two characters are the blue channel value.
  • A hexadecimal string formatted as #RRGGBBAA. The first two characters are the red channel value, the next two characters are the green channel value, the next two characters are the blue channel value, and the final characters are the alpha channel value.
  • As a predefined string with one of the values listed in the chart that follows. For more information, see Microsoft's Colors Class reference.

Disable Application Indicators

Use the AppIndicatorOff() function to turn off all indicators with the specified ID or name. Before you use this function, you can use the AppIndicatorOffIsRegistered() function to see if it is registered with an Automation1 Studio, Automation1 MachineApps, or a custom .NET application.

Program Example

// Turn on an indicator by ID with a solid background.
AppIndicatorOn(0, "ON", IndicatorAnimationType.Solid, "limegreen", "#ffffff", "", "", 0)

// Use a variable to store a core value.
var $orange as string = "orange"
// Turn on an indicator by name with an animation that uses predefined color options.
AppIndicatorOn("Indicator1", "WARNING", IndicatorAnimationType.ColorSweep, "gold", $orange, "yellow", $orange, 750)

// Turn on an indicator with an animation that uses hexadecimal values.
AppIndicatorOn(2, "LOADING", IndicatorAnimationType.Flash, "#98b9d6", "#5d6163ff", "", "", 500)

// Turn off an indicator.
AppIndicatorOff(3)