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
f9c9d61f
Commit
f9c9d61f
authored
Jul 10, 2012
by
Pavel Vaynerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(UNetUDP): исправлена ошибка в логике переключения каналов
(мигание датчика связи, в случае отсутствия связи по обоим каналам)
parent
7bee3168
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
8 deletions
+25
-8
libuniset.spec
conf/libuniset.spec
+4
-1
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+2
-0
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+13
-2
UNetReceiver.h
extensions/UNetUDP/UNetReceiver.h
+3
-0
StorageInterface.h
include/StorageInterface.h
+3
-5
No files found.
conf/libuniset.spec
View file @
f9c9d61f
...
...
@@ -3,7 +3,7 @@
Name: libuniset
Version: 1.4
Release: alt
5
Release: alt
6
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
...
...
@@ -213,6 +213,9 @@ rm -f %buildroot%_libdir/*.la
%changelog
* Tue Jul 10 2012 Pavel Vaynerman <pv@server> 1.4-alt6
- (unetudp): fixed bug in the logic of switching channels
* Thu Jun 14 2012 Pavel Vainerman <pv@altlinux.ru> 1.4-alt5
- (codegen): fixed bug in validation 'iotype'
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
f9c9d61f
...
...
@@ -39,6 +39,7 @@ sender2(0)
<<
"' nodes-filter-value='"
<<
n_fvalue
<<
"'"
<<
endl
;
int
recvTimeout
=
conf
->
getArgPInt
(
"--unet-recv-timeout"
,
it
.
getProp
(
"recvTimeout"
),
5000
);
int
prepareTime
=
conf
->
getArgPInt
(
"--unet-preapre-time"
,
it
.
getProp
(
"prepareTime"
),
2000
);
int
lostTimeout
=
conf
->
getArgPInt
(
"--unet-lost-timeout"
,
it
.
getProp
(
"lostTimeout"
),
recvTimeout
);
int
recvpause
=
conf
->
getArgPInt
(
"--unet-recvpause"
,
it
.
getProp
(
"recvpause"
),
10
);
int
sendpause
=
conf
->
getArgPInt
(
"--unet-sendpause"
,
it
.
getProp
(
"sendpause"
),
150
);
...
...
@@ -247,6 +248,7 @@ sender2(0)
r
->
setLockUpdate
(
false
);
r
->
setReceiveTimeout
(
recvTimeout
);
r
->
setPrepareTime
(
prepareTime
);
r
->
setLostTimeout
(
lostTimeout
);
r
->
setReceivePause
(
recvpause
);
r
->
setUpdatePause
(
updatepause
);
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
f9c9d61f
...
...
@@ -25,6 +25,7 @@ recvpause(10),
updatepause
(
100
),
udp
(
0
),
recvTimeout
(
5000
),
prepareTime
(
2000
),
lostTimeout
(
5000
),
lostPackets
(
0
),
sidRespond
(
UniSetTypes
::
DefaultObjectId
),
...
...
@@ -78,6 +79,7 @@ a_cache_init_ok(false)
u_thr
=
new
ThreadCreator
<
UNetReceiver
>
(
this
,
&
UNetReceiver
::
update
);
ptRecvTimeout
.
setTiming
(
recvTimeout
);
ptPrepare
.
setTiming
(
prepareTime
);
}
// -----------------------------------------------------------------------------
UNetReceiver
::~
UNetReceiver
()
...
...
@@ -93,6 +95,12 @@ void UNetReceiver::setReceiveTimeout( timeout_t msec )
ptRecvTimeout
.
setTiming
(
msec
);
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
setPrepareTime
(
timeout_t
msec
)
{
prepareTime
=
msec
;
ptPrepare
.
setTiming
(
msec
);
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
setLostTimeout
(
timeout_t
msec
)
{
lostTimeout
=
msec
;
...
...
@@ -136,6 +144,8 @@ void UNetReceiver::setLockUpdate( bool st )
{
uniset_mutex_lock
l
(
lockMutex
,
200
);
lockUpdate
=
st
;
if
(
!
st
)
ptPrepare
.
reset
();
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
resetTimeout
()
...
...
@@ -157,7 +167,7 @@ void UNetReceiver::start()
// -----------------------------------------------------------------------------
void
UNetReceiver
::
update
()
{
cerr
<<
"******************* u
dp
ate start"
<<
endl
;
cerr
<<
"******************* u
pd
ate start"
<<
endl
;
while
(
activated
)
{
try
...
...
@@ -398,7 +408,8 @@ void UNetReceiver::receive()
tout
=
ptRecvTimeout
.
checkTime
();
}
if
(
trTimeout
.
change
(
tout
)
)
// только если "режим подготовки закончился, то можем генерировать "события"
if
(
ptPrepare
.
checkTime
()
&&
trTimeout
.
change
(
tout
)
)
{
if
(
tout
)
slEvent
(
this
,
evTimeout
);
...
...
extensions/UNetUDP/UNetReceiver.h
View file @
f9c9d61f
...
...
@@ -73,6 +73,7 @@ class UNetReceiver
void
setReceivePause
(
timeout_t
msec
);
void
setUpdatePause
(
timeout_t
msec
);
void
setLostTimeout
(
timeout_t
msec
);
void
setPrepareTime
(
timeout_t
msec
);
void
setMaxDifferens
(
unsigned
long
set
);
void
setRespondID
(
UniSetTypes
::
ObjectId
id
,
bool
invert
=
false
);
...
...
@@ -116,7 +117,9 @@ class UNetReceiver
UniSetTypes
::
uniset_mutex
pollMutex
;
PassiveTimer
ptRecvTimeout
;
PassiveTimer
ptPrepare
;
timeout_t
recvTimeout
;
timeout_t
prepareTime
;
timeout_t
lostTimeout
;
PassiveTimer
ptLostTimeout
;
unsigned
long
lostPackets
;
/*!< счётчик потерянных пакетов */
...
...
include/StorageInterface.h
View file @
f9c9d61f
...
...
@@ -51,8 +51,7 @@ class StorageInterface
private
:
};
// ---------------------------------------------------------------------------
class
STLStorage
:
public
StorageInterface
{
...
...
@@ -76,7 +75,6 @@ class STLStorage:
protected
:
private
:
};
// ---------------------------------------------------------------------------
#endif
// ---------------------------------------------------------------------------
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