From OpenSCADAWiki
Jump to: navigation, search
This page is a translated version of the page Libs/Documents and the translation is 33% complete.

Other languages:
English • ‎mRussian • ‎Українська
Название Версия Лицензия Источник Языки Автор Иконка Описание
Библиотека отчётов и документов 2.0, 2.1 GPLv2

OscadaLibs.db (SQL, GZip) > DAQ.JavaLikeCalc.doc
vcaBase.db (SQL, GZip) > VCA.wlb_doc

en, uk, ru Роман Савоченко LibDocuments.png Предоставляет комбинированную библиотеку отчётов, документов и связанных функций общей и промышленной автоматизации.
- расширить документ "Годовой отчёт месячных значений" обработкой переполнений счётчиков введенных вручную;
- расширить функцию документов "Диаграмма" поддержкой полосового графика (гистограмм).

Библиотека создаётся для предоставления элементов-кадров отчётов и документов пользовательского интерфейса и содержит графические элементы, которые часто востребованы при формировании пользовательского интерфейса автоматизации технологических и общих процессом. Строится библиотека на основе примитивов виджетов и языка внутреннего программирования JavaLikeCalc, также для связанных функций.

Названия элементов и их параметров доступны на языках: Английский, Украинский и mRussian. Их исходный код написан в языко(человеческий)-независимом режиме с вызовом функции перевода tr() и перевод этих сообщений также доступен Английским, Украинским и mRussian.

1 Документы

Содержит элементы-кадры документов шаблонного и конечного типов, которые предназначены для размещения в разделе "Документы" (вид отображения) дерева страниц проекта, построенного по концепции объектов сигнализации корневой страницы "RootPgSo". Однако, они могут быть размещены как отдельные сущности или в составе собственной концепции управления страницами, но тут нужно учитывать, что кадры часто ссылаются и вызывают панель документов!

Для подключения части библиотеки к проекту станции OpenSCADA Вы можете получить файл БД как:

  • такой что поставляется с готовым и соответствующим пакетом дистрибутива Linux вроде "openscada-libdb-vca", "openscada-LibDB.VCA";
  • наиболее актуальный и непосредственно полученный из репозиторию subversion, преобразованный в файл БД SQLite путём:
wget http://oscada.org/svn/trunk/OpenSCADA/data/LibsDB/vcaBase.sql
sqlite3 -init vcaBase.sql vcaBase.db .exit

Этот полученный файл Вы далее можете разместить в каталоге проекта станции и создать объект базы данных модуля БД "SQLite", зарегистрировав файл базы данных в конфигурации.


1.1 Document - archival (doc)

1.2 GPLv2 * en, uk, ru Roman Savochenko

The frame, shown in Figure 1.1, is a template of documents of the archive type and it is provided as an example and for building own archive documents on it basis. The main specific of that document type is the periodic generating on the VCA-session level (in the background) and placing the final and ready to view documents to an archive, the VCA-project's session DB-table "prj_{ProjID}_ses".

The main advantage of this document type is the lowest load on CPU during the generation, which can be multi-step one during the main generation period, and the fast view, which involves simply opening the ready documents from the archive. But this document type has a significant disadvantage, which is the constant execution of single project session in the background and the absence of which leads to the omission of the documents generation in the archive.

At.png Therefore, documents of this type are appropriated to use on the stationary AWPs of the operators, even if it is a reproduction from the visualisation server, and are useless in the WEB-interface!

Fig.1.1. The "Document - archival" frame in the development mode.

Using — development
The frame can only be used as a basis for creating your own archival type documents, for which you should it copy or inherit, by selecting the appropriate option in the copy dialog. Next, you need to edit the document template, in the appropriate attribute, according to the needs of your document, and write your own procedure for periodically and step-by-step formatting of the documents with closing to the archive, a sample of which can be obtained from the final documents based on this.


1.1.1 Day report of the hour-averaged values (docRepDay)

3.2 GPLv2 * en, uk, ru Roman Savochenko -1 ms (parent)

The document, shown in Figure 1.1.1, is provided for generating a day report of the hour-averaged values in view of the trends diagram and the data table. The document is initially the archival type but in time it is made dynamic also, so, depending from the execution mode, you can whether select a ready document from the archive or specify the data time and depth. The document commonly uses and represents the representative structure of the DAQ-template "Analog signal". As a data source of this document is the value archives of the DAQ-parameters.

Working in the primary archival mode performed with the 5 minutes period, when during an hour an one record-row data is formed. The last one record-row is closed at the 5 minute of a new hour (14:05 for example) and a new one record-row is started. Whole and complete document is archived at the 3 minute of the "Report hour (repHour)" of the next day (09:03 for example).

  • Sponsored for the dynamization by: BLUE STAR GROUP Ltd and Vinnica Poultry Farm
Fig.1.1.1. The "Day report of the hour-averaged values" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree. To each document can be connected up to ten parameters, setting the links. Items, for which there are not set the links, will be hidden at runtime.

At.png To each document can be set:

  • the "Archive length (n)" attribute in need value of the document archive size or in 0 for the dynamic mode;
  • the "Archiver (arch)" attribute in need archiver that maintains the specified parameters; you must not use archivers with worse at one minute quality;
  • the "Report hour (repHour)" attribute in the document report hour — start hour of the day;
  • the "Enable graph (enGraph)" attribute for enable/disable the graph;
  • the "Title (title)" attribute in the document specific title.

Using — runtime
In the runtime mode, the items, for which links have been set, are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area.

Linking and configuring the attributes

Identifier Name Type Configuration Configuration template Description
n Archive length, 0 for the dynamic mode Integer Constant Setting the archive size in 0 you switch the document mode to the dynamic type, by default 100.
repHour Report hour Integer Constant The hour which means as the report start — the day start, by default 9.
Document widget (doc)
arch Archiver String Constant Values archiver, by default and preferable to use one-minute archiver "FSArch.1m".
title Title String Constant Title of the report.
enGraph Enable graph Boolean Constant Enabled by default.
Parameter {n} from 1 to 10.
p{n}name Parameter {n}: name String Input link Parameter{n}|NAME Name of the parameter in the table header.
p{n}var Parameter {n}: variable Address Input link Parameter{n}|var Address to the parameter attribute with the value archive.
p{n}ed Parameter {n}: dimension String Input link Parameter{n}|ed
p{n}prec Parameter {n}: precision Integer Input link Parameter{n}|prec
p{n}cntr Parameter {n}: is counter Boolean Constant Parameter{n}|isCntr Sets for counters for obtain the values as difference.
p{n}max Parameter {n}: maximum Address Input link Parameter{n}|max Used for determining the parameter scale on the graph.
p{n}min Parameter {n}: minimum Address Input link Parameter{n}|min Used for determining the parameter scale on the graph.


1.1.2 Month report of the day-averaged values (docRepMonth)

3.2 GPLv2 * en, uk, ru Roman Savochenko -1 ms (parent)

The document, shown in Figure 1.1.2, is provided for generating a month report of the day-averaged values in view of the trends diagram and the data table. The document is initially the archival type but in time it is made dynamic also, so, depending from the execution mode, you can whether select a ready document from the archive or specify the data time and depth. The document commonly uses and represents the representative structure of the DAQ-template "Analog signal". As a data source of this document is the value archives of the DAQ-parameters.

Working in the primary archival mode performed with the 5 minutes period, when during a day an one record-row data is formed. The last one record-row is closed at the 5 minute of a new day (05 09:05 for example) and a new one record-row is started. Whole and complete document is archived at the 3 minute of the "Report hour (repHour)" of the next month (05 09:03 for example).

  • Sponsored for the dynamization by: BLUE STAR GROUP Ltd
Fig.1.1.2. The "Month report of the day-averaged values" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree. To each document can be connected up to ten parameters, setting the links. Items, for which there are not set the links, will be hidden at runtime.

At.png To each document can be set:

  • the "Archive length (n)" attribute in need value of the document archive size or in 0 for the dynamic mode;
  • the "Archiver (arch)" attribute in need archiver that maintains the specified parameters; you must not use archivers with worse at one day quality;
  • the "Report hour (repHour)" attribute in the document report hour — start hour of the day;
  • the "Enable graph (enGraph)" attribute for enable/disable the graph;
  • the "Title (title)" attribute in the document specific title.

Using — runtime
In the runtime mode, the items, for which links have been set, are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area.

Linking and configuring the attributes

Identifier Name Type Configuration Configuration template Description
n Archive length, 0 for the dynamic mode Integer Constant Setting the archive size in 0 you switch the document mode to the dynamic type, by default 100.
repHour Report hour Integer Constant The hour which means as the report start — the day start, by default 9.
Document widget (doc)
arch Archiver String Constant Values archiver, by default and preferable to use one-minute archiver "FSArch.1m".
title Title String Constant Title of the report.
enGraph Enable graph Boolean Constant Enabled by default.
Parameter {n} from 1 to 10.
p{n}name Parameter {n}: name String Input link Parameter{n}|NAME Name of the parameter in the table header.
p{n}var Parameter {n}: variable Address Input link Parameter{n}|var Address to the parameter attribute with the value archive.
p{n}ed Parameter {n}: dimension String Input link Parameter{n}|ed
p{n}prec Parameter {n}: precision Integer Input link Parameter{n}|prec
p{n}cntr Parameter {n}: is counter Boolean Constant Parameter{n}|isCntr Sets for counters for obtain the values as difference.
p{n}max Parameter {n}: maximum Address Input link Parameter{n}|max Used for determining the parameter scale on the graph.
p{n}min Parameter {n}: minimum Address Input link Parameter{n}|min Used for determining the parameter scale on the graph.


1.2 Document - dynamic (docDin)

1.3 GPLv2 * en, uk, ru Roman Savochenko -2 ms (disabled)

The frame, shown in Figure 1.2, is a template of documents of the dynamic type and it is provided as an example and for building own dynamic documents on it basis. The main specific of that document type is the synchronous generating at the requesting-opening.

The main advantage of this document type is the maximal actuality of the data and the document language, for the multilingual interfaces, that is the possibility of generating for the specified date and time. But this document type has a significant disadvantage, which is the high CPU load and long time of the synchronous generation for big archival data.

At.png Therefore, documents of this type are allowed to use on every types of the interfaces, include the WEB-interfaces, but some documents based on big archival data require for not slow processing systems!

Fig.1.2. The "Document - dynamic" frame in the development mode.

Using — development
The frame can only be used as a basis for creating your own dynamic type documents, for which you should it copy or inherit, by selecting the appropriate option in the copy dialog. Next, you need to edit the document template, in the appropriate attribute, according to the needs of your document, and write your own common generation procedure, if it is not builtin into the document template.


1.2.1 Instantaneous values report (docRepInstVals)

2.1 GPLv2 * en, uk, ru Roman Savochenko

The document, shown in Figure 1.2.1, is provided for generating a report of the instantaneous values in view of the trends diagram and the data table. The document is the dynamic type, so you can specify the data time and depth. The document commonly uses and represents the representative structure of the DAQ-template "Analog signal". As a data source of this document is the value archives of the DAQ-parameters.

Fig.1.2.1. The "Instantaneous values report" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree. To each document can be connected up to ten parameters, setting the links. Items, for which there are not set the links, will be hidden at runtime. The default document depth in the past is set at 10 minutes.

At.png To each document can be set:

  • the "Enable graph (enGraph)" attribute for enable/disable the graph;
  • the "Title (title)" attribute in the document specific title.

Using — runtime
In the runtime mode, the items, for which links have been set, are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area.

Linking and configuring the attributes

Identifier Name Type Configuration Configuration template Description
Document widget (doc)
title Title String Constant Title of the report.
enGraph Enable graph Boolean Constant Enabled by default.
Parameter {n} from 1 to 10.
p{n}name Parameter {n}: name String Input link Parameter{n}|NAME Name of the parameter in the table header.
p{n}var Parameter {n}: variable Address Input link Parameter{n}|var Address to the parameter attribute with the value archive.
p{n}ed Parameter {n}: dimension String Input link Parameter{n}|ed
p{n}prec Parameter {n}: precision Integer Input link Parameter{n}|prec
p{n}max Parameter {n}: maximum Address Input link Parameter{n}|max Used for determining the parameter scale on the graph.
p{n}min Parameter {n}: minimum Address Input link Parameter{n}|min Used for determining the parameter scale on the graph.


1.2.2 Protocol of violations (docAlarmsRep)

1.7 GPLv2 * en, uk, ru Roman Savochenko -2 ms (disabled)

The document, shown in Figure 1.2.2, is provided for generating a report of the violations. The document is the dynamic type, so you can specify the data time and depth. The document commonly uses and represents the messages structure "Violations". As a data source of this document is the message archive.

Fig.1.2.2. The "Protocol of violations" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree. To each document can be set own messages level and category of the processed violations in the attribute "Message category (messCat)", which is the generic one by default "1:al*:*" and can be specified by the data sources. The default document depth in the past is set at 1 day.

Using — runtime
In the runtime mode, the specified violation messages are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area.

Linking and configuring the attributes

Identifier Name Type Description
messCat Message category String The requested violation messages level and category, by default "1:al*:*".


1.2.3 Protocol of interruptions (docUsersSet)

1.8 GPLv2 * en, uk, ru Roman Savochenko

The document, shown in Figure 1.2.3, is provided for generating a report of the user interruptions. The document is the dynamic type, so you can specify the data time and depth. The document commonly uses and represents the messages structure "User-operator actions". As a data source of this document is the message archive.

Fig.1.2.3. The "Protocol of interruptions" document in the runtime mode.

Using — development
The document is designed to perform the role of page, and should therefore be placed directly in the project's tree. The document does not mean any configurations due to the interruption messages are common. The default document depth in the past is set at 1 day.

Using — runtime
In the runtime mode, the user interruption messages are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area.

Linking and configuring the attributes

Identifier Name Type Description
messCat Message category String The requested messages level and category, by default "2:/(^|.*:)OP*/".


1.2.4 Protocol of messages (docMessRep)

1.5 GPLv2 * en, uk, ru Roman Savochenko

The document, shown in Figure 1.2.4, is provided for generating a report of different sort messages together, including: "Violations", "User-operator actions" and "System". The document is the dynamic type, so you can specify the data time and depth. The document so commonly uses and represents the messages structures: "Violations", "User-operator actions" and "System". As a data source of this document is the message archive.

The document also provides a simple filtering for selected criteria: "Disabled", "Date and time (dttm)", "Level (lev)", "Parameter (prm)", "Description (dscr)", "Value (alrm)".

  • Sponsored by: Ustijancev Michael
Fig.1.2.4. The "Protocol of messages" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree.

At.png To each document can be set own level and category of the processed messages in the attribute "Message category (messCat)", which is the generic one by default "1:/^(al|OP|/sub_UI/mod_VCAEngine)/" and can be specified for yourself. Also you can specify the only used archivers by setting the attribute "Archivers list (archLs)". The default document depth in the past is set at 1 day.

Using — runtime
In the runtime mode, the specified messages are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area.

Selecting a filtering criteria and entering text required to presence, the user can see only needed messages.

Linking and configuring the attributes

Identifier Name Type Description
messCat Message category String The requested messages level and category, by default "1:/^(al|OP|/sub_UI/mod_VCAEngine)/".
archLs Archivers list, "{ArhMod}.{Arh}[;{ArhModN}.{ArhN}]" String List of message archivers from which the messages will be only requested, set empty for common access.


1.2.5 Report of two working shifts (docRep2WorkSh)

2.0 GPLv2 * en, uk, ru Roman Savochenko

The document, shown in Figure 1.2.5, is provided for generating a report of the hour values of up to 10 parameters for two working shift of day with the result sum for flows and related parameters. The document is the dynamic type, so you can specify the data time and depth (fixed). The document commonly uses and represents the representative structure of the DAQ-template "Analog signal". As a data source of this document is the value archives of the DAQ-parameters.

Fig.1.2.5. The "Report of two working shifts" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree. To each document can be connected up to ten parameters, setting the links. Items, for which there are not set the links, will be hidden at runtime.

At.png You must also specify an one-hour archiver in the "Archiver (arch)" attribute that maintains the specified parameters, since this document requires such data. If the start of the first working shift is different from 8 (eighth) hours, then you must specify the required hour in the "Start hour (stH) attribute.

Using — runtime
In the runtime mode, the items, for which links have been set, are displayed. Additionally you can control the display properties of documents, for what there is used the document control panel, which can be called clicking the left mouse button in the document area. Since the document fixes the depth in history at 12 hours (one working shift), the user can only change the document time!

Linking and configuring the attributes

Identifier Name Type Configuration Configuration template Description
Document widget (doc)
stH Start hour Integer Constant Start hour of the working shifts, from 0 to 11 hour, by default 8.
arch Archiver String Constant One-hour archiver, by default "FSArch.1h".
Parameter {n} from 1 to 10.
p{n}_sh Parameter {n}: code String Input link Parameter{n}|NAME Code of the parameter in the table.
p{n}_nm Parameter {n}: description String Input link Parameter{n}|DESCR Description of the parameter in the table.
p{n}_val Parameter {n}: value Address Input link Parameter{n}|var Address to the parameter attribute with the value archive.
p{n}_ed Parameter {n}: dimension String Input link Parameter{n}|ed
p{n}_prec Parameter {n}: precision Integer Input link Parameter{n}|prec
p{n}_flSum Parameter {n}: sum flag Boolean Constant Parameter{n}|flSum Sign of calculation the parameter values sum for the working shift.


1.2.6 Year report of the month values (docRepYear)

1.3 GPLv2 * en, uk, ru Roman Savochenko -2 ms (disabled)

The document, shown in Figure 1.2.6, is provided for generating a year report of the month values in view of the trends diagram and the data table. The document is the dynamic type. The document commonly uses and represents the representative structure of the DAQ-template "Analog signal". As a data source of this document is the value archives of the DAQ-parameters mostly.

The document first introduced the manual entry of archival values of a large measurement time interval, which in this case is a month, as an undetermined interval. This feature is of great relevance for counters that for one reason or another cannot be connected to the system directly, with continuous measurement or periodic uploading of archive parts. Determining the parameter to manual input performs by setting the constant isMan of the appropriate parameter, which enables the form elements at the top of the document under the appropriate rights ("root" or in the "ITW" group), and accessing the data for the table and trend strictly at the interval of the document — month, as well as entering them.

Manually entered data is stored whether traditionally in an archive of values, with only one value recorded per representative interval, that is, with unreliable values between them; or as a separate entry with a value in the message archive, also introduced for the first time by this document:

CATEGORY: defines the source ID SrcID in the form "val{SrcID}", where:
  • "val*" — the typical template-sign of a value, that can be directly used in the category filter to determine only the values in messages;
  • SrcID — source identifier, what directly entered by a constant in the parameter address var.
TEXT: the parameter Name and Value in the form "{Name}: {Value}".

The message archiver of the module FSArch must be set for the next attributes to correct work perform together this document: set "Prevent duplicates", "Consider duplicates and prevent, for equal time, category, level" and set "Time size of the archive files" to 3660 days. The module DBArch must work without such kind specific.

Fig.1.2.6. The "Year report of the month values" document in the runtime mode.

Using — development
The document is designed to perform the role of page-template, and should therefore be placed directly in the project's tree. To each document can be connected up to ten parameters, setting the links. Items, for which there are not set the links, will be hidden at runtime.

At.png To each document can be set:

  • the "Archiver (arch)" attribute in required value and message archiver in the form {ValArch};{MessArch}, these maintain the specified parameters; you must not use archivers with worse at one hour quality for values;
  • the "Enable graph (enGraph)" attribute for enable/disable the graph;
  • the "Title (title)" attribute in the document specific title.

Using — runtime
In the runtime mode, the items, for which links have been set, are displayed. The year of the document formation is available for selection on the top of this document, from the current year and for ten years in depth.

With the rights ("root" or in the "ITW" group), the user can enter parameter values with the manual entry sign (isMan) using the form elements above, where you can select the month, parameter and value that will be recorded immediately after confirmation and shown in the document.

Linking and configuring the attributes

Identifier Name Type Configuration Configuration template Description
Document widget (doc)
arch Archiver, {ValArch};{MessArch} String Constant Value and message archiver in the form {ValArch};{MessArch}, by default and preferable to use one-hour archiver "FSArch.1h".
title Title String Constant Title of the report.
enGraph Enable graph Boolean Constant Enabled by default.
depth Depth to select, years Integer Constant Years depth allowed to select.
showOrigCntr Show original counter Boolean Constant Show the original counter value near to the interval value.
Parameter {n} from 1 to 10.
p{n}name Parameter {n}: name String Input link Parameter{n}|NAME Name of the parameter in the table header.
p{n}var Parameter {n}: variable Address Input link Parameter{n}|var Address to the parameter attribute with the value archive or the parameter identifier (val:{PrmId}) for manually values writing at storing in the message archive.
p{n}ed Parameter {n}: dimension String Input link Parameter{n}|ed
p{n}prec Parameter {n}: precision Integer Input link Parameter{n}|prec
p{n}cntr Parameter {n}: is counter Boolean Constant Parameter{n}|isCntr Sets for counters for obtain the values as difference.
p{n}max Parameter {n}: maximum Address Input link Parameter{n}|max Used for determining the parameter scale on the graph.
p{n}min Parameter {n}: minimum Address Input link Parameter{n}|min Used for determining the parameter scale on the graph.
p{n}isMan Parameter {n}: is manual Boolean Constant Parameter{n}|isMan Marks this parameter as the manual input one.

2 Сервисные связанные функции

Сервисные функции кадров отчётов и документов предназначены для выполнения характерных задач получения отчётных данных, для чего нужно осуществлять какую-то проверку или подсчёт, например, проверять достоверность и суммировать. Сервисной функцией может быть и формирование сложных данных, вроде встраиваемых в документ диаграмм.

Для адресации к функции этой библиотеки можно использовать статический адрес вызова DAQ.JavaLikeCalc.lib_doc.{Func}() или динамический SYS.DAQ.JavaLikeCalc["lib_doc"]["{Func}"].call(), SYS.DAQ.JavaLikeCalc["lib_doc"].{Func}(). Где {Func} — идентификатор функции в библиотеке.

Для подключения части библиотеки к проекту станции OpenSCADA Вы можете получить файл БД как:

  • такой что поставляется с готовым и соответствующим пакетом дистрибутива Linux вроде "openscada-libdb-main", "openscada-LibDB.Main";
  • наиболее актуальный и непосредственно полученный из репозитория subversion, преобразованный в файл БД SQLite путём:
wget http://oscada.org/svn/trunk/OpenSCADA/data/LibsDB/OscadaLibs.sql
sqlite3 -init OscadaLibs.sql OscadaLibs.db .exit

Этот полученный файл Вы далее можете разместить в каталоге проекта станции и создать объект базы данных модуля БД "SQLite", зарегистрировав файл базы данных в конфигурации.


2.1 Получение значения из архива значений (getVal)

1.1 GPLv2 * en, uk, ru Роман Савоченко

Запрос значения за определённое время (time:uTime) из связанного архиватора archtor (FSArch.1m) и формирование результата с определённым количеством знаков prec после запятой.

Функция работает с объектами атрибутов DAQ-параметров к которым подключён архив, и адрес addr к нему записывается полным путём вроде "/DAQ/LogicLev/gen/prm_F3/a_var". Для пустого archtor запрос будет осуществляться в целом ко всем с периодичностью буфера архива.

В процессе получения значения, время этого значения может отличаться от запрошенного, если архив на это время отсутствует и возвращается ближайшее, предотвратить что можно установив strong. Когда таки необходимо контролировано получить ближайшее достоверное значение, например для счётчиков, то предусмотрен аргумент времени tryTo до которого искать ближайшее достоверное значение. Время в tryTo может быть как больше, так и меньше времени запроса.

Первично, результат предоставляется в виде строки вещественного значения с определённым количеством знаков prec после запятой, и с значением "Пусто" для недостоверных значений, что позволяет вставлять его в документ без дополнительной обработки. Однако, при необходимости дополнительной обработки и специфического форматирования, результат можно получить неформатированным вещественным значением, для prec менше 0.

Параметры

Идентификатор Параметр Тип Режим Скрытый По умолчанию
rez Результат Строка Возврат false
addr Адрес Строка Вход false
time Время, секунд Целый Вход false
uTime Время, микросекунды Целый Вход false
prec Знаков после запятой Целый Вход false 3
archtor Архиватор Строка Вход false
strong Точно Логич. Вход false 0
tryTo Пробовать значение до, микросекунды Целый Вход false 0


2.2 Среднее значение архива значений (averVal)

1.1 GPLv2 * en, uk, ru Роман Савоченко

Вычисление среднего значения за указанный период времени [bTime...eTime], для данных архиватора archtor (FSArch.1m) и формирование результата с определённым количеством знаков prec после запятой.

Функция работает с объектами атрибутов DAQ-параметров к которым подключён архив, и адрес addr к нему записывается полным путём вроде "/DAQ/LogicLev/gen/prm_F3/a_var". Для пустого archtor запрос будет осуществляться в целом ко всем с периодичностью буфера архива.

В процессе расчёта осуществляется проверка данных в архиве на предмет достоверности и формируется значение процента достоверных данных actPerc, которые приняли участие в получении результата. В целом, стоит использовать промежуточные архиваторы — архиваторы среднего качества, чтобы данных в нём, за указанный интервал, не было очень много для понижения производительности, и чтобы это не было вообще одне значение.

Первично, результат предоставляется в виде строки вещественного значения с определённым количеством знаков prec после запятой, и с значением "Пусто" для недостоверных значений, что позволяет вставлять его в документ без дополнительной обработки. Однако, при необходимости дополнительной обработки и специфического форматирования, результат можно получить неформатированным вещественным значением, для prec менше 0.

Параметры

Идентификатор Параметр Тип Режим Скрытый По умолчанию
rez Результат Строка Возврат false
addr Адрес Строка Вход false
bTime Время начала, секунд Целый Вход false
eTime Время конца, секунд Целый Вход false
prec Знаков после запятой Целый Вход false 3
archtor Архиватор Строка Вход false
actPerc Процент актуальных значений Веществ. Выход false


2.3 Сумма значений архива значений (sumVal)

1.1 GPLv2 * en, uk, ru Роман Савоченко

Вычисление суммы значений за указанный период времени [bTime...eTime], для данных архиватора archtor (FSArch.1m) и формирование результата с определённым количеством знаков prec после запятой.

Функция работает с объектами атрибутов DAQ-параметров к которым подключён архив, и адрес addr к нему записывается полным путём вроде "/DAQ/LogicLev/gen/prm_F3/a_var". Для пустого archtor запрос будет осуществляться в целом ко всем с периодичностью буфера архива.

В процессе расчёта осуществляется проверка данных в архиве на предмет достоверности.

Первично, результат предоставляется в виде строки вещественного значения с определённым количеством знаков prec после запятой, и с значением "Пусто" для недостоверных значений, что позволяет вставлять его в документ без дополнительной обработки. Однако, при необходимости дополнительной обработки и специфического форматирования, результат можно получить неформатированным вещественным значением, для prec менше 0.

Параметры

Идентификатор Параметр Тип Режим Скрытый По умолчанию
rez Результат Строка Возврат false
addr Адрес Строка Вход false
bTime Время начала, секунд Целый Вход false
eTime Время конца, секунд Целый Вход false
prec Знаков после запятой Целый Вход false 3
archtor Архиватор Строка Вход false


2.4 Диаграмма (diagram)

1.4 GPLv2 * en, uk, ru Роман Савоченко

Построение диаграммы трендов в SVG, которая может далее встраиваться в XHTML-документ, для данных за указанный период времени [(end-size)...end] и из источников srcs.

  • Общая трудоёмкость: 1.3 ЧД[!]
  • Спонсировано, начальной имплементации на 1.0 ЧД[!]: Магомед, SAVTECH

Код формирования диаграммы основан на коде примитива "Диаграмма" визуализаторов, и который был довольно просто перенесен с языка C++ на встроенный язык JavaLikeCalc. Сейчас перенесено-реализовано только тренды!

Вид диаграммы определяется её размерами hsz*vsz и исходным SVG-шаблоном tmpl, ряд атрибутов кореневого тега которого имеют особое значение и которые соответствуют примитиву "Диаграмма":

  • Шкала: Маркеры: шрифт (sclMarkFont), по умолчанию "Arial 10".
  • Шкала: горизонтальная (sclHor), по умолчанию "Маркеры (2)" и в целом предусмотрено: "Не рисовать (0)", "Решетка (1)", "Маркеры (2)", "Решетка и маркеры (3)".
  • Шкала: вертикальная (sclVer), по умолчанию "Решетка и маркеры (3)" и в целом предусмотрено: "Не рисовать (0)", "Решетка (1)", "Маркеры (2)", "Решетка и маркеры (3)", "Решетка (лог) (5)", "Маркеры (лог) (6)", "Решетка и маркеры (лог) (7)".
  • Шкала: цвет (sclColor), по умолчанию "gray".
  • Шкала: Маркеры: цвет (sclMarkColor), по умолчанию "gray".

В качестве источника данных на данный момент могут использоваться только архивы значений, прямым адресом к ним или через атрибут DAQ-параметра с архивом. Количество источников данных прямо не ограничено и они записываются отдельными строками аргумента srcs с форматом "{addr}:{min}:{max}:{color}[:{scale}[:{width}]]", где:

  • addr — адрес к:
    • архиву значений ("/Archive/va_CPULoad_load") или атрибуту DAQ-параметра ("/DAQ/LogicLev/gen/F3/var");
    • прямые данные в форме "<d s='1' aprox='1' per='1'>{p0}={pV0},{p1}={pV1},...,{pN}={pVN}</d>", установкой атрибута "s" можно указать на период в секундах; "aprox" — аппроксимировать переход от одной точки к другой вместо подстановки предыдущего значения во все точки периодичности от упаковки.
  • min, max — минимум и максимум шкалы, при отсутствии шкалы (min >= max) она будет вычисляться из реальных данных;
  • color — цвет кривой тренда;
  • scale — отдельное определение шкалы тренда, по умолчанию "Глобально (0)" и в целом предусмотрено: "Глобально (0)", "Маркеры (2)", "Решетка и маркеры (3)", "Маркеры (лог) (6)", "Решетка и маркеры (лог) (7)".
  • width — ширина кривой тренда, по умолчанию 2.
Рис.2.4. Типичный результат функции "Диаграмма" в XHTML-документе.

Параметры

Идентификатор Параметр Тип Режим Скрытый По умолчанию
res Результат Текст Возврат false
end Время конца, секунд Веществ. Вход false 0
size Размер, секунд Веществ. Вход false 3600
srcs Источники Текст Вход false
/DAQ/LogicLev/gen/F3/var:0:100:#ae77c3:2
/Archive/va_CPULoad_load:0:0:darkcyan:2
hsz Горизонтальный размер, пикселей Целый Вход false 600
vsz Вертикальный размер, пикселей Целый Вход false 400
arch Архиватор Строка Вход false
tmpl Шаблон Текст Вход false
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" sclMarkFont="Arial 10" sclHor="2" sclVer="3" sclColor="gray" sclMarkColor="gray">
    <style type="text/css">
	    #scVer rect { stroke: none; }
	    #scVer text { stroke: none; }
	    #scHor rect { stroke: none; }
	    #scHor text { stroke: none; }
	    #drawArea path { fill: none; }
    </style>
    <!--Draw grid and markers-->
    <g id="scVer" />
    <g id="scHor" />
    <!--Curves area -->
    <g id="drawArea" />
</svg>