From 545f7015eaee3d3c689a736f0bfef33d63a13379 Mon Sep 17 00:00:00 2001
From: Marko Mecina <marko.mecina@univie.ac.at>
Date: Wed, 5 Jul 2023 15:08:26 +0200
Subject: [PATCH] add IWF EGSE signal mnemonics

---
 Ccs/communication.py | 14 +++++++++++++-
 Ccs/iwf_egse.py      | 17 +++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/Ccs/communication.py b/Ccs/communication.py
index c02e20b..3bb4b21 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 de33510..17a9a42 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'')
-- 
GitLab