Events and MethodsΒΆ

Events and Methods in UNIQO

The application logic of a Q Application is created through different features; one of these is the execution of specific actions called methods. These are called (or invoked) and executed on the occurrence of events.

Example

To increase a value after a button click, the event is the mouse click and the method is the action that causes the increase of the value.

Events

An event is a message generated at runtime to signal the occurrence of a situation. It can be used to invoke a method.

For reference information on the events, see Object and variable references.

Methods

A method is an action, a subprogram that an object can execute at runtime or at design time, as a consequence of one of the following conditions:

It is possible to associate multiple methods with a single event: when the event occurs, the methods are invoked in the order in which they are associated with the event in Q Studio design phase.

For reference information on the methods, see Object and variable references.

Native Events

We define as native events the events present in UNIQO native object types, for example the events of the Button object.

Example

Below is how the events of the Button object are displayed in Q Studio.

../_images/a1fb00df06b366bbecaa6fabdfcd23a2e9bcfeff.png

Change Events

In addition to the native events, it is possible to set custom events linked to the variables, called change events.

In each object, it is possible to set a change event for each of its variables. This occurs when the value of the corresponding variable changes at runtime.

Arguments of a method

A method can have properties, called arguments. There are input arguments, which are used to specify values that the method uses during execution (for example, the increment value of a figure), and output arguments, which are values that the method returns. The value of an argument, as for variables, can be fixed or dynamic (see Dynamic Links).

Local methods

The methods of the single project objects are called local: in other words, the methods exposed by the objects. Some objects that display methods are, for example, alarms, loggers, databases and some graphical objects (e.g. the object Video Video).

Example

Below is an example of the methods exposed by a Digital Alarm object, as displayed in Q Studio.

../_images/7f4e3fcc3bff12bc8ecb9bd96fdb4782d1920b56.png

Global methods

The methods always exposed by UNIQO are called global, regardless of the project nodes.

Example

An alarm object always exposes the Acknowledge local method, to acknowledge active alarms generated by the specific object.

Among the global methods, for example, the Acknowledge all method is available, to acknowledge the active alarms generated by all the project alarm objects.

How the global methods related to alarms are displayed in Q Studio is shown below:

../_images/4add0ed6388b89779a55a5411ad1996325553953.png