AlarmScreenNg 0.9.9
AS EWO API

The AS EWO is called AS.ewo, it can be found in component installation directory under

bin/widgets/<platform>/

This sections describes API of AS EWO for WinCC OA panel, where EWO is placed: properties, methods and events.

Properties

basicConfigDp

This is the most important property of AS EWO because AS EWO is not able to operate without the name of internal DP containing the valid basic configuration in JSON format.

Furthermore, all other settings for AS EWO (except for admin settings) are tightly coupled with basic configuration, and it is reflected in the structure of DP types, used for storing those other settings. For example, the filter that contains alarm property named 'alias' was saved by user when working with particular basic configuration. Later this filter, in principle, can be used also for other basic configuration, but: what if that 'other basic configuration' just does not contain the alarm property named 'alias', or if the meaning of 'alias' is dfifferent in other basic configuration? Of course, in such case previously saved filter will not wotk as expected - just because the filter was saved for another basic configuration.

alarmDataRole

The alarm data, read from AS EWO, are passed to CTRL script in panel (in methods or events) as CTRL data type mapping, where keys are the names of alarm properties.

The value of this EWO property determines what shall be the values in such mapping. Two values are possible:

  • EditRole: the values in mapping have 'native' data types. For example, the properties which hold a boolean value are returned as CTRL data type bool with two possible values: true and false
  • DisplayRole: the values in mapping have CTRL data type string, exactly as they appear to user in The Alarm Table. In such case, the alarm property holding boolean value can be returned as strings "YES"/"NO", or "CAME"/"WENT", or in some other format, selected for displaying this particular property in table.

Note that some (but not all!) of methods of AS EWO have an argument, allowing to override this 'default' setting.

timeSpec

EWO is able to work with archived alarms, in order to get archived alarms used shall provide time range (mandatory) and filter (optional). The question is how times of time range shall be interpreted? There are two options for the moment:

  • times to be interpreted as local times, or
  • times to be interpreted as UTC times

EWO itself has no way to determine which of two shall be used, the reason is: these settings are set and obtained differently in different frameworks, and even in different projects. Instead, the EWO provides this property, the value for this proerty shall be set by CTRL code, which must know: where and how to find appropriate settings for this particular project.

The value of this property can be seen in time range editor.

Settings for log

During operation AS EWO may produce some text messages: to inform about critical errors, warnings, or just to produce messages for debugging (for developer). These messages are sent into two places:

  • To Win CC OA log, like for many other managers
  • To dedicated buffer inside EWO itself, from where the list of messages can be opened (see Internal messages)

Every message is assosiated with one of possible levels of severity: Debug, Info, Warnign, Critical.

The following properties of AS EWO control the process of producing such messages, as we as content of produced messages.

Property Description
logSeverity Mininum level of severity for messages which shall appear in WinCC OA log; the default value is Warning
userlogSeverity Minimum level of severity for messages which shall be buffered (and observed by user) in AS EWO itself; the default value is Warning.
logTimestamp true if message text shal include timestamp when message was produced by AS EWO; the default value is false
logFunction true if message text shall include the name of function that produced the message; the default value is false

Visual appearance

Visual appearance of AS EWO is fully configured with user settings. However, user settings are applied at run time, but it is often desirable to modify appearance at design time (in GEDI). For example, if AS EWO is supposed to be used without filter and/or footer (see picture), then AS EWO can be very small, and it is desirable to see it small in GEDI. For this purpose some properties have been introduced to EWO:

Property Description
showFilterWidget Used to show/hide filter area of AS EWO
showFooterWidget Used to show/hide footer area of AS EWO
singleRowMode Switch the table with alarms to 'single row' mode. In this mode:
  • Column headers are hidden
  • the height of table row is equal to height of the whole table, i.e. table becomes high enough to display one row only
Normally table in this mode shall really have small enough height, high table with just one row would look weird.
strongCellBorder Forces strong black border to be drawn arounf every cell; the property was introduced to be used together with singleRowMode where column headers are missing and borders between columns becomes not evident.

Methods

The methods in this secction of document are grouped according to their purpose (intended usage). In principle, methods described can be used for other purposes if needed.

Panel initialization

When new basic configuration is set to AS EWO, the EWO shall notify the panel in order to make necessary adjustments for new basic configuration. This can include, for example: loading and applying default user settings, connecting to all (or some) of systems etc.

The problem occurs when panel, containing AS EWO, is just created/opened: there is (short) period of time when EWO itself is ready, and may fire events for CTRL code in panel, but the panel is not ready yet to process the events from EWO. The dedicated method of EWO was introduced, that normally shall be called from the Initialize event of panel;

string ownerPanelReady();

The method returns the name of currently used basic configuration DP.

Source filter parameters

As described in basic configuration, the configuration may contain string for FROM and WHERE clauses of query. They can be not only fixed strings, but also parametrizable strings.

The following method of EWO is used for passing to EWO list of strings which will substitute parameters in FROM and WHERE clause templates.

string setQueryFilterParams(string filterKey, dyn_string arguments)

The filterKey argument must correspond to part of query filter for which passed arguments shall be used, see keys under 'queryFilter' in JSON description; see also constants AS_NG_EWO_QUERY_FILTER_XXX/

This method may return non-empty string, containing error description, if call was not successful. Note that 'successful' doesn't mean that query with passed parameters will work as expected, this doesn't even mean that query syntax is correct: 'success' here just means that parameters were passed successfully to alarm source.

Alarm properties and table columns

The methods described here are used for operations with alarm properties, defined in basic configuration, and with set of columns shown in table.

dyn_mapping getAllProperties();

Get all alarm properties, defined by basic configuration. Every mapping in returned list contains the following information for alarm property:

  • "id": the value is string with internal identifier of this alarm property, see Alarm properties.
  • "alarmAttr": the value is string with the name of attribute of _alert_hdl DPE config, corresponding to this alarm property. Empty string if alarm property does not directly correspond to one of attributes of _alert_hdl config.
  • "isAtime": true if this property is part of atime for alarms (reminder: atime includes alarm DPE, alarm time and count of alarm within 1 msec)


dyn_mapping getTableColumns();

Get all columns of Alarm Table, defined in basic configuration. Every mapping in returned list contains the following information for table column (see constants AS_TABLE_COL_xxx in CTRL library AlarmScreenNg.ctl). The method was introduced for UNICOS-style popup menu where column visibility can be modified from menu.

  • "source": the value is int with enumerated value for the source of this column. See constants AS_TABLE_SOURCE_xxx in CTRL library AlarmScreenNg.ctl for possible values.
  • "id": the value is string, containing internal name (ID) of alarm property for this table column, see Alarm properties.
  • "title": the value is string, containing header for this table column.
  • "width": the value is int - current width of this column in table [Pixels]
  • "hideable": the value is bool indicating if user is allowed to hide this column of not
  • "visible": the value is bool indicating if this column is currently visible in table or not


void toggleTableColumnVisibility(int column);

Toggle the visibility of column with given index, the index must correspond to one of columns returned by method getTableColumns()

void showAllTableColumns();

Set all columns of table to 'visible' state.

Connection to systems

The methods of this group are used to force connection/disconnection of AS EWO to WinCC OA systems.

bool connectSystem(string systemName);

Connect to system with given name; returns true if connection was successful. If current source mode for AS EWO is not Live, then AS EWO first switches to Live mode, and only after tries to connect to given system

bool disconnectSystem(string systemName);

Disconnect from system with given name; returns true if disconnection was successful. The method only works if AS EWO's source mode for AS EWO is Live.

dyn_string getConnectedSystems();

Get list of all systems names to which AS EWO is connected now. If current source mode for AS EWO is not Live, then the method returns list of systems to which AS EWO was connected when it was in Live mode.

bool connectDps(dyn_string dpNames);

The method connectSystem() makes connection to alarms of all DPs in given system. On the contrary, this methods only makes connection to particular DPs. The DPs in argument are not required to be in the same system. The method was introduced for alarm screen used in UNICOS faceplate; this can also be used in other cases where AS shall only connect to alarms of certain DP(s).
This method returns true if connection was successful. If current source mode for AS EWO is not Live, then AS EWO first switches to Live mode, and only after tries to connect to given system.

bool disconnectDps();

Exit the mode of connecting to limited set of DP(s) that was entered when connectDps() was called. After calling this method, AS EWO returns to 'serve system connections' mode.

void setFixedDpNames(dyn_string &dpNames);

AS EWO is intructed to be prepared to work with limited set of DPs only, but unlike connectDps() or queryArchivedDps() methods, this method does not cause immediate connection (for online data), or query (for archived data). Calling this method just sets a list of DPs for subsequent actions to be initiated by Apply button in AS EWO.

string queryArchived(time startTime, time endTime, dyn_string &systemNames);

Starts query for data from archive. If current source mode for AS EWO is not History, then AS EWO first siwtches to History mode, then starts the query. Current filter remains unchanged, i.e. the query will be performed with current filter.

Note
AS EWO will not be able to switch to History mode if credentials for DB connection were not supplied.
startTime and endTime parameters are interpreted as either local or UTC times, depending on value of timeSpec EWO property.
string queryArchivedDps(time startTime, time endTime, dyn_string &dpNames);

Very similar to previous method, but query is executed not for list of systems, but rather for list of DPs. DPs in the list can belong to different systems.

Alarm details

The methods of this group are used to read details of alarms shown in Alarm Table. Note that 'details' includes not only alarm properties, visible in table columns, but rather all alarm properties known inside AS EWO. The data for one alarm is mapping with keys = names of alarm properties, and values = value of that alarm property.

dyn_mapping getAllRowsData(string format = "");

Get details of all alarms in table. The argument format allows to override default setting for alarmDataRole EWO property. Two values are allowed for this argument:

  • "edit": the values of alarm properties are returned as 'native' data types
  • "display": the values of alarm properties are returned as string shown in table


dyn_mapping getSelectedRowsData(string format = "");

Get details of all alarms in selected row(s) in table. The format argument is the same as for getAllRowsData() method above.

If alarms are displayed as hierarcical tree, then selecting any group node in the tree is interpreted as selecting all alarms = descendants of this group node.

dyn_mapping getVisibleRowsData(string format = "");

Get details of all alarms in currently visible rows in table. The format argument is the same as for getAllRowsData() method above.

dyn_mapping getForAcknowledgementAll();

Get details of all unacknowledged alarms in table. Note that alarms for acknowledgement are always returned using "edit" data role, independently of the value of alarmDataRole EWO property.

dyn_mapping getForAcknowledgementSelected();

Get details of all unacknowledged alarms, found in selected rows in table in table. Note that alarms for acknowledgement are always returned using "edit" data role, independently of the value of alarmDataRole EWO property.

The interpretaion of 'selected' for hierarchical tree is different from getSelectedRowsData() method: here only explicitly selected rows with alarms are considered, the selection of group nodes is not propagated down in tree hierarchy.

dyn_mapping getForAcknowledgementAllGone();

Get details of all unacknowledged alarms with direction WENT in table. Note that alarms for acknowledgement are always returned using "edit" data role, independently of the value of alarmDataRole EWO property.

string getTableRowAsString(dyn_int row);

Very specific method, used for functionality like 'copy to clipboard' of popup menu. The method returns string with space-separated values in columns of given table row.
The argument row really describes the single row in table, but why dyn_int? In case of flat alarm table the row argument shall contain just one item: the index of required row in table (zero-based). However, if alarms are displayed in hierarchical tree, then dyn_int shall contain the list of numbers, describing the 'route' from root of tree to required row with alarm data. This is illustrated on the following picture (tree with 2 levels of grouping):

Row index for tree

In this example dyn_int shall contain 3 values {2, 1, 3} in order to address highlighted row with alarm data.

  • 2 is index of group on top level
  • 1 is index of next level group inside selected group
  • 3 is index of alarm within the lowest level group

I.e. in case of tree view, the row argument shall contain number of values equal to number of grouping levels plus one.

Access control

The AS EWO itself doesn't make any assumptions on how exactly access control is configured and operated, Instead, AS EWO just provides methods, allowing to modify appearance of different elements (widgets) in EWO according to access rights of given user. The approach is simple, see Action names.

string setActionEnabled(const string &action, int state);

Set the state of widget inside EWO according to the ability of current user to execute given named action. The state shall conatin one of supported values (see constant ALARM_SCREEN_ACCESS_ACTION_xxx in CTRL library AsNgAccessControl.ctl):

  • 0: action is allowed for user, corresponding widget in EWO shall appear in 'norma; state
  • 1: action is disabled for user, corresponding widget in EWO shall appear in 'disabled' state (grayed out)
  • 2: action is disabled for user, corresponding widget in EWO shall be hidden


string setFixedActionState(const string &action, int state);

Set the state of widget inside EWO to the fixed state, independent on the ability of current user to execute given named action. The method was introduced for initial configuration of AS EWO's appearance,in particular, to hide controls which do not make sense for current project configuration.
The state shall conatin one of supported values (see constant ALARM_SCREEN_ACCESS_ACTION_xxx in CTRL library AsNgAccessControl.ctl):

  • 0: action is allowed for user, corresponding widget in EWO shall appear in 'norma; state
  • 1: action is disabled for user, corresponding widget in EWO shall appear in 'disabled' state (grayed out)
  • 2: action is disabled for user, corresponding widget in EWO shall be hidden


string resetFixedActionState(const string &action);

Discard the fixed state for action, previously set using setFixedActionState(). After this call action will return to 'normal' state control, based on access rights.

dyn_string getAllActions();

Get the names of all actions, known to AS EWO. This method, together with previous one, can be used in processing the changes in access rights of current user, using the following algorithm:

  • get list of all action names, known to EWO
  • check the access rights of current user for every action
  • finally apply the result of check to EWO using the method setActionEnabled()

Custom buttons

string addCustomButton(const string &actionName, const string &label, const string &iconFile, const string &tooltipText)

Add the custom button to toolbar in the footer area of AS EWO. The EWO itself doesn't know what to do with added buttons, EWO just fires corresponding event, which shall be processed by CTRL code in panel.

Arguments:

  • actionName: the name of action linked to new button. This name is used for access control, i.e. the CTRL code in panel can enable/disable/hide new button, based on access rights of current user, or on other conditions. This name is also passed to CTRL code in argument of corresponding event of EWO when new button is activated by user. The argument must be non-empty string.
  • label: the label string for new button. Argument can be empty string, in such case iconFile argument must be non-empty.
  • iconFile: the name of file with image to be used as icon for new button. This must be the name relative to PICTURES_REL_PATH. The algorithm used by AS EWO to find the file with picture is similar to the algorithm used by getPath() function of CTRL, see WinCC OA online help. This argument can be empty, in such case label argument must be non-empty.
  • tooltipText: the tooltip text for new button.

In case of success method returns empty string; in case of error the string with error description is returned.

Note
AS EWO doesn't check if actionName is unique.

Specific options

mapping getSpecificOption(const string &optionId);

The method is used to read the value of specific option, given in basic configuration. The parameter is the name (ID) of specific option as it is specified in basic configuration.

Other

string getFilter(bool compact);

Get the current structured filter of EWO as a string in JSON format, suitable for saving current filter to DP. The compact argument allows to choose between compact and pretty formatted JSON string. See filter JSON syntax.

string applyFilter(const string &jsonString);

Apply previously saved filter to AS EWO. Normally the value of jsonString argument is read from DP where filter was saved before; the value shall contain the definition of structured filter in JSON format. The method returns string with description of error if parsing/applying filter has failed; or empty string if processing was successful

string getUserSettings(bool compact);

Get the current user settings of EWO (see User Settings) as a string in JSON format, suitable for saving current user settings to DP. The compact argument allows to choose between compact and pretty formatted JSON string.

string applyUserSettings(const string &jsonString);

Apply previously saved user settings to AS EWO. Normally the value of jsonString argument is read from DP where user settings were saved before; the value shall contain the user settings in JSON format. The method returns string with description of error if parsing/applying user settings has failed; or empty string if processing was successful

mapping getFilterStatistics(const string &filterId);

Get the current statistics, collected by single filter in Filter View of AS EWO (see also Filter View editor). The filterId argument shall contain not the name of filter, but rather the name of DP where definition of this filter is stored. This must correspond to one of filters, shown in filter view area. In case of success the method returns mapping, containing values for all keys, listed in the table, plus two more keys:

Key Value
itemTextFormat The text format used for visible text of all items in filter view (see text templates)
itemToolTipTextFormat The text format used for tooltip text of all items oinfilter view (see text templates)

In case of error, the returned mapping contains the only key "error", where value is a string with error description.

The AS EWO has a button for exporting table content to CSV file. In addition, the exporting operation can be initiated from CTRL code using the method

string exportToCsv(const string &fileName = "", bool allRows = false, bool headers = true, bool withGrouping = false, const dyn_string &columns);

The method has the following arguments:

  • fileName: the name of file where resulting CSV shall be written, absolute path. If empty string is passed, then AS EWO will present file selection dialog to user,
  • allRows: true means writing all rows to output file, false - only selected rows.
  • headers: if true then column headers will also be written to output file.
  • withGrouping: this argument makes sense if alarms are shown in hierarchical tree. true means that content of grouping column shall also be written to output file.
  • columns: the list of column titles which shall be written to otuput file. Empty list is interpreted as 'write all visible columns of table'.


string getUniqueId();

Get the string, uniquely identifying this instance of AS EWO in UI manager. The method is used in CTRL code for building name of module, working with particular EWO. The unique identifier can also be used for other purposes if needed.

setOracleRdbPass(const string &pass);

It was mentioned in Actions description that:

  • AS EWO needs to know credentials in order to connected to ORACLE DB for retrieving archived alarms
  • the password for connection is stored in DPE as encoded string
  • AS EWO itself is not able to decode the password Taking these prerequisits into account, the sequence for preparing password for ORACLE is the following:
  • AS EWO reads the encoded password from DPE
  • AS EWO fires event with action name oraclePassRequest
  • CTRL code shall decode the password string and pass result to AS EWO using this method
sysConnectDist(mapping callbackArg);

AS EWO needs to have notifications about event like connection/disconnection of individual systems in distributed system. One of mechanism, provided by WinCC OA for this purpose, is sysConnect() function (see WinCC OA help). However, the sysConnect() is not available in WinCC OA API, hence, C++ code of AS EWO can't use the sysConnect() call directly.
One possible solution is the following:

  • the panel, where AS EWO is located, shall call sysConnect() (for example, in Initialize event)
  • callback for this call shall call this method of AS EWO, passign the mapping arrived to callback
setActivated(activated);

The method allows switching AS EWO between active/not active state. While not active, AS EWO does not connect to systems automatically. This method can be used if AS EWO in panel shall be hidden, and we don't want to spend processing resources for updating invisible control.

Debugging, tests...

AS EWO has also some methods which are not supposed to be used in normal operation. These methods were added to be used by integration tests and/or for debugging.

mapping getSourceStatistics()

The method is used when testing the process of reading alarms from RDB archive, It was observed during the test preparation that in one case filter condition, passed to alarm source, was not converted to query predicate, while it should be converted. However, that was very indirect observation (looking at query text at WinCC OA log). In order to make it possible for automatic test procedure to check for such kind of problems, this method was introduced. The keys in this map are (see class AbstractAlarmSource in C++ code for more details):

  • timeQueryPrepare: the value is time: time when query preparation has started
  • timeQueryStart: the value is time: time when query has been sent to DB server
  • timeQueryData: the value is time: time when first results of query have arrived from DB server
  • timeQueryFinish: the value is time: time when query was finished, successfully or otherwise
  • inFilters: the value is int: number of filters passed to alarm source
  • queryFilters: the value is int: number of filters converted to query predicates
void debugPrintCounts()

This method is used to display total number of alarms instances in alarm source, plus total number of alarm attributes in these alarm instance. Calculated counters are not returned to caller, instead they are just pronted in WinCC OA log.

Events

ctrlActionRequested(mapping &mArgs);

Probably, the most important and widely used event of this EWO. This event is fired on many occasions, including change of basic configuration, activating different controls (widgets) inside AS EWO.

The general meaning of this event is: something happened inside AS EWO, that can't be processed by EWO itself, and this requires some processing by CTRL code.

Normally this event shall be processed by CTRL function

void AlarmScreenNgEwo_ctrlActionRequested(mapping &mArgs);

which is defined in CTRL library AlarmScreenNgEwo.ctl

The only argument of this event contains the following keys (all keys are strings):

  • "sAction": the value is a string identifying requested action, see Action names.
  • "sCtrlLib": the value is a string, containing the name of CTRL library to be loaded for processing this event. See Basic configuration.
  • "sCtrlFunc": the value is a string, containing the name of CTRL function to be called for processing this event. See Basic configuration.
  • "sourceMode": the value is int, enumerating current source type for AS EWO; the following values are possible:
    • 0: AS EWO operates without data source, i.e. it does not display any alarms. This can happen if empty/invalid basic configuration is set for AS EWO.
    • 1: AS EWO operates with Live alarms from WinCC OA project
    • 2: AS EWO operates with History alarms from archive
    See constants AS_NG_EWO_MODE_xxx, defined in CTRL library AlarmScreenNgEwo.ctl


mouseEvent(mapping &mArgs);

Next important event, which is fired in response to user's mouse button events on table row with alarm data. The only argument for this event contains all keys for event ctrlActionRequested(), plus some more keys:

  • "mSource": the value is another mapping with information on event source, contains the following keys of type string:
    • "button": the value is int, indicating which mouse button caused this event
    • "screenX": the value is int, X-ccordinate of mouse event that caused this event. The coordinate is in screen's coordinate system
    • "screenY": the value is int, Y-ccordinate of mouse event that caused this event. The coordinate is in screen's coordinate system
    • "row": the value is dyn_int, containing the index of table row where mouse event occured. See the EWO's method getTableRowAsString() for description of content of this dyn_int
    • "columnSource": the value is int, enumerated source of information for column where mouse event occured. See constants AS_TABLE_SOURCE_xxx in CTRL library AlarmScreenNg.ctl for possible values.
    • "columnId": the value is string, identifying the alarm property shown in column where mouse event occured, see Alarm properties
  • "mAlarm": the value is mapping with all properties of alarm in a row where mouse event occured, see Alarm properties


sourceStateChanged(mapping &mArgs);

This event is fired when the state of alarm source in EWO has changed. Initially event was introduced for testing, but it can also be used for other purposes. The only argument of this event contains the following keys (all keys are strings):

  • "sCtrlLib": the value is empty string.
  • "sCtrlFunc": the value is empty string.
  • "sourceMode": the value is int, enumerating current source type of AS EWO; the following values are possible:
    • 0: AS EWO operates without data source, i.e. it does not display any alarms. This can happen if empty/invalid basic configuration is set for AS EWO.
    • 1: AS EWO operates with Live data from WinCC OA project
    • 2: AS EWO operates with History data from archive
    See constants AS_NG_EWO_MODE_xxx, defined in CTRL library AlarmScreenNgEwo.ctl
  • "iState": current state of alarm source, see constants AS_NG_EWO_SOURCE_xxx in CTRL library AlarmScreenNgEwo.ctl


sourceCountsChanged(mapping &mArgs);

This event is fired when the number of alarms, processed by source in EWO, have changed. Initially this event was introduced for testing, but it can also be used for other purposes. The only argument of this event contains the following keys (all keys are strings):

  • "sCtrlLib": the value is empty string.
  • "sCtrlFunc": the value is empty string.
  • "sourceMode": the value is int, enumerating current source type of AS EWO; the following values are possible:
    • 0: AS EWO operates without data source, i.e. it does not display any alarms. This can happen if empty/invalid basic configuration is set for AS EWO.
    • 1: AS EWO operates with Live data from WinCC OA project
    • 2: AS EWO operates with History data from archive
    See constants AS_NG_EWO_MODE_xxx, defined in CTRL library AlarmScreenNgEwo.ctl
  • "iArrived": number of alarms arrived to source from outside (from online systems, from archive...
  • "iProcessed": number of alarms passed by source further to alarms model


countPosChanged(mapping &mArgs);

This event is fired when the number of alarms, displayed in table, or/and range of rows visible in table are changed. This event can be used to react on user's navigation in table. Note that event is not fired when alarms are shown in hierarchical tree, event is for flat table only.
The only argument of this event contains the following keys (all keys are strings):

  • "sCtrlLib": the value is empty string.
  • "sCtrlFunc": the value is empty string.
  • "sourceMode": the value is int, enumerating current source type of AS EWO; the following values are possible:
    • 0: AS EWO operates without data source, i.e. it does not display any alarms. This can happen if empty/invalid basic configuration is set for AS EWO.
    • 1: AS EWO operates with Live data from WinCC OA project
    • 2: AS EWO operates with History data from archive
    See constants AS_NG_EWO_MODE_xxx, defined in CTRL library AlarmScreenNgEwo.ctl
  • "iTotal": Total number of rows in table
  • "iFirst": index of first visible row in table; index is zero-based
  • "iLast": index of last visible row in table; index is zero-based


customAction(mapping &mArgs);

This event is fired when one of custom buttons was clicked by user. The only argument of this event contains the following keys (all keys are strings):

  • "sAction": the value is a string identifying requested action. The value corresponds to actionName argument for addCustomButton() method which added this button.
  • "sCtrlLib": the value is a string, containing the name of CTRL library to be loaded for processing this event. See Basic configuration.
  • "sCtrlFunc": the value is a string, containing the name of CTRL function to be called for processing this event. See Basic configuration.
  • "sourceMode": the value is int, enumerating current source type of AS EWO; the following values are possible:
    • 0: AS EWO operates without data source, i.e. it does not display any alarms. This can happen if empty/invalid basic configuration is set for AS EWO.
    • 1: AS EWO operates with Live data from WinCC OA project
    • 2: AS EWO operates with History data from archive
    See constants AS_NG_EWO_MODE_xxx, defined in CTRL library AlarmScreenNgEwo.ctl
  • "screenX": the value is int, X-ccordinate of center of custom button that was activated. The coordinate is in screen's coordinate system.
  • "screenY": the value is int, Y-ccordinate of center of custom button that was activated. The coordinate is in screen's coordinate system.

The values screenX and screenY are added to arguments in order to allow for CTRL code to display menu when processing this event, see popupMenuXY() in WinCC OA online help.