Commit 9f93e031 authored by Vitaly Lipatov's avatar Vitaly Lipatov

use getIntProp instead uni_atoi,atoi (getProp)

parent 22e725e8
...@@ -1107,8 +1107,8 @@ bool RTUExchange::initRSProperty( RSProperty& p, UniXML_iterator& it ) ...@@ -1107,8 +1107,8 @@ bool RTUExchange::initRSProperty( RSProperty& p, UniXML_iterator& it )
bool RTUExchange::initRegInfo( RegInfo* r, UniXML_iterator& it, RTUExchange::RTUDevice* dev ) bool RTUExchange::initRegInfo( RegInfo* r, UniXML_iterator& it, RTUExchange::RTUDevice* dev )
{ {
r->dev = dev; r->dev = dev;
r->mbval = UniSetTypes::uni_atoi(it.getProp("default").c_str()); r->mbval = it.getIntProp("default");
r->offset= UniSetTypes::uni_atoi(it.getProp("mboffset").c_str()); r->offset= it.getIntProp("mboffset");
if( dev->dtype == RTUExchange::dtMTR ) if( dev->dtype == RTUExchange::dtMTR )
{ {
......
...@@ -373,7 +373,7 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec ) ...@@ -373,7 +373,7 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
}; };
HeartBeatInfo hi; HeartBeatInfo hi;
hi.a_sid = UniSetTypes::uni_atoi( it.getProp("id").c_str() ); hi.a_sid = it.getIntProp("id");
if( it.getProp("heartbeat_ds_name").empty() ) if( it.getProp("heartbeat_ds_name").empty() )
{ {
...@@ -401,7 +401,7 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec ) ...@@ -401,7 +401,7 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
} }
} }
hi.reboot_msec = UniSetTypes::uni_atoi( it.getProp("heartbeat_reboot_msec").c_str() ); hi.reboot_msec = it.getIntProp("heartbeat_reboot_msec");
hi.ptReboot.setTiming(UniSetTimer::WaitUpTime); hi.ptReboot.setTiming(UniSetTimer::WaitUpTime);
if( hi.a_sid <= 0 ) if( hi.a_sid <= 0 )
...@@ -503,7 +503,7 @@ void SharedMemory::readEventList( std::string oname ) ...@@ -503,7 +503,7 @@ void SharedMemory::readEventList( std::string oname )
if( it.getProp(e_filter).empty() ) if( it.getProp(e_filter).empty() )
continue; continue;
ObjectId oid = UniSetTypes::uni_atoi(it.getProp("id").c_str()); ObjectId oid = it.getIntProp("id");
if( oid != 0 ) if( oid != 0 )
{ {
if( dlog.debugging(Debug::INFO) ) if( dlog.debugging(Debug::INFO) )
...@@ -564,7 +564,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode ) ...@@ -564,7 +564,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
UniXML_iterator it(n); UniXML_iterator it(n);
histSaveTime = uni_atoi(it.getProp("savetime").c_str()); histSaveTime = it.getIntProp("savetime");
if( histSaveTime < 0 ) if( histSaveTime < 0 )
histSaveTime = 200; histSaveTime = 200;
...@@ -577,8 +577,8 @@ void SharedMemory::buildHistoryList( xmlNode* cnode ) ...@@ -577,8 +577,8 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
for( ; it.getCurrent(); it.goNext() ) for( ; it.getCurrent(); it.goNext() )
{ {
HistoryInfo hi; HistoryInfo hi;
hi.id = UniSetTypes::uni_atoi( it.getProp("id").c_str() ); hi.id = it.getIntProp("id");
hi.size = UniSetTypes::uni_atoi( it.getProp("size").c_str() ); hi.size = it.getIntProp("size");
if( hi.size <=0 ) if( hi.size <=0 )
continue; continue;
...@@ -596,12 +596,12 @@ void SharedMemory::buildHistoryList( xmlNode* cnode ) ...@@ -596,12 +596,12 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
continue; continue;
} }
hi.fuse_invert = uni_atoi(it.getProp("fuse_invert").c_str()); hi.fuse_invert = it.getIntProp("fuse_invert");
if( !it.getProp("fuse_value").empty() ) if( !it.getProp("fuse_value").empty() )
{ {
hi.fuse_use_val = true; hi.fuse_use_val = true;
hi.fuse_val = uni_atoi(it.getProp("fuse_value").c_str()); hi.fuse_val = it.getIntProp("fuse_value");
} }
// WARNING: no check duplicates... // WARNING: no check duplicates...
...@@ -623,7 +623,7 @@ void SharedMemory::checkHistoryFilter( UniXML_iterator& xit ) ...@@ -623,7 +623,7 @@ void SharedMemory::checkHistoryFilter( UniXML_iterator& xit )
if( !xit.getProp("id").empty() ) if( !xit.getProp("id").empty() )
{ {
ai.id = uni_atoi(xit.getProp("id").c_str()); ai.id = xit.getIntProp("id");
it->hlst.push_back(ai); it->hlst.push_back(ai);
continue; continue;
} }
......
...@@ -398,7 +398,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm, ...@@ -398,7 +398,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
sid = conf->getSensorID(sname); sid = conf->getSensorID(sname);
else else
{ {
sid = UniSetTypes::uni_atoi(it.getProp("id").c_str()); sid = it.getIntProp("id");
if( sid <=0 ) if( sid <=0 )
sid = DefaultObjectId; sid = DefaultObjectId;
} }
...@@ -522,9 +522,9 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm, ...@@ -522,9 +522,9 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
return false; return false;
} }
b->ti.lowlimit = uni_atoi( it.getProp("lowlimit").c_str() ); b->ti.lowlimit = it.getIntProp("lowlimit");
b->ti.hilimit = uni_atoi( it.getProp("hilimit").c_str() ); b->ti.hilimit = it.getIntProp("hilimit");
b->ti.sensibility = uni_atoi( it.getProp("sensibility").c_str() ); b->ti.sensibility = it.getIntProp("sensibility");
} }
} }
// else // else
......
...@@ -134,7 +134,7 @@ void ObjectIndex_idXML::read_section( UniXML& xml, const std::string sec ) ...@@ -134,7 +134,7 @@ void ObjectIndex_idXML::read_section( UniXML& xml, const std::string sec )
for( ;it.getCurrent(); it.goNext() ) for( ;it.getCurrent(); it.goNext() )
{ {
ObjectInfo inf; ObjectInfo inf;
inf.id = uni_atoi( it.getProp("id").c_str() ); inf.id = it.getIntProp("id");
if( inf.id <= 0 ) if( inf.id <= 0 )
{ {
...@@ -187,7 +187,7 @@ void ObjectIndex_idXML::read_nodes( UniXML& xml, const std::string sec ) ...@@ -187,7 +187,7 @@ void ObjectIndex_idXML::read_nodes( UniXML& xml, const std::string sec )
{ {
ObjectInfo inf; ObjectInfo inf;
inf.id = uni_atoi( it.getProp("id").c_str() ); inf.id = it.getIntProp("id");
if( inf.id <= 0 ) if( inf.id <= 0 )
{ {
ostringstream msg; ostringstream msg;
......
...@@ -227,7 +227,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -227,7 +227,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
try try
{ {
if( unixml.getProp(cnode,"idfromfile").empty() || atoi(unixml.getProp(cnode,"idfromfile").c_str())==0 ) if( unixml.getProp(cnode,"idfromfile").empty() || unixml.getIntProp(cnode,"idfromfile")==0 )
oind = new ObjectIndex_XML(unixml); //(fileConfName); oind = new ObjectIndex_XML(unixml); //(fileConfName);
else else
oind = new ObjectIndex_idXML(unixml); //(fileConfName); oind = new ObjectIndex_idXML(unixml); //(fileConfName);
...@@ -247,7 +247,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -247,7 +247,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
mi = new DefaultMessageInterface(); mi = new DefaultMessageInterface();
else else
{ {
if( unixml.getProp(cnode,"idfromfile").empty() || atoi(unixml.getProp(cnode,"idfromfile").c_str())==0 ) if( unixml.getProp(cnode,"idfromfile").empty() || unixml.getIntProp(cnode,"idfromfile")==0 )
mi = new MessageInterface_XML(unixml); // (fileConfName); mi = new MessageInterface_XML(unixml); // (fileConfName);
else else
mi = new MessageInterface_idXML(unixml); // (fileConfName); mi = new MessageInterface_idXML(unixml); // (fileConfName);
...@@ -481,18 +481,18 @@ void Configuration::initParameters() ...@@ -481,18 +481,18 @@ void Configuration::initParameters()
} }
else if( name == "CountOfNet" ) else if( name == "CountOfNet" )
{ {
countOfNet = atoi(it.getProp("name").c_str()); countOfNet = it.getIntProp("name");
} }
else if( name == "RepeatTimeoutMS" ) else if( name == "RepeatTimeoutMS" )
{ {
repeatTimeout = atoi( it.getProp("name").c_str()); repeatTimeout = it.getIntProp("name");
if(!repeatTimeout) if(!repeatTimeout)
repeatTimeout=50; //[????] repeatTimeout=50; //[????]
} }
else if( name == "RepeatCount" ) else if( name == "RepeatCount" )
{ {
repeatCount = atoi( it.getProp("name").c_str()); repeatCount = it.getIntProp("name");
if(!repeatCount) if(!repeatCount)
repeatCount = 1; repeatCount = 1;
} }
...@@ -502,11 +502,11 @@ void Configuration::initParameters() ...@@ -502,11 +502,11 @@ void Configuration::initParameters()
} }
else if( name == "LocalIOR" ) else if( name == "LocalIOR" )
{ {
localIOR = atoi( it.getProp("name").c_str() ); localIOR = it.getIntProp("name");
} }
else if( name == "TransientIOR" ) else if( name == "TransientIOR" )
{ {
transientIOR = atoi( it.getProp("name").c_str()); transientIOR = it.getIntProp("name");
} }
else if( name == "DataDir" ) else if( name == "DataDir" )
{ {
......
...@@ -109,7 +109,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is ) ...@@ -109,7 +109,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is )
{ {
UniXML_iterator it(node); UniXML_iterator it(node);
bool autoID=atoi(it.getProp("autoID").c_str()); bool autoID=it.getIntProp("autoID");
if( !it.goChildren() ) if( !it.goChildren() )
return; return;
...@@ -124,8 +124,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is ) ...@@ -124,8 +124,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is )
code = conf->mi->getCodeByIdName(it.getProp("name")); code = conf->mi->getCodeByIdName(it.getProp("name"));
else else
{ {
string scode(xml.getProp(it,"id")); code = xml.getIntProp(it,"id");
code = atoi(scode.c_str());
} }
if( code == UniSetTypes::DefaultMessageCode ) if( code == UniSetTypes::DefaultMessageCode )
...@@ -150,7 +149,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is ) ...@@ -150,7 +149,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is )
continue; continue;
InfoServer::ConsumerInfoExt cinf(ci); InfoServer::ConsumerInfoExt cinf(ci);
cinf.ask = atoi(xml.getProp(itc,"ask").c_str()); cinf.ask = xml.getIntProp(itc,"ask");
lst.push_front(cinf); lst.push_front(cinf);
cslot(xml,itc,it.getCurrent()); cslot(xml,itc,it.getCurrent());
} }
......
...@@ -102,7 +102,7 @@ void MessageInterface_idXML::build( UniXML& xml ) ...@@ -102,7 +102,7 @@ void MessageInterface_idXML::build( UniXML& xml )
{ {
MessageInfo inf; MessageInfo inf;
inf.code = uni_atoi( it.getProp("id").c_str() ); inf.code = it.getIntProp("id");
if( inf.code <= 0 ) if( inf.code <= 0 )
{ {
ostringstream msg; ostringstream msg;
......
...@@ -291,12 +291,12 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf ) ...@@ -291,12 +291,12 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf )
// //
if( inf.type == UniversalIO::AnalogInput || inf.type == UniversalIO::AnalogOutput ) if( inf.type == UniversalIO::AnalogInput || inf.type == UniversalIO::AnalogOutput )
{ {
inf.ci.minRaw = uni_atoi( xml.getProp(it,"rmin").c_str() ); inf.ci.minRaw = xml.getIntProp(it,"rmin");
inf.ci.maxRaw = uni_atoi( xml.getProp(it,"rmax").c_str() ); inf.ci.maxRaw = xml.getIntProp(it,"rmax");
inf.ci.minCal = uni_atoi( xml.getProp(it,"cmin").c_str() ); inf.ci.minCal = xml.getIntProp(it,"cmin");
inf.ci.maxCal = uni_atoi( xml.getProp(it,"cmax").c_str() ); inf.ci.maxCal = xml.getIntProp(it,"cmax");
inf.ci.sensibility = uni_atoi( xml.getProp(it,"sensibility").c_str() ); inf.ci.sensibility = xml.getIntProp(it,"sensibility");
inf.ci.precision = uni_atoi( xml.getProp(it,"precision").c_str() ); inf.ci.precision = xml.getIntProp(it,"precision");
} }
else else
{ {
...@@ -308,7 +308,7 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf ) ...@@ -308,7 +308,7 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf )
inf.ci.precision = 0; inf.ci.precision = 0;
} }
inf.default_val = uni_atoi(xml.getProp(it,"default").c_str()); inf.default_val = xml.getIntProp(it,"default");
inf.value = inf.default_val; inf.value = inf.default_val;
inf.undefined = false; inf.undefined = false;
inf.real_value = inf.value; inf.real_value = inf.value;
...@@ -450,11 +450,11 @@ bool NCRestorer_XML::getThresholdInfo( UniXML& xml,xmlNode* node, ...@@ -450,11 +450,11 @@ bool NCRestorer_XML::getThresholdInfo( UniXML& xml,xmlNode* node,
} }
UniXML_iterator uit(node); UniXML_iterator uit(node);
ti.id = uni_atoi( uit.getProp("id").c_str() ); ti.id = uit.getIntProp("id");
ti.lowlimit = uni_atoi( uit.getProp("lowlimit").c_str() ); ti.lowlimit = uit.getIntProp("lowlimit");
ti.hilimit = uni_atoi( uit.getProp("hilimit").c_str() ); ti.hilimit = uit.getIntProp("hilimit");
ti.sensibility = uni_atoi( uit.getProp("sensibility").c_str() ); ti.sensibility = uit.getIntProp("sensibility");
ti.inverse = atoi( uit.getProp("inverse").c_str() ); ti.inverse = uit.getIntProp("inverse");
ti.state = IONotifyController_i::NormalThreshold; ti.state = IONotifyController_i::NormalThreshold;
if( ti.sid == UniSetTypes::DefaultObjectId ) if( ti.sid == UniSetTypes::DefaultObjectId )
......
...@@ -65,11 +65,11 @@ SystemGuard::SystemGuard( ObjectId id ): //, ObjectsActivator* a ): ...@@ -65,11 +65,11 @@ SystemGuard::SystemGuard( ObjectId id ): //, ObjectsActivator* a ):
void SystemGuard::init() void SystemGuard::init()
{ {
WatchDogTimeOut = atoi( conf->getField("WatchDogTime").c_str() )*60; WatchDogTimeOut = conf->getIntField("WatchDogTime") * 60;
PingNodeTimeOut = atoi( conf->getField("PingNodeTime").c_str() ); PingNodeTimeOut = conf->getIntField("PingNodeTime");
AutoStartUpTimeOut = atoi( conf->getField("AutoStartUpTime").c_str() ); AutoStartUpTimeOut = conf->getIntField("AutoStartUpTime");
DumpStateTime = atoi( conf->getField("DumpStateTime").c_str() ); DumpStateTime = conf->getIntField("DumpStateTime");
SleepTickMS = atoi( conf->getField("SleepTickMS").c_str() ); SleepTickMS = conf->getIntField("SleepTickMS");
// act->addManager( static_cast<ObjectsManager*>(this) ); // act->addManager( static_cast<ObjectsManager*>(this) );
} }
......
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