From 24e3d169b826eeff6b9a77bd0f109416c7001200 Mon Sep 17 00:00:00 2001
From: Andreas Persson <andreas.persson@ess.eu>
Date: Fri, 1 Jul 2022 14:23:51 +0200
Subject: [PATCH] caensyproxy: Remove scripts from boolean buttons and slide
 buttons

Can't set border color on such widgets
---
 99-Shared/caensyproxy/HV/HV_channel_light.bob | 18 +++-----
 .../caensyproxy/HV/HV_channel_light_more.bob  | 44 +++++++------------
 99-Shared/caensyproxy/LV/LV_A2519_board.bob   | 40 +++++------------
 99-Shared/caensyproxy/LV/LV_channel.bob       |  6 ---
 .../scripts/compare_value_and_rb.js           |  4 +-
 5 files changed, 35 insertions(+), 77 deletions(-)

diff --git a/99-Shared/caensyproxy/HV/HV_channel_light.bob b/99-Shared/caensyproxy/HV/HV_channel_light.bob
index 75d7b79..bdb7ea3 100644
--- a/99-Shared/caensyproxy/HV/HV_channel_light.bob
+++ b/99-Shared/caensyproxy/HV/HV_channel_light.bob
@@ -168,7 +168,7 @@
     <x>642</x>
     <y>2</y>
     <width>62</width>
-    <height>13</height>
+    <height>12</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -250,7 +250,7 @@
     <x>629</x>
     <y>22</y>
     <width>68</width>
-    <height>13</height>
+    <height>12</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -336,7 +336,7 @@
     <x>439</x>
     <y>13</y>
     <width>38</width>
-    <height>13</height>
+    <height>12</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -472,7 +472,7 @@
     <x>184</x>
     <y>22</y>
     <width>72</width>
-    <height>13</height>
+    <height>12</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -499,7 +499,7 @@
     <x>184</x>
     <y>2</y>
     <width>58</width>
-    <height>13</height>
+    <height>12</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -556,19 +556,13 @@
     </off_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
   </widget>
   <widget type="label" version="2.0.0">
     <text>on/off</text>
     <x>96</x>
     <y>1</y>
     <width>29</width>
-    <height>13</height>
+    <height>12</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
diff --git a/99-Shared/caensyproxy/HV/HV_channel_light_more.bob b/99-Shared/caensyproxy/HV/HV_channel_light_more.bob
index 8776882..6843c6d 100644
--- a/99-Shared/caensyproxy/HV/HV_channel_light_more.bob
+++ b/99-Shared/caensyproxy/HV/HV_channel_light_more.bob
@@ -21,7 +21,7 @@
     <text>internal trip</text>
     <x>661</x>
     <width>59</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -49,7 +49,7 @@
     <x>661</x>
     <y>20</y>
     <width>80</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -125,7 +125,7 @@
     <text>external disable</text>
     <x>535</x>
     <width>80</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -153,7 +153,7 @@
     <x>535</x>
     <y>20</y>
     <width>62</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -180,7 +180,7 @@
     <text>UNDERVOLTAGE condition</text>
     <x>343</x>
     <width>132</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -257,7 +257,7 @@
     <x>169</x>
     <y>22</y>
     <width>124</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -285,7 +285,7 @@
     <x>169</x>
     <y>2</y>
     <width>125</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -313,7 +313,7 @@
     <x>6</x>
     <y>22</y>
     <width>62</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -341,7 +341,7 @@
     <x>6</x>
     <y>2</y>
     <width>59</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -378,12 +378,6 @@
     </off_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
   </widget>
   <widget type="led" version="2.0.0">
     <name>SY4527_20</name>
@@ -412,7 +406,7 @@
     <text>Restore conf after power on</text>
     <x>1164</x>
     <width>139</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -449,12 +443,6 @@
     </off_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
   </widget>
   <widget type="led" version="2.0.0">
     <name>SY4527_22</name>
@@ -484,7 +472,7 @@
     <x>1164</x>
     <y>18</y>
     <width>112</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -545,7 +533,7 @@
     <x>330</x>
     <y>22</y>
     <width>20</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -623,7 +611,7 @@
     <x>799</x>
     <y>1</y>
     <width>53</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -676,7 +664,7 @@
     <x>799</x>
     <y>18</y>
     <width>90</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -703,7 +691,7 @@
     <text>over voltage protection</text>
     <x>948</x>
     <width>117</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -731,7 +719,7 @@
     <x>948</x>
     <y>18</y>
     <width>49</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
diff --git a/99-Shared/caensyproxy/LV/LV_A2519_board.bob b/99-Shared/caensyproxy/LV/LV_A2519_board.bob
index 95af5ff..d375d32 100644
--- a/99-Shared/caensyproxy/LV/LV_A2519_board.bob
+++ b/99-Shared/caensyproxy/LV/LV_A2519_board.bob
@@ -83,7 +83,7 @@ $(pv_value)</tooltip>
     <x>62</x>
     <y>323</y>
     <width>95</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -111,7 +111,7 @@ $(pv_value)</tooltip>
     <x>62</x>
     <y>354</y>
     <width>96</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -139,7 +139,7 @@ $(pv_value)</tooltip>
     <x>68</x>
     <y>237</y>
     <width>46</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -167,7 +167,7 @@ $(pv_value)</tooltip>
     <x>285</x>
     <y>237</y>
     <width>46</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -196,7 +196,7 @@ $(pv_value)</tooltip>
     <x>6</x>
     <y>6</y>
     <width>292</width>
-    <height>30</height>
+    <height>32</height>
     <font use_class="true">
       <font name="Header 2" family="Source Sans Pro" style="BOLD_ITALIC" size="21.0">
       </font>
@@ -232,12 +232,6 @@ $(pv_value)</tooltip>
     </off_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
   </widget>
   <widget type="slide_button" version="2.0.0">
     <pv_name>${P}${R}IntckA</pv_name>
@@ -253,12 +247,6 @@ $(pv_value)</tooltip>
     </off_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
   </widget>
   <widget type="label" version="2.0.0">
     <name>Label Template_86</name>
@@ -266,7 +254,7 @@ $(pv_value)</tooltip>
     <x>193</x>
     <y>290</y>
     <width>27</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -294,7 +282,7 @@ $(pv_value)</tooltip>
     <x>180</x>
     <y>260</y>
     <width>50</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -322,7 +310,7 @@ $(pv_value)</tooltip>
     <x>154</x>
     <y>220</y>
     <width>96</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -482,7 +470,7 @@ $(pv_value)</tooltip>
     <x>24</x>
     <y>36</y>
     <width>63</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -510,7 +498,7 @@ $(pv_value)</tooltip>
     <x>150</x>
     <y>387</y>
     <width>95</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
@@ -576,12 +564,6 @@ $(pv_value)</tooltip>
     </background_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
     <mode>1</mode>
     <confirm_message>Are you sure you want to do this?</confirm_message>
   </widget>
@@ -616,7 +598,7 @@ $(pv_value)</tooltip>
     <x>261</x>
     <y>37</y>
     <width>63</width>
-    <height>12</height>
+    <height>13</height>
     <font>
       <font name="Small" family="OpenSans" style="REGULAR" size="9.900990099009901">
       </font>
diff --git a/99-Shared/caensyproxy/LV/LV_channel.bob b/99-Shared/caensyproxy/LV/LV_channel.bob
index 9d4707b..884ed26 100644
--- a/99-Shared/caensyproxy/LV/LV_channel.bob
+++ b/99-Shared/caensyproxy/LV/LV_channel.bob
@@ -56,12 +56,6 @@
     </off_color>
     <actions>
     </actions>
-    <scripts>
-      <script file="../scripts/compare_value_and_rb.js">
-        <pv_name>$(pv_name)</pv_name>
-        <pv_name>$(pv_name)-RB</pv_name>
-      </script>
-    </scripts>
   </widget>
   <widget type="label" version="2.0.0">
     <name>Label Template_34</name>
diff --git a/99-Shared/caensyproxy/scripts/compare_value_and_rb.js b/99-Shared/caensyproxy/scripts/compare_value_and_rb.js
index 4203a8b..fe4b9ab 100644
--- a/99-Shared/caensyproxy/scripts/compare_value_and_rb.js
+++ b/99-Shared/caensyproxy/scripts/compare_value_and_rb.js
@@ -11,11 +11,11 @@ var value_rb    = Math.round(PVUtil.getDouble(pvs[1]), ROUND_PREC); 	// read-bac
 
 if(value != value_rb){
 	// widget.setPropertyValue("border_style",1); // line style
-	widget.setPropertyValue("border_color","Major");
+	widget.setPropertyValue("border_color", ColorFontUtil.getColorFromRGB(252,13,17));
 	// ConsoleUtil.writeInfo("error RB");
 }
 else {
         // widget.setPropertyValue("border_style",3); // lowered style
-	widget.setPropertyValue("border_color",ColorFontUtil.getColorFromRGB(0,255,255));
+	widget.setPropertyValue("border_color", ColorFontUtil.getColorFromRGB(0,255,255));
 	// ConsoleUtil.writeInfo("ok");
 }
-- 
GitLab