Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
9f93e031
Commit
9f93e031
authored
Aug 04, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use getIntProp instead uni_atoi,atoi (getProp)
parent
22e725e8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
46 deletions
+45
-46
RTUExchange.cc
extensions/RTUExchange/RTUExchange.cc
+2
-2
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+9
-9
IOBase.cc
extensions/lib/IOBase.cc
+4
-4
ObjectIndex_idXML.cc
src/ObjectRepository/ObjectIndex_idXML.cc
+2
-2
Configuration.cc
src/Various/Configuration.cc
+7
-7
ISRestorer_XML.cc
src/Various/ISRestorer_XML.cc
+3
-4
MessageInterface_idXML.cc
src/Various/MessageInterface_idXML.cc
+1
-1
NCRestorer_XML.cc
src/Various/NCRestorer_XML.cc
+12
-12
SystemGuard.cc
src/Various/SystemGuard.cc
+5
-5
No files found.
extensions/RTUExchange/RTUExchange.cc
View file @
9f93e031
...
...
@@ -1107,8 +1107,8 @@ bool RTUExchange::initRSProperty( RSProperty& p, UniXML_iterator& it )
bool
RTUExchange
::
initRegInfo
(
RegInfo
*
r
,
UniXML_iterator
&
it
,
RTUExchange
::
RTUDevice
*
dev
)
{
r
->
dev
=
dev
;
r
->
mbval
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"default"
).
c_str
()
);
r
->
offset
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"mboffset"
).
c_str
()
);
r
->
mbval
=
it
.
getIntProp
(
"default"
);
r
->
offset
=
it
.
getIntProp
(
"mboffset"
);
if
(
dev
->
dtype
==
RTUExchange
::
dtMTR
)
{
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
9f93e031
...
...
@@ -373,7 +373,7 @@ bool SharedMemory::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
};
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
()
)
{
...
...
@@ -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
);
if
(
hi
.
a_sid
<=
0
)
...
...
@@ -503,7 +503,7 @@ void SharedMemory::readEventList( std::string oname )
if
(
it
.
getProp
(
e_filter
).
empty
()
)
continue
;
ObjectId
oid
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
ObjectId
oid
=
it
.
getIntProp
(
"id"
);
if
(
oid
!=
0
)
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
...
...
@@ -564,7 +564,7 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
UniXML_iterator
it
(
n
);
histSaveTime
=
uni_atoi
(
it
.
getProp
(
"savetime"
).
c_str
()
);
histSaveTime
=
it
.
getIntProp
(
"savetime"
);
if
(
histSaveTime
<
0
)
histSaveTime
=
200
;
...
...
@@ -577,8 +577,8 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
for
(
;
it
.
getCurrent
();
it
.
goNext
()
)
{
HistoryInfo
hi
;
hi
.
id
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
hi
.
size
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"size"
).
c_str
()
);
hi
.
id
=
it
.
getIntProp
(
"id"
);
hi
.
size
=
it
.
getIntProp
(
"size"
);
if
(
hi
.
size
<=
0
)
continue
;
...
...
@@ -596,12 +596,12 @@ void SharedMemory::buildHistoryList( xmlNode* cnode )
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
()
)
{
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...
...
...
@@ -623,7 +623,7 @@ void SharedMemory::checkHistoryFilter( UniXML_iterator& xit )
if
(
!
xit
.
getProp
(
"id"
).
empty
()
)
{
ai
.
id
=
uni_atoi
(
xit
.
getProp
(
"id"
).
c_str
()
);
ai
.
id
=
xit
.
getIntProp
(
"id"
);
it
->
hlst
.
push_back
(
ai
);
continue
;
}
...
...
extensions/lib/IOBase.cc
View file @
9f93e031
...
...
@@ -398,7 +398,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
sid
=
conf
->
getSensorID
(
sname
);
else
{
sid
=
UniSetTypes
::
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
sid
=
it
.
getIntProp
(
"id"
);
if
(
sid
<=
0
)
sid
=
DefaultObjectId
;
}
...
...
@@ -522,9 +522,9 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
return
false
;
}
b
->
ti
.
lowlimit
=
uni_atoi
(
it
.
getProp
(
"lowlimit"
).
c_str
()
);
b
->
ti
.
hilimit
=
uni_atoi
(
it
.
getProp
(
"hilimit"
).
c_str
()
);
b
->
ti
.
sensibility
=
uni_atoi
(
it
.
getProp
(
"sensibility"
).
c_str
()
);
b
->
ti
.
lowlimit
=
it
.
getIntProp
(
"lowlimit"
);
b
->
ti
.
hilimit
=
it
.
getIntProp
(
"hilimit"
);
b
->
ti
.
sensibility
=
it
.
getIntProp
(
"sensibility"
);
}
}
// else
...
...
src/ObjectRepository/ObjectIndex_idXML.cc
View file @
9f93e031
...
...
@@ -134,7 +134,7 @@ void ObjectIndex_idXML::read_section( UniXML& xml, const std::string sec )
for
(
;
it
.
getCurrent
();
it
.
goNext
()
)
{
ObjectInfo
inf
;
inf
.
id
=
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
inf
.
id
=
it
.
getIntProp
(
"id"
);
if
(
inf
.
id
<=
0
)
{
...
...
@@ -187,7 +187,7 @@ void ObjectIndex_idXML::read_nodes( UniXML& xml, const std::string sec )
{
ObjectInfo
inf
;
inf
.
id
=
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
inf
.
id
=
it
.
getIntProp
(
"id"
);
if
(
inf
.
id
<=
0
)
{
ostringstream
msg
;
...
...
src/Various/Configuration.cc
View file @
9f93e031
...
...
@@ -227,7 +227,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
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);
else
oind
=
new
ObjectIndex_idXML
(
unixml
);
//(fileConfName);
...
...
@@ -247,7 +247,7 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
mi
=
new
DefaultMessageInterface
();
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);
else
mi
=
new
MessageInterface_idXML
(
unixml
);
// (fileConfName);
...
...
@@ -481,18 +481,18 @@ void Configuration::initParameters()
}
else
if
(
name
==
"CountOfNet"
)
{
countOfNet
=
atoi
(
it
.
getProp
(
"name"
).
c_str
()
);
countOfNet
=
it
.
getIntProp
(
"name"
);
}
else
if
(
name
==
"RepeatTimeoutMS"
)
{
repeatTimeout
=
atoi
(
it
.
getProp
(
"name"
).
c_str
()
);
repeatTimeout
=
it
.
getIntProp
(
"name"
);
if
(
!
repeatTimeout
)
repeatTimeout
=
50
;
//[????]
}
else
if
(
name
==
"RepeatCount"
)
{
repeatCount
=
atoi
(
it
.
getProp
(
"name"
).
c_str
()
);
repeatCount
=
it
.
getIntProp
(
"name"
);
if
(
!
repeatCount
)
repeatCount
=
1
;
}
...
...
@@ -502,11 +502,11 @@ void Configuration::initParameters()
}
else
if
(
name
==
"LocalIOR"
)
{
localIOR
=
atoi
(
it
.
getProp
(
"name"
).
c_str
()
);
localIOR
=
it
.
getIntProp
(
"name"
);
}
else
if
(
name
==
"TransientIOR"
)
{
transientIOR
=
atoi
(
it
.
getProp
(
"name"
).
c_str
()
);
transientIOR
=
it
.
getIntProp
(
"name"
);
}
else
if
(
name
==
"DataDir"
)
{
...
...
src/Various/ISRestorer_XML.cc
View file @
9f93e031
...
...
@@ -109,7 +109,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is )
{
UniXML_iterator
it
(
node
);
bool
autoID
=
atoi
(
it
.
getProp
(
"autoID"
).
c_str
()
);
bool
autoID
=
it
.
getIntProp
(
"autoID"
);
if
(
!
it
.
goChildren
()
)
return
;
...
...
@@ -124,8 +124,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is )
code
=
conf
->
mi
->
getCodeByIdName
(
it
.
getProp
(
"name"
));
else
{
string
scode
(
xml
.
getProp
(
it
,
"id"
));
code
=
atoi
(
scode
.
c_str
());
code
=
xml
.
getIntProp
(
it
,
"id"
);
}
if
(
code
==
UniSetTypes
::
DefaultMessageCode
)
...
...
@@ -150,7 +149,7 @@ void ISRestorer_XML::read_list(UniXML& xml, xmlNode* node, InfoServer* is )
continue
;
InfoServer
::
ConsumerInfoExt
cinf
(
ci
);
cinf
.
ask
=
atoi
(
xml
.
getProp
(
itc
,
"ask"
).
c_str
());
cinf
.
ask
=
xml
.
getIntProp
(
itc
,
"ask"
);
lst
.
push_front
(
cinf
);
cslot
(
xml
,
itc
,
it
.
getCurrent
());
}
...
...
src/Various/MessageInterface_idXML.cc
View file @
9f93e031
...
...
@@ -102,7 +102,7 @@ void MessageInterface_idXML::build( UniXML& xml )
{
MessageInfo
inf
;
inf
.
code
=
uni_atoi
(
it
.
getProp
(
"id"
).
c_str
()
);
inf
.
code
=
it
.
getIntProp
(
"id"
);
if
(
inf
.
code
<=
0
)
{
ostringstream
msg
;
...
...
src/Various/NCRestorer_XML.cc
View file @
9f93e031
...
...
@@ -291,12 +291,12 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf )
//
if
(
inf
.
type
==
UniversalIO
::
AnalogInput
||
inf
.
type
==
UniversalIO
::
AnalogOutput
)
{
inf
.
ci
.
minRaw
=
uni_atoi
(
xml
.
getProp
(
it
,
"rmin"
).
c_str
()
);
inf
.
ci
.
maxRaw
=
uni_atoi
(
xml
.
getProp
(
it
,
"rmax"
).
c_str
()
);
inf
.
ci
.
minCal
=
uni_atoi
(
xml
.
getProp
(
it
,
"cmin"
).
c_str
()
);
inf
.
ci
.
maxCal
=
uni_atoi
(
xml
.
getProp
(
it
,
"cmax"
).
c_str
()
);
inf
.
ci
.
sensibility
=
uni_atoi
(
xml
.
getProp
(
it
,
"sensibility"
).
c_str
()
);
inf
.
ci
.
precision
=
uni_atoi
(
xml
.
getProp
(
it
,
"precision"
).
c_str
()
);
inf
.
ci
.
minRaw
=
xml
.
getIntProp
(
it
,
"rmin"
);
inf
.
ci
.
maxRaw
=
xml
.
getIntProp
(
it
,
"rmax"
);
inf
.
ci
.
minCal
=
xml
.
getIntProp
(
it
,
"cmin"
);
inf
.
ci
.
maxCal
=
xml
.
getIntProp
(
it
,
"cmax"
);
inf
.
ci
.
sensibility
=
xml
.
getIntProp
(
it
,
"sensibility"
);
inf
.
ci
.
precision
=
xml
.
getIntProp
(
it
,
"precision"
);
}
else
{
...
...
@@ -308,7 +308,7 @@ bool NCRestorer_XML::getSensorInfo( UniXML& xml, xmlNode* it, SInfo& inf )
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
.
undefined
=
false
;
inf
.
real_value
=
inf
.
value
;
...
...
@@ -450,11 +450,11 @@ bool NCRestorer_XML::getThresholdInfo( UniXML& xml,xmlNode* node,
}
UniXML_iterator
uit
(
node
);
ti
.
id
=
u
ni_atoi
(
uit
.
getProp
(
"id"
).
c_str
()
);
ti
.
lowlimit
=
u
ni_atoi
(
uit
.
getProp
(
"lowlimit"
).
c_str
()
);
ti
.
hilimit
=
u
ni_atoi
(
uit
.
getProp
(
"hilimit"
).
c_str
()
);
ti
.
sensibility
=
u
ni_atoi
(
uit
.
getProp
(
"sensibility"
).
c_str
()
);
ti
.
inverse
=
atoi
(
uit
.
getProp
(
"inverse"
).
c_str
()
);
ti
.
id
=
u
it
.
getIntProp
(
"id"
);
ti
.
lowlimit
=
u
it
.
getIntProp
(
"lowlimit"
);
ti
.
hilimit
=
u
it
.
getIntProp
(
"hilimit"
);
ti
.
sensibility
=
u
it
.
getIntProp
(
"sensibility"
);
ti
.
inverse
=
uit
.
getIntProp
(
"inverse"
);
ti
.
state
=
IONotifyController_i
::
NormalThreshold
;
if
(
ti
.
sid
==
UniSetTypes
::
DefaultObjectId
)
...
...
src/Various/SystemGuard.cc
View file @
9f93e031
...
...
@@ -65,11 +65,11 @@ SystemGuard::SystemGuard( ObjectId id ): //, ObjectsActivator* a ):
void
SystemGuard
::
init
()
{
WatchDogTimeOut
=
atoi
(
conf
->
getField
(
"WatchDogTime"
).
c_str
()
)
*
60
;
PingNodeTimeOut
=
atoi
(
conf
->
getField
(
"PingNodeTime"
).
c_str
()
);
AutoStartUpTimeOut
=
atoi
(
conf
->
getField
(
"AutoStartUpTime"
).
c_str
()
);
DumpStateTime
=
atoi
(
conf
->
getField
(
"DumpStateTime"
).
c_str
()
);
SleepTickMS
=
atoi
(
conf
->
getField
(
"SleepTickMS"
).
c_str
()
);
WatchDogTimeOut
=
conf
->
getIntField
(
"WatchDogTime"
)
*
60
;
PingNodeTimeOut
=
conf
->
getIntField
(
"PingNodeTime"
);
AutoStartUpTimeOut
=
conf
->
getIntField
(
"AutoStartUpTime"
);
DumpStateTime
=
conf
->
getIntField
(
"DumpStateTime"
);
SleepTickMS
=
conf
->
getIntField
(
"SleepTickMS"
);
// act->addManager( static_cast<ObjectsManager*>(this) );
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment