Commit 969fac56 authored by Pavel Vainerman's avatar Pavel Vainerman

(MBTCPMaster): корректировка параметов по умолчанию.

(MBSlave): добавил дополнительнулью информацию в vmonit
parent 82d01b3d
...@@ -130,7 +130,7 @@ MBExchange::MBExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, ...@@ -130,7 +130,7 @@ MBExchange::MBExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId,
initPause = conf->getArgPInt("--" + prefix + "-initPause", it.getProp("initPause"), 3000); initPause = conf->getArgPInt("--" + prefix + "-initPause", it.getProp("initPause"), 3000);
sleepPause_usec = conf->getArgPInt("--" + prefix + "-sleepPause-usec", it.getProp("sleepPause"), 100); sleepPause_msec = conf->getArgPInt("--" + prefix + "-sleepPause-msec", it.getProp("sleepPause"), 10);
force = conf->getArgInt("--" + prefix + "-force", it.getProp("force")); force = conf->getArgInt("--" + prefix + "-force", it.getProp("force"));
force_out = conf->getArgInt("--" + prefix + "-force-out", it.getProp("force_out")); force_out = conf->getArgInt("--" + prefix + "-force-out", it.getProp("force_out"));
...@@ -3134,7 +3134,10 @@ bool MBExchange::poll() ...@@ -3134,7 +3134,10 @@ bool MBExchange::poll()
if( stat_time > 0 && ptStatistic.checkTime() ) if( stat_time > 0 && ptStatistic.checkTime() )
{ {
mblog9 << endl << "(poll statistic): number of calls is " << poll_count << " (poll time: " << stat_time << " sec)" << endl << endl; ostringstream s;
s << "number of calls is " << poll_count << " (poll time: " << stat_time << " sec)";
statInfo = std::move(s.str());
mblog9 << myname << "(stat): " << statInfo << endl;
ptStatistic.reset(); ptStatistic.reset();
poll_count = 0; poll_count = 0;
} }
...@@ -3293,6 +3296,9 @@ UniSetTypes::SimpleInfo* MBExchange::getInfo( CORBA::Long userparam ) ...@@ -3293,6 +3296,9 @@ UniSetTypes::SimpleInfo* MBExchange::getInfo( CORBA::Long userparam )
inf << "Parameters: reopenTimeout=" << ptReopen.getInterval() inf << "Parameters: reopenTimeout=" << ptReopen.getInterval()
<< endl; << endl;
if( stat_time > 0 )
inf << "Statistics: " << statInfo << endl;
inf << "Devices: " << endl; inf << "Devices: " << endl;
for( const auto& it : devices ) for( const auto& it : devices )
inf << " " << it.second->getShortInfo() << endl; inf << " " << it.second->getShortInfo() << endl;
......
...@@ -341,7 +341,7 @@ class MBExchange: ...@@ -341,7 +341,7 @@ class MBExchange:
bool force_out = { false }; /*!< флаг означающий, принудительного чтения выходов */ bool force_out = { false }; /*!< флаг означающий, принудительного чтения выходов */
bool mbregFromID = { false }; bool mbregFromID = { false };
int polltime = { 100 }; /*!< переодичность обновления данных, [мсек] */ int polltime = { 100 }; /*!< переодичность обновления данных, [мсек] */
timeout_t sleepPause_usec; timeout_t sleepPause_msec;
unsigned int maxQueryCount = { ModbusRTU::MAXDATALEN }; /*!< максимальное количество регистров для одного запроса */ unsigned int maxQueryCount = { ModbusRTU::MAXDATALEN }; /*!< максимальное количество регистров для одного запроса */
PassiveTimer ptHeartBeat; PassiveTimer ptHeartBeat;
...@@ -364,6 +364,7 @@ class MBExchange: ...@@ -364,6 +364,7 @@ class MBExchange:
timeout_t stat_time = { 0 }; /*!< время сбора статистики обмена, 0 - отключена */ timeout_t stat_time = { 0 }; /*!< время сбора статистики обмена, 0 - отключена */
unsigned int poll_count = { 0 }; unsigned int poll_count = { 0 };
PassiveTimer ptStatistic; /*!< таймер для сбора статистики обмена */ PassiveTimer ptStatistic; /*!< таймер для сбора статистики обмена */
std::string statInfo = { "" };
std::string prop_prefix; /*!< префикс для считывания параметров обмена */ std::string prop_prefix; /*!< префикс для считывания параметров обмена */
......
...@@ -111,7 +111,7 @@ std::shared_ptr<ModbusClient> MBTCPMaster::initMB( bool reopen ) ...@@ -111,7 +111,7 @@ std::shared_ptr<ModbusClient> MBTCPMaster::initMB( bool reopen )
if( recv_timeout > 0 ) if( recv_timeout > 0 )
mbtcp->setTimeout(recv_timeout); mbtcp->setTimeout(recv_timeout);
mbtcp->setSleepPause(sleepPause_usec); mbtcp->setSleepPause(sleepPause_msec);
mbtcp->setAfterSendPause(aftersend_pause); mbtcp->setAfterSendPause(aftersend_pause);
mbinfo << myname << "(init): ipaddr=" << iaddr << " port=" << port << endl; mbinfo << myname << "(init): ipaddr=" << iaddr << " port=" << port << endl;
......
...@@ -120,7 +120,7 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob ...@@ -120,7 +120,7 @@ MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::Ob
sinf.ptIgnoreTimeout.setTiming( it1.getPIntProp("ignore_timeout", ignore_timeout) ); sinf.ptIgnoreTimeout.setTiming( it1.getPIntProp("ignore_timeout", ignore_timeout) );
sinf.recv_timeout = it1.getPIntProp("recv_timeout", recv_timeout); sinf.recv_timeout = it1.getPIntProp("recv_timeout", recv_timeout);
sinf.aftersend_pause = it1.getPIntProp("aftersend_pause", aftersend_pause); sinf.aftersend_pause = it1.getPIntProp("aftersend_pause", aftersend_pause);
sinf.sleepPause_usec = it1.getPIntProp("sleepPause_usec", sleepPause_usec); sinf.sleepPause_usec = it1.getPIntProp("sleepPause_msec", sleepPause_msec);
sinf.respond_invert = it1.getPIntProp("invert", 0); sinf.respond_invert = it1.getPIntProp("invert", 0);
sinf.respond_force = it1.getPIntProp("force", 0); sinf.respond_force = it1.getPIntProp("force", 0);
......
...@@ -78,7 +78,7 @@ RTUExchange::RTUExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmI ...@@ -78,7 +78,7 @@ RTUExchange::RTUExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmI
transmitCtl = conf->getArgInt("--" + prefix + "-transmit-ctl", it.getProp("transmitCtl")); transmitCtl = conf->getArgInt("--" + prefix + "-transmit-ctl", it.getProp("transmitCtl"));
defSpeed = ComPort::getSpeed(speed); defSpeed = ComPort::getSpeed(speed);
sleepPause_usec = conf->getArgPInt("--" + prefix + "-sleepPause-usec", it.getProp("slepePause"), 100); sleepPause_msec = conf->getArgPInt("--" + prefix + "-sleepPause-usec", it.getProp("slepePause"), 100);
rs_pre_clean = conf->getArgInt("--" + prefix + "-pre-clean", it.getProp("pre_clean")); rs_pre_clean = conf->getArgInt("--" + prefix + "-pre-clean", it.getProp("pre_clean"));
...@@ -155,7 +155,7 @@ std::shared_ptr<ModbusClient> RTUExchange::initMB( bool reopen ) ...@@ -155,7 +155,7 @@ std::shared_ptr<ModbusClient> RTUExchange::initMB( bool reopen )
if( recv_timeout > 0 ) if( recv_timeout > 0 )
mbrtu->setTimeout(recv_timeout); mbrtu->setTimeout(recv_timeout);
mbrtu->setSleepPause(sleepPause_usec); mbrtu->setSleepPause(sleepPause_msec);
mbrtu->setAfterSendPause(aftersend_pause); mbrtu->setAfterSendPause(aftersend_pause);
mbinfo << myname << "(init): dev=" << devname << " speed=" << ComPort::getSpeed( mbrtu->getSpeed() ) << endl; mbinfo << myname << "(init): dev=" << devname << " speed=" << ComPort::getSpeed( mbrtu->getSpeed() ) << endl;
......
...@@ -227,7 +227,7 @@ MBSlave::MBSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const ...@@ -227,7 +227,7 @@ MBSlave::MBSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const
sessMaxNum = conf->getArgInt("--" + prefix + "-session-maxnum", it.getProp("sessMaxNum")); sessMaxNum = conf->getArgInt("--" + prefix + "-session-maxnum", it.getProp("sessMaxNum"));
if( sessMaxNum == 0 ) if( sessMaxNum == 0 )
sessMaxNum = 3; sessMaxNum = 5;
vmonit(sessMaxNum); vmonit(sessMaxNum);
...@@ -2591,7 +2591,7 @@ UniSetTypes::SimpleInfo* MBSlave::getInfo( CORBA::Long userparam ) ...@@ -2591,7 +2591,7 @@ UniSetTypes::SimpleInfo* MBSlave::getInfo( CORBA::Long userparam )
{ {
uniset_mutex_lock l(sessMutex); uniset_mutex_lock l(sessMutex);
inf << "TCP sessions[" << sess.size() << "]:" << endl; inf << "TCP sessions[" << sess.size() << "]: max=" << sessMaxNum << " updateStatTime=" << updateStatTime << endl;
for( const auto& m : sess ) for( const auto& m : sess )
inf << " " << m.iaddr << " askCount=" << m.askCount << endl; inf << " " << m.iaddr << " askCount=" << m.askCount << endl;
} }
......
...@@ -38,7 +38,6 @@ void SharedMemory::help_print( int argc, const char* const* argv ) ...@@ -38,7 +38,6 @@ void SharedMemory::help_print( int argc, const char* const* argv )
cout << "--wdt-device - Использовать в качестве WDT указанный файл." << endl; cout << "--wdt-device - Использовать в качестве WDT указанный файл." << endl;
cout << "--heartbeat-node - Загружать heartbeat датчики для указанного узла." << endl; cout << "--heartbeat-node - Загружать heartbeat датчики для указанного узла." << endl;
cout << "--heartbeat-check-time - период проверки 'счётчиков'. По умолчанию 1000 мсек" << endl; cout << "--heartbeat-check-time - период проверки 'счётчиков'. По умолчанию 1000 мсек" << endl;
cout << "--lock-rvalue-pause-msec - пауза между проверкой rw-блокировки на разрешение чтения" << endl;
cout << "--e-filter - фильтр для считывания <eventlist>" << endl; cout << "--e-filter - фильтр для считывания <eventlist>" << endl;
cout << "--e-startup-pause - пауза перед посылкой уведомления о старте SM. (По умолчанию: 1500 мсек)." << endl; cout << "--e-startup-pause - пауза перед посылкой уведомления о старте SM. (По умолчанию: 1500 мсек)." << endl;
cout << "--activate-timeout - время ожидания активизации (По умолчанию: 15000 мсек)." << endl; cout << "--activate-timeout - время ожидания активизации (По умолчанию: 15000 мсек)." << endl;
......
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