Commit 1aec772e authored by Pavel Vainerman's avatar Pavel Vainerman Committed by Pavel Vainerman

fixed getSensorIOInfo interface (supported old omniORB)

parent 2b9068f2
...@@ -1219,7 +1219,7 @@ int sinfo(const string& args, UInterface& ui ) ...@@ -1219,7 +1219,7 @@ int sinfo(const string& args, UInterface& ui )
if( it.si.node == DefaultObjectId ) if( it.si.node == DefaultObjectId )
it.si.node = conf->getLocalNode(); it.si.node = conf->getLocalNode();
IOController_i::SensorIOInfo_var sinf = ui.getSensorIOInfo(it.si); auto sinf = ui.getSensorIOInfo(it.si);
#if 0 #if 0
UniversalIO::IOType type; /*!< тип */ UniversalIO::IOType type; /*!< тип */
long priority; /*!< приоритет уведомления */ long priority; /*!< приоритет уведомления */
...@@ -1229,22 +1229,22 @@ int sinfo(const string& args, UInterface& ui ) ...@@ -1229,22 +1229,22 @@ int sinfo(const string& args, UInterface& ui )
const int w = 14; const int w = 14;
print_help(w, "id", std::to_string(it.si.id) + "\n", " ", " : "); print_help(w, "id", std::to_string(it.si.id) + "\n", " ", " : ");
print_help(w, "node", std::to_string(it.si.node) + "\n", " ", " : "); print_help(w, "node", std::to_string(it.si.node) + "\n", " ", " : ");
print_help(w, "value", std::to_string(sinf->value) + "\n", " ", " : "); print_help(w, "value", std::to_string(sinf.value) + "\n", " ", " : ");
print_help(w, "real_value", std::to_string(sinf->real_value) + "\n", " ", " : "); print_help(w, "real_value", std::to_string(sinf.real_value) + "\n", " ", " : ");
print_help(w, "frozen", std::to_string(sinf->frozen) + "\n", " ", " : "); print_help(w, "frozen", std::to_string(sinf.frozen) + "\n", " ", " : ");
print_help(w, "undefined", std::to_string(sinf->undefined) + "\n", " ", " : "); print_help(w, "undefined", std::to_string(sinf.undefined) + "\n", " ", " : ");
print_help(w, "blocked", std::to_string(sinf->blocked) + "\n", " ", " : "); print_help(w, "blocked", std::to_string(sinf.blocked) + "\n", " ", " : ");
if( sinf->depend_sid != DefaultObjectId ) if( sinf.depend_sid != DefaultObjectId )
print_help(w, "depend_sensor", "(" + to_string(sinf->depend_sid) + ")" + ORepHelpers::getShortName(conf->oind->getMapName(sinf->depend_sid)) + "\n", " ", " : "); print_help(w, "depend_sensor", "(" + to_string(sinf.depend_sid) + ")" + ORepHelpers::getShortName(conf->oind->getMapName(sinf.depend_sid)) + "\n", " ", " : ");
if( sinf->supplier == uniset::AdminID ) if( sinf.supplier == uniset::AdminID )
print_help(w, "supplier", "admin\n", " ", " : "); print_help(w, "supplier", "admin\n", " ", " : ");
else else
print_help(w, "supplier", ORepHelpers::getShortName(conf->oind->getMapName(sinf->supplier)) + "\n", " ", " : "); print_help(w, "supplier", ORepHelpers::getShortName(conf->oind->getMapName(sinf.supplier)) + "\n", " ", " : ");
ostringstream ts; ostringstream ts;
ts << dateToString(sinf->tv_sec) << " " << timeToString(sinf->tv_sec) << "." << sinf->tv_nsec << "\n"; ts << dateToString(sinf.tv_sec) << " " << timeToString(sinf.tv_sec) << "." << sinf.tv_nsec << "\n";
print_help(w, "changed", ts.str(), " ", " : "); print_help(w, "changed", ts.str(), " ", " : ");
} }
catch( const uniset::Exception& ex ) catch( const uniset::Exception& ex )
......
...@@ -291,37 +291,37 @@ TEST_CASE("UInterface::getSensorIOInfo", "[UInterface][getSensorIOInfo]") ...@@ -291,37 +291,37 @@ TEST_CASE("UInterface::getSensorIOInfo", "[UInterface][getSensorIOInfo]")
REQUIRE_NOTHROW( ui->getSensorIOInfo(si) ); REQUIRE_NOTHROW( ui->getSensorIOInfo(si) );
auto inf = ui->getSensorIOInfo(si); auto inf = ui->getSensorIOInfo(si);
REQUIRE( inf->supplier == testOID ); REQUIRE( inf.supplier == testOID );
REQUIRE( inf->value == 200 ); REQUIRE( inf.value == 200 );
REQUIRE( inf->real_value == 200 ); REQUIRE( inf.real_value == 200 );
REQUIRE( inf->blocked == false ); REQUIRE( inf.blocked == false );
REQUIRE( inf->frozen == false ); REQUIRE( inf.frozen == false );
REQUIRE( inf->undefined == false ); REQUIRE( inf.undefined == false );
REQUIRE( inf->tv_sec > 0 ); REQUIRE( inf.tv_sec > 0 );
REQUIRE( inf->dbignore == false ); REQUIRE( inf.dbignore == false );
REQUIRE( inf->depend_sid == DefaultObjectId ); REQUIRE( inf.depend_sid == DefaultObjectId );
// freeze/unfreeze // freeze/unfreeze
REQUIRE_NOTHROW( ui->freezeValue(si, true, 10, testOID) ); REQUIRE_NOTHROW( ui->freezeValue(si, true, 10, testOID) );
inf = ui->getSensorIOInfo(si); inf = ui->getSensorIOInfo(si);
REQUIRE( inf->frozen == true ); REQUIRE( inf.frozen == true );
REQUIRE( inf->supplier == testOID ); REQUIRE( inf.supplier == testOID );
REQUIRE_NOTHROW( ui->freezeValue(si, false, 10, testOID) ); REQUIRE_NOTHROW( ui->freezeValue(si, false, 10, testOID) );
inf = ui->getSensorIOInfo(si); inf = ui->getSensorIOInfo(si);
REQUIRE( inf->frozen == false ); REQUIRE( inf.frozen == false );
REQUIRE( inf->supplier == testOID ); REQUIRE( inf.supplier == testOID );
// undef // undef
REQUIRE_NOTHROW( ui->setUndefinedState( si, true, testOID )); REQUIRE_NOTHROW( ui->setUndefinedState( si, true, testOID ));
inf = ui->getSensorIOInfo(si); inf = ui->getSensorIOInfo(si);
REQUIRE( inf->undefined == true ); REQUIRE( inf.undefined == true );
REQUIRE( inf->supplier == testOID ); REQUIRE( inf.supplier == testOID );
REQUIRE_NOTHROW( ui->setUndefinedState( si, false, testOID )); REQUIRE_NOTHROW( ui->setUndefinedState( si, false, testOID ));
inf = ui->getSensorIOInfo(si); inf = ui->getSensorIOInfo(si);
REQUIRE( inf->undefined == false ); REQUIRE( inf.undefined == false );
REQUIRE( inf->supplier == testOID ); REQUIRE( inf.supplier == testOID );
// depend // depend
si.id = 100; si.id = 100;
...@@ -330,14 +330,14 @@ TEST_CASE("UInterface::getSensorIOInfo", "[UInterface][getSensorIOInfo]") ...@@ -330,14 +330,14 @@ TEST_CASE("UInterface::getSensorIOInfo", "[UInterface][getSensorIOInfo]")
si.id = 101; si.id = 101;
inf = ui->getSensorIOInfo(si); inf = ui->getSensorIOInfo(si);
REQUIRE( inf->blocked == true ); REQUIRE( inf.blocked == true );
REQUIRE( inf->depend_sid == 100 ); REQUIRE( inf.depend_sid == 100 );
si.id = 100; si.id = 100;
REQUIRE_NOTHROW( ui->setValue(si, 10, testOID) ); REQUIRE_NOTHROW( ui->setValue(si, 10, testOID) );
si.id = 101; si.id = 101;
inf = ui->getSensorIOInfo(si); inf = ui->getSensorIOInfo(si);
REQUIRE( inf->blocked == false ); REQUIRE( inf.blocked == false );
REQUIRE( inf->depend_sid == 100 ); REQUIRE( inf.depend_sid == 100 );
} }
...@@ -80,7 +80,7 @@ namespace uniset ...@@ -80,7 +80,7 @@ namespace uniset
IOController_i::SensorInfoSeq_var getSensorSeq( const uniset::IDList& lst ); IOController_i::SensorInfoSeq_var getSensorSeq( const uniset::IDList& lst );
//! Получение состояния информации о датчике //! Получение состояния информации о датчике
IOController_i::SensorIOInfo_var getSensorIOInfo( const IOController_i::SensorInfo& si ); IOController_i::SensorIOInfo getSensorIOInfo( const IOController_i::SensorInfo& si );
/*! Изменения состояния списка входов/выходов /*! Изменения состояния списка входов/выходов
\return Возвращает список не найденных идентификаторов */ \return Возвращает список не найденных идентификаторов */
......
...@@ -2236,7 +2236,7 @@ namespace uniset ...@@ -2236,7 +2236,7 @@ namespace uniset
} }
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------
IOController_i::SensorIOInfo_var UInterface::getSensorIOInfo( const IOController_i::SensorInfo& si ) IOController_i::SensorIOInfo UInterface::getSensorIOInfo( const IOController_i::SensorInfo& si )
{ {
if ( si.id == uniset::DefaultObjectId ) if ( si.id == uniset::DefaultObjectId )
throw uniset::ORepFailed("UI(getSensorIOInfo): error node=uniset::DefaultObjectId"); throw uniset::ORepFailed("UI(getSensorIOInfo): error node=uniset::DefaultObjectId");
......
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