Use the Alarm Table Genie
- Last UpdatedJul 18, 2023
- 2 minute read
In the example below, a simple initialization function is used to set the columns (fields) and then filter the display list when the alarm table initializes.
Example
The Cicode sample below will be used in the following example.
INT FUNCTION MyAlmTable_Init(STRING sTable, STRING sEquipment)
// Set up columns
LibTable_AddColumn(sTable, "Name", 150);
LibTable_AddColumn(sTable, "Description", 150, "Desc");
LibTable_AddColumn(sTable, "State", 150);
// Set up filter
INT nAN = LibAlmTable_GetAN(sTable);
INT hEdit = AlarmFilterEditOpen(nAN);
AlarmFilterEditSet(hEdit, "Equipment=" + sEquipment);
AlarmFilterEditCommit(hEdit);
AlarmFilterEditClose(hEdit);
RETURN TRUE;
END
To set columns and filter via table initialization callback event:
-
Open the Cicode Editor and create a new Cicode file (for example, _MyAlmTable_Ex.ci).
-
From the Graphics Builder create a new page (for example, the Normal Tab Style Page).
-
When created, from the Object toolbox select the Paste Genie icon.
-
In the Paste Genie window select the lib_controls library
-
Select the Alarm Table genie. The Alarm Table genie is pasted onto the graphics page.
-
In the Alarm Table Genie property dialog, configure the fields according to the table below. Click OK to save the changes.
-
Save the graphics page and compile and run the project.
|
Parameter |
Description |
|---|---|
|
Table Name |
Table 1 |
|
Width |
400 ( all columns within the table are displayed. If left at 100 some columns may not be displayed) |
|
Number of rows |
10 |
|
Header Height |
18 |
|
Row Height |
15 |
|
Header Padding |
5 |
|
Row Padding |
4 |
|
Column Padding |
5 |
|
Horizontal Scrollbar |
|
|
Vertical Scrollbar |
|
|
Initialize |
MyAlmTable_Init("#Name","Plant*") |
At runtime the table will look like the following:
