Web visual user interface for the project execution of visual control area (VCA).
License:
GPL
Introduction
WebVision module provides a mechanism of the final visualization of the visual control area (VCA) in the OpenSCADA system. The module is based on WEB technologies (XHTML, JavaScript, CSS, AJAX). In its work, the module uses the data from the VCA engine ( module VCAEngine ).
Visual control area (VCA) is an integral part of the SCADA system. It applies to the client stations with a view to providing accessible information about the object and to for the the issuance of the control actions to the object. In various practical situations and conditions the VCA, based on different principles of visualization may by applied. For example, this may be the library of widgets QT, GTK+, ~ wxWidgets or hypertext mechanisms based technologies HTML, XHTML, XML, CSS, and JavaScript, or third-party applications of visualization, realized in various programming languages Java, Python, etc. Any of these principles has its advantages and disadvantages, the combination of which could become an insurmountable obstacle to the use of VCA in a practical case. For example, technologies like the QT library can create highly-reactive VCA, which will undoubtedly important for the operator station for control of technological processes (TP). However, the need for installation of that client software in some cases may make using of it impossible. On the other hand, Web-technology does not require installation on client systems and is extremely multi-platform (it is enough to create a link to the Web-server at any Web-browser) that is most important for various engineering and administrative stations, but the responsiveness and reliability of such interfaces is lower that actually eliminates the using of them at the operator of the TP stations.
OpenSCADA system has extremely flexible architecture that allows you to create external interfaces, including user and in any manner and for any taste. For example, the system configuration OpenSCADA as now available as by means of the QT library, and also the Web-based.
At the same time creation of an independent implementation of the VCA in different basis may cause the inability to use the configuration of one VCA into another one. That is inconvenient and limited from the user side, as well as costly in terms of implementation and follow-up support. In order to avoid these problems, as well as to create as soon as possible the full spectrum of different types of VCA проект создания концепции СВУ? is established. The result of this project - the direct visualization module based on the WEB technologies, the direct visualization module Vision and VCA engine VCAEngine.
1. Purpose
This module of the direct visualization of the VCA serves only for the execution of interfaces of the VCA in the area of WEB-technologies.
The user interface is formed in the WEB-browser, by reference to the WEB-server and receiving from it XHTML-document over HTTP. In this case, the WEB-server - OpenSCADA system, which supports standard communication mechanisms of the TCP-networks (module Transport.Sockets), hypertext transfer protocol (module Protocol.HTTP), as well as encryption of traffic between the browser and the server (Transport.SSL). On this basis, to gain access to the user interface provided by this module, you need to configure the transport in the OpenSCADA (Transport.Sockets or Transport.SSL) in conjunction with the protocol HTTP (Protocol.HTTP). In the delivery of the OpenSCADA system there are configuration files containing settings of the Transport.Sockets for ports 10002 and 10004. Consequently, the interface of the module in the default configuration of the OpenSCADA will be available at URL: http://localhost:10002 or http://localhost:10004.
The final version of the VCA module, built on the basis of this module, will provide:
three levels of complexity in the formation of visualization interface which let organically to develop and apply the tools of the methodology from simple to complex:
formation from the template frames through the appointment of the dynamics (without the graphical configuration);
graphical formation of new frames through the use of already made visualization elements from the library (mimic panel);
formation of new frames, template frames of the visualization elements in the libraries.
building of the visualization interfaces of various complexity, ranging from simple flat interfaces of the monitoring and finishing with the full-fledged hierarchical interface used in SCADA systems;
providing of the different ways of formation and configuration of the user interface, based on different graphical interfaces (QT, Web, Java ...) and also through the standard management interface of OpenSCADA system;
change of dynamics in the process of execution;
building of the new template frames on the user level and the formation of the frames libraries, specialized for the area of application (eg the inclusion of frames of parameters, graphs and other items linking them to each other) in accordance with the theory of secondary using and accumulation;
building of the new user elements of the visualization and the formation of the libraries of frames,specialized for the area of application in accordance with the theory of secondary using and accumulation;
description of the logic of new template frames and user visualization elements as with the simple links, and also with the laconic, a full-fledged programming language;
the possibility of the inclusion of the functions(or frames of computing of the functions) of the object model of OpenSCADA to the user elements of the visualization, actually linking the presentation of the algorithm of computing (for example, by visualizing the library of models of devices of TP for following visual modeling TP);
separation of user interfaces and interfaces of visualization of data provides building the user interface in a single environment, and performance of it in many others (QT, Web, Java ...);
the possibility to connect to the performing interface for monitoring and corrective actions (for example, while operator training and control in real time for his actions);
Visual building of various schemes with the superposition of the logical links and the subsequent centralized execution in the background (visual construction and performance of mathematical models, logic circuits, relay circuits and other proceedings);
providing of the the functions of the object API to the OpenSCADA system, it can be used to control the properties of the visualization interface from the user procedures;
building of the servers of frames, of elements of the visualization and of the project of the interfaces of the visualization with the possibility to serve the great number of the client connections;
simple organization of client stations in different basis (QT, Web, Java ...) with the connection to the central server;
full mechanism of separation of privileges between the users which allows to create and execute projects with the various rights of access to its components;
adaptive formation of alarms and notifications, with the support of different ways of notification;
support of the user formation of the palettes and font preferences for the visualization of the interface;
support of the user formation of maps of the events under the various items of equipment management and user preferences;
support for user profiles, allowing to define various properties of the visualization interface (colors, font characteristics, the preferred maps of events);
flexible storage and distribution of libraries of widgets, frames, and projects of the visualization interfaces in the databases, supported by OpenSCADA; actually users need only to register the database with data.
2. Execution of the VCA interfaces
Execution of the VCA interface is to run a new project session or connect to the existing one on the level of VCA engine (Fig.2). Before the connection request to the session the authentication of the user request is done . Then the module of direct visualization represents and manages the data of the session. The main window of the execution mode of this module has the form presented at Fig.3.
The interface of the execution window is fully dynamically built by the JavaScript script on the basis of the contents of the session of the project through direct XML requests to the server.
Update of the contents of the open pages of the visualization interface with the frequency of 1 second. In the updating process it is performed:
request a list of opened pages, with a sign of page modification, at the model and consistency checking of the actually opened pages to that list;
request of the branch of the modified pages;
update of the contents of the modified pages and their widgets, in accordance with the received modified data.
The mechanism of the request of the only modified data is based on an absolute counter of the session execution. If you want to make real changes in the attributes of widgets the memorizing of the value of this counter is done, which allows the identification of modified attributes. This approach can increase productivity and reduce the load on network sharing in the case of access to the VCA engine via network.
Hierarchically the module provides an opportunity to accommodate the project pages in the main execution window of the WEB-browser (Fig.3), as well as putting them inside of the container widgets.
file:login.png
Fig.1.Authentication page.
Fig.2. Connection or the creation of a new session of the project's execution of the VCA.
file:wvis_run.png
Fig.3. The main execution window.
3. Представление базовых элементов (примитивов)
В данной версии этого модуля реализованы не все образы примитивов заложенные этим проектом. В общем же проектом заложены примитивы:
Id
Наименование
Функция
ElFigure
Элементарные графические фигуры
Примитив является основой для отрисовки элементарных графических фигур со всевозможной комбинацией их в одном объекте. Предусматривается поддержка следующих элементарных фигур:
Линия.
Дуга.
Кривая безье.
Заливка замкнутого пространства.
Для всех фигур, содержащихся в виджете устанавливаются единые свойства толщины, цвета и т.д., но это не исключает возможность указания вышеперчисленных атрибутов конкретно для каждой фигуры отдельно.
FormEl
Элементы формы.
Включает поддержку стандартных компонентов формы:
Редактирование строки.
Редактирование текста.
Флажок.
Кнопка.
Поле выбора из списка.
Список.
Слайдер.
Строка прокрутки.
Text
Текст
Элемент текста(метки). Характеризуется типом шрифта, цветом, ориентацией и выравниванием.
Media
Медиа
Элемент отображения растровых и векторных изображений различных форматов, проигрывания анимированных изображений, проигрывание аудио фрагментов и просмотр видео-фрагментов. Возможно в него стоит включить поддержку OpenGL!
Diagram
Диаграмма
Элемент диаграммы с поддержкой возможности отображения нескольких потоков трендов и различных режимов отображения, от минималистического до полноэкранного, двухмерного, трёхмерного, кругового и т.д.
Protocol
Протокол
Элемент протокола, визуализатора системных сообщений, с поддержкой различных режимов работы при различных размерах и установках.
Document
Документ
Элемент формирования отчётов, журналов и другой документации на основе указанных данных.
Function
Функция API объектной модели OpenSCADA
Невизуальный, на стороне исполнения, виджет, позволяющий включать вычислительные функции объектной модели OpenSCADA в СВУ.
Box
Контейнер
Содержит механизм размещения других виджетов с целью формирования новых, более сложных виджетов и страниц конечной визуализации.
Более детально рассмотрим реализацию каждого примитива.
3.1. Примитив элементарная фигура (ElFigure)
Реализована поддержка элементарных фигур: линии, эллиптической дуги, кривой Безье и заливка замкнутых контуров цветом и изображением. Для элементарных фигур реализованы следующие операции:
создание/удаление фигур;
копирование фигур;
перемещение и изменение размеров фигур с помощью мыши и клавиатуры;
возможность связывать элементарные фигуры друг с другом, получая более сложные, для которых доступны все свойства исходных элементарных фигур;
возможность одновременного перемещения нескольких фигур;
генерация событий клавиш мыши, в момент клика мышью на залитые контура;
масштабирование;
поворот.
На рис. 4 представлена часть экрана с кадром, содержащим вышеперечисленные элементарные фигуры.
file:wvis_run_elfig.png
Рис.4 Реализация элементарных фигур в WebVision.
3.2. Примитив текста (Text)
Реализована поддержка элемента текста со свойствами:
Шрифт со свойствами: типа/класса шрифта, размера, усиления, наклонности, подчёркивания и перечёркивания.
Цвет текста.
Ориентация текста.
Автоматический перенос по словам.
Выравнивание текста по горизонтали и вертикали со всеми вариантами.
Отображение фона в виде цвета и/или изображения.
Отображение бордюра вокруг текста, с указанным цветом, шириной и стилем.
Формирование текста из атрибутов различного типа и свойств.
На рис. 5 представлена часть экрана с кадром, содержащим примеры текста с использованием различных параметров.
file:wvis_run_txt.png
Рис.5. Реализация базового элемента текста в WebVision.
3.3. Примитив элементов формы (FormEl)
Реализована поддержка элементов формы на кадрах СВУ. Реализованы заложенные свойства, включая следующие элементы формы:
Редактор строки -- Представлено следующими видами: "Текст", "Combo", "Целое", "Вещественное", "Время", "Дата", "Время и Дата". Редактор текста -- Представляет редактор плоского текста с подтверждением или отказом от ввода. Поле флажка -- Предоставляет поле бинарного флажка. Кнопка -- Предоставляет кнопку с поддержкой: цвета кнопки, изображения в кнопке и режима фиксации. Выбор из списка -- Предоставляет поле выбора элемента, со списка указанных элементов. Список -- Предоставляет поле списка с контролем за текущим элементом. Слайдер -- Элемент слайдера (не реализован). Прогрес-бар -- Полоска прогресс-бара (не реализован).
Реализованы режимы: «Включен» и «Активен», а также передача изменений и событий в модель данных СВУ (движок). Для всех реализованных представлений поддерживается активный режим, т.е. элементы могут быть использованы для создания форм пользовательского ввода.
На рис. 6 представлена часть экрана с кадром, содержащим вышеперечисленные элементы формы.
file:wvis_run_formel.png
Рис.6. Реализация элементов формы в WebVision.
Реализована поддержка элемента построения диаграмм/трендов со свойствами:
Построение графиков/трендов:
Построения графика для: архивных данных, текущих данных и формирования промежуточного буфера отображения для параметров без архива.
Построение как одиночных графиков со значением параметра по оси ординат, так и сводных графиков, включающих до 10 параметров, с процентной шкалой.
Возможность адаптации графика параметра к значениям данным, подгон шкалы.
Широкий диапазон масштабирования и адаптации горизонтальной шкалы, с автоматическим усреднением на уровне сервера и самого примитива.
Возможность отображение размерной сетки и маркеров по горизонтали и вертикали, с адаптацией к диапазону отображения.
Возможность установки курсора тренда мышью.
На рис. 8 представлена часть экрана с кадром, содержащим примеры диаграммы-тренда.
file:wvis_run_diag.png
Рис.8. Реализация базового элемента отображения диаграммы-тренда в WebVision.
3.6. Примитив формирования протокола (Protocol)
Реализована поддержка элемента формирования протокола со свойствами:
Формирование протокола из архива сообщений за указанное время и глубину.
Запрос данных из указанных архиваторов сообщений.
Выборка данных из архивов по уровню важности и шаблону категории сообщений.
Поддержка режима слежение за появлением сообщений в архиве сообщений.
На рис. 9 представлена часть экрана с кадром, содержащим пример протокола.
file:wvis_run_prot.png
Рис.9 Реализация базового элемента отображения протоколов в WebVision.
3.7. Примитив формирования отчётной документации (Document)
Реализована поддержка элемента формирования отчётной документации со свойствами:
Гибкое формирование структуры документа на основе языка гипертекстовой разметки. Это предоставляет поддержку широких возможностей форматирования документов.
Формирование документов по команде или по графику. Необходимо для формирования отчётной документации в архив с последующим просмотром архива.
Формирование документа в режиме реального времени. Для формирования документов полностью динамически и на основе архивов за указанное время.
Использование атрибутов виджета для передачи значений и адресов на архивы в документ. Позволяет использовать виджет документа как шаблон при формирования отчётов с другими входными данными.
В основе любого документа лежит XHTML-шаблон. XHTML-шаблон это тег 'body', WEB-страницы, содержащий статику документа в стандарте XHTML 1.0 и элементы исполняемых инструкций на одном из языков пользовательского программирования OpenSCADA в виде <?dp <procedure> ?>. Результирующий документ формируется путём исполнения процедур и вставки их результата в документ.
Источником значений исполняемых инструкций являются атрибуты виджета этого примитива, а также все механизмы языка пользовательского программирования. Атрибуты могут добавляться пользователем и линковаться на реальные атрибуты параметров или-же являться автономными, значения которых будут формироваться в скрипте виджета. В случае со слинкованными атрибутами могут извлекаться значения из истории, архива.
На рис. 10 представлен кадр, содержащий пример документа.
file:wvis_run_doc.png
Рис.10 Реализация базового элемента отображения отчётной документации в WebVision.
3.8. Примитив контейнера (Box)
Реализована поддержка примитива контейнера, по совместительству выполняющего роль страниц проектов. Данный примитив является единственным элементом-контейнером, который может включать в себя ссылки на кадры из библиотеки, формируя тем самым пользовательские элементы нужной конфигурации. Примитив реализует предусмотренные проектом свойства. Перечислим по пунктам свойства данного примитива:
Контейнер -- Позволяет формировать нужные объекты путём группировки базовых в рамках данного примитива. Страница -- Элементы построенные на данном примитиве могут выполнять роль страницы пользовательского интерфейса. Контейнер страниц -- Свойство замещения собственного содержимого другой страницей, в процессе исполнения. Используется для формирования фреймов на страницах пользовательского интерфейса. Например, главная страница традиционной SCADA системы с объектами сигнализации строится именно таким образом. Фон -- Поддерживает возможность указания фона в виде цвета или изображения. Бордюр -- Поддерживает возможность изображения бордюра с указанным цветом, толщиной и стилем.
4. Общая конфигурация модуля
Для настройки собственного поведения, в не очевидных ситуациях, модулем предоставляется возможность настройки отдельных параметров посредством интерфейса управления OpenSCADA (рис. 11). Таковыми параметрами являются:
На данном этапе модуль уже может быть использован для построения реальных интерфейсов пользователя с поддержкой основных функций. Однако отдельные проблемы могут возникать как по причине недоработанности, так и различия браузеров. Сейчас достаточно качественно обеспечена работоспособность на браузерах: FireFox, Konqueror и Opera.