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
70196012
Commit
70196012
authored
Sep 09, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UniNework debugging
parent
ecc4f4ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
10 deletions
+28
-10
libuniset.spec
conf/libuniset.spec
+5
-1
test.xml
conf/test.xml
+1
-1
UniExchange.cc
extensions/UniNetwork/UniExchange.cc
+22
-8
No files found.
conf/libuniset.spec
View file @
70196012
...
...
@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.96
Release: eter5
8
Release: eter5
9
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
...
...
@@ -167,6 +167,7 @@ rm -f %buildroot%_libdir/*.la
%_libdir/libUniSetMB*.so
%_libdir/libUniSetRT*.so
%_libdir/libUniSetShared*.so
%_libdir/libUniSetNetwork.so
%_pkgconfigdir/*Extensions.pc
%_pkgconfigdir/libUniSetIO*.pc
%_pkgconfigdir/libUniSetLog*.pc
...
...
@@ -178,6 +179,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Wed Sep 09 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter58
- UniNetwork debugging
* Wed Sep 09 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter57
- new build
...
...
conf/test.xml
View file @
70196012
...
...
@@ -54,7 +54,7 @@
</SharedMemory>
<UniExchange
name=
"UniExchange"
>
<item
name=
"UniExchange2"
node
_id
=
"Node2"
sid_connection=
""
/>
<item
name=
"UniExchange2"
node=
"Node2"
sid_connection=
""
/>
<item
id=
"3001"
node_id=
"Node2"
sid_connection=
""
/>
</UniExchange>
...
...
extensions/UniNetwork/UniExchange.cc
View file @
70196012
...
...
@@ -38,6 +38,12 @@ polltime(200)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): read fileter-field='"
<<
s_field
<<
"' filter-value='"
<<
s_fvalue
<<
"'"
<<
endl
;
polltime
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-polltime"
,
it
.
getProp
(
"polltime"
));
if
(
polltime
<=
0
)
polltime
=
200
;
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): polltime="
<<
polltime
<<
endl
;
if
(
it
.
goChildren
()
)
{
for
(
;
it
.
getCurrent
();
it
.
goNext
()
)
...
...
@@ -48,14 +54,13 @@ polltime(200)
if
(
!
n
.
empty
()
)
id
=
it
.
getIntProp
(
"id"
);
else
{
id
=
conf
->
getControllerID
(
it
.
getProp
(
"name"
)
);
n
=
it
.
getProp
(
"name"
);
}
if
(
id
==
DefaultObjectId
)
{
if
(
n
.
empty
()
)
n
=
it
.
getProp
(
"name"
);
throw
SystemError
(
"(UniExchange): Uknown ID for "
+
n
);
}
UniSetTypes
::
ObjectId
node
;
...
...
@@ -63,8 +68,11 @@ polltime(200)
if
(
!
n1
.
empty
()
)
node
=
it
.
getIntProp
(
"node_id"
);
else
{
n1
=
it
.
getProp
(
"node"
);
node
=
conf
->
getNodeID
(
n1
);
}
if
(
id
==
DefaultObjectId
)
throw
SystemError
(
"(UniExchange): Uknown ID for node="
+
n1
);
...
...
@@ -102,8 +110,14 @@ void UniExchange::execute()
bool
ok
=
false
;
try
{
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
": connect to id="
<<
it
->
id
<<
" node="
<<
it
->
node
<<
endl
;
IOController_i
::
ShortMapSeq_var
sseq
=
ui
.
getSensors
(
it
->
id
,
it
->
node
);
ok
=
true
;
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
" update sensors from id="
<<
it
->
id
<<
" node="
<<
it
->
node
<<
endl
;
it
->
update
(
sseq
,
shm
);
}
catch
(
Exception
&
ex
)
...
...
@@ -129,8 +143,8 @@ void UniExchange::execute()
}
}
if
(
!
ok
)
dlog
[
Debug
::
INFO
]
<<
"
****** cannot connect with node="
<<
it
->
node
<<
endl
;
if
(
!
ok
&&
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
myname
<<
":
****** cannot connect with node="
<<
it
->
node
<<
endl
;
}
msleep
(
polltime
);
...
...
@@ -262,7 +276,7 @@ UniExchange* UniExchange::init_exchange( int argc, const char* const* argv,
UniSetTypes
::
ObjectId
icID
,
SharedMemory
*
ic
,
const
std
::
string
prefix
)
{
string
p
(
"--"
+
prefix
+
"-
id
"
);
string
p
(
"--"
+
prefix
+
"-
name
"
);
string
nm
(
UniSetTypes
::
getArgParam
(
p
,
argc
,
argv
,
"UniExchange"
));
UniSetTypes
::
ObjectId
ID
=
conf
->
getControllerID
(
nm
);
...
...
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