KB-33354: Changing E3Browser’s row color via double click.

Question:

How can I change E3Browser’s row color via double click, similarly to what happens in an alarms acknowledgment system?

Solution:

To acknowledge alarms, it is recommended that you use E3Alarm instead, which already has an interface for this sort of operation.

However, if you are already using a more complex system, the solution would be:

1. First, add a field to the Historic, which will be the Ack column. Use an internal tag as this field’s source; its value must be fixed, and it will refer to the text to be displayed for unacknowledged alarms (Ex.: “Not OK”);

2. A query must be added to the screen. It will change the value in Ack field according to its date/time:

UPDATE Table1
SET Ack = “OK”
WHERE E3TimeStamp = # < % VarTime % > #

Then, it will change the value in Ack field to “OK” when the row is double-clicked.

3. Add a script to E3Browser’s OnDblClick event, where the following query will be executed:

set query = Screen.Item(“Query1”)
query.SetVariableValue “VarTime”, GetColumnValue(0)
query.Execute(true)
‘The variable sets which row must be changed, and since when (in this example).
‘Consider that date/time is not to be repeated

4. Add a script to E3Browser’s OnDrawRow event to change the row’s color:

if GetColumnValue(n) = “OK” then
RowBackColor = RGB(255,0,0)
end if

Where “n” is Ack‘s column number.

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *