To obtain customized dynamic hehaviors than just setting from properties sheet, you can attach rules or scripts to widgets or OPI. With rules, you can make widget properties dynamically changeable without any programming. Widget property value will change along with the boolean expression status or input PV value. The execution of a rule is triggered by its input PV(s), so at least one trigger PV is needed for a rule.
To have more complex dynamic behaviors if rules cannot achieve, you will need to attach scripts to the widget or OPI. Diffrent with script, rules is part of the OPI file, so no additional file is needed.
The Boolean Expression is javascript boolean expression, so all javascript operators are applicable here. Besides, all input PVs of the rule are also accessible in the expression.
pv{index}
. For example: pv0 > pv1
pvInt{index}
. For example: pvInt0 == 5
pvStr{index}
. For example: pvStr0 == "apple"
pvSev{index}
. It is an integer value, in which: 0: OK; -1: Invalid; 1: Major; 2:Minor.
For example: pvSev0 == 1 || pvSev0 ==2
Besides outputing a constant value to the property based on the boolean expression value, you can also output an expression value to
the property. For example, if you want make the String value of a PV as the URL of a web browser widget, you can set the output expression
to pvStr0
. If you want to skip the boolean expression, simply set boolean expression to true
.