Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
fd58df7c
Commit
fd58df7c
authored
Apr 18, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(LogicProcessor): Добавил краткую документацию
parent
9cfa1491
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
+81
-0
LProcessor.h
extensions/LogicProcessor/LProcessor.h
+80
-0
PassiveLProcessor.h
extensions/LogicProcessor/PassiveLProcessor.h
+1
-0
No files found.
extensions/LogicProcessor/LProcessor.h
View file @
fd58df7c
#ifndef LProcessor_H_
#define LProcessor_H_
// --------------------------------------------------------------------------
/*! \page pageLogicProcessor Логический процессор
\section sec_lpCommon Общее описание
Логический процессор представляет из себя процесс, который работает по принципу
PLC-контроллеров, выполняя бесконечный цикл:
\code
1. опрос входов
2. шаг алгоритма
3. выставление выходов
\endcode
При этом "логика" формируется из простых логических элементов:
-# \b "И" \b (AND)
-# \b "ИЛИ" \b (OR)
-# \b "Задержка" \b (Delay)
-# \b "Отрицание" \b (NOT)
\section sec_lpShema Конфигурирование
Конфигурирование процесса осуществляется при помощи xml-файла задающего
"схему соединения" элементов. Например
\code
<Schema>
<text-view>
----
1 --| |
2 --|TOR1|---| 1 -----
| | |----| |
---- 2 | |--|
|----|TAND3| |
---- | | | |
| | | ----- |
1 --|TOR2| | | 1 ---- -------
2 --| |--- | ---- ---| | | | out
| | | 1 | | 2 |TOR5|-----| Delay |----
---- |---|TOR4|-----| | | |
2 ----| | | | | |
---- ---- -------
</text-view>
<elements>
<item id="1" type="OR" inCount="2"/>
<item id="2" type="OR" inCount="2"/>
<item id="3" type="AND" inCount="2"/>
<item id="4" type="OR" inCount="2"/>
<item id="5" type="OR" inCount="2"/>
<item id="6" type="Delay" inCount="1" delayMS="3000"/>
</elements>
<connections>
<item type="ext" from="Input1_S" to="1" toInput="1" />
<item type="ext" from="Input2_S" to="1" toInput="2" />
<item type="ext" from="Input3_S" to="2" toInput="1" />
<item type="ext" from="Input4_S" to="2" toInput="2" />
<item type="ext" from="Input5_S" to="4" toInput="2" />
<item type="ext" from="Input6_S" to="5" toInput="1" />
<item type="int" from="1" to="3" toInput="1" />
<item type="int" from="2" to="3" toInput="2" />
<item type="int" from="3" to="4" toInput="1" />
<item type="int" from="4" to="5" toInput="2" />
<item type="int" from="5" to="6" toInput="1" />
<item type="out" from="6" to="Output1_C"/>
</connections>
</Schema>
\endcode
Блок \b <elements> содержит список элементов участвующих в "логике", каждому из
которых присвоен уникальный id, а также характеристики каждого элемента.
В секции \b <connections> задаютcя собственно соединения.
\par Тэги:
- \b type="ext" - Соединение связанное с внешним датчиком, задаваемым по имени.
- \b type="int" - Внутреннее соединение элементов между собой.
- \b type="out" - Замыкание на "внешний" датчик.
- \b from=".." - задаёт идентификатор элемента ("откуда"). Для type="ext", сюда пишется ID датчика.
- \b to=".." - задаёт идентификатор элемента("куда"), к которому происходит подключение.
- \b toInput=".." - В качестве значения указывается номер "входа" элемента из которого выходит "сигнал".
В текущей реализации в качестве датчиков разрешено использовать только типы DO или DI.
*/
// --------------------------------------------------------------------------
#include <map>
#include "UniSetTypes.h"
#include "UniversalInterface.h"
...
...
extensions/LogicProcessor/PassiveLProcessor.h
View file @
fd58df7c
...
...
@@ -10,6 +10,7 @@
#include "SMInterface.h"
#include "LProcessor.h"
// --------------------------------------------------------------------------
/*! Реализация LogicProccessor основанная на заказе датчиков */
class
PassiveLProcessor
:
public
UniSetObject_LT
,
protected
LProcessor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment