Dynamizations
Dynamization is one of the most powerful features of the InDataX synoptic editor. It allows the visual properties of an element (such as its color, position, or visibility) to change automatically in real-time based on the value of one or more variables.
Unlike scripts, dynamizations offer a simple visual interface for defining logical behaviors without the need to write code.
How it works
Each element has a tab called Dynamization in its properties panel. From here, you can "subscribe" an element's property to the changes of a variable.
Structure of a Condition
A dynamization consists of one or more evaluations (rules). Each evaluation consists of:
- Variable: The tag or variable to be monitored.
- Operator: The logical comparison to be performed (
=,>,<,>=,<=,!=). - Reference value: The threshold or state against which the variable is compared.
- Result: The value the property will take if the condition is met.
Multi-condition and Priority
InDataX allows you to add multiple conditions for the same property. This is extremely useful for creating complex states (e.g., a traffic light or alarm levels).
- Cascading evaluation: The system evaluates conditions from top to bottom.
- Prevalence: The first condition in the list that is met will determine the visual state of the element.
- Default value: If none of the defined expressions are met, the element will apply the value originally configured in the corresponding tab (usually in Style or General).
- Individual conditions: Each expression supports only one variable and comparison. If you want to apply the same visual effect for two different conditions (for example, two different variables or two different thresholds), you must create two separate entries in the list, even if the resulting value is the same.
Practical example: Motor status
Imagine you want to dynamize the Background Color of a shape representing a motor:
- Condition 1: If
Status_Variable=1(Running) → Green. - Condition 2: If
Status_Variable=2(Alarm) → Red. - Default value: If neither condition is met (Stopped), the element will maintain the color defined in the Style tab.
Common Dynamizable Properties
Depending on the type of element, different properties can be dynamized:
- Background / Border / Text Color: Changes colors based on analog or digital states.
- Hidden: Allows showing or hiding elements (e.g., showing a warning icon only if there is a failure).
- Flashing: Activates visual effects to draw the operator's attention.
- Position and Size: Creates movement animations or manual level bars.
Use Dynamizations for direct visual changes and simple logic (if A > X, then Red). Use Scripts when you need complex calculations, interaction between multiple elements, or advanced business logic.