Skip to content
Snippets Groups Projects
Commit d6437b2d authored by Taya Snijder's avatar Taya Snijder
Browse files

changed put_nowait to put

parent 02aa04d1
No related branches found
No related tags found
1 merge request!50Resolve L2SS-188 "2021 05 27 branched from master udp recv sst client"
...@@ -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:
......
%% 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
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment