|
UniSet 2.32.1
|
#include <MBConfig.h>
Классы | |
| struct | InitRegInfo |
| struct | RegInfo |
| struct | RSProperty |
| struct | RTUDevice |
Открытые типы | |
| enum | ExchangeMode { emNone = 0 , emWriteOnly = 1 , emReadOnly = 2 , emSkipSaveToSM = 3 , emSkipExchange = 4 } |
| enum | SafeMode { safeNone = 0 , safeResetIfNotRespond = 1 , safeExternalControl = 2 } |
| enum | DeviceType { dtUnknown , dtRTU , dtMTR , dtRTU188 } |
| typedef std::list< RSProperty > | PList |
| typedef std::map< ModbusRTU::RegID, std::shared_ptr< RegInfo > > | RegMap |
| typedef std::unordered_map< ModbusRTU::ModbusAddr, std::shared_ptr< RTUDevice > > | RTUDeviceMap |
| typedef std::list< IOBase > | ThresholdList |
| typedef std::list< InitRegInfo > | InitList |
Открытые члены | |
| MBConfig (const std::shared_ptr< uniset::Configuration > &conf, xmlNode *cnode, std::shared_ptr< SMInterface > _shm) | |
| void | loadConfig (const std::shared_ptr< uniset::UniXML > &xml, UniXML::iterator sensorsSection) |
| void | initDeviceList (const std::shared_ptr< UniXML > &xml) |
| bool | initItem (UniXML::iterator &it) |
| void | cloneParams (const std::shared_ptr< MBConfig > &conf) |
| std::string | getShortInfo () const |
| bool | checkDuplicationRegID (const ModbusRTU::RegID id, const std::shared_ptr< RTUDevice > &dev, const std::shared_ptr< RegMap > &rmap) const |
Открытые статические члены | |
| static DeviceType | getDeviceType (const std::string &dtype) noexcept |
| static void | printMap (RTUDeviceMap &d) |
| static void | rtuQueryOptimization (RTUDeviceMap &m, size_t maxQueryCount) |
| static void | rtuQueryOptimizationForDevice (const std::shared_ptr< RTUDevice > &d, size_t maxQueryCount) |
| static void | rtuQueryOptimizationForRegMap (const std::shared_ptr< RegMap > ®map, size_t maxQueryCount) |
Открытые атрибуты | |
| ThresholdList | thrlist |
| RTUDeviceMap | devices |
| InitList | initRegList |
| std::string | s_field |
| std::string | s_fvalue |
| timeout_t | recv_timeout = { 500 } |
| timeout_t | default_timeout = { 5000 } |
| timeout_t | aftersend_pause = { 0 } |
| timeout_t | polltime = { 100 } |
| timeout_t | sleepPause_msec = { 10 } |
| size_t | maxQueryCount = { ModbusRTU::MAXDATALEN } |
| xmlNode * | cnode = { 0 } |
| std::shared_ptr< DebugStream > | mblog |
| std::string | myname |
| std::string | prefix |
| std::string | prop_prefix |
| std::string | defaultMBtype |
| std::string | defaultMBaddr |
| bool | mbregFromID = { false } |
| bool | defaultMBinitOK = { false } |
| bool | noQueryOptimization = { false } |
| std::shared_ptr< uniset::Configuration > | conf |
| std::shared_ptr< SMInterface > | shm |
| bool | init_mbval_changed = { true } |
Статические открытые данные | |
| static const size_t | changeOnlyWrite = { 65535 } |
Защищенные члены | |
| bool | initSMValue (ModbusRTU::ModbusData *data, int count, RSProperty *p) |
| void | readConfiguration (const std::shared_ptr< uniset::UniXML > &xml, UniXML::iterator sensorsSection) |
| void | initOffsetList () |
| std::shared_ptr< RTUDevice > | addDev (RTUDeviceMap &dmap, ModbusRTU::ModbusAddr a, UniXML::iterator &it) |
| std::shared_ptr< RegInfo > | addReg (std::shared_ptr< RegMap > &devices, ModbusRTU::RegID id, ModbusRTU::ModbusData r, UniXML::iterator &it, std::shared_ptr< RTUDevice > dev) |
| RSProperty * | addProp (PList &plist, RSProperty &&p) |
| bool | initMTRitem (UniXML::iterator &it, std::shared_ptr< RegInfo > &p) |
| bool | initRTU188item (UniXML::iterator &it, std::shared_ptr< RegInfo > &p) |
| bool | initRSProperty (RSProperty &p, UniXML::iterator &it) |
| bool | initRegInfo (std::shared_ptr< RegInfo > &r, UniXML::iterator &it, std::shared_ptr< RTUDevice > &dev) |
| bool | initRTUDevice (std::shared_ptr< RTUDevice > &d, UniXML::iterator &it) |
| bool | initDeviceInfo (RTUDeviceMap &m, ModbusRTU::ModbusAddr a, UniXML::iterator &it) |
Друзья | |
| std::ostream & | operator<< (std::ostream &os, const ExchangeMode &em) |
| std::string | to_string (const SafeMode &m) |
| std::ostream & | operator<< (std::ostream &os, const SafeMode &m) |
| std::ostream & | operator<< (std::ostream &os, const DeviceType &dt) |
| std::ostream & | operator<< (std::ostream &os, const RSProperty &p) |
| std::ostream & | operator<< (std::ostream &os, const RegInfo &r) |
| std::ostream & | operator<< (std::ostream &os, const RegInfo *r) |
| std::ostream & | operator<< (std::ostream &os, RTUDevice &d) |
| std::ostream & | operator<< (std::ostream &os, RTUDeviceMap &d) |
Конфигурация для ModbusMaster
Режимы работы процесса обмена
| bool uniset::MBConfig::checkDuplicationRegID | ( | const ModbusRTU::RegID | id, |
| const std::shared_ptr< RTUDevice > & | dev, | ||
| const std::shared_ptr< RegMap > & | rmap ) const |
проверка регистров на дубликаты в pollmap
| bool uniset::MBConfig::initItem | ( | UniXML::iterator & | it | ) |
приоритет опроса: 1...n - задаёт "частоту" опроса. Т.е. каждые 1...n циклов 0 - значение по-умолчанию фактически тоже, что и 1. 65535 - Отдельное значение для записи регистров по изменению значения датчика. По-этому без оптимизации "склейки" регистров в один запрос. TODO:
|
static |
Номер pollfactor для регистров с записью только по изменению значения датчика
| bool uniset::MBConfig::init_mbval_changed = { true } |
Глобальный флаг для инициализации флага изменения значения датчика каждого регистра
| InitList uniset::MBConfig::initRegList |
список регистров для инициализации
| size_t uniset::MBConfig::maxQueryCount = { ModbusRTU::MAXDATALEN } |
максимальное количество регистров для одного запроса
| timeout_t uniset::MBConfig::polltime = { 100 } |
периодичность обновления данных, [мсек]
| std::string uniset::MBConfig::prop_prefix |
префикс для считывания параметров обмена