From c37748e403346d750be72f18478dde5b07727cd7 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Wed, 16 Oct 2024 17:00:38 +0200
Subject: [PATCH 01/21] Added endpoint for eye diagram

---
 api/itk_demo_optoboard/api/routes.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/api/itk_demo_optoboard/api/routes.py b/api/itk_demo_optoboard/api/routes.py
index c5002cb..85df64c 100644
--- a/api/itk_demo_optoboard/api/routes.py
+++ b/api/itk_demo_optoboard/api/routes.py
@@ -365,6 +365,17 @@ def readLpgbtSupplyVoltage():
     return _error_catcher(
         readSupplyVoltageTask.apply_async((optoboardPosition,device,monitor_channel),queue=queue).wait
     )
+    
+def eyeMonitorDiagram():
+    payload = request.get_json()
+    optoboardPosition = str(payload["optoboardPosition"])
+    device = str(payload["device"])
+    meastime = str(payload["meastime"])
+    filename = str(payload["filename"])
+    queue = "itk_demo_optoboard_queue_" + optoboardPosition
+    return _error_catcher(
+        eyeMonitorDiagramTask.apply_async((optoboardPosition,device,meastime,filename),queue=queue).wait
+    )   
 
 # from itk_demo_optoboard.wsgi import celery
 from itk_demo_optoboard.worker.celeryTasks import *
-- 
GitLab


From 5585e8a811291d8ab288fdf5b31b8477214a740c Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Wed, 16 Oct 2024 17:01:20 +0200
Subject: [PATCH 02/21] Added endpoint for EMD

---
 .../api/openapi/openapi.yaml                  | 20 +++++++++++++++++++
 api/itk_demo_optoboard/worker/celeryTasks.py  |  9 +++++++++
 2 files changed, 29 insertions(+)

diff --git a/api/itk_demo_optoboard/api/openapi/openapi.yaml b/api/itk_demo_optoboard/api/openapi/openapi.yaml
index c1f2df0..076bf78 100644
--- a/api/itk_demo_optoboard/api/openapi/openapi.yaml
+++ b/api/itk_demo_optoboard/api/openapi/openapi.yaml
@@ -676,6 +676,26 @@ paths:
         200:
           description: Voltage value
 
+  /eyeMonitorDiagram
+    post:
+      summary: Eye monitor diagram with DC offset monitoring
+      description: Produces an eye monitor diagram and an array of the XY values of the plot of the 2.56 Gbps downlink
+      x-openapi-router-controller: itk_demo_optoboard.api.routes
+      operationId: eyeMonitorDiagram
+      requestBody:
+        description: JSON serialised object containing device, meastime, and filename
+        content:
+          application/json:
+            schema:
+              type: object
+              properties:
+                optoboardPosition:
+                  type: string
+                  example: "OB0"
+                  description: Optoboard position
+                  #THIS NEEDS FINISHING
+
+
   /setLpgbtPhase:
     post:
       summary: Change phase mode of lpGBT
diff --git a/api/itk_demo_optoboard/worker/celeryTasks.py b/api/itk_demo_optoboard/worker/celeryTasks.py
index ee15992..d8235ee 100644
--- a/api/itk_demo_optoboard/worker/celeryTasks.py
+++ b/api/itk_demo_optoboard/worker/celeryTasks.py
@@ -350,3 +350,12 @@ def readSupplyVoltageTask(optoboardPosition, device, monitor_channel):
     except Exception as e:
         logger.error("Task terminated due to exception: " + str(e))
         return "Could not read supply voltage of " + device + "!"
+    
+@celery.task()
+def eyeMonitorDiagramTask(optoboardPosition, device, meastime, filename):
+    try:
+        EMDresult = eval('optoboard_dic["' + optoboardPosition + '"].' + device).eye_opening_monitor(meastime,filename)
+        return EMDresult
+    except Exception as e:
+        logger.error("Task terminated due to exception: " + str(e))
+        return "Could not produce eye monitior diagram for " + device + "!"
-- 
GitLab


From 68e059bfbff587f701d3475c0a5bc79bb9ce457b Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Thu, 17 Oct 2024 12:28:03 +0200
Subject: [PATCH 03/21] Finished adding EMD endpoint - needs testing

---
 .../api/openapi/openapi.yaml                  | 27 ++++++++++++++-----
 api/itk_demo_optoboard/api/routes.py          |  2 +-
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/api/itk_demo_optoboard/api/openapi/openapi.yaml b/api/itk_demo_optoboard/api/openapi/openapi.yaml
index 076bf78..744bf70 100644
--- a/api/itk_demo_optoboard/api/openapi/openapi.yaml
+++ b/api/itk_demo_optoboard/api/openapi/openapi.yaml
@@ -668,18 +668,19 @@ paths:
                 device:
                   type: string
                   example: "lpgbt1"
-                  description: device
+                  description: Device
                 monitor_channel:
                   type: string
                   example: "0"
+                  description: Channel for which voltage should be monitored
       responses:
         200:
           description: Voltage value
 
-  /eyeMonitorDiagram
+  /eyeMonitorDiagram:
     post:
       summary: Eye monitor diagram with DC offset monitoring
-      description: Produces an eye monitor diagram and an array of the XY values of the plot of the 2.56 Gbps downlink
+      description: Produces an eye monitor diagram and an array of the XY values of the plot of the 2.56 Gbps downlink. Only possible with lpGBT1.
       x-openapi-router-controller: itk_demo_optoboard.api.routes
       operationId: eyeMonitorDiagram
       requestBody:
@@ -693,7 +694,21 @@ paths:
                   type: string
                   example: "OB0"
                   description: Optoboard position
-                  #THIS NEEDS FINISHING
+                device:
+                  type: string
+                  example: "lpgbt1"
+                  description: Device
+                meastime:
+                  type: string
+                  example: "10"
+                  description: Measurement time
+                filename:
+                  type: string
+                  example: "Eye_monitor_diagram"
+                  description: Filename for diagram plot
+      responses:
+        200:
+          description: XY values of diagram and DC offset
 
 
   /setLpgbtPhase:
@@ -716,7 +731,7 @@ paths:
                 device:
                   type: string
                   example: "lpgbt1"
-                  description: device
+                  description: Device
                 phaseMode:
                   type: string
                   example: "fixed_phase"
@@ -724,7 +739,7 @@ paths:
                 group:
                   type: string
                   example: "4"
-                  description: e-group number
+                  description: E-group number
                 phase:
                   type: string
                   example: "5"
diff --git a/api/itk_demo_optoboard/api/routes.py b/api/itk_demo_optoboard/api/routes.py
index 85df64c..fdf7595 100644
--- a/api/itk_demo_optoboard/api/routes.py
+++ b/api/itk_demo_optoboard/api/routes.py
@@ -370,7 +370,7 @@ def eyeMonitorDiagram():
     payload = request.get_json()
     optoboardPosition = str(payload["optoboardPosition"])
     device = str(payload["device"])
-    meastime = str(payload["meastime"])
+    meastime = int(payload["meastime"])
     filename = str(payload["filename"])
     queue = "itk_demo_optoboard_queue_" + optoboardPosition
     return _error_catcher(
-- 
GitLab


From 778cfbaba2877b6a71f3745130df60ec54ea9881 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Mon, 21 Oct 2024 16:40:19 +0200
Subject: [PATCH 04/21] Software update to 05-00-04/demi-12

---
 example/docker-compose.yml | 15 +++++++--------
 opto-base-image/Dockerfile |  2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index a094375..505f992 100644
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -1,5 +1,3 @@
-version: "3.9"
-
 networks:
   deminet:
     name: deminet
@@ -7,7 +5,7 @@ networks:
 
 services:
   api:
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:demi-6
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:latest
     container_name: optoboard-api
     depends_on:
       - worker
@@ -36,7 +34,7 @@ services:
       - deminet
 
   worker:
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:demi-6
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:latest
     container_name: optoboard-worker
     depends_on:
       - rabbitmq
@@ -53,7 +51,7 @@ services:
       - RX_PORT=12350
       - TX_TAG=17
       - INTERFACE=optoboard-worker # use the name of the optoboard worker container (or its IP address) when using lpgbt-com, the same but for the felix container for ic-over-netio; else provide IP address
-      - RX_TAG=25
+      - RX_TAG=29
       - SR_URL=http://${HOST}:5111/api
       - FLX_URL_KEY=demi/${STACK}/itk-demo-optoboard/felix/url
       - RUNKEY_UI_URL_KEY=demi/${STACK}/itk-demo-configdb/runkey-ui/url
@@ -95,7 +93,7 @@ services:
 
   ui:
     build: .
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-ui:demi-6
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-ui:latest
     container_name: optoboard-ui
     ports:
       - 5089:80
@@ -114,7 +112,7 @@ services:
       - demi.${STACK}.itk-demo-optoboard.ui.category=Microservice-UI
 
   felix:
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-felix/api:05-00-04-rm5-el9-demi-10
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-felix/api:05-00-04-rm5-el9-demi-12
     restart: unless-stopped
     container_name: felix
     command: ["with-contenv", "bash", "--login", "-c", "reflex init && reflex run"]
@@ -317,7 +315,7 @@ services:
       - ${PWD}/configs:/config/workspace
 
   yarr:
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-daqapi/base:YARR-v1.5.1-FELIX-05-00-03-rm5-el9-demi-1
+    image: gitlab-registry.cern.ch/yarr/yarr:v1.5.2
     container_name: yarr
     tty: true    
     restart: unless-stopped
@@ -330,6 +328,7 @@ services:
       - /tmp/bus:/bus
     networks:
       - deminet
+    working_dir: /workspace
     labels:
       - demi.${USER}.itk-demo-optoboard.yarr.host=${HOST}
       - demi.${USER}.itk-demo-optoboard.yarr.description=yarr
diff --git a/opto-base-image/Dockerfile b/opto-base-image/Dockerfile
index 6b2d483..ea54c7f 100644
--- a/opto-base-image/Dockerfile
+++ b/opto-base-image/Dockerfile
@@ -46,7 +46,7 @@ RUN python3 -m pip install optoboard-felix --index-url https://gitlab.cern.ch/ap
     python3 -m pip install service-registry --index-url https://gitlab.cern.ch/api/v4/projects/145742/packages/pypi/simple  && \
     python3 -m pip install config-checker --index-url https://gitlab.cern.ch/api/v4/projects/163911/packages/pypi/simple && \
     echo pip show optoboard-felix &&\
-    python3 -m pip install progress    
+    python3 -m pip install alive-progress    
     
 
 
-- 
GitLab


From bdd82ef8e86d67d9ecf57d4333b786e2d0d02183 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Mon, 21 Oct 2024 16:44:24 +0200
Subject: [PATCH 05/21] Moved installation of alive-progress to correct
 Dockerfile (API)

---
 api/Dockerfile             | 1 +
 opto-base-image/Dockerfile | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/api/Dockerfile b/api/Dockerfile
index a591240..16a8548 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -19,6 +19,7 @@ COPY . .
 RUN python3 -m pip install -U pip
 RUN python3 -m pip install 'python-dotenv<2.0.0' 'Flask-Cors<3.1.0' 'celery[redis]<6.0.0' 'connexion[swagger-ui]<3.0.0' 'gunicorn<21.0.0' 'PyAMQP<1.0.0' git+https://gitlab.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/pypi-packages/rcf-response.git
 RUN pip install pyconfigdb --index-url https://gitlab.cern.ch/api/v4/projects/180899/packages/pypi/simple
+RUN pip install alive-progress
 
 # RUN python3 -m pip install --no-cache-dir poetry==1.5.1 && \
 #     poetry config virtualenvs.create false && \
diff --git a/opto-base-image/Dockerfile b/opto-base-image/Dockerfile
index ea54c7f..2165d26 100644
--- a/opto-base-image/Dockerfile
+++ b/opto-base-image/Dockerfile
@@ -46,7 +46,6 @@ RUN python3 -m pip install optoboard-felix --index-url https://gitlab.cern.ch/ap
     python3 -m pip install service-registry --index-url https://gitlab.cern.ch/api/v4/projects/145742/packages/pypi/simple  && \
     python3 -m pip install config-checker --index-url https://gitlab.cern.ch/api/v4/projects/163911/packages/pypi/simple && \
     echo pip show optoboard-felix &&\
-    python3 -m pip install alive-progress    
     
 
 
-- 
GitLab


From 83db5d76c1d77765d5459d141e20fae8e941c0b1 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Tue, 22 Oct 2024 11:19:31 +0200
Subject: [PATCH 06/21] Small mistake at end of line 60

---
 opto-base-image/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opto-base-image/Dockerfile b/opto-base-image/Dockerfile
index 2165d26..c931c60 100644
--- a/opto-base-image/Dockerfile
+++ b/opto-base-image/Dockerfile
@@ -45,7 +45,7 @@ ENV PS1="[Docker] $(whoami)@$(hostname):$(pwd)\\$ " \
 RUN python3 -m pip install optoboard-felix --index-url https://gitlab.cern.ch/api/v4/projects/113584/packages/pypi/simple  && \
     python3 -m pip install service-registry --index-url https://gitlab.cern.ch/api/v4/projects/145742/packages/pypi/simple  && \
     python3 -m pip install config-checker --index-url https://gitlab.cern.ch/api/v4/projects/163911/packages/pypi/simple && \
-    echo pip show optoboard-felix &&\
+    echo pip show optoboard-felix
     
 
 
-- 
GitLab


From 99eff55ca133447eea7593c8fd938a4ee47efa67 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Tue, 22 Oct 2024 11:22:09 +0200
Subject: [PATCH 07/21] Merging of two soft error counter endpoints into one

---
 .../api/openapi/openapi.yaml                  | 61 ++-----------------
 api/itk_demo_optoboard/api/routes.py          | 33 +++++-----
 api/itk_demo_optoboard/worker/celeryTasks.py  | 29 ++++-----
 3 files changed, 33 insertions(+), 90 deletions(-)

diff --git a/api/itk_demo_optoboard/api/openapi/openapi.yaml b/api/itk_demo_optoboard/api/openapi/openapi.yaml
index 744bf70..44cf09d 100644
--- a/api/itk_demo_optoboard/api/openapi/openapi.yaml
+++ b/api/itk_demo_optoboard/api/openapi/openapi.yaml
@@ -446,59 +446,6 @@ paths:
         200:
           $ref: "#/components/schemas/standard_model"
 
-  /softErrorCounter:
-    post:
-      summary: Performs a soft error counnt
-      description: The number of soft errors is monitored by checking the associated felix register.
-      x-openapi-router-controller: itk_demo_optoboard.api.routes
-      operationId: softErrorCounter
-      requestBody:
-        description: JSON serialized object containing the parameters of the bert script
-        content:
-          application/json:
-            schema:
-              type: object
-              properties:
-                optoboardPosition:
-                  type: string
-                  example: "OB0"
-                  description: Optoboard position
-                optical_link:
-                  type: string
-                  example: "00"
-                  description: optical link to monitor, example "00" for felix channel 0
-                felix_device:
-                  type: string
-                  example: "0"
-                  description: Felix device in use
-                egroup:
-                  type: string
-                  example: "00"
-                  description: lpGBT egroup to monitor
-                meastime:
-                  type: string
-                  example: "12"
-                  description: measuring time in seconds
-                API:
-                  type: string
-                  example: "1"
-                  description: use endpoint call to monitor the soft error (0 or 1)
-                url:
-                  type: string
-                  example: "http://felix:8000"
-                  description: url of the server with FELIX backend, url of the server with FELIX backend if the SR is not successful
-              required:
-                - optical_link
-                - felix_device
-                - egroup
-                - meastime
-                - API
-                - url
-      responses:
-        200:
-          $ref: "#/components/responses/SOFTERRORCounter_response" 
-
-
   /swapPolarity:
     post:
       summary: Swaps polarities of uplinks (tx)/downlinks (rx)
@@ -610,12 +557,12 @@ paths:
               schema:
                 type: object    
 
-  /parallelsoftErrorCounter:
+  /softErrorCounter:
     post:
-      summary: Runs a parallel soft error scan
-      description: Runs a parallel soft error scan, possible on multiple egroups and optical links on multiple devices
+      summary: Runs a soft error scan, which can either be for one egroup or parallelised
+      description: Runs a soft error scan, possible on multiple egroups and optical links on multiple devices, or just a single egroup
       x-openapi-router-controller: itk_demo_optoboard.api.routes
-      operationId: parallelsoftErrorCounter
+      operationId: softErrorCounter
       requestBody:
         description: JSON serialised object containing device, a combined variable for FELIX device, optical link and egroup, and measurement time 
         content:
diff --git a/api/itk_demo_optoboard/api/routes.py b/api/itk_demo_optoboard/api/routes.py
index fdf7595..d4ad6b3 100644
--- a/api/itk_demo_optoboard/api/routes.py
+++ b/api/itk_demo_optoboard/api/routes.py
@@ -208,14 +208,14 @@ def phaseScan():
     bertmeastime = int(payload["bertmeastime"])
     queue = "itk_demo_optoboard_queue_" + optoboardPosition
     return _error_catcher(
-        PHASESCAN_Task.apply_async(
+        phaseScanTask.apply_async(
             (optoboardPosition, device,eprx_group, bertmeastime),
             queue=queue,
         ).wait
     )
         
 
-def softErrorCounter():
+'''def softErrorCounter():
     payload = request.get_json()
     optoboardPosition = str(payload["optoboardPosition"])
     optical_link = str(payload["optical_link"])
@@ -226,12 +226,23 @@ def softErrorCounter():
     url = str(payload["url"])
     queue = "itk_demo_optoboard_queue_" + optoboardPosition
     return _error_catcher(
-        SOFTERRORCOUNTER_Task.apply_async(
+        softErrorCounterTask.apply_async(
             (optoboardPosition, optical_link, felix_device, egroup, meastime, API, url),
             queue=queue,
         ).wait
-    )
+    )'''
+    
         
+def softErrorCounter():
+    payload = request.get_json()
+    optoboardPosition = str(payload["optoboardPosition"])
+    dev_olink_egrp = list(payload["dev_olink_egrp"])
+    meastime = int(payload["meastime"])
+    queue = "itk_demo_optoboard_queue_" + optoboardPosition
+    return _error_catcher(
+        softErrorCounterTask.apply_async((optoboardPosition,dev_olink_egrp,meastime),queue=queue).wait
+    )
+
 
 def softErrorScan():
     payload = request.get_json()
@@ -250,7 +261,7 @@ def softErrorScan():
     jump = int(payload["jump"])
     queue = "itk_demo_optoboard_queue_" + optoboardPosition
     return _error_catcher(
-        SOFTERRORSCAN_Task.apply_async(
+        softErrorScanTask.apply_async(
             (optoboardPosition, optical_link, felix_device, egroup, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump),
             queue=queue,
         ).wait
@@ -266,7 +277,7 @@ def BERT():
     meastime = int(payload["meastime"])
     queue = "itk_demo_optoboard_queue_" + optoboardPosition
     return _error_catcher(
-        BERT_Task.apply_async(
+        bertTask.apply_async(
             (optoboardPosition, device, channel, meastime),
             queue=queue,
         ).wait
@@ -346,16 +357,6 @@ def readLog():
         readLogTask.apply_async(queue="itk_demo_optoboard_queue").wait
     )
     
-def parallelsoftErrorCounter():
-    payload = request.get_json()
-    optoboardPosition = str(payload["optoboardPosition"])
-    dev_olink_egrp = list(payload["dev_olink_egrp"])
-    meastime = int(payload["meastime"])
-    queue = "itk_demo_optoboard_queue_" + optoboardPosition
-    return _error_catcher(
-        parallelsoftErrorCounterTask.apply_async((optoboardPosition,dev_olink_egrp,meastime),queue=queue).wait
-    )
-    
 def readLpgbtSupplyVoltage():
     payload = request.get_json()
     optoboardPosition = str(payload["optoboardPosition"])
diff --git a/api/itk_demo_optoboard/worker/celeryTasks.py b/api/itk_demo_optoboard/worker/celeryTasks.py
index d8235ee..a3f2c28 100644
--- a/api/itk_demo_optoboard/worker/celeryTasks.py
+++ b/api/itk_demo_optoboard/worker/celeryTasks.py
@@ -255,32 +255,27 @@ def configureAllTask():
             return "Configuration failed"
     return "Configuration completed"
 
-### task for PHASE SCAN
 
 @celery.task()
-def PHASESCAN_Task(optoboardPosition, device,eprx_group, bertmeastime):
-    PHASESCAN_result = eval('optoboard_dic["' + optoboardPosition + '"].' + device).bert_by_phase(eprx_group, bertmeastime, 6)
-    return PHASESCAN_result
+def phaseScanTask(optoboardPosition, device,eprx_group, bertmeastime):
+    phaseScan_result = eval('optoboard_dic["' + optoboardPosition + '"].' + device).bert_by_phase(eprx_group, bertmeastime, 6)
+    return phaseScan_result
 
-### task for SOFT ERROR COUNTER
 
-@celery.task()
-def SOFTERRORCOUNTER_Task(optoboardPosition, optical_link, felix_device, egroup, meastime, API=True, url="http://felix:8000"):
-    SOFTERRORCOUNTER_result = optoboard_dic[optoboardPosition].softErrorCounter(optical_link, felix_device, egroup, meastime, API, url)
-    return SOFTERRORCOUNTER_result
+'''@celery.task()
+def softErrorCounterTask(optoboardPosition, optical_link, felix_device, egroup, meastime, API=True, url="http://felix:8000"):
+    softErrorCounter_result = optoboard_dic[optoboardPosition].softErrorCounter(optical_link, felix_device, egroup, meastime, API, url)
+    return softErrorCounter_result'''
 
-### task for SOFT ERROR SCAN
 
 @celery.task()
-def SOFTERRORSCAN_Task(optoboardPosition, optical_link, felix_device, egroup, gbcr_name, meastime, filename="softErrorScan_result", plot=False, HFmin=0, HFmax=15, MFmin=0, MFmax=15, jump=1):
-    SOFTERRORSCAN_result = optoboard_dic[optoboardPosition].softErrorScan(optical_link, felix_device, egroup, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump)
-    return SOFTERRORSCAN_result
-
+def softErrorScanTask(optoboardPosition, optical_link, felix_device, egroup, gbcr_name, meastime, filename="softErrorScan_result", plot=False, HFmin=0, HFmax=15, MFmin=0, MFmax=15, jump=1):
+    softErrorScan_result = optoboard_dic[optoboardPosition].softErrorScan(optical_link, felix_device, egroup, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump)
+    return softErrorScan_result
 
-### task for BER test
 
 @celery.task()
-def BERT_Task(optoboardPosition, device, channel, meastime):
+def bertTask(optoboardPosition, device, channel, meastime):
     BERT_result = eval('optoboard_dic["' + optoboardPosition + '"].' + device).bert(channel, meastime, 6)
     return BERT_result
 
@@ -334,7 +329,7 @@ def dumpCustomRegConfigTask(optoboardPosition,filename):
     return "Finished!"
 
 @celery.task()
-def parallelsoftErrorCounterTask(optoboardPosition,dev_olink_egrp,meastime):
+def softErrorCounterTask(optoboardPosition,dev_olink_egrp,meastime):
     try:
         softerrors = optoboard_dic[optoboardPosition].parallelsoftErrorCounter(dev_olink_egrp,meastime)
         return softerrors
-- 
GitLab


From 2690d2bdcd6b7052f37eb39e1fb53825342ed748 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Mon, 4 Nov 2024 15:40:17 +0100
Subject: [PATCH 08/21] Changed RUN command formatting, added /results
 directory creation

---
 api/Dockerfile | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/api/Dockerfile b/api/Dockerfile
index 16a8548..b280ecb 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -1,13 +1,9 @@
-# FROM gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/containers/optoboard-container/optoboard-container:latest
 ARG OPTO_BASE_IMAGE
 FROM ${OPTO_BASE_IMAGE}
 
 ENV HOME="/root"
 WORKDIR ${HOME}
 
-# -- install from source: no longer needed
-# RUN git clone https://gitlab.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/${PROJECT}.git
-
 # -- pip install needs to be fixed.
 # RUN pip install git+https://gitlab.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard.git
 
@@ -16,16 +12,11 @@ SHELL ["/bin/bash", "--login", "-c"]
 COPY . .
 
 ### Installation with poetry
-RUN python3 -m pip install -U pip
-RUN python3 -m pip install 'python-dotenv<2.0.0' 'Flask-Cors<3.1.0' 'celery[redis]<6.0.0' 'connexion[swagger-ui]<3.0.0' 'gunicorn<21.0.0' 'PyAMQP<1.0.0' git+https://gitlab.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/pypi-packages/rcf-response.git
-RUN pip install pyconfigdb --index-url https://gitlab.cern.ch/api/v4/projects/180899/packages/pypi/simple
-RUN pip install alive-progress
-
-# RUN python3 -m pip install --no-cache-dir poetry==1.5.1 && \
-#     poetry config virtualenvs.create false && \
-#     poetry install
-# RUN poetry export --format=requirements.txt --output=requirements.txt --without-hashes
-# RUN python3 -m pip install -r requirements.txt
+RUN python3 -m pip install -U pip && \
+    python3 -m pip install 'python-dotenv<2.0.0' 'Flask-Cors<3.1.0' 'celery[redis]<6.0.0' 'connexion[swagger-ui]<3.0.0' 'gunicorn<21.0.0' 'PyAMQP<1.0.0' git+https://gitlab.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/pypi-packages/rcf-response.git && \
+    pip install pyconfigdb --index-url https://gitlab.cern.ch/api/v4/projects/180899/packages/pypi/simple && \
+    pip install alive-progress && \
+    mkdir /results
 
 COPY root /
 
-- 
GitLab


From 5516873490e43487e50579ee854985b447551435 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Thu, 7 Nov 2024 15:18:40 +0100
Subject: [PATCH 09/21] Change /usr-->/venv

---
 opto-base-image/Dockerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opto-base-image/Dockerfile b/opto-base-image/Dockerfile
index c931c60..c39702a 100644
--- a/opto-base-image/Dockerfile
+++ b/opto-base-image/Dockerfile
@@ -22,12 +22,12 @@ COPY lpgbt-com-build /root/lpgbt-com-build
 RUN dnf -y install pip git && \
     PYTHON_VERSION_SHORT=$(python3 --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2 | tr -d '.') && \
     machine_architecture=$(uname -m) && \
-    cp /root/lpgbt-com-build/lpgbtcom.cpython-${PYTHON_VERSION_SHORT}-${machine_architecture}-linux-gnu.so /usr/lib64/python3.9/site-packages/ && \
+    cp /root/lpgbt-com-build/lpgbtcom.cpython-${PYTHON_VERSION_SHORT}-${machine_architecture}-linux-gnu.so /venv/lib64/python3.9/site-packages/ && \
     cp /root/lpgbt-com-build/liblpgbt-com.so /felix-05-00-04-rm5-stand-alone/x86_64-el9-gcc13-opt/lib && \
     # cp /root/lpgbt-com-build/x86_64-el9-gcc13-opt/lib/lpgbtcom.so /usr/lib64/python3.9/site-packages/ && \
     # cp /root/lpgbt-com-build/x86_64-el9-gcc13-opt/lib/liblpgbt-com.so /felix-05-00-03-rm5-stand-alone/x86_64-el9-gcc13-opt/lib && \
     # cp /root/ic-over-netio-next-build/libitk_ic_over_netio_next.so /usr/lib64/python3.9/site-packages/ && \
-    cp /root/ic-over-netio-build/libic_comms.cpython-${PYTHON_VERSION_SHORT}-${machine_architecture}-linux-gnu.so /usr/lib64/python3.9/site-packages/
+    cp /root/ic-over-netio-build/libic_comms.cpython-${PYTHON_VERSION_SHORT}-${machine_architecture}-linux-gnu.so /venv/lib64/python3.9/site-packages/
 
 # environment variables
 
-- 
GitLab


From cb15f2282812a10fcfe610f42735a612c4a5406a Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 8 Nov 2024 14:46:44 +0100
Subject: [PATCH 10/21] Corrected API_IMAGE

---
 config                             | 2 --
 opto-base-image/docker-compose.yml | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/config b/config
index 76dce01..38b4aad 100755
--- a/config
+++ b/config
@@ -8,7 +8,6 @@ set_additional_envvars() {
   API_PORT=5009
   UI_HOSTPORT=5089
   OPTO_BASE_IMAGE=${GL_REGISTRY}/${GL_ROOTGROUP}/${GL_SUBGROUP}/itk-demo-optoboard/opto-base-image:latest
-  API_IMAGE=${GL_REGISTRY}/${GL_ROOTGROUP}/${GL_SUBGROUP}/itk-demo-optoboard/itk-demo-optoboard-api:latest
 
   # GL_PROJECTID=123155
   
@@ -33,7 +32,6 @@ write_additional_dotenv() {
   say "Additional ${1:-.}/.env"
 cat <<-EOF >> ${1:-.}/.env || true
 OPTO_BASE_IMAGE=${OPTO_BASE_IMAGE}
-API_IMAGE=${API_IMAGE}
 CONFIGDB_API_KEY=${CONFIGDB_API_KEY}
 RABBITMQ_IMAGE=${RABBITMQ_IMAGE}
 RABBITMQ_KEY=${RABBITMQ_KEY}
diff --git a/opto-base-image/docker-compose.yml b/opto-base-image/docker-compose.yml
index d7c253f..cf565ad 100644
--- a/opto-base-image/docker-compose.yml
+++ b/opto-base-image/docker-compose.yml
@@ -14,7 +14,7 @@ services:
       context: .
       dockerfile: Dockerfile
     container_name: optoboard-container
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/containers/optoboard-container/optoboard-container:latest
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/opto-base-image:latest
     environment:
       - PUID=1001
       - PGID=1001   
-- 
GitLab


From 254d4afe3b87fc2d61adfbf17bcb84911911e2e9 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 8 Nov 2024 15:35:17 +0100
Subject: [PATCH 11/21] Changed order so permissions set before starting
 service

---
 .../etc/s6-overlay/s6-rc.d/run-service/run    | 43 ++++++++++---------
 1 file changed, 23 insertions(+), 20 deletions(-)

diff --git a/api/root/etc/s6-overlay/s6-rc.d/run-service/run b/api/root/etc/s6-overlay/s6-rc.d/run-service/run
index f6edf40..62e2158 100755
--- a/api/root/etc/s6-overlay/s6-rc.d/run-service/run
+++ b/api/root/etc/s6-overlay/s6-rc.d/run-service/run
@@ -1,5 +1,28 @@
 #!/command/with-contenv bash
 
+# Noisy chown alias to handle read-only/remote volumes
+cat <<-EOF >/usr/bin/demiown
+#!/bin/bash
+chown "\$@" || printf '**** Permissions to $2 could not be set. This is probably because your volume mounts are remote or read-only. ****\n**** The app may not work properly. ****\n'
+EOF
+chmod +x /usr/bin/demiown
+
+cat <<-EOF >/usr/bin/demimod
+#!/bin/bash
+chmod "\$@" || printf '**** Permissions to $2 could not be set. This is probably because your volume mounts are remote or read-only. ****\n**** The app may not work properly. ****\n'
+EOF
+chmod +x /usr/bin/demimod
+
+demiown itk:itk /config
+demiown itk:itk /results
+demiown -R itk:itk /root
+demiown -R itk:itk /workspace
+
+demimod 775 /config
+demimod 775 /results
+demimod -R 775 /root
+demimod -R 775 /workspace
+
 echo "-------------------------------------------------------------------"
 echo "Changing pwd to /root"
 cd /root
@@ -25,23 +48,3 @@ else
     exit 1
 fi
 
-# Noisy chown alias to handle read-only/remote volumes
-cat <<-EOF >/usr/bin/demiown
-#!/bin/bash
-chown "\$@" || printf '**** Permissions to $2 could not be set. This is probably because your volume mounts are remote or read-only. ****\n**** The app may not work properly. ****\n'
-EOF
-chmod +x /usr/bin/demiown
-
-cat <<-EOF >/usr/bin/demimod
-#!/bin/bash
-chmod "\$@" || printf '**** Permissions to $2 could not be set. This is probably because your volume mounts are remote or read-only. ****\n**** The app may not work properly. ****\n'
-EOF
-chmod +x /usr/bin/demimod
-
-demiown itk:itk /config
-demiown itk:itk /results
-demiown -R itk:itk /root
-
-demimod 775 /config
-demimod 775 /results
-demimod -R 775 /root
-- 
GitLab


From e0f75d2d2cd6a713abde916d3b93e9ad39051065 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 8 Nov 2024 16:19:47 +0100
Subject: [PATCH 12/21] Add DEMI_ADD_ITK_USER

---
 example/docker-compose.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 example/docker-compose.yml

diff --git a/example/docker-compose.yml b/example/docker-compose.yml
old mode 100644
new mode 100755
index 505f992..ae862f3
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -18,6 +18,7 @@ services:
       - API_WORKERS=4
       - PUID=${PUID}
       - PGID=${PGID}
+      - DEMI_ADD_ITK_USER=1
       - SR_URL=http://${HOST}:5111/api
       - RUNKEY_UI_URL_KEY=demi/${STACK}/itk-demo-configdb/runkey-ui/url
     labels:
@@ -47,11 +48,12 @@ services:
       - WORKSPACE=/workspace
       - PUID=${PUID}
       - PGID=${PGID}
+      - DEMI_ADD_ITK_USER=1
       - TX_PORT=12340
       - RX_PORT=12350
       - TX_TAG=17
       - INTERFACE=optoboard-worker # use the name of the optoboard worker container (or its IP address) when using lpgbt-com, the same but for the felix container for ic-over-netio; else provide IP address
-      - RX_TAG=29
+      - RX_TAG=25
       - SR_URL=http://${HOST}:5111/api
       - FLX_URL_KEY=demi/${STACK}/itk-demo-optoboard/felix/url
       - RUNKEY_UI_URL_KEY=demi/${STACK}/itk-demo-configdb/runkey-ui/url
-- 
GitLab


From d69e8a636c2fb739ccb602d7ab28bd5b0aa58073 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 8 Nov 2024 16:29:47 +0100
Subject: [PATCH 13/21] if/else for changing permission of /workspace (both run
 and finish)

---
 api/root/etc/s6-overlay/s6-rc.d/run-service/run | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/api/root/etc/s6-overlay/s6-rc.d/run-service/run b/api/root/etc/s6-overlay/s6-rc.d/run-service/run
index 62e2158..551cea4 100755
--- a/api/root/etc/s6-overlay/s6-rc.d/run-service/run
+++ b/api/root/etc/s6-overlay/s6-rc.d/run-service/run
@@ -16,7 +16,16 @@ chmod +x /usr/bin/demimod
 demiown itk:itk /config
 demiown itk:itk /results
 demiown -R itk:itk /root
-demiown -R itk:itk /workspace
+
+ITK_UID=$(id -u itk)
+
+# Check if the UID is different from 1111
+if [ "$ITK_UID" -ne 1111 ]; then
+    echo "Taking posession of /workspace with 'itk' UID $ITK_UID."
+    demiown -R itk:itk /workspace
+else
+    echo "The user 'itk' has UID 1111, meaning it is probably not cloning your local UID."
+fi
 
 demimod 775 /config
 demimod 775 /results
-- 
GitLab


From 2c7480629d0bb249a12aa153034e905149120a71 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Tue, 12 Nov 2024 10:18:50 +0100
Subject: [PATCH 14/21] YARR bus volume corrected

---
 example/docker-compose.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index ae862f3..78c71d7 100755
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -327,7 +327,7 @@ services:
     volumes:
       - ./configs:/configs
       - ./data:/data
-      - /tmp/bus:/bus
+      - ${PWD}/.shared_volumes/bus:/bus:/bus
     networks:
       - deminet
     working_dir: /workspace
-- 
GitLab


From dd8ddd3f41dabba357ba7a9c67443570110612ac Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Tue, 12 Nov 2024 11:28:35 +0100
Subject: [PATCH 15/21] Minor

---
 example/docker-compose.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index 78c71d7..82e9860 100755
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -327,7 +327,7 @@ services:
     volumes:
       - ./configs:/configs
       - ./data:/data
-      - ${PWD}/.shared_volumes/bus:/bus:/bus
+      - ${PWD}/.shared_volumes/bus:/bus
     networks:
       - deminet
     working_dir: /workspace
-- 
GitLab


From 8ee734a57418a1fb8d601d3aedb6be1d72734147 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Thu, 14 Nov 2024 17:44:35 +0100
Subject: [PATCH 16/21] Moved pyconfigdb installation: api --> opto-base-image

---
 api/Dockerfile             | 2 --
 opto-base-image/Dockerfile | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/api/Dockerfile b/api/Dockerfile
index b280ecb..2e4c3c3 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -14,8 +14,6 @@ COPY . .
 ### Installation with poetry
 RUN python3 -m pip install -U pip && \
     python3 -m pip install 'python-dotenv<2.0.0' 'Flask-Cors<3.1.0' 'celery[redis]<6.0.0' 'connexion[swagger-ui]<3.0.0' 'gunicorn<21.0.0' 'PyAMQP<1.0.0' git+https://gitlab.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/pypi-packages/rcf-response.git && \
-    pip install pyconfigdb --index-url https://gitlab.cern.ch/api/v4/projects/180899/packages/pypi/simple && \
-    pip install alive-progress && \
     mkdir /results
 
 COPY root /
diff --git a/opto-base-image/Dockerfile b/opto-base-image/Dockerfile
index c39702a..65f5ac1 100644
--- a/opto-base-image/Dockerfile
+++ b/opto-base-image/Dockerfile
@@ -20,6 +20,7 @@ COPY lpgbt-com-build /root/lpgbt-com-build
 
 
 RUN dnf -y install pip git && \
+    pip install pyconfigdb==2.3.3 --index-url https://gitlab.cern.ch/api/v4/groups/33370/-/packages/pypi/simple && \
     PYTHON_VERSION_SHORT=$(python3 --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2 | tr -d '.') && \
     machine_architecture=$(uname -m) && \
     cp /root/lpgbt-com-build/lpgbtcom.cpython-${PYTHON_VERSION_SHORT}-${machine_architecture}-linux-gnu.so /venv/lib64/python3.9/site-packages/ && \
-- 
GitLab


From 959f52ec769e5876250a2fb5f0b1d58ca9bb1053 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Thu, 14 Nov 2024 18:05:41 +0100
Subject: [PATCH 17/21] Removed hardcoded pyconfigdb version

---
 opto-base-image/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opto-base-image/Dockerfile b/opto-base-image/Dockerfile
index 65f5ac1..a89f0ee 100644
--- a/opto-base-image/Dockerfile
+++ b/opto-base-image/Dockerfile
@@ -20,7 +20,7 @@ COPY lpgbt-com-build /root/lpgbt-com-build
 
 
 RUN dnf -y install pip git && \
-    pip install pyconfigdb==2.3.3 --index-url https://gitlab.cern.ch/api/v4/groups/33370/-/packages/pypi/simple && \
+    pip install pyconfigdb --index-url https://gitlab.cern.ch/api/v4/groups/33370/-/packages/pypi/simple && \
     PYTHON_VERSION_SHORT=$(python3 --version 2>&1 | awk '{print $2}' | cut -d '.' -f 1,2 | tr -d '.') && \
     machine_architecture=$(uname -m) && \
     cp /root/lpgbt-com-build/lpgbtcom.cpython-${PYTHON_VERSION_SHORT}-${machine_architecture}-linux-gnu.so /venv/lib64/python3.9/site-packages/ && \
-- 
GitLab


From 591b18f8fc677017cc0f381f485e31c87ac97bd4 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 15 Nov 2024 15:48:12 +0100
Subject: [PATCH 18/21] Added application/json section to /eyeMonitorDiagram
 endpoint

---
 api/itk_demo_optoboard/api/openapi/openapi.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/api/itk_demo_optoboard/api/openapi/openapi.yaml b/api/itk_demo_optoboard/api/openapi/openapi.yaml
index 44cf09d..b2a17c5 100644
--- a/api/itk_demo_optoboard/api/openapi/openapi.yaml
+++ b/api/itk_demo_optoboard/api/openapi/openapi.yaml
@@ -656,6 +656,10 @@ paths:
       responses:
         200:
           description: XY values of diagram and DC offset
+          content:
+            application/json:
+              schema:
+                type: object
 
 
   /setLpgbtPhase:
-- 
GitLab


From 950f68dc5464747178dba86080b3c3d43b5ed23e Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 15 Nov 2024 17:09:04 +0100
Subject: [PATCH 19/21] Modified /softErrorScan function to reflect changes
 made in optoboard_felix

---
 .../api/openapi/openapi.yaml                  | 36 +++++++++----------
 api/itk_demo_optoboard/api/routes.py          |  7 ++--
 api/itk_demo_optoboard/worker/celeryTasks.py  | 20 ++++++-----
 3 files changed, 30 insertions(+), 33 deletions(-)

diff --git a/api/itk_demo_optoboard/api/openapi/openapi.yaml b/api/itk_demo_optoboard/api/openapi/openapi.yaml
index b2a17c5..a16d241 100644
--- a/api/itk_demo_optoboard/api/openapi/openapi.yaml
+++ b/api/itk_demo_optoboard/api/openapi/openapi.yaml
@@ -328,12 +328,12 @@ paths:
 
   /softErrorScan:
     post:
-      summary: Performs a soft error scan
-      description: Perform a 2D soft error scan as a function of the parameters of the equalizer of the GBCR.
+      summary: Performs a soft error scan on one link or multiple links of the same device
+      description: Perform a 2D soft error scan as a function of the parameters of the equalizer of the GBCR, for one link or for multiple links on the same device
       x-openapi-router-controller: itk_demo_optoboard.api.routes
       operationId: softErrorScan
       requestBody:
-        description: JSON serialized object containing the parameters of the bert script
+        description: JSON serialized object containing soft error scan parameters
         content:
           application/json:
             schema:
@@ -343,18 +343,13 @@ paths:
                   type: string
                   example: "OB0"
                   description: Optoboard position
-                optical_link:
-                  type: string
-                  example: "00"
-                  description: optical link to monitor
-                felix_device:
-                  type: string
-                  example: "0"
-                  description: Felix device in use
-                egroup:
-                  type: string
-                  example: "00"
-                  description: egroup to monitor
+                dev_olink_egrp:
+                  description: A combination of FELIX device, optical link and egroup
+                  type: array
+                  items:
+                    type: string
+                  minItems: 1
+                  example: ["0_00_1"]
                 gbcr_name:
                   type: string
                   example: "gbcr1"
@@ -392,9 +387,7 @@ paths:
                   example: "1"
                   description: level of detail of the scan of the GBCR parameters (default 1)
               required:
-                - optical_link
-                - felix_device 
-                - egroup
+                - dev_olink_egrp
                 - gbcr_name
                 - meastime
                 - filename
@@ -584,10 +577,13 @@ paths:
                 meastime:
                   type: string
                   example: "10"
-                  description: Length of the soft error test              
+                  description: Length of the soft error test  
+              required:
+                - dev_olink_egrp
+                - meastime
       responses:
         200:
-          description: JSON serialized object containing the status of the optoboard microservice
+          description: JSON serialized object containing the filename, DC offset
           content:
             application/json:
               schema:
diff --git a/api/itk_demo_optoboard/api/routes.py b/api/itk_demo_optoboard/api/routes.py
index d4ad6b3..e73cf1c 100644
--- a/api/itk_demo_optoboard/api/routes.py
+++ b/api/itk_demo_optoboard/api/routes.py
@@ -60,7 +60,6 @@ def modifyOptoGUIConf():
 
 def writeRegister():
     payload = request.get_json()
-
     optoboardPosition = str(payload["optoboardPosition"])
     device = str(payload["device"])
     register = str(payload["register"])
@@ -247,9 +246,7 @@ def softErrorCounter():
 def softErrorScan():
     payload = request.get_json()
     optoboardPosition = str(payload["optoboardPosition"])
-    optical_link = str(payload["optical_link"])
-    felix_device = int(payload["felix_device"])
-    egroup = int(payload["egroup"])
+    dev_olink_egrp = list(payload["dev_olink_egrp"])
     gbcr_name = str(payload["gbcr_name"])
     meastime = int(payload["meastime"])
     filename = str(payload["filename"])
@@ -262,7 +259,7 @@ def softErrorScan():
     queue = "itk_demo_optoboard_queue_" + optoboardPosition
     return _error_catcher(
         softErrorScanTask.apply_async(
-            (optoboardPosition, optical_link, felix_device, egroup, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump),
+            (optoboardPosition, dev_olink_egrp, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump),
             queue=queue,
         ).wait
     )
diff --git a/api/itk_demo_optoboard/worker/celeryTasks.py b/api/itk_demo_optoboard/worker/celeryTasks.py
index a3f2c28..a4dd5e9 100644
--- a/api/itk_demo_optoboard/worker/celeryTasks.py
+++ b/api/itk_demo_optoboard/worker/celeryTasks.py
@@ -269,10 +269,14 @@ def softErrorCounterTask(optoboardPosition, optical_link, felix_device, egroup,
 
 
 @celery.task()
-def softErrorScanTask(optoboardPosition, optical_link, felix_device, egroup, gbcr_name, meastime, filename="softErrorScan_result", plot=False, HFmin=0, HFmax=15, MFmin=0, MFmax=15, jump=1):
-    softErrorScan_result = optoboard_dic[optoboardPosition].softErrorScan(optical_link, felix_device, egroup, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump)
-    return softErrorScan_result
-
+def softErrorScanTask(optoboardPosition, dev_olink_egrp, gbcr_name, meastime, filename="softErrorScan_result", plot=False, HFmin=0, HFmax=15, MFmin=0, MFmax=15, jump=1):
+    try:
+        softErrorScan_result = optoboard_dic[optoboardPosition].softErrorScan(dev_olink_egrp, gbcr_name, meastime, filename, plot, HFmin, HFmax, MFmin, MFmax, jump)
+        return softErrorScan_result
+    except Exception as e:
+        logger.error("Task terminated due to exception: " + str(e))
+        return "Could not perform soft error scan!"
+    return "Soft error scan files created!"
 
 @celery.task()
 def bertTask(optoboardPosition, device, channel, meastime):
@@ -322,7 +326,7 @@ def configureI2CControllerTask(optoboardPosition, device):
 @celery.task()
 def dumpCustomRegConfigTask(optoboardPosition,filename):
     try:
-        optoboard_dic[optoboardPosition].dump_opto_config(str(filename))
+        optoboard_dic[optoboardPosition].dump_opto_config(filename)
     except Exception as e:
             logger.error("Task terminated due to exception: " + str(e))
             return "Could not create configuration file!"
@@ -331,7 +335,7 @@ def dumpCustomRegConfigTask(optoboardPosition,filename):
 @celery.task()
 def softErrorCounterTask(optoboardPosition,dev_olink_egrp,meastime):
     try:
-        softerrors = optoboard_dic[optoboardPosition].parallelsoftErrorCounter(dev_olink_egrp,meastime)
+        softerrors = optoboard_dic[optoboardPosition].softErrorCounter(dev_olink_egrp,meastime)
         return softerrors
     except Exception as e:
         logger.error("Task terminated due to exception: " + str(e))
@@ -349,8 +353,8 @@ def readSupplyVoltageTask(optoboardPosition, device, monitor_channel):
 @celery.task()
 def eyeMonitorDiagramTask(optoboardPosition, device, meastime, filename):
     try:
-        EMDresult = eval('optoboard_dic["' + optoboardPosition + '"].' + device).eye_opening_monitor(meastime,filename)
-        return EMDresult
+        emd = eval('optoboard_dic["' + optoboardPosition + '"].' + device).eye_opening_monitor(meastime,filename)
+        return emd
     except Exception as e:
         logger.error("Task terminated due to exception: " + str(e))
         return "Could not produce eye monitior diagram for " + device + "!"
-- 
GitLab


From 243b249dd4242864119bd9ed262ba6431c746535 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Fri, 15 Nov 2024 17:10:55 +0100
Subject: [PATCH 20/21] Changed API/UI/worker image to demi-7 in preparation
 for tag

---
 example/docker-compose.yml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index 82e9860..558c2ce 100755
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -5,7 +5,7 @@ networks:
 
 services:
   api:
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:latest
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:demi-7
     container_name: optoboard-api
     depends_on:
       - worker
@@ -35,7 +35,7 @@ services:
       - deminet
 
   worker:
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:latest
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-api:demi-7
     container_name: optoboard-worker
     depends_on:
       - rabbitmq
@@ -53,7 +53,7 @@ services:
       - RX_PORT=12350
       - TX_TAG=17
       - INTERFACE=optoboard-worker # use the name of the optoboard worker container (or its IP address) when using lpgbt-com, the same but for the felix container for ic-over-netio; else provide IP address
-      - RX_TAG=25
+      - RX_TAG=29
       - SR_URL=http://${HOST}:5111/api
       - FLX_URL_KEY=demi/${STACK}/itk-demo-optoboard/felix/url
       - RUNKEY_UI_URL_KEY=demi/${STACK}/itk-demo-configdb/runkey-ui/url
@@ -95,7 +95,7 @@ services:
 
   ui:
     build: .
-    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-ui:latest
+    image: gitlab-registry.cern.ch/atlas-itk-pixel-systemtest/itk-demo-sw/itk-demo-optoboard/itk-demo-optoboard-ui:demi-7
     container_name: optoboard-ui
     ports:
       - 5089:80
@@ -328,9 +328,9 @@ services:
       - ./configs:/configs
       - ./data:/data
       - ${PWD}/.shared_volumes/bus:/bus
+      - ${PWD}:/workspace
     networks:
       - deminet
-    working_dir: /workspace
     labels:
       - demi.${USER}.itk-demo-optoboard.yarr.host=${HOST}
       - demi.${USER}.itk-demo-optoboard.yarr.description=yarr
-- 
GitLab


From fc6751ee1a7fbd926151ca25029d3591c5d8ba50 Mon Sep 17 00:00:00 2001
From: Daniele Dal Santo <dal.santo.daniele@cern.ch>
Date: Mon, 18 Nov 2024 10:02:14 +0100
Subject: [PATCH 21/21] Now includes demi-7

---
 CHANGELOG.md | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 21ea4e0..783f537 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
 # Changelog
 
+## demi-7 tag
+*optoboard_felix-1.0.47*
+- Compatible with FELIX FW 5.0 and SW 05-00-04
+- optoboard.log ownership issue fixed
+- New endpoint for eye monitoring diagram with DC offset (or bias) calculation
+- Reorganisation of soft error endpoints - now two endpoints for counter and scan that can be used on either single or multiple links
+    - In the case of scans, the links must come from the same device
+
 ## demi-6 tag
 *optoboard-felix-1.0.43*
 - Configdb included in itk-demo-optoboard. Possibility to use it or not.
-- 
GitLab