inSCADA
EN
EN
  • Introduction
  • Getting started
  • User Interface
    • Home
    • Development
      • Projects
      • Connections
      • Devices
      • Animations
        • Get
        • Color
        • Rotate
        • Move
        • Opacity
        • Bar
        • Click
        • Tooltip
      • Alarm Groups
      • Alarms
      • Scripts
      • Expressions
      • Variables
      • Reports
      • Processes
      • Mail
      • Import/Export
    • Wizards
      • Gas Metering
      • HPP Unit
      • Device Library
    • Visiualisation
    • Processes
    • Control Panel
    • Project Map
    • Variable History
    • Alarm History
    • Alarm Monitor
    • Trend Graphics
    • Reports
    • Logs
    • Auth Logs
    • Jobs
    • Users
    • Help
    • About
    • License
  • Mimic Design
  • Communication Protocols
    • MODBUS
      • Modbus TCP
      • Modbus UDP
      • Modbus RTU Over TCP
      • Modbus TCP Server
      • Modbus RTU Slave Over TCP
    • DNP3
      • DNP3 Master
      • DNP3 Outstation
    • PROFINET
    • IEC-104
    • SNMP
    • OPC
      • OPC UA Client
  • Programing
    • APIs
      • Variable Functions
      • Connection Functions
      • Project Functions
      • Alarm Functions
      • Script Functions
      • In-Memory DB Functions
      • System Functions
      • User Functions
      • Date-Time Functions
      • String Functions
      • Notification Functions
      • Confirmation Functions
      • Database Functions
      • Other Functions
  • Database
  • Usefull Features
  • Update Logs
  • Architectures and Applications
  • Development Roadmap
  • Migration to inSCADA
  • Licensing Policies
  • FAQ
  • Screenshots
  • Auxiliary Tools
  • Installations
    • Requirements
    • Installation on Linux
Powered by GitBook
On this page
  • Color-Expression
  • Color-Switch
  • Color-Switch Gradient
  1. User Interface
  2. Development
  3. Animations

Color

PreviousGetNextRotate

Last updated 5 years ago

With a Color type animation, you can change the colors of objects on the mimic display.

Color-Expression

A javascript expression is applied to change the color of a selected text object, as shown in Figure 1.

Let's examine the code below, written in the expression part of Figure 1.

// Retrieving variable named Percent.
var tag=ins.getVariableValue("Percent");
// Check for Null. If Null object will be in purple.
if (tag===null) {
    return "purple";
}
// The variable named Percent makes it possible to display the 
// object in different colors according to the ranges defined below.
if (tag.value>0 && tag.value<11) {
    return "red";
}

if (tag.value>10 && tag.value<21) {
    return "gray";
}

if (tag.value>20 && tag.value<31) {
    return "blue";
}

if (tag.value>30 && tag.value<41) {
    return "lime";
}

if (tag.value>40) {
    return "yellow";
}

return "green";

Color-Switch

As shown in Figure 2, we make a selected variable appear in different colors on different values on a selected object, without coding, by adding or editing the configuration settings on the form.

Let us examine the details of the Color-Switch Form shown in Figure 3 below.

When you open the animation wizard form for a selected object as in Figure 2, switch to the color tab and click the switch radio button on the right side, the form in Figure 3 opens. Here you will be prompted for the following parameters.

  • Variable: The variable to which we want to link our Color animation.

  • Default Value : If the value of the variable that we are connecting to cannot be read or if the communication is gone. (Example : #7A006D)

In the Color section, you are asked for two colors. Here the second color is not mandatory. When you enter the second color, it will blink between the two selected colors.

Color-Switch Gradient

Switch-color gradient animation on a selected object, as shown in Figure 5, allows a variable value to switch proportionally over the selected two colors between 0 and 100 values.

When we select the Gradient checkbox at the bottom of the form in Figure 5, we make the proportional transition between two colors in the related conditions. In this example, we make the selected object to switch from dark red to light red by variable value.

Condition-Value-Color : It allows us to display in different colors according to the conditions that we will determine on the variable value. You can add conditions by pressing the button. In the Condition section you will be presented with options as shown in Figure 4. The meaning of the example in Figure 4; If the value of the variable named Percent is less than or equal to 10, blink the object color in red and black.

Figure 1 : Animation Type Color-Expression
Figure 2 : Animation Type Color-Switch
Figure 3 : Color-Switch Form
Figure 4 : Color-Switch Conditions
Resim 5 : Color-Switch Gradient