Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
18a7903a
Commit
18a7903a
authored
May 31, 2021
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
removed print statements and replaced with debug_stream
parent
e00b21a6
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!50
Resolve L2SS-188 "2021 05 27 branched from master udp recv sst client"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/clients/sst_client.py
+8
-7
8 additions, 7 deletions
devices/clients/sst_client.py
with
8 additions
and
7 deletions
devices/clients/sst_client.py
+
8
−
7
View file @
18a7903a
...
@@ -46,8 +46,8 @@ class sst_client(CommClient):
...
@@ -46,8 +46,8 @@ class sst_client(CommClient):
"""
"""
if
not
self
.
connected
:
if
not
self
.
connected
:
self
.
deque
=
deque
(
maxlen
=
1024
)
self
.
deque
=
deque
(
maxlen
=
1024
)
self
.
udp
=
UDP_Receiver
(
self
.
host
,
self
.
port
,
self
.
deque
,
self
.
buffersize
,
self
.
timeout
)
self
.
udp
=
UDP_Receiver
(
self
.
host
,
self
.
port
,
self
.
deque
,
self
.
streams
,
self
.
buffersize
,
self
.
timeout
)
self
.
sst
=
SST
(
self
.
deque
)
self
.
sst
=
SST
(
self
.
deque
,
self
.
streams
)
return
super
().
connect
()
return
super
().
connect
()
def
disconnect
(
self
):
def
disconnect
(
self
):
...
@@ -88,7 +88,6 @@ class sst_client(CommClient):
...
@@ -88,7 +88,6 @@ class sst_client(CommClient):
def
read_function
():
def
read_function
():
print
([
self
.
sst
.
parameters
[
SST_param
]])
return
[
self
.
sst
.
parameters
[
SST_param
]]
return
[
self
.
sst
.
parameters
[
SST_param
]]
def
write_function
(
value
):
def
write_function
(
value
):
...
@@ -104,8 +103,9 @@ class UDP_Receiver(Thread):
...
@@ -104,8 +103,9 @@ class UDP_Receiver(Thread):
This class provides a small wrapper for the OPC ua read/write functions in order to better organise the code
This class provides a small wrapper for the OPC ua read/write functions in order to better organise the code
"""
"""
def
__init__
(
self
,
host
,
port
,
deque
,
buffersize
=
9000
,
timeout
=
0.1
):
def
__init__
(
self
,
host
,
port
,
deque
,
streams
,
buffersize
=
9000
,
timeout
=
0.1
):
self
.
streams
=
streams
self
.
deque
=
deque
self
.
deque
=
deque
self
.
host
=
host
self
.
host
=
host
self
.
port
=
port
self
.
port
=
port
...
@@ -124,7 +124,7 @@ class UDP_Receiver(Thread):
...
@@ -124,7 +124,7 @@ class UDP_Receiver(Thread):
def
run
(
self
):
def
run
(
self
):
# all variables are manually defined and are updated each time
# all variables are manually defined and are updated each time
print
(
"
starting UDP thread with port {} and host {}
"
.
format
(
self
.
port
,
self
.
host
))
self
.
streams
.
debug_stream
(
"
starting UDP thread with port {} and host {}
"
.
format
(
self
.
port
,
self
.
host
))
while
self
.
stream_on
:
while
self
.
stream_on
:
try
:
try
:
...
@@ -146,8 +146,9 @@ class UDP_Receiver(Thread):
...
@@ -146,8 +146,9 @@ class UDP_Receiver(Thread):
class
SST
(
Thread
):
class
SST
(
Thread
):
def
__init__
(
self
,
deque
):
def
__init__
(
self
,
deque
,
streams
):
self
.
streams
=
streams
self
.
deque
=
deque
self
.
deque
=
deque
self
.
last_packet
=
None
self
.
last_packet
=
None
...
@@ -160,7 +161,7 @@ class SST(Thread):
...
@@ -160,7 +161,7 @@ class SST(Thread):
self
.
start
()
self
.
start
()
def
run
(
self
):
def
run
(
self
):
print
(
"
starting SST thread
"
)
self
.
streams
.
debug_stream
(
"
starting SST thread
"
)
while
True
:
while
True
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment