diff --git a/Ccs/communication.py b/Ccs/communication.py index c02e20b52854563cf25714952901cc73662d0f40..3bb4b215af3d523c9a04d74e62b47538fa7547e0 100644 --- a/Ccs/communication.py +++ b/Ccs/communication.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """ -General purpose socket communication utility functions +General purpose socket communication utilities """ import queue @@ -12,6 +12,10 @@ import time class Connector: + """ + Utility class for bidirectional socket handling + """ + 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): @@ -156,6 +160,11 @@ class Connector: self.response_to = seconds def start_receiver(self, procfunc=None): + """ + + :param procfunc: function that must return a list + :return: + """ if self.conn is None: print('No connection') return @@ -168,6 +177,9 @@ class Connector: class Receiver: + """ + Reads and processes data from sockets + """ RECV_BYTES = 4096 SEL_TIMEOUT = 2 diff --git a/Ccs/iwf_egse.py b/Ccs/iwf_egse.py index de33510775792a022fc094b673e22e25ad837819..17a9a42d266a2d0f26e85d5532f7e5a9b9a2e1ee 100644 --- a/Ccs/iwf_egse.py +++ b/Ccs/iwf_egse.py @@ -303,6 +303,23 @@ def _hexasciify(value, nchars, signed=False): 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): pkts = rawdata.split(EOP) pkts.remove(b'')