Skip to content
GitLab
Explore
Sign in
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
d6437b2d
Commit
d6437b2d
authored
4 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
changed put_nowait to put
parent
02aa04d1
No related branches found
No related tags found
1 merge request
!50
Resolve L2SS-188 "2021 05 27 branched from master udp recv sst client"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/clients/sst_client.py
+1
-3
1 addition, 3 deletions
devices/clients/sst_client.py
jupyter-notebooks/test_device.ipynb
+9
-35
9 additions, 35 deletions
jupyter-notebooks/test_device.ipynb
with
10 additions
and
38 deletions
devices/clients/sst_client.py
+
1
−
3
View file @
d6437b2d
...
@@ -130,7 +130,7 @@ class UDP_Receiver(Thread):
...
@@ -130,7 +130,7 @@ class UDP_Receiver(Thread):
try
:
try
:
packet
=
[
bytearray
(
self
.
buffersize
)]
packet
=
[
bytearray
(
self
.
buffersize
)]
self
.
sock
.
recvmsg_into
(
packet
[
0
:
self
.
buffersize
])
self
.
sock
.
recvmsg_into
(
packet
[
0
:
self
.
buffersize
])
self
.
queue
.
put
_nowait
(
packet
)
self
.
queue
.
put
(
packet
)
except
socket
.
timeout
:
except
socket
.
timeout
:
pass
pass
...
@@ -159,8 +159,6 @@ class SST(Thread):
...
@@ -159,8 +159,6 @@ class SST(Thread):
self
.
streams
.
debug_stream
(
"
starting SST thread
"
)
self
.
streams
.
debug_stream
(
"
starting SST thread
"
)
while
True
:
while
True
:
packet
=
self
.
queue
.
get
()
packet
=
self
.
queue
.
get
()
if
packet
is
None
:
if
packet
is
None
:
...
...
This diff is collapsed.
Click to expand it.
jupyter-notebooks/test_device.ipynb
+
9
−
35
View file @
d6437b2d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"cells": [
"cells": [
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
26
,
"execution_count":
1
,
"id": "waiting-chance",
"id": "waiting-chance",
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
...
@@ -13,17 +13,17 @@
...
@@ -13,17 +13,17 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
2
,
"execution_count":
3
,
"id": "moving-alexandria",
"id": "moving-alexandria",
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
"d=DeviceProxy(\"LTS/
test_device
/1\")"
"d=DeviceProxy(\"LTS/
SST
/1\")"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
27
,
"execution_count":
4
,
"id": "ranking-aluminum",
"id": "ranking-aluminum",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
31
,
"execution_count":
8
,
"id": "beneficial-evidence",
"id": "beneficial-evidence",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -59,36 +59,10 @@
...
@@ -59,36 +59,10 @@
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"bool_scalar_R [False]\n",
"packet_count_R [80]\n",
"bool_scalar_RW [False]\n",
"last_packet_timestamp_R [1623239037]\n",
"int64_spectrum_R [0 0 0 0 0 0 0 0]\n",
"State <function __get_command_func.<locals>.f at 0x7fcb20e510d0>\n",
"str_spectrum_RW ('', '', '', '', '', '', '', '')\n",
"Status <function __get_command_func.<locals>.f at 0x7fcb20e510d0>\n"
"double_image_R [[0. 0.]\n",
" [0. 0.]\n",
" [0. 0.]\n",
" [0. 0.]\n",
" [0. 0.]\n",
" [0. 0.]\n",
" [0. 0.]\n",
" [0. 0.]]\n",
"double_image_RW [[0. 0. 0. 0. 0. 0. 0. 0.]\n",
" [0. 0. 0. 0. 0. 0. 0. 0.]]\n",
"int32_scalar_R [0]\n",
"uint16_spectrum_RW [0 0 0 0 0 0 0 0]\n",
"float32_image_R [[0. 0. 0. 0. 0. 0. 0. 0.]\n",
" [0. 0. 0. 0. 0. 0. 0. 0.]]\n",
"uint8_image_RW [[0 0]\n",
" [0 0]\n",
" [0 0]\n",
" [0 0]\n",
" [0 0]\n",
" [0 0]\n",
" [0 0]\n",
" [0 0]]\n",
"tr_tod_R [0]\n",
"tr_uptime_R [0]\n",
"State <function __get_command_func.<locals>.f at 0x7f1c88a29e18>\n",
"Status <function __get_command_func.<locals>.f at 0x7f1c88a5abf8>\n"
]
]
}
}
],
],
...
...
%% Cell type:code id:waiting-chance tags:
%% Cell type:code id:waiting-chance tags:
```
python
```
python
import
time
import
time
import
numpy
import
numpy
```
```
%% Cell type:code id:moving-alexandria tags:
%% Cell type:code id:moving-alexandria tags:
```
python
```
python
d
=
DeviceProxy
(
"
LTS/
test_device
/1
"
)
d
=
DeviceProxy
(
"
LTS/
SST
/1
"
)
```
```
%% Cell type:code id:ranking-aluminum tags:
%% Cell type:code id:ranking-aluminum tags:
```
python
```
python
state
=
str
(
d
.
state
())
state
=
str
(
d
.
state
())
if
state
==
"
OFF
"
:
if
state
==
"
OFF
"
:
d
.
initialise
()
d
.
initialise
()
time
.
sleep
(
1
)
time
.
sleep
(
1
)
state
=
str
(
d
.
state
())
state
=
str
(
d
.
state
())
if
state
==
"
STANDBY
"
:
if
state
==
"
STANDBY
"
:
d
.
on
()
d
.
on
()
state
=
str
(
d
.
state
())
state
=
str
(
d
.
state
())
if
state
==
"
ON
"
:
if
state
==
"
ON
"
:
print
(
"
Device is now in on state
"
)
print
(
"
Device is now in on state
"
)
```
```
%% Output
%% Output
Device is now in on state
Device is now in on state
%% Cell type:code id:beneficial-evidence tags:
%% Cell type:code id:beneficial-evidence tags:
```
python
```
python
attr_names
=
d
.
get_attribute_list
()
attr_names
=
d
.
get_attribute_list
()
for
i
in
attr_names
:
for
i
in
attr_names
:
exec
(
"
value = print(i, d.{})
"
.
format
(
i
))
exec
(
"
value = print(i, d.{})
"
.
format
(
i
))
```
```
%% Output
%% Output
bool_scalar_R [False]
packet_count_R [80]
bool_scalar_RW [False]
last_packet_timestamp_R [1623239037]
int64_spectrum_R [0 0 0 0 0 0 0 0]
State <function __get_command_func.<locals>.f at 0x7fcb20e510d0>
str_spectrum_RW ('', '', '', '', '', '', '', '')
Status <function __get_command_func.<locals>.f at 0x7fcb20e510d0>
double_image_R [[0. 0.]
[0. 0.]
[0. 0.]
[0. 0.]
[0. 0.]
[0. 0.]
[0. 0.]
[0. 0.]]
double_image_RW [[0. 0. 0. 0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0. 0. 0. 0.]]
int32_scalar_R [0]
uint16_spectrum_RW [0 0 0 0 0 0 0 0]
float32_image_R [[0. 0. 0. 0. 0. 0. 0. 0.]
[0. 0. 0. 0. 0. 0. 0. 0.]]
uint8_image_RW [[0 0]
[0 0]
[0 0]
[0 0]
[0 0]
[0 0]
[0 0]
[0 0]]
tr_tod_R [0]
tr_uptime_R [0]
State <function __get_command_func.<locals>.f at 0x7f1c88a29e18>
Status <function __get_command_func.<locals>.f at 0x7f1c88a5abf8>
%% Cell type:code id:sporting-current tags:
%% Cell type:code id:sporting-current tags:
```
python
```
python
d
.
RCU_mask_RW
=
[
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
d
.
RCU_mask_RW
=
[
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,]
False
,
False
,
False
,
False
,
False
,
False
,
False
,
False
,]
time
.
sleep
(
1
)
time
.
sleep
(
1
)
print
(
d
.
RCU_mask_RW
)
print
(
d
.
RCU_mask_RW
)
monitor_rate
=
d
.
RCU_monitor_rate_RW
monitor_rate
=
d
.
RCU_monitor_rate_RW
print
(
"
current monitoring rate: {}, setting to {}
"
.
format
(
monitor_rate
,
monitor_rate
+
1
))
print
(
"
current monitoring rate: {}, setting to {}
"
.
format
(
monitor_rate
,
monitor_rate
+
1
))
monitor_rate
=
monitor_rate
+
1
monitor_rate
=
monitor_rate
+
1
time
.
sleep
(
1
)
time
.
sleep
(
1
)
```
```
%% Output
%% Output
3.0
3.0
%% Cell type:code id:sharing-mechanics tags:
%% Cell type:code id:sharing-mechanics tags:
```
python
```
python
``
`
``
`
%%
Cell
type
:
code
id
:
ruled
-
tracy
tags
:
%%
Cell
type
:
code
id
:
ruled
-
tracy
tags
:
```
python
```
python
```
```
...
...
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