From badfad6a1ad8767b8510c8a932122b465baaed8f Mon Sep 17 00:00:00 2001
From: Benjamin Bolling <benjaminbolling@ci0021286.esss.lu.se>
Date: Wed, 12 Feb 2020 07:53:07 +0100
Subject: [PATCH] fixed the horizontal center-line for the BPM widget in PBI.
 began making the beam transmission window in PBI, supports selection of and
 showing the beam charge from 2 BCM:s but not yet the transmission. It either
 has to be calculated in the OPI or in a soft-IOC with the latter being the
 preferred method.

---
 .../EmbedddedWindows/em_BCM_rr.bob            |   2 +-
 .../wdg-bpm_traj_widget_MEBT.bob              |  35 ++-
 .../collectedOPIs_01_beamsettings.bob         |   8 +-
 .../collectedOPIs_01_diagnostics.bob          | 269 +++++++++++++++---
 4 files changed, 255 insertions(+), 59 deletions(-)

diff --git a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/em_BCM_rr.bob b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/em_BCM_rr.bob
index 4a0dd8c2..d764c67d 100644
--- a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/em_BCM_rr.bob
+++ b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/em_BCM_rr.bob
@@ -36,7 +36,7 @@
   </widget>
   <widget type="tank" version="2.0.0">
     <name>BCM_2</name>
-    <pv_name>$(PV_name)$(PV_name)</pv_name>
+    <pv_name>$(PV_name)</pv_name>
     <width>70</width>
     <height>140</height>
     <fill_color>
diff --git a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/wdg-bpm_traj_widget_MEBT.bob b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/wdg-bpm_traj_widget_MEBT.bob
index 8948f286..6d0ea0e3 100644
--- a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/wdg-bpm_traj_widget_MEBT.bob
+++ b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/EmbedddedWindows/wdg-bpm_traj_widget_MEBT.bob
@@ -84,6 +84,23 @@
       </y_axis>
     </y_axes>
     <traces>
+      <trace>
+        <name>Line</name>
+        <x_pv></x_pv>
+        <y_pv>loc://posYbpms5(0,0,0,0,0,0,0,0,0,0)</y_pv>
+        <err_pv></err_pv>
+        <axis>0</axis>
+        <trace_type>1</trace_type>
+        <color>
+          <color red="255" green="0" blue="0">
+          </color>
+        </color>
+        <line_width>2</line_width>
+        <line_style>0</line_style>
+        <point_type>0</point_type>
+        <point_size>10</point_size>
+        <visible>true</visible>
+      </trace>
       <trace>
         <name></name>
         <x_pv>=1</x_pv>
@@ -358,22 +375,4 @@
       </trace>
     </traces>
   </widget>
-  <widget type="polyline" version="2.0.0">
-    <name>Polyline</name>
-    <x>23</x>
-    <y>271</y>
-    <width>1336</width>
-    <height>1</height>
-    <line_width>2</line_width>
-    <line_color>
-      <color name="RED-BORDER" red="150" green="8" blue="16">
-      </color>
-    </line_color>
-    <points>
-      <point x="0.0" y="0.0">
-      </point>
-      <point x="1335.9999999999995" y="0.0">
-      </point>
-    </points>
-  </widget>
 </display>
diff --git a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_beamsettings.bob b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_beamsettings.bob
index 2b940dee..7e6b5cc7 100644
--- a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_beamsettings.bob
+++ b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_beamsettings.bob
@@ -711,13 +711,13 @@ Used for fast scans to rapidly determine/verify RF setpoints.</tooltip>
     <x>2040</x>
     <y>250</y>
     <width>380</width>
-    <height>380</height>
+    <height>350</height>
     <style>3</style>
     <transparent>true</transparent>
     <widget type="rectangle" version="2.0.0">
       <name>MGGrey03-background_17</name>
       <width>380</width>
-      <height>380</height>
+      <height>350</height>
       <line_width>2</line_width>
       <line_color>
         <color name="GROUP-BORDER" red="150" green="155" blue="151">
@@ -752,13 +752,13 @@ Used for fast scans to rapidly determine/verify RF setpoints.</tooltip>
     <x>1050</x>
     <y>290</y>
     <width>520</width>
-    <height>340</height>
+    <height>310</height>
     <style>3</style>
     <transparent>true</transparent>
     <widget type="rectangle" version="2.0.0">
       <name>MGGrey03-background_14</name>
       <width>520</width>
-      <height>340</height>
+      <height>310</height>
       <line_width>2</line_width>
       <line_color>
         <color name="GROUP-BORDER" red="150" green="155" blue="151">
diff --git a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_diagnostics.bob b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_diagnostics.bob
index 1e4b5e7a..c0d4fac7 100644
--- a/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_diagnostics.bob
+++ b/NON-APPROVED/COMMON/OPERATOR-OVERVIEW-OPIS/collectedOPIs_01_diagnostics.bob
@@ -1,11 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <display version="2.0.0">
   <name>PBI</name>
+  <class></class>
   <macros>
+    <A2TBCM01>A2T-010LWU:PBI-BCM-001</A2TBCM01>
     <BCMfile>./EmbedddedWindows/em_BCM_rr.bob</BCMfile>
+    <DTLBCM01>DTL-010:PBI-BCM-001</DTLBCM01>
+    <DTLBCM02>DTL-010:PBI-BCM-002</DTLBCM02>
+    <DTLBCM03>DTL-010:PBI-BCM-003</DTLBCM03>
+    <DTLBCM04>DTL-010:PBI-BCM-004</DTLBCM04>
+    <DTLBCM05>DTL-010:PBI-BCM-005</DTLBCM05>
+    <HBLBCM01>HBL-010LWU:PBI-BCM-001</HBLBCM01>
+    <HEBTBCM01>HEBT-010LWU:PBI-BCM-001</HEBTBCM01>
+    <HEBTBCM02>HEBT-160LWU:PBI-BCM-001</HEBTBCM02>
+    <ISrcBCM01>ISrc-010:PBI-BCM-001</ISrcBCM01>
+    <LEBTBCM01>LEBT-010:PBI-BCM-001</LEBTBCM01>
+    <MBLBCM01>MBL-010LWU:PBI-BCM-001</MBLBCM01>
+    <MEBTBCM01>MEBT-010:PBI-BCM-001</MEBTBCM01>
+    <MEBTBCM02>MEBT-010:PBI-BCM-002</MEBTBCM02>
+    <MEBTBCM03>MEBT-010:PBI-BCM-003</MEBTBCM03>
+    <RFQBCM01>RFQ-010:PBI-BCM-001</RFQBCM01>
   </macros>
-  <width>2350</width>
-  <height>1340</height>
+  <width>2470</width>
+  <height>1350</height>
   <background_color>
     <color name="Transparent" red="255" green="255" blue="255" alpha="0">
     </color>
@@ -39,7 +56,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>ISrc</PV_label>
-        <PV_name>ISrc-010:PBI-BCM-001</PV_name>
+        <PV_name>$(ISrcBCM01)</PV_name>
       </macros>
       <x>130</x>
       <y>20</y>
@@ -52,7 +69,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>LEBT</PV_label>
-        <PV_name>LEBT-010:PBI-BCM-001</PV_name>
+        <PV_name>$(LEBTBCM01)</PV_name>
       </macros>
       <x>210</x>
       <y>20</y>
@@ -65,7 +82,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>RFQ</PV_label>
-        <PV_name>RFQ-010:PBI-BCM-001</PV_name>
+        <PV_name>$(RFQBCM01)</PV_name>
       </macros>
       <x>290</x>
       <y>20</y>
@@ -78,7 +95,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>MEBT 1</PV_label>
-        <PV_name>MEBT-010:PBI-BCM-001</PV_name>
+        <PV_name>$(MEBTBCM01)</PV_name>
       </macros>
       <x>370</x>
       <y>20</y>
@@ -91,7 +108,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>MEBT 2</PV_label>
-        <PV_name>MEBT-010:PBI-BCM-002</PV_name>
+        <PV_name>$(MEBTBCM02)</PV_name>
       </macros>
       <x>450</x>
       <y>20</y>
@@ -104,7 +121,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>MEBT 3</PV_label>
-        <PV_name>MEBT-010:PBI-BCM-003</PV_name>
+        <PV_name>$(MEBTBCM03)</PV_name>
       </macros>
       <x>530</x>
       <y>20</y>
@@ -117,7 +134,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>DTL 1</PV_label>
-        <PV_name>DTL-010:PBI-BCM-001</PV_name>
+        <PV_name>$(DTLBCM01)</PV_name>
       </macros>
       <x>610</x>
       <y>20</y>
@@ -130,7 +147,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>DTL 2</PV_label>
-        <PV_name>DTL-010:PBI-BCM-002</PV_name>
+        <PV_name>$(DTLBCM02)</PV_name>
       </macros>
       <x>690</x>
       <y>20</y>
@@ -143,7 +160,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>DTL 3</PV_label>
-        <PV_name>DTL-010:PBI-BCM-003</PV_name>
+        <PV_name>$(DTLBCM03)</PV_name>
       </macros>
       <x>770</x>
       <y>20</y>
@@ -156,7 +173,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>DTL 4</PV_label>
-        <PV_name>DTL-010:PBI-BCM-004</PV_name>
+        <PV_name>$(DTLBCM04)</PV_name>
       </macros>
       <x>850</x>
       <y>20</y>
@@ -169,7 +186,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>DTL 5</PV_label>
-        <PV_name>DTL-010:PBI-BCM-005</PV_name>
+        <PV_name>$(DTLBCM05)</PV_name>
       </macros>
       <x>930</x>
       <y>20</y>
@@ -182,7 +199,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>MBeta</PV_label>
-        <PV_name>MBL-010LWU:PBI-BCM-001</PV_name>
+        <PV_name>$(MBLBCM01)</PV_name>
       </macros>
       <x>1010</x>
       <y>20</y>
@@ -195,7 +212,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>HBeta</PV_label>
-        <PV_name>HBL-010LWU:PBI-BCM-001</PV_name>
+        <PV_name>$(HBLBCM01)</PV_name>
       </macros>
       <x>1090</x>
       <y>20</y>
@@ -208,7 +225,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>HEBT 1</PV_label>
-        <PV_name>HEBT-010LWU:PBI-BCM-001</PV_name>
+        <PV_name>$(HEBTBCM01)</PV_name>
       </macros>
       <x>1170</x>
       <y>20</y>
@@ -221,7 +238,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>HEBT 2</PV_label>
-        <PV_name>HEBT-160LWU:PBI-BCM-001</PV_name>
+        <PV_name>$(HEBTBCM02)</PV_name>
       </macros>
       <x>1250</x>
       <y>20</y>
@@ -234,7 +251,7 @@
       <file>$(BCMfile)</file>
       <macros>
         <PV_label>A2T</PV_label>
-        <PV_name>A2T-010LWU:PBI-BCM-001</PV_name>
+        <PV_name>$(A2TBCM01)</PV_name>
       </macros>
       <x>1330</x>
       <y>20</y>
@@ -491,15 +508,15 @@
   <widget type="group" version="2.0.0">
     <name>FCGroup</name>
     <x>1460</x>
-    <y>620</y>
-    <width>870</width>
-    <height>710</height>
+    <y>600</y>
+    <width>990</width>
+    <height>730</height>
     <style>3</style>
     <transparent>true</transparent>
     <widget type="rectangle" version="2.0.0">
       <name>MGGrey03-background_5</name>
-      <width>870</width>
-      <height>710</height>
+      <width>990</width>
+      <height>730</height>
       <line_width>2</line_width>
       <line_color>
         <color name="GROUP-BORDER" red="150" green="155" blue="151">
@@ -515,7 +532,7 @@
     <widget type="label" version="2.0.0">
       <name>MGGrey03-title_5</name>
       <text>Faraday Cup</text>
-      <width>870</width>
+      <width>990</width>
       <height>50</height>
       <font>
         <font family="Source Sans Pro" style="BOLD_ITALIC" size="21.0">
@@ -532,15 +549,15 @@
   <widget type="group" version="2.0.0">
     <name>BDtoolsGroup</name>
     <x>1460</x>
-    <y>20</y>
+    <y>280</y>
     <width>290</width>
-    <height>580</height>
+    <height>300</height>
     <style>3</style>
     <transparent>true</transparent>
     <widget type="rectangle" version="2.0.0">
       <name>MGGrey03-background_7</name>
       <width>290</width>
-      <height>580</height>
+      <height>300</height>
       <line_width>2</line_width>
       <line_color>
         <color name="GROUP-BORDER" red="150" green="155" blue="151">
@@ -659,15 +676,15 @@
   <widget type="group" version="2.0.0">
     <name>PhaseGroup_1</name>
     <x>1770</x>
-    <y>20</y>
-    <width>560</width>
-    <height>320</height>
+    <y>280</y>
+    <width>680</width>
+    <height>300</height>
     <style>3</style>
     <transparent>true</transparent>
     <widget type="rectangle" version="2.0.0">
       <name>MGGrey03-background_17</name>
-      <width>560</width>
-      <height>320</height>
+      <width>680</width>
+      <height>300</height>
       <line_width>2</line_width>
       <line_color>
         <color name="GROUP-BORDER" red="150" green="155" blue="151">
@@ -683,7 +700,7 @@
     <widget type="label" version="2.0.0">
       <name>MGGrey03-title_15</name>
       <text>Phase Scan</text>
-      <width>560</width>
+      <width>680</width>
       <height>50</height>
       <font>
         <font family="Source Sans Pro" style="BOLD_ITALIC" size="21.0">
@@ -699,8 +716,8 @@
   </widget>
   <widget type="group" version="2.0.0">
     <name>PowerGroup</name>
-    <x>1770</x>
-    <y>360</y>
+    <x>1890</x>
+    <y>20</y>
     <width>560</width>
     <height>240</height>
     <style>3</style>
@@ -742,7 +759,11 @@
       <x>20</x>
       <y>50</y>
       <width>520</width>
-      <height>170</height>
+      <height>180</height>
+      <background_color>
+        <color name="Transparent" red="255" green="255" blue="255" alpha="0">
+        </color>
+      </background_color>
       <x_axis>
         <title>Beam Phase</title>
         <autoscale>false</autoscale>
@@ -781,4 +802,180 @@
       </y_axes>
     </widget>
   </widget>
+  <widget type="group" version="2.0.0">
+    <name>BeamTransmissionsGroup</name>
+    <x>1460</x>
+    <y>20</y>
+    <width>410</width>
+    <height>240</height>
+    <style>3</style>
+    <transparent>true</transparent>
+    <widget type="rectangle" version="2.0.0">
+      <name>MGGrey03-background_19</name>
+      <width>410</width>
+      <height>240</height>
+      <line_width>2</line_width>
+      <line_color>
+        <color name="GROUP-BORDER" red="150" green="155" blue="151">
+        </color>
+      </line_color>
+      <background_color>
+        <color name="GROUP-BACKGROUND" red="200" green="205" blue="201">
+        </color>
+      </background_color>
+      <corner_width>10</corner_width>
+      <corner_height>10</corner_height>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>MGGrey03-title_17</name>
+      <text>Beam Transmission</text>
+      <width>410</width>
+      <height>50</height>
+      <font>
+        <font family="Source Sans Pro" style="BOLD_ITALIC" size="21.0">
+        </font>
+      </font>
+      <background_color>
+        <color name="RED-BORDER" red="150" green="8" blue="16">
+        </color>
+      </background_color>
+      <horizontal_alignment>1</horizontal_alignment>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="combo" version="2.0.0">
+      <name>Combo Box_1</name>
+      <pv_name>loc://transmissionBCM1("$(LEBTBCM01)")</pv_name>
+      <x>20</x>
+      <y>80</y>
+      <width>260</width>
+      <items>
+        <item>$(ISrcBCM01)</item>
+        <item>$(LEBTBCM01)</item>
+        <item>$(RFQBCM01)</item>
+        <item>$(MEBTBCM01)</item>
+        <item>$(MEBTBCM02)</item>
+        <item>$(MEBTBCM03)</item>
+        <item>$(DTLBCM01)</item>
+        <item>$(DTLBCM02)</item>
+        <item>$(DTLBCM03)</item>
+        <item>$(DTLBCM04)</item>
+        <item>$(DTLBCM05)</item>
+        <item>$(MBLBCM01)</item>
+        <item>$(HBLBCM01)</item>
+        <item>$(HEBTBCM01)</item>
+        <item>$(HEBTBCM02)</item>
+      </items>
+      <items_from_pv>false</items_from_pv>
+    </widget>
+    <widget type="textupdate" version="2.0.0">
+      <name>Text Update_5</name>
+      <x>300</x>
+      <y>200</y>
+      <width>90</width>
+      <rules>
+        <rule name="calcTrans" prop_id="pv_name" out_exp="true">
+          <exp bool_exp="pv0">
+            <expression>='pvStr0'/'pvStr1'</expression>
+          </exp>
+          <pv_name>loc://transmissionBCM1</pv_name>
+          <pv_name>loc://transmissionBCM2</pv_name>
+        </rule>
+      </rules>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label</name>
+      <text>To BCM:</text>
+      <x>20</x>
+      <y>130</y>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_1</name>
+      <text>From BCM:</text>
+      <x>20</x>
+      <y>60</y>
+    </widget>
+    <widget type="combo" version="2.0.0">
+      <name>Combo Box_5</name>
+      <pv_name>loc://transmissionBCM2("$(MEBTBCM03)")</pv_name>
+      <x>20</x>
+      <y>150</y>
+      <width>260</width>
+      <items>
+        <item>$(LEBTBCM01)</item>
+        <item>$(RFQBCM01)</item>
+        <item>$(MEBTBCM01)</item>
+        <item>$(MEBTBCM02)</item>
+        <item>$(MEBTBCM03)</item>
+        <item>$(DTLBCM01)</item>
+        <item>$(DTLBCM02)</item>
+        <item>$(DTLBCM03)</item>
+        <item>$(DTLBCM04)</item>
+        <item>$(DTLBCM05)</item>
+        <item>$(MBLBCM01)</item>
+        <item>$(HBLBCM01)</item>
+        <item>$(HEBTBCM01)</item>
+        <item>$(HEBTBCM02)</item>
+        <item>$(A2TBCM01)</item>
+      </items>
+      <items_from_pv>false</items_from_pv>
+    </widget>
+    <widget type="textupdate" version="2.0.0">
+      <name>Text Update_6</name>
+      <pv_name>$(LEBTBCM01)</pv_name>
+      <x>300</x>
+      <y>85</y>
+      <width>90</width>
+      <vertical_alignment>1</vertical_alignment>
+      <rules>
+        <rule name="BCM1rule" prop_id="pv_name" out_exp="true">
+          <exp bool_exp="pvStr0">
+            <expression>pvStr0</expression>
+          </exp>
+          <pv_name>loc://transmissionBCM1</pv_name>
+        </rule>
+      </rules>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_2</name>
+      <text>Charge:</text>
+      <x>300</x>
+      <y>60</y>
+      <width>90</width>
+      <horizontal_alignment>1</horizontal_alignment>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_3</name>
+      <text>Charge:</text>
+      <x>300</x>
+      <y>130</y>
+      <width>90</width>
+      <horizontal_alignment>1</horizontal_alignment>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_4</name>
+      <text>Transmission [%]:</text>
+      <x>150</x>
+      <y>200</y>
+      <width>130</width>
+      <horizontal_alignment>2</horizontal_alignment>
+    </widget>
+    <widget type="textupdate" version="2.0.0">
+      <name>Text Update_7</name>
+      <pv_name>$(MEBTBCM03)</pv_name>
+      <x>300</x>
+      <y>155</y>
+      <width>90</width>
+      <vertical_alignment>1</vertical_alignment>
+      <rules>
+        <rule name="BCM2rule" prop_id="pv_name" out_exp="true">
+          <exp bool_exp="pvStr0">
+            <expression>pvStr0</expression>
+          </exp>
+          <pv_name>loc://transmissionBCM2</pv_name>
+        </rule>
+      </rules>
+    </widget>
+  </widget>
 </display>
-- 
GitLab