Skip to content
Snippets Groups Projects
Commit 545f7015 authored by Marko Mecina's avatar Marko Mecina
Browse files

add IWF EGSE signal mnemonics

parent 0ad62a9d
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3 #!/usr/bin/env python3
""" """
General purpose socket communication utility functions General purpose socket communication utilities
""" """
import queue import queue
...@@ -12,6 +12,10 @@ import time ...@@ -12,6 +12,10 @@ import time
class Connector: class Connector:
"""
Utility class for bidirectional socket handling
"""
RECV_NBYTES = 4096 RECV_NBYTES = 4096
def __init__(self, host, port, is_server=False, response_to=2, recv_nbytes_min=0, save_to_file=None, msgdecoding='hex', resp_decoder=None): def __init__(self, host, port, is_server=False, response_to=2, recv_nbytes_min=0, save_to_file=None, msgdecoding='hex', resp_decoder=None):
...@@ -156,6 +160,11 @@ class Connector: ...@@ -156,6 +160,11 @@ class Connector:
self.response_to = seconds self.response_to = seconds
def start_receiver(self, procfunc=None): def start_receiver(self, procfunc=None):
"""
:param procfunc: function that must return a list
:return:
"""
if self.conn is None: if self.conn is None:
print('No connection') print('No connection')
return return
...@@ -168,6 +177,9 @@ class Connector: ...@@ -168,6 +177,9 @@ class Connector:
class Receiver: class Receiver:
"""
Reads and processes data from sockets
"""
RECV_BYTES = 4096 RECV_BYTES = 4096
SEL_TIMEOUT = 2 SEL_TIMEOUT = 2
......
...@@ -303,6 +303,23 @@ def _hexasciify(value, nchars, signed=False): ...@@ -303,6 +303,23 @@ def _hexasciify(value, nchars, signed=False):
return value return value
class Signal:
EGSE_PSU_OK = 1
EGSE_FEE_DIG_OK = 2
EGSE_RSE_OK = 3
EGSE_PIN_PULL_OK = 4
EGSE_FEE_ANA_OK = 5
EGSE_I_FEE = 1
EGSE_I_PSU = 2
EGSE_I_HEATER = 3
EGSE_I_RSE = 4
FEE_Thermistor = 1
CDD_Thermistor = 2
def response_proc_func(rawdata): def response_proc_func(rawdata):
pkts = rawdata.split(EOP) pkts = rawdata.split(EOP)
pkts.remove(b'') pkts.remove(b'')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment