Commit fd58df7c authored by Pavel Vainerman's avatar Pavel Vainerman

(LogicProcessor): Добавил краткую документацию

parent 9cfa1491
#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"
......
......@@ -10,6 +10,7 @@
#include "SMInterface.h"
#include "LProcessor.h"
// --------------------------------------------------------------------------
/*! Реализация LogicProccessor основанная на заказе датчиков */
class PassiveLProcessor:
public UniSetObject_LT,
protected LProcessor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment