From 41a8f599a8a719ff2d4357fb74fc0e91e610ee64 Mon Sep 17 00:00:00 2001
From: Juliano Murari <juliano.murari@ess.eu>
Date: Tue, 22 Nov 2022 15:19:00 +0100
Subject: [PATCH] Update BPM Manager related OPIs

---
 .../bpmmanager/bpmmanager-square-instance.bob |   4 +-
 .../bpmmanager/bpmmanager-top-legend.bob      | 405 ++++++++++++++++++
 99-Shared/bpmmanager/bpmmanager-top.bob       |  30 +-
 3 files changed, 429 insertions(+), 10 deletions(-)
 create mode 100644 99-Shared/bpmmanager/bpmmanager-top-legend.bob

diff --git a/99-Shared/bpmmanager/bpmmanager-square-instance.bob b/99-Shared/bpmmanager/bpmmanager-square-instance.bob
index 48833bb..8961030 100644
--- a/99-Shared/bpmmanager/bpmmanager-square-instance.bob
+++ b/99-Shared/bpmmanager/bpmmanager-square-instance.bob
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <display version="2.0.0">
   <name>BPMManager - Square</name>
-  <width>100</width>
-  <height>100</height>
+  <width>60</width>
+  <height>60</height>
   <background_color>
     <color name="Transparent" red="255" green="255" blue="255" alpha="0">
     </color>
diff --git a/99-Shared/bpmmanager/bpmmanager-top-legend.bob b/99-Shared/bpmmanager/bpmmanager-top-legend.bob
new file mode 100644
index 0000000..1cb99d7
--- /dev/null
+++ b/99-Shared/bpmmanager/bpmmanager-top-legend.bob
@@ -0,0 +1,405 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<display version="2.0.0">
+  <name>BPM - Legend</name>
+  <width>400</width>
+  <height>240</height>
+  <background_color>
+    <color red="240" green="240" blue="240">
+    </color>
+  </background_color>
+  <actions>
+  </actions>
+  <widget type="rectangle" version="2.0.0">
+    <name>Background_1</name>
+    <width>400</width>
+    <height>240</height>
+    <line_width>0</line_width>
+    <background_color>
+      <color name="BLUE-BACKGROUND" red="195" green="226" blue="225">
+      </color>
+    </background_color>
+    <corner_width>5</corner_width>
+    <corner_height>5</corner_height>
+  </widget>
+  <widget type="rectangle" version="2.0.0">
+    <name>titleBar_1</name>
+    <width>400</width>
+    <height>50</height>
+    <line_width>0</line_width>
+    <background_color>
+      <color name="PRIMARY-HEADER-BACKGROUND" red="151" green="188" blue="202">
+      </color>
+    </background_color>
+    <corner_width>5</corner_width>
+    <corner_height>5</corner_height>
+  </widget>
+  <widget type="label" version="2.0.0">
+    <name>title_1</name>
+    <class>GROUP-TITLE</class>
+    <text>BPM Manager Legend</text>
+    <x>20</x>
+    <y>10</y>
+    <width>380</width>
+    <height use_class="true">30</height>
+    <font use_class="true">
+      <font name="Header 2" family="Source Sans Pro" style="BOLD_ITALIC" size="21.0">
+      </font>
+    </font>
+    <foreground_color use_class="true">
+      <color name="GROUP-TEXT" red="25" green="25" blue="25">
+      </color>
+    </foreground_color>
+    <horizontal_alignment use_class="true">1</horizontal_alignment>
+    <vertical_alignment use_class="true">1</vertical_alignment>
+    <wrap_words use_class="true">false</wrap_words>
+  </widget>
+  <widget type="group" version="2.0.0">
+    <name>Legend_1</name>
+    <x>160</x>
+    <y>60</y>
+    <width>220</width>
+    <height>160</height>
+    <style>3</style>
+    <transparent>true</transparent>
+    <widget type="label" version="2.0.0">
+      <name>Label_5</name>
+      <text>Timing Status</text>
+      <x>40</x>
+      <width>180</width>
+      <height>40</height>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_6</name>
+      <text>Open BPM parameters</text>
+      <x>40</x>
+      <y>40</y>
+      <width>180</width>
+      <height>40</height>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_7</name>
+      <text>MTCA Status</text>
+      <x>40</x>
+      <y>80</y>
+      <width>180</width>
+      <height>40</height>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="label" version="2.0.0">
+      <name>Label_8</name>
+      <text>Health Status</text>
+      <x>40</x>
+      <y>120</y>
+      <width>180</width>
+      <height>40</height>
+      <vertical_alignment>1</vertical_alignment>
+    </widget>
+    <widget type="polygon" version="2.0.0">
+      <name>Polygon_5</name>
+      <y>10</y>
+      <width>20</width>
+      <points>
+        <point x="0.0" y="20.0">
+        </point>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="20.0" y="10.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+      <background_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </background_color>
+    </widget>
+    <widget type="polygon" version="2.0.0">
+      <name>Polygon_6</name>
+      <y>50</y>
+      <width>20</width>
+      <points>
+        <point x="0.0" y="20.0">
+        </point>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="20.0" y="10.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+      <background_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </background_color>
+    </widget>
+    <widget type="polygon" version="2.0.0">
+      <name>Polygon_7</name>
+      <y>90</y>
+      <width>20</width>
+      <points>
+        <point x="0.0" y="20.0">
+        </point>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="20.0" y="10.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+      <background_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </background_color>
+    </widget>
+    <widget type="polygon" version="2.0.0">
+      <name>Polygon_8</name>
+      <y>130</y>
+      <width>20</width>
+      <points>
+        <point x="0.0" y="20.0">
+        </point>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="20.0" y="10.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+      <background_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </background_color>
+    </widget>
+  </widget>
+  <widget type="group" version="2.0.0">
+    <name>Lines_1</name>
+    <x>60</x>
+    <y>80</y>
+    <width>100</width>
+    <height>121</height>
+    <style>3</style>
+    <transparent>true</transparent>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_7</name>
+      <height>1</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="100.0" y="0.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_8</name>
+      <x>60</x>
+      <y>40</y>
+      <width>40</width>
+      <height>1</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="40.0" y="0.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_9</name>
+      <x>80</x>
+      <y>80</y>
+      <width>20</width>
+      <height>0</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="20.0" y="0.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_10</name>
+      <y>120</y>
+      <height>1</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="100.0" y="0.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_11</name>
+      <width>1</width>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="0.0" y="20.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_12</name>
+      <x>1</x>
+      <y>80</y>
+      <width>1</width>
+      <height>40</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="0.0" y="40.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_14</name>
+      <x>30</x>
+      <y>100</y>
+      <width>50</width>
+      <height>1</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="50.0" y="0.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_15</name>
+      <x>30</x>
+      <y>79</y>
+      <width>1</width>
+      <height>22</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="0.0" y="22.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+    <widget type="polyline" version="2.0.0">
+      <name>Polyline_18</name>
+      <x>81</x>
+      <y>79</y>
+      <width>1</width>
+      <height>22</height>
+      <points>
+        <point x="0.0" y="0.0">
+        </point>
+        <point x="0.0" y="22.0">
+        </point>
+      </points>
+      <line_color>
+        <color name="BLACK" red="0" green="0" blue="0">
+        </color>
+      </line_color>
+    </widget>
+  </widget>
+  <widget type="group" version="2.0.0">
+    <name>Status_1</name>
+    <x>40</x>
+    <y>100</y>
+    <width>80</width>
+    <height>60</height>
+    <style>3</style>
+    <transparent>true</transparent>
+    <widget type="action_button" version="3.0.0">
+      <name>DTL-BPM08_1</name>
+      <actions>
+      </actions>
+      <text></text>
+      <x>60</x>
+      <width>20</width>
+      <height>60</height>
+      <tooltip>$(actions)</tooltip>
+    </widget>
+    <widget type="rectangle" version="2.0.0">
+      <name>Background_2</name>
+      <width>60</width>
+      <height>60</height>
+      <line_width>0</line_width>
+      <background_color>
+        <color name="BLUE-BACKGROUND" red="195" green="226" blue="225">
+        </color>
+      </background_color>
+      <corner_width>5</corner_width>
+      <corner_height>5</corner_height>
+    </widget>
+    <widget type="led" version="2.0.0">
+      <name>Health</name>
+      <pv_name>=1</pv_name>
+      <y>20</y>
+      <width>40</width>
+      <height>40</height>
+      <off_color>
+        <color name="RED" red="252" green="13" blue="27">
+        </color>
+      </off_color>
+      <square>true</square>
+      <actions>
+      </actions>
+    </widget>
+    <widget type="led" version="2.0.0">
+      <name>mTCA</name>
+      <pv_name>=1</pv_name>
+      <x>40</x>
+      <y>20</y>
+      <height>40</height>
+      <off_color>
+        <color name="RED" red="252" green="13" blue="27">
+        </color>
+      </off_color>
+      <square>true</square>
+    </widget>
+    <widget type="led" version="2.0.0">
+      <name>Timing</name>
+      <pv_name>=1</pv_name>
+      <width>60</width>
+      <off_color>
+        <color name="RED" red="252" green="13" blue="27">
+        </color>
+      </off_color>
+      <square>true</square>
+    </widget>
+  </widget>
+</display>
diff --git a/99-Shared/bpmmanager/bpmmanager-top.bob b/99-Shared/bpmmanager/bpmmanager-top.bob
index f893a1a..ba230cc 100644
--- a/99-Shared/bpmmanager/bpmmanager-top.bob
+++ b/99-Shared/bpmmanager/bpmmanager-top.bob
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <display version="2.0.0">
   <name>BPM Manager</name>
-  <width>1200</width>
+  <width>1600</width>
   <height>700</height>
   <background_color>
     <color name="BACKGROUND" red="220" green="225" blue="221">
@@ -11,7 +11,7 @@
   </actions>
   <widget type="group" version="2.0.0">
     <name>Titlebar</name>
-    <width>1070</width>
+    <width>1600</width>
     <height>50</height>
     <style>3</style>
     <transparent>true</transparent>
@@ -20,7 +20,7 @@
       <class>TITLE-BAR</class>
       <x use_class="true">0</x>
       <y use_class="true">0</y>
-      <width>1200</width>
+      <width>1600</width>
       <height use_class="true">50</height>
       <line_width use_class="true">0</line_width>
       <background_color use_class="true">
@@ -34,7 +34,7 @@
       <text>Beam Position Monitor Manager</text>
       <x use_class="true">20</x>
       <y use_class="true">0</y>
-      <width>770</width>
+      <width>1600</width>
       <height use_class="true">50</height>
       <font use_class="true">
         <font name="Header 1" family="Source Sans Pro" style="BOLD_ITALIC" size="36.0">
@@ -49,6 +49,20 @@
       <vertical_alignment use_class="true">1</vertical_alignment>
       <wrap_words use_class="true">false</wrap_words>
     </widget>
+    <widget type="action_button" version="3.0.0">
+      <name>Legend</name>
+      <actions>
+        <action type="open_display">
+          <file>bpmmanager-top-legend.bob</file>
+          <target>window</target>
+          <description>Open Display</description>
+        </action>
+      </actions>
+      <text>Legend</text>
+      <x>1480</x>
+      <y>10</y>
+      <tooltip>$(actions)</tooltip>
+    </widget>
   </widget>
   <widget type="group" version="2.0.0">
     <name>Section1-MEBT</name>
@@ -1064,10 +1078,10 @@
     <name>SquareExample</name>
     <class></class>
     <macros>
-      <BPM_PAIR>BPM08-01</BPM_PAIR>
-      <P>$(P)</P>
-      <R>BPM01-</R>
-      <S>$(S2)</S>
+      <BPM_PAIR></BPM_PAIR>
+      <P></P>
+      <R></R>
+      <S></S>
     </macros>
     <file>bpmmanager-square-instance.bob</file>
     <x>860</x>
-- 
GitLab