|
UniSet 2.32.1
|
#include <IOConfig_XML.h>
Открытые типы | |
| typedef sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode * > | ReaderSlot |
| typedef sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode *, std::shared_ptr< IOController::USensorInfo > & > | NCReaderSlot |
Открытые члены | |
| virtual IOController::IOStateList | read () override |
| IOConfig_XML (const std::string &fname, const std::shared_ptr< Configuration > &conf) | |
| IOConfig_XML (const std::shared_ptr< UniXML > &_xml, const std::shared_ptr< Configuration > &conf, xmlNode *root=nullptr) | |
| void | setReadItem (ReaderSlot sl) |
| void | setReadConsumerItem (ReaderSlot sl) |
| void | setItemFilter (const std::string &filterField, const std::string &filterValue="") |
| void | setConsumerFilter (const std::string &filterField, const std::string &filterValue="") |
| bool | getConsumerInfo (UniXML::iterator &it, uniset::ObjectId &cid, uniset::ObjectId &cnode) const |
| void | setThresholdsFilter (const std::string &filterField, const std::string &filterValue="") |
| void | setReadThresholdItem (ReaderSlot sl) |
| void | setNCReadItem (NCReaderSlot sl) |
Защищенные члены | |
| bool | check_list_item (UniXML::iterator &it) const |
| bool | check_consumer_item (UniXML::iterator &it) const |
| bool | check_thresholds_item (UniXML::iterator &it) const |
| void | read_consumers (const std::shared_ptr< UniXML > &xml, xmlNode *node, std::shared_ptr< IOController::USensorInfo > &inf) |
| IOController::IOStateList | read_list (xmlNode *node) |
| void | init_thresholds (xmlNode *node, IOController::IOStateList &iolist) |
| void | init_depends_signals (IOController::IOStateList &lst) |
| bool | getBaseInfo (xmlNode *it, IOController_i::SensorInfo &si) const |
| bool | getSensorInfo (xmlNode *snode, std::shared_ptr< IOController::USensorInfo > &si) const |
| bool | getThresholdInfo (xmlNode *tnode, std::shared_ptr< IOController::UThresholdInfo > &ti) const |
Защищенные статические члены | |
| static void | set_dumptime (const std::shared_ptr< UniXML > &xml, xmlNode *node) |
| static xmlNode * | bind_node (const std::shared_ptr< UniXML > &xml, xmlNode *root, const std::string &nodename, const std::string &nm="") |
| static xmlNode * | rebind_node (const std::shared_ptr< UniXML > &xml, xmlNode *root, const std::string &nodename, const std::string &nm="") |
Защищенные данные | |
| std::string | s_filterField = { "" } |
| std::string | s_filterValue = { "" } |
| std::string | t_filterField = { "" } |
| std::string | t_filterValue = { "" } |
| std::string | i_filterField = { "" } |
| std::string | i_filterValue = { "" } |
| std::string | c_filterField = { "" } |
| std::string | c_filterValue = { "" } |
| std::string | fname = { "" } |
| std::shared_ptr< Configuration > | conf |
| std::shared_ptr< UniXML > | uxml |
| xmlNode * | root = { nullptr } |
| ReaderSlot | rtslot |
| ReaderSlot | rslot |
| ReaderSlot | cslot |
| NCReaderSlot | ncrslot |
Реализация интерфейса конфигурирования на основе XML
| typedef sigc::slot<bool, const std::shared_ptr<UniXML>&, UniXML::iterator&, xmlNode*> uniset::IOConfig_XML::ReaderSlot |
слот для подключения функции чтения датчика из xml-файла.
| uxml | - интерфейс для работы с xml-файлом |
| it | - итератор (указатель) на текущий считываемый xml-узел (item) |
| sec | - итератор (указатель) на корневой узел секции (SubscriberList) |
| uniset::IOConfig_XML::IOConfig_XML | ( | const std::string & | fname, |
| const std::shared_ptr< Configuration > & | conf ) |
| fname | - файл формата uniset-project |
| conf | - конфигурация |
| uniset::IOConfig_XML::IOConfig_XML | ( | const std::shared_ptr< UniXML > & | _xml, |
| const std::shared_ptr< Configuration > & | conf, | ||
| xmlNode * | root = nullptr ) |
| xml | - xml формата uniset-project |
| conf | - конфигурация |
| root | - узел со списком датчиков (если не задан, ищется "sensors") |
| bool uniset::IOConfig_XML::getConsumerInfo | ( | UniXML::iterator & | it, |
| uniset::ObjectId & | cid, | ||
| uniset::ObjectId & | cnode ) const |
универсальная функция получения информации о заказчике (id и node) по новому формату файла (<consumer name="xxxx" type="objects" >)
|
overridevirtual |
считать список io
Замещает uniset::IOConfig.
| void uniset::IOConfig_XML::setConsumerFilter | ( | const std::string & | filterField, |
| const std::string & | filterValue = "" ) |
Установить фильтр на чтение списка заказчиков (по каждому датчику)
| void uniset::IOConfig_XML::setItemFilter | ( | const std::string & | filterField, |
| const std::string & | filterValue = "" ) |
Установить фильтр на чтение списка датчиков
| void uniset::IOConfig_XML::setNCReadItem | ( | NCReaderSlot | sl | ) |
установить callback на событие формирования информации в формате IOController (USenorInfo)
| void uniset::IOConfig_XML::setReadConsumerItem | ( | ReaderSlot | sl | ) |
установить функцию для callback-вызова при чтении списка заказчиков For example: setReadItem( sigc::mem_fun(this,&MyClass::myReadItem) );
bool myReadItem::myfunc(UniXML& xml, UniXML::iterator& it, xmlNode* sec)
uxml - интерфейс для работы с xml-файлом it - итератор(указатель) на текущий считываемый xml-узел (<consumer>) sec - указатель на текущий узел сообщения ()
| void uniset::IOConfig_XML::setReadItem | ( | ReaderSlot | sl | ) |
установить функцию для callback-вызова при чтении списка сообщений For example: setReadItem( sigc::mem_fun(this,&MyClass::myReadItem) );
bool myReadItem::myfunc(UniXML& xml, UniXML::iterator& it, xmlNode* sec)
uxml - интерфейс для работы с xml-файлом it - итератор(указатель) на текущий считываемый xml-узел (item) sec - указатель на корневой узел секции (SubscriberList)
| void uniset::IOConfig_XML::setReadThresholdItem | ( | ReaderSlot | sl | ) |
установить функцию для callback-вызова при чтении списка пороговых датчиков.
bool xxxMyClass::myfunc(UniXML& xml, UniXML::iterator& it, xmlNode* sec) uxml - интерфейс для работы с xml-файлом it - итератор(указатель) на текущий считываемый xml-узел (<sensor>) sec - указатель на корневой узел секции (<threshold>)
| void uniset::IOConfig_XML::setThresholdsFilter | ( | const std::string & | filterField, |
| const std::string & | filterValue = "" ) |
Установить фильтр на чтение списка 'порогов'