OpenSCADAWiki: Home Page En/Doc/VC Aconcept/part4/part8 ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 
This is an old revision of HomePageEn/Doc/VCAconcept/part4/part8 from 2010-04-20 10:20:23..

4.7. Signaling (Alarms)

An important element of any visualization interface is the user notification about the violation - alarm. To simplify the perception, but also in mind the close connectivity of visualization and notification (typically notification is amplified with the visualization) it is decided to integrate the interface of a notification in the visualization interface. To do this, all the widget provides two additional attributes ( of the session level): "alarm" and "alarmSt". Attribute "alarm" is used to form the signal by the widget, according to his logic, and attribute "alarmSt" is used to control the signaling fact of the branch of the tree of the session of the project.


Attribute "alarm" is a line and has the following format: {lev|categ|message|type|tp_arg}
Where:


Attribute "alarmSt" is an integer number that represents the maximum alarm level and the fact of the quittance of the branch of the tree of the session of the project. Format of the number is as follows:


Alarm formation and receipt of it by the visualizer.
Alarm formation is performed by the widget by setting its own attribute "alarm" in appropriate way and in accordance with it the attribute "alarmSt" of current and the parent widget is set. Visualizers receive notification of the alarm using a standard mechanism for notifications of the changes of attributes of widgets.


This mechanism provides the ability to build the signaling (alarm) interfaces at the level of subsystems "data acquisition", or directly at the level of representation.


Taking into account that the processing of conditions of the signaling is made in the widgets, the page containing the objects of signaling should be performed in the background, regardless of their openness to the moment. This is done by setting a flag of the background execution of the page.


Although the mechanism of signaling is built in the visualization area the possibility of formation of visual signaling elements remains, for example by creating the page that will never be opened.


Quittance
Quittance is done by specifying the root of the branch of the widgets and the types of notification. This allows to make quittance on the side of visualizer both as by groups, for example by the signaling objects as well as individually by the objects. It is possible to independently quit different types of alarms. Setting of the quittance is made by the simple modification of the attribute "alarmSt".


Example of the script to work with the signals is listed below:

//Allocation of the existence of alarms of different ways of notification
cvt_light_en = alarmSt&0x100; cvt_alarm_en = alarmSt&0x200; cvt_sound_en = alarmSt&0x400;
//Allocation of the existence of not quited alarms of different ways notification
cvt_light_active = alarmSt&0x10000; cvt_alarm_active = alarmSt&0x20000; cvt_sound_active = alarmSt&0x40000;
//Processing of the event  buttons of quittance and quittance of different ways of notification
ev_rez = "";
off = 0;
while(true)
{
  sval = strParse(event,0,"\n",off);
  if( sval == "" ) break;
  else if( sval == "ws_BtPress:/cvt_light" ) alarmSt = 0x1000001;
  else if( sval == "ws_BtPress:/cvt_alarm" ) alarmSt = 0x1000002;
  else if( sval == "ws_BtPress:/cvt_sound" ) alarmSt = 0x1000004;
  else ev_rez+=sval+"\n";
}
event=ev_rez;


 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]