Commit 29613ad1 authored by Pavel Vainerman's avatar Pavel Vainerman

(RRDServer): добавил проверку готовности SM к работе, перед заказом датчиков.

parent 24964c67
......@@ -54,6 +54,17 @@ RRDServer::RRDServer(UniSetTypes::ObjectId objId, xmlNode* cnode, UniSetTypes::O
for( ; it1.getCurrent(); it1++, ++tmID )
initRRD(it1, tmID);
if( smTestID == DefaultObjectId && !rrdlist.empty() )
{
// берём первый датчик из списка
const auto& lst = rrdlist.begin()->dslist;
if( !lst.empty() )
{
const auto& dsi = *(lst.begin());
smTestID = dsi->sid;
}
}
}
// -----------------------------------------------------------------------------
RRDServer::~RRDServer()
......@@ -268,6 +279,8 @@ void RRDServer::help_print( int argc, const char* const* argv )
cout << " set-levels ... " << endl;
cout << " logfile filanme " << endl;
cout << " no-debug " << endl;
cout << " Base oprtions: " << endl;
// cout << UObject_SK::help() << endl;
cout << " LogServer: " << endl;
cout << "--prefix-run-logserver - run logserver. Default: localhost:id" << endl;
cout << "--prefix-logserver-host ip - listen ip. Default: localhost" << endl;
......@@ -315,6 +328,9 @@ void RRDServer::askSensors( UniversalIO::UIOCommand cmd )
{
UObject_SK::askSensors(cmd);
// прежде чем заказывать датчики, надо убедиться что SM доступна
waitSM(smReadyTimeout);
for( auto& it : rrdlist )
{
for( auto& s : it.dsmap )
......
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