Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
38cb5150
Commit
38cb5150
authored
May 30, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Min holdtime added for subpoll
parent
2a858fbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
opc/exe/opc_server/src/opc_server.cpp
opc/exe/opc_server/src/opc_server.cpp
+16
-11
No files found.
opc/exe/opc_server/src/opc_server.cpp
View file @
38cb5150
/*
/*
* Proview $Id: opc_server.cpp,v 1.18 2007-05-30 13:19:04 claes Exp $
* Proview $Id: opc_server.cpp,v 1.19 2007-05-30 13:22:12 claes Exp $
* Proview $Id: opc_server.cpp,v 1.19 2007-05-30 13:22:12 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -21,6 +22,7 @@
...
@@ -21,6 +22,7 @@
#include <net/if.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/if_arp.h>
#include <pthread.h>
#include <pthread.h>
#include <float.h>
#include "pwr.h"
#include "pwr.h"
#include "pwr_version.h"
#include "pwr_version.h"
...
@@ -883,13 +885,15 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__SubscriptionPolledRefresh(struct soap* soap,
...
@@ -883,13 +885,15 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__SubscriptionPolledRefresh(struct soap* soap,
bool
has_waittime
=
false
;
bool
has_waittime
=
false
;
int
waited_time
=
0
;
int
waited_time
=
0
;
pwr_tFloat32
wait_scan
=
0.5
;
pwr_tFloat32
wait_scan
=
0.5
;
pwr_tDeltaTime
dwait_scan
;
pwr_tFloat32
min_hold
=
0.5
;
pwr_tDeltaTime
dwait_scan
,
dmin_hold
;
if
(
s0__SubscriptionPolledRefresh
->
HoldTime
)
{
if
(
s0__SubscriptionPolledRefresh
->
HoldTime
)
{
if
(
!
client
->
m_multi_threaded
)
if
(
!
client
->
m_multi_threaded
)
client
->
m_multi_threaded
=
true
;
client
->
m_multi_threaded
=
true
;
else
{
else
{
has_holdtime
=
true
;
has_holdtime
=
true
;
time_FloatToD
(
&
dmin_hold
,
min_hold
);
opc_time_OPCAsciiToA
(
(
char
*
)
s0__SubscriptionPolledRefresh
->
HoldTime
->
c_str
(),
opc_time_OPCAsciiToA
(
(
char
*
)
s0__SubscriptionPolledRefresh
->
HoldTime
->
c_str
(),
&
hold_time
);
&
hold_time
);
if
(
s0__SubscriptionPolledRefresh
->
WaitTime
)
{
if
(
s0__SubscriptionPolledRefresh
->
WaitTime
)
{
...
@@ -903,15 +907,16 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__SubscriptionPolledRefresh(struct soap* soap,
...
@@ -903,15 +907,16 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__SubscriptionPolledRefresh(struct soap* soap,
if
(
has_holdtime
)
{
if
(
has_holdtime
)
{
pthread_mutex_t
mutex
=
PTHREAD_MUTEX_INITIALIZER
;
pthread_mutex_t
mutex
=
PTHREAD_MUTEX_INITIALIZER
;
pthread_cond_t
cond
=
PTHREAD_COND_INITIALIZER
;
pthread_cond_t
cond
=
PTHREAD_COND_INITIALIZER
;
pwr_tTime
current_time
;
pwr_tTime
current_time
,
next_time
;
char
str1
[
80
],
str2
[
80
];
if
(
min_hold
>
FLT_EPSILON
)
{
clock_gettime
(
CLOCK_REALTIME
,
&
current_time
);
clock_gettime
(
CLOCK_REALTIME
,
&
current_time
);
time_AtoAscii
(
&
current_time
,
time_eFormat_DateAndTime
,
str1
,
sizeof
(
str1
));
time_Aadd
(
&
next_time
,
&
current_time
,
&
dmin_hold
);
time_AtoAscii
(
&
hold_time
,
time_eFormat_DateAndTime
,
str2
,
sizeof
(
str2
));
if
(
time_Acomp
(
&
next_time
,
&
hold_time
)
==
-
1
)
next_time
=
hold_time
;
printf
(
"TimedWait %s %s
\n
"
,
str1
,
str2
);
pthread_cond_timedwait
(
&
cond
,
&
mutex
,
&
next_time
);
}
else
pthread_cond_timedwait
(
&
cond
,
&
mutex
,
&
hold_time
);
pthread_cond_timedwait
(
&
cond
,
&
mutex
,
&
hold_time
);
}
}
...
...
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