From dd9c09930132ceb89e114308238434a46f3db438 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kriszti=C3=A1n=20L=C3=B6ki?= <krisztian.loki@ess.eu>
Date: Thu, 2 Apr 2020 12:02:57 +0200
Subject: [PATCH] Use combobox for calibration file name

---
 .../TS2/ts2-cryomodule/cabtr/cabtr_te.bob     | 20 ++++++++++++++++++-
 .../ts2-cryomodule/cabtr/fill_calib_files.py  |  8 ++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 NON-APPROVED/TS2/ts2-cryomodule/cabtr/fill_calib_files.py

diff --git a/NON-APPROVED/TS2/ts2-cryomodule/cabtr/cabtr_te.bob b/NON-APPROVED/TS2/ts2-cryomodule/cabtr/cabtr_te.bob
index aa01b8ec..899dd1b9 100644
--- a/NON-APPROVED/TS2/ts2-cryomodule/cabtr/cabtr_te.bob
+++ b/NON-APPROVED/TS2/ts2-cryomodule/cabtr/cabtr_te.bob
@@ -272,12 +272,30 @@
     <horizontal_alignment>2</horizontal_alignment>
     <vertical_alignment>1</vertical_alignment>
   </widget>
-  <widget type="textentry" version="3.0.0">
+  <widget type="combo" version="2.0.0">
     <name>CurveFileS</name>
     <pv_name>$(DEVICE):CurveFileS</pv_name>
     <x>126</x>
     <y>300</y>
     <width>150</width>
+    <height>20</height>
+    <background_color>
+      <color name="Write_Background" red="224" green="217" blue="202">
+      </color>
+    </background_color>
+    <actions>
+      <action type="write_pv">
+        <pv_name>$(CONTROLLER):CalibRereadCmd</pv_name>
+        <value>1</value>
+        <description>Reread calibration files list</description>
+      </action>
+    </actions>
+    <scripts>
+      <script file="fill_calib_files.py">
+        <pv_name>$(CONTROLLER):CalibFiles-RB</pv_name>
+      </script>
+    </scripts>
+    <items_from_pv>false</items_from_pv>
   </widget>
   <widget type="textupdate" version="2.0.0">
     <name>CurveFile-RB</name>
diff --git a/NON-APPROVED/TS2/ts2-cryomodule/cabtr/fill_calib_files.py b/NON-APPROVED/TS2/ts2-cryomodule/cabtr/fill_calib_files.py
new file mode 100644
index 00000000..89474e15
--- /dev/null
+++ b/NON-APPROVED/TS2/ts2-cryomodule/cabtr/fill_calib_files.py
@@ -0,0 +1,8 @@
+from org.csstudio.display.builder.runtime.script import PVUtil
+import java.util.ArrayList as ArrayList
+
+items = PVUtil.getStringArray(pvs[0])
+arraylist = ArrayList(len(items))
+for item in items:
+    arraylist.add(item)
+widget.setItems(arraylist)
-- 
GitLab