UniSet 2.32.1
|
#include <MBSlave.h>
Классы | |
struct | BitRegProperty |
struct | ClientInfo |
struct | IOProperty |
Открытые типы | |
enum | AccessMode { amRW , amRO , amWO } |
Открытые члены | |
MBSlave (uniset::ObjectId objId, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="mbs") | |
std::string | amode2str (AccessMode m) |
long | getConnCount () |
std::shared_ptr< LogAgregator > | getLogAggregator () |
std::shared_ptr< DebugStream > | log () |
virtual uniset::SimpleInfo * | getInfo (const char *userparam=0) override |
virtual Poco::JSON::Object::Ptr | httpHelp (const Poco::URI::QueryParameters &p) override |
virtual Poco::JSON::Object::Ptr | httpRequest (const std::string &req, const Poco::URI::QueryParameters &p) override |
![]() | |
UniSetObject (const std::string &name, const std::string §ion) | |
UniSetObject (uniset::ObjectId id) | |
virtual CORBA::Boolean | exist () override |
virtual uniset::ObjectId | getId () override |
const uniset::ObjectId | getId () const |
std::string | getName () const |
virtual uniset::ObjectType | getType () override |
const std::string | getStrType () |
virtual uniset::SimpleInfo * | apiRequest (const char *query) override |
virtual void | push (const uniset::TransportMessage &msg) override |
поместить сообщение в очередь | |
virtual void | pushMessage (const char *msg, ::CORBA::Long mtype, const ::uniset::Timespec &tm, const ::uniset::ProducerInfo &pi, ::CORBA::Long priority, ::CORBA::Long consumer) override |
поместить текстовое сообщение в очередь | |
virtual Poco::JSON::Object::Ptr | httpGet (const Poco::URI::QueryParameters &p) override |
uniset::ObjectPtr | getRef () const |
std::shared_ptr< UniSetObject > | get_ptr () |
virtual timeout_t | askTimer (uniset::TimerId timerid, timeout_t timeMS, clock_t ticks=-1, uniset::Message::Priority p=uniset::Message::High) override |
![]() | |
timeout_t | checkTimers (UniSetObject *obj) |
timeout_t | getTimeInterval (uniset::TimerId timerid) const |
timeout_t | getTimeLeft (uniset::TimerId timerid) const |
Открытые статические члены | |
static std::shared_ptr< MBSlave > | init_mbslave (int argc, const char *const *argv, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="mbs") |
static void | help_print (int argc, const char *const *argv) |
Статические открытые данные | |
static const int | NoSafetyState = -1 |
Защищенные типы | |
enum | Timer { tmCheckExchange } |
typedef std::map< ModbusRTU::RegID, IOProperty > | RegMap |
typedef std::unordered_map< ModbusRTU::ModbusAddr, RegMap > | IOMap |
typedef std::list< IOBase > | ThresholdList |
typedef std::unordered_map< int, std::string > | FileList |
typedef std::unordered_map< int, std::string > | MEIValMap |
typedef std::unordered_map< int, MEIValMap > | MEIObjIDMap |
typedef std::unordered_map< int, MEIObjIDMap > | MEIDevIDMap |
typedef std::unordered_map< std::string, ClientInfo > | ClientsMap |
![]() | |
typedef std::deque< TimerInfo > | TimersList |
Защищенные члены | |
ModbusRTU::mbErrCode | readCoilStatus (ModbusRTU::ReadCoilMessage &query, ModbusRTU::ReadCoilRetMessage &reply) |
ModbusRTU::mbErrCode | readInputStatus (ModbusRTU::ReadInputStatusMessage &query, ModbusRTU::ReadInputStatusRetMessage &reply) |
ModbusRTU::mbErrCode | readOutputRegisters (ModbusRTU::ReadOutputMessage &query, ModbusRTU::ReadOutputRetMessage &reply) |
ModbusRTU::mbErrCode | readInputRegisters (ModbusRTU::ReadInputMessage &query, ModbusRTU::ReadInputRetMessage &reply) |
ModbusRTU::mbErrCode | forceSingleCoil (ModbusRTU::ForceSingleCoilMessage &query, ModbusRTU::ForceSingleCoilRetMessage &reply) |
ModbusRTU::mbErrCode | forceMultipleCoils (ModbusRTU::ForceCoilsMessage &query, ModbusRTU::ForceCoilsRetMessage &reply) |
ModbusRTU::mbErrCode | writeOutputRegisters (ModbusRTU::WriteOutputMessage &query, ModbusRTU::WriteOutputRetMessage &reply) |
ModbusRTU::mbErrCode | writeOutputSingleRegister (ModbusRTU::WriteSingleOutputMessage &query, ModbusRTU::WriteSingleOutputRetMessage &reply) |
ModbusRTU::mbErrCode | setDateTime (ModbusRTU::SetDateTimeMessage &query, ModbusRTU::SetDateTimeRetMessage &reply) |
ModbusRTU::mbErrCode | remoteService (ModbusRTU::RemoteServiceMessage &query, ModbusRTU::RemoteServiceRetMessage &reply) |
ModbusRTU::mbErrCode | fileTransfer (ModbusRTU::FileTransferMessage &query, ModbusRTU::FileTransferRetMessage &reply) |
ModbusRTU::mbErrCode | diagnostics (ModbusRTU::DiagnosticMessage &query, ModbusRTU::DiagnosticRetMessage &reply) |
ModbusRTU::mbErrCode | read4314 (ModbusRTU::MEIMessageRDI &query, ModbusRTU::MEIMessageRetRDI &reply) |
virtual void | sysCommand (const uniset::SystemMessage *msg) override |
virtual void | sensorInfo (const uniset::SensorMessage *sm) override |
virtual void | timerInfo (const uniset::TimerMessage *tm) override |
void | askSensors (UniversalIO::UIOCommand cmd) |
bool | waitSMReady () |
virtual void | execute_rtu () |
virtual void | execute_tcp () |
virtual void | updateStatistics () |
virtual void | updateTCPStatistics () |
virtual void | updateThresholds () |
virtual void | postReceiveEvent (ModbusRTU::mbErrCode res) |
void | runTCPServer () |
virtual bool | activateObject () override |
Активизация объекта (переопределяется для необходимых действий после активизации) | |
virtual bool | deactivateObject () override |
Деактивация объекта (переопределяется для необходимых действий при завершении работы) | |
virtual void | finalThread () |
virtual void | initIterators () |
bool | initItem (UniXML::iterator &it) |
bool | readItem (const std::shared_ptr< UniXML > &xml, UniXML::iterator &it, xmlNode *sec) |
void | readConfiguration () |
bool | check_item (UniXML::iterator &it) |
ModbusRTU::mbErrCode | real_write (RegMap &rmap, const ModbusRTU::ModbusData regOKOK, ModbusRTU::ModbusData val, const int fn=0) |
ModbusRTU::mbErrCode | real_write (RegMap &rmap, const ModbusRTU::ModbusData regOKOK, ModbusRTU::ModbusData *dat, size_t &i, size_t count, const int fn=0) |
ModbusRTU::mbErrCode | real_read (RegMap &rmap, const ModbusRTU::ModbusData regOKOK, ModbusRTU::ModbusData &val, const int fn=0) |
ModbusRTU::mbErrCode | much_real_read (RegMap &rmap, const ModbusRTU::ModbusData regOKOK, ModbusRTU::ModbusData *dat, size_t count, const int fn=0) |
ModbusRTU::mbErrCode | much_real_write (RegMap &rmap, const ModbusRTU::ModbusData regOKOK, ModbusRTU::ModbusData *dat, size_t count, const int fn=0) |
ModbusRTU::mbErrCode | real_read_it (RegMap &rmap, RegMap::iterator &it, ModbusRTU::ModbusData &val) |
ModbusRTU::mbErrCode | real_bitreg_read_it (std::shared_ptr< BitRegProperty > &bp, ModbusRTU::ModbusData &val) |
ModbusRTU::mbErrCode | real_read_prop (IOProperty *p, ModbusRTU::ModbusData &val) |
ModbusRTU::mbErrCode | real_write_it (RegMap &rmap, RegMap::iterator &it, ModbusRTU::ModbusData *dat, size_t &i, size_t count) |
ModbusRTU::mbErrCode | real_bitreg_write_it (std::shared_ptr< BitRegProperty > &bp, const ModbusRTU::ModbusData val) |
ModbusRTU::mbErrCode | real_write_prop (IOProperty *p, ModbusRTU::ModbusData *dat, size_t &i, size_t count) |
Poco::JSON::Object::Ptr | request_regs (const std::string &req, const Poco::URI::QueryParameters &p) |
Poco::JSON::Object::Ptr | get_regs (ModbusRTU::ModbusAddr addr, const RegMap &rmap, const std::vector< std::string > &q_regs) |
Poco::JSON::Object::Ptr | get_reginfo (const IOProperty &prop) |
int | getOptimizeWriteFunction (const int fn) |
void | initTCPClients (UniXML::iterator confnode) |
![]() | |
virtual void | processingMessage (const uniset::VoidMessage *msg) |
virtual void | onTextMessage (const uniset::TextMessage *tm) |
VoidMessagePtr | receiveMessage () |
VoidMessagePtr | waitMessage (timeout_t msec=UniSetTimer::WaitUpTime) |
void | termWaiting () |
size_t | countMessages () |
size_t | getCountOfLostMessages () const |
void | uterminate () |
void | thread (bool create) |
void | offThread () |
void | onThread () |
virtual void | callback () |
void | setID (uniset::ObjectId id) |
void | setThreadPriority (Poco::Thread::Priority p) |
void | setMaxSizeOfMessageQueue (size_t s) |
size_t | getMaxSizeOfMessageQueue () const |
bool | isActive () const |
void | setActive (bool set) |
virtual Poco::JSON::Object::Ptr | httpGetMyInfo (Poco::JSON::Object::Ptr root) |
Poco::JSON::Object::Ptr | request_configure (const std::string &req, const Poco::URI::QueryParameters &p) |
Poco::JSON::Object::Ptr | request_configure_get (const std::string &req, const Poco::URI::QueryParameters &p) |
Poco::JSON::Object::Ptr | request_configure_by_name (const std::string &name, const std::string &props) |
Poco::JSON::Object::Ptr | request_params (const std::string &req, const Poco::URI::QueryParameters &p) |
virtual Poco::JSON::Object::Ptr | request_params_get (const std::string &req, const Poco::URI::QueryParameters &p) |
virtual Poco::JSON::Object::Ptr | request_params_set (const std::string &req, const Poco::URI::QueryParameters &p) |
![]() | |
virtual std::string | getTimerName (int id) const |
TimersList | getTimersList () const |
Защищенные данные | |
IOMap | iomap |
ThresholdList | thrlist |
std::shared_ptr< ModbusServerSlot > | mbslot |
std::unordered_set< ModbusRTU::ModbusAddr > | vaddr |
std::string | default_mbaddr = { "" } |
xmlNode * | cnode = { 0 } |
std::string | s_field = { "" } |
std::string | s_fvalue = { "" } |
int | default_mbfunc = {0} |
std::shared_ptr< SMInterface > | shm |
uniset::timeout_t | checkExchangeTime = { 10000 } |
timeout_t | initPause = { 3000 } |
uniset::uniset_rwmutex | mutex_start |
std::unique_ptr< ThreadCreator< MBSlave > > | thr |
std::mutex | mutexStartNotify |
std::condition_variable | startNotifyEvent |
PassiveTimer | ptHeartBeat |
uniset::ObjectId | sidHeartBeat = { uniset::DefaultObjectId } |
long | maxHeartBeat = { 10 } |
IOController::IOStateList::iterator | itHeartBeat |
uniset::ObjectId | sidTestSMReady = {uniset::DefaultObjectId } |
IOController::IOStateList::iterator | itAskCount |
uniset::ObjectId | askcount_id = { uniset::DefaultObjectId } |
IOController::IOStateList::iterator | itRespond |
uniset::ObjectId | respond_id = { uniset::DefaultObjectId } |
bool | respond_invert = { false } |
PassiveTimer | ptTimeout |
long | connCount = { 0 } |
long | restartTCPServerCount = { 0 } |
std::atomic_bool | activated = { false } |
std::atomic_bool | canceled = {false } |
timeout_t | activateTimeout = { 20000 } |
bool | smPingOK = { false } |
timeout_t | wait_msec = { 3000 } |
bool | force = { false } |
bool | mbregFromID = {0} |
bool | checkMBFunc = {0} |
bool | noMBFuncOptimize = {0} |
FileList | flist |
std::string | prefix = { "" } |
std::string | prop_prefix = { "" } |
ModbusRTU::ModbusData | buf [ModbusRTU::MAXLENPACKET/2+1] |
MEIDevIDMap | meidev |
std::shared_ptr< LogAgregator > | loga |
std::shared_ptr< DebugStream > | mblog |
std::shared_ptr< LogServer > | logserv |
std::string | logserv_host = {""} |
int | logserv_port = {0} |
VMonitor | vmon |
std::string | mbtype = { "" } |
timeout_t | sockTimeout = { 30000 } |
timeout_t | sessTimeout = { 2000 } |
timeout_t | updateStatTime = { 4000 } |
ModbusTCPServer::Sessions | sess |
std::mutex | sessMutex |
size_t | sessMaxNum = { 5 } |
std::shared_ptr< ModbusTCPServerSlot > | tcpserver |
ClientsMap | cmap |
uniset::ObjectId | sesscount_id = { uniset::DefaultObjectId } |
IOController::IOStateList::iterator | sesscount_it |
std::atomic_bool | tcpCancelled = { true } |
bool | tcpBreakIfFailRun = { false } |
timeout_t | tcpRepeatCreateSocketPause = { 30000 } |
![]() | |
std::shared_ptr< UInterface > | ui |
std::string | myname |
std::weak_ptr< UniSetManager > | mymngr |
![]() | |
timeout_t | sleepTime |
Реализация slave-интерфейса
|
overrideprotectedvirtual |
Активизация объекта (переопределяется для необходимых действий после активизации)
Переопределяет метод предка uniset::UniSetObject.
|
overrideprotectedvirtual |
Деактивация объекта (переопределяется для необходимых действий при завершении работы)
Переопределяет метод предка uniset::UniSetObject.
|
protected |
обработка 0x0F
|
protected |
обработка 0x05
|
overridevirtual |
Переопределяет метод предка uniset::UniSetObject.
|
overridevirtual |
Переопределяет метод предка uniset::UniSetObject.
|
overridevirtual |
Переопределяет метод предка uniset::UHttp::IHttpRequest.
|
static |
глобальная функция для инициализации объекта
|
protected |
обработка 0x01
|
protected |
обработка 0x04
|
protected |
обработка 0x02
|
protected |
обработка 0x03
|
protected |
обработка запроса удалённого сервиса
|
overrideprotectedvirtual |
Переопределяет метод предка uniset::UniSetObject.
|
protected |
обработка запросов на чтение ошибок
обработка запроса на установку времени
|
overrideprotectedvirtual |
Переопределяет метод предка uniset::UniSetObject.
|
overrideprotectedvirtual |
Переопределяет метод предка uniset::UniSetObject.
|
protected |
обработка 0x10
|
protected |
обработка 0x06
|
protected |
буфер для формирования ответов
|
protected |
флаг означающий, что надо сохранять в SM, даже если значение не менялось
|
protected |
список входов/выходов по адресам
|
protected |
список открытых сессий
|
protected |
таймаут на сессию
|
protected |
таймаут на переоткрытие сокета (если нет сессий)
|
protected |
адреса данного узла