OpenSCADAWiki: Home Page En/Doc/VC Aconcept/part6/part3 ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 
This is an old revision of HomePageEn/Doc/VCAconcept/part6/part3 from 2010-05-11 10:15:55..

6.3 Sessions of the project's execution -- Done


The objectives of this stage is:


At this stage it was added the mechanism of the project's execution in the sessions of the data model of the VCAEngine module, as well as visualization of the project's session, the "RunTime" mode in the visualization module on the QT library Vision with the elements of the data update and interaction with the user.

Formation of the hierarchical final visualization widgets' tree based on the project for which the session is opened.

In accordance with Fig.4.10.1 and Fig.4.10.2 the objects of the project's session are inherited from the abstract object Widget and use the appropriate objects of the project. Thus, the session (Session) uses the project (Project) and forms the expanded tree on the basis of it. The project's page Page is directly used by the session's page SessPage. The remaining objects (SessWdg) are shown in accordance with the hierarchy of page's elements (Fig.4.10.2).


In addition to the standard properties of the abstract widget (Widget) the elements of the page and pages of session get the properties of storage of frame of values of the computational procedure, calculation of procedures and events' processing mechanism. Pages of the session, in addition to all, contain the container of following by the hierarchy pages. The session is calculated with the specified periodicity and in the following sequence:

This policy allows you to pass the page in accordance with the hierarchy, and events in the widgets to rise to the top in one iteration.


The session includes the support for the special properties of the pages:

Container - the page is the container for the underlying pages;
Template - the page is the template for the underlying pages;
Empty - the blank inactive page, this property is used in conjunction with the property Container for the organization of logical containers.

On the basis of these properties the following types of pages are implemented:

Standard -- Standard page (none property is set). Is the full-fledged final page.
Container -- Full-fledged page with the container property (Container).
Logical container -- The logical container which is actually not a page (Container|Empty). It performs the property of intermediate and grouping element in the pages tree.
Template -- The template page (Template). The clean master page is used to describe the common properties and for extending them privately in the embedded pages.
Container and template -- The template and container page (Template|Container). It combines the template and container functions.

Providing the values' frames for the final visualization widgets' calculation procedures.

In the section above, we have already noted that the widget of the session contains the frame of values of the calculation procedures. This image is initiated and is used in the case of presence of the calculation procedure. At the time of the initialization the list of parameters of procedure is created and the compilation of the procedures with these parameters is done in the module that implements the selected programming language and that id encoded with the full name of the widget. The compiled function is connected to frame the values of calculation procedures. Next, the calculation is done with the periodicity of the session.


Calculation and processing of the widget as a whole is done in the following order:

Processing the links on the data sources of OpenSCADA.

At the execution of the widget of the session it is necessary to make the links' processing. At the moment the connection on the links is made at the time of calculation, which is not a quick operation. Implementation of links processing will be reviewed and optimized in the future.


The support for the following types of links is provided:


Currently the first two types of links are implemented. The last will be implemented together with the implementation of the basic widget "Link".

Formation of the window of the project execution (RunTime).

On the side of visualization (Vision module) to visualize the process of execution of the project the VisRun object is implemented. At startup it sends the request to create and initialize the session. Further the request on the list of opened pages is made. Based on the information of the VisRun opened pages and their connections, the resulting interface is formed. Fig. 6.3 shows an example of classical SCADA interface with alarm objects, where the main window contains a page inside which is replaced by pressing the buttons of alarm objects and paging.


 (90 Kb)
Fig.6.3 The visualization of the project's execution window. The "RunTime" mode.

Visualization of the project's frames in the "RunTime" mode with periodic update of the content.

The update of the contents of the opened pages of the visualization interface with the periodicity of the execution of the project's session is implemented. In the update process it is done:
- request of the list of opened pages in the model and checking consistency of the really opened pages to this list;
- requests of the modified data on each page and widget;
- update the content of the pages and their widgets in accordance with the received modified data.


By closing the "RunTime" window the closing of the project's session in the data model is made. It will be implemented the opportunity to connect to the earlier opened session and disconnect from the session without closing it.


The mechanism of the request of the only modified data is based on absolute counter of the session's execution. When you make real changes in the attributes of widgets the remembering of the value of this counter is made, which allows us to identify the modified attributes. This approach allows to increase productivity and reduce the load on the traffic in case of access to the model through the network.

Realization of transfer and processing of events.

The visualizer of the ("RunTime") session, because of its direct contact with the user, collects various events. Some of the events are processed by the images of the basic widgets (Text, Box, Document, etc.), which can form other events. Another part is directly transfered to the data model, where they are processed.


To the data model events are transferred immediately upon their receiption, where they are collected in the attribute "event" of the widget until the next iteration of the session's execution. Further, in the process of data session's calculation, the events are extracted from the "event" attribute and are processed in the procedure of the widget or in accordance with the script(scenario) in the "evProc" attribute. The events which are not processed rise to the higher widget of the model.

The implementation of the mechanism of the switching/opening/replacement/navigation through the pages of the project taking into account the processing scenarios(scripts).

Переключение, открытие, замещение и навигация по страницам реализовано на основе обработки событий по сценарию, в атрибуте активного виджета "evProc". Сценирий этого атрибута записывается в виде списка команд с синтаксисом: <event>:<srcWdg>:<com>:<prm>
где:

event -- ожидаемое событие;
srcWdg -- дочерний виджет - источник события
com -- команда сессии;
prm -- параметр команды;

Реализованы следующие команды:

open -- Открытие страницы. Открываемая страница указывается в параметре prm как на прямую, так и в виде шаблона (например: /pg_so/1/*/*).
next -- Открытие следующей страницы. Открываемая страница указывается в параметре prm как на прямую, так и в виде шаблона (например: /pg_so/*/*/$).
prev -- Открытие предыдущей страницы. Открываемая страница указывается в параметре prm как на прямую, так и в виде шаблона (например: /pg_so/*/*/$).

Специальные символы шаблона расшифровываются следующим образом:

pg_so -- Прямое имя требуемой страницы, с префиксом. Требует обязательного соответствия и используется для идентификации предыдущей открытой страницы.
1 -- Имя новой страницы в общем пути, без префикса. Имя предыдущей страницы игнорируется.
* -- Страница берётся с имени предыдущей открытой страницы или подставляется первая доступная страница, если предыдущая открытая страница отсутствует.
$ -- Указывает на место открытой страницы относительно которой необходимо искать следующую или предыдущую.

Для понимания работы механизма шаблонов приведём несколько реальных примеров:

Переключение объекта сигнализации:
Команда: open:/pg_so/2/*/*
Было: /pg_so/pg_1/pg_mn/pg_1
Стало: /pg_so/pg_2/pg_mn/pg_1

Переключение вида:

Команда: open:/pg_so/*/gkadr/*
Было: /pg_so/pg_1/pg_mn/pg_1
Стало: /pg_so/pg_1/pg_gkadr/pg_1

Следующая/предыдущая страница вида:

Команда: next:/pg_so/*/*/$
Было: /pg_so/pg_1/pg_mn/pg_1
Стало: /pg_so/pg_1/pg_mn/pg_2

В связке с выше описанным механизмом, на стороне визуализации (RunTime), построена логика, регулирующая каким образом открывать страницы. Логика построена на следующих атрибутах базового элемента "Box":

pgOpen -- Признак "Страница открыта".
pgNoOpenProc -- Признак "Исполнять страницу даже если она не открыта".
pgOpenSrc -- Содержит адрес виджета или страницы, открывшей текущую. В случае вложенного контейнерного виджета здесь содержится адрес включаемой страницы.
pgGrp -- Группа страниц. Используется для связки контейнеров страниц со страницами в одной группе.

Логика определения способа открытия страниц работает следующим образом:


Совокупность всех этих механизмов уже сейчас позволяет строить сложные, многоуровневые и многооконные интерфейсы пользователя.


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