Commit 9c1b321a authored by Peter Zumbruch's avatar Peter Zumbruch
Browse files

first import

parents
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Registers</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
//Create a new Macro Input
var macroInput = DataUtil.createMacrosInput(true);
//Put a macro in the new Macro Input
macroInput.put("HADCON", PVUtil.getString(pvArray[0]));
//Set the macro input of the linking container to this new macro input.
widgetController.setPropertyValue("macros", macroInput);
//Reload the OPI file in the linking container again
//by setting the property value with forcing fire option in true.
widgetController.setPropertyValue("opi_file",
widgetController.getPropertyValue("opi_file"), true);
<?xml version="1.0" encoding="UTF-8"?>
<display typeId="org.csstudio.opibuilder.Display" version="1.0.0">
<auto_zoom_to_fit_all>false</auto_zoom_to_fit_all>
<macros>
<include_parent_macros>true</include_parent_macros>
<HADCON>$(hadcon)</HADCON>
<PREFIX>APFEL:$(HADCON)</PREFIX>
<NAME></NAME>
<SUFFIX></SUFFIX>
<ADDRESS>$(portName):ps$(pinSet):s$(sideSelect)</ADDRESS>
</macros>
<wuid>-3bda0168:13b8fa7e601:-14ed</wuid>
<boy_version>3.2.16.20140409</boy_version>
<scripts />
<show_ruler>true</show_ruler>
<height>1000</height>
<name>HadCon2 Controls</name>
<snap_to_geometry>true</snap_to_geometry>
<show_grid>false</show_grid>
<background_color>
<color name="OPI_Background" red="255" green="255" blue="255" />
</background_color>
<foreground_color>
<color red="192" green="192" blue="192" />
</foreground_color>
<widget_type>Display</widget_type>
<show_close_button>true</show_close_button>
<width>620</width>
<rules />
<show_edit_range>true</show_edit_range>
<grid_space>6</grid_space>
<auto_scale_widgets>
<auto_scale_widgets>false</auto_scale_widgets>
<min_width>-1</min_width>
<min_height>-1</min_height>
</auto_scale_widgets>
<actions hook="false" hook_all="false" />
<y>-1</y>
<x>-1</x>
<widget typeId="org.csstudio.opibuilder.widgets.Label" version="1.0.0">
<visible>true</visible>
<vertical_alignment>1</vertical_alignment>
<wuid>-2128e279:14d4318ca4d:-3daa</wuid>
<auto_size>true</auto_size>
<scripts />
<height>31</height>
<name>Label</name>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<transparent>false</transparent>
<background_color>
<color name="Header_Background" red="77" green="77" blue="77" />
</background_color>
<foreground_color>
<color name="Header_ForeGround" red="255" green="255" blue="255" />
</foreground_color>
<widget_type>Label</widget_type>
<enabled>true</enabled>
<text>HadCon Controls - Registers</text>
<font>
<opifont.name fontName="Segoe UI" height="17" style="1">Header 1</opifont.name>
</font>
<width>302</width>
<border_style>0</border_style>
<rules />
<border_width>1</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<horizontal_alignment>1</horizontal_alignment>
<actions hook="false" hook_all="false" />
<y>0</y>
<wrap_words>false</wrap_words>
<tooltip></tooltip>
<x>0</x>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.groupingContainer" version="1.0.0">
<macros>
<include_parent_macros>true</include_parent_macros>
</macros>
<visible>true</visible>
<wuid>-78ec1f26:14db340fe4d:-7516</wuid>
<scripts />
<height>28</height>
<name>HadCon</name>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<transparent>false</transparent>
<show_scrollbar>false</show_scrollbar>
<foreground_color>
<color red="192" green="192" blue="192" />
</foreground_color>
<background_color>
<color name="OPI_Background" red="255" green="255" blue="255" />
</background_color>
<enabled>true</enabled>
<widget_type>Grouping Container</widget_type>
<font>
<opifont.name fontName="Segoe UI" height="9" style="0">Default</opifont.name>
</font>
<width>600</width>
<border_style>0</border_style>
<rules />
<fc>false</fc>
<lock_children>false</lock_children>
<border_width>1</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<y>41</y>
<actions hook="false" hook_all="false" />
<x>0</x>
<tooltip></tooltip>
<widget typeId="org.csstudio.opibuilder.widgets.TextUpdate" version="1.0.0">
<border_alarm_sensitive>true</border_alarm_sensitive>
<visible>true</visible>
<vertical_alignment>1</vertical_alignment>
<show_units>true</show_units>
<wuid>-78ec1f26:14db340fe4d:-7532</wuid>
<auto_size>true</auto_size>
<rotation_angle>0.0</rotation_angle>
<scripts />
<height>24</height>
<name>Text Update</name>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<format_type>0</format_type>
<precision_from_pv>true</precision_from_pv>
<transparent>true</transparent>
<pv_name></pv_name>
<background_color>
<color red="255" green="255" blue="255" />
</background_color>
<foreground_color>
<color red="0" green="0" blue="0" />
</foreground_color>
<widget_type>Text Update</widget_type>
<enabled>true</enabled>
<text>HadCon</text>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<precision>0</precision>
<font>
<opifont.name fontName="Segoe UI" height="11" style="1">Header 3</opifont.name>
</font>
<width>59</width>
<border_style>0</border_style>
<rules />
<pv_value />
<border_width>1</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<horizontal_alignment>0</horizontal_alignment>
<actions hook="false" hook_all="false" />
<y>0</y>
<wrap_words>false</wrap_words>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
<x>0</x>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.combo" version="1.0.0">
<border_alarm_sensitive>true</border_alarm_sensitive>
<visible>true</visible>
<wuid>-78ec1f26:14db340fe4d:-7a40</wuid>
<scripts />
<height>27</height>
<name>Combo</name>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>false</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<pv_name>loc://hadCon_$(DID)&lt;VString&gt;("ee-raspi0112")</pv_name>
<background_color>
<color name="WritePV_Background" red="128" green="255" blue="255" />
</background_color>
<foreground_color>
<color red="0" green="0" blue="0" />
</foreground_color>
<widget_type>Combo</widget_type>
<enabled>true</enabled>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<font>
<opifont.name fontName="Segoe UI" height="9" style="0">Default</opifont.name>
</font>
<width>249</width>
<border_style>0</border_style>
<rules />
<pv_value />
<items>
<s>ee-raspi0112</s>
<s>ee-raspi0201:1</s>
<s>ee-raspi0201:2</s>
<s>ee-raspi0202:1</s>
<s>ee-raspi0202:2</s>
<s>ee-raspi0203:1</s>
<s>ee-raspi0203:2</s>
</items>
<border_width>1</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<items_from_pv>false</items_from_pv>
<actions hook="false" hook_all="false" />
<y>0</y>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
<x>61</x>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.TextInput" version="2.0.0">
<border_alarm_sensitive>true</border_alarm_sensitive>
<visible>true</visible>
<multiline_input>false</multiline_input>
<auto_size>false</auto_size>
<scripts />
<height>27</height>
<forecolor_alarm_sensitive>false</forecolor_alarm_sensitive>
<precision_from_pv>true</precision_from_pv>
<background_color>
<color name="WritePV_Background" red="128" green="255" blue="255" />
</background_color>
<enabled>true</enabled>
<widget_type>Text Input</widget_type>
<text></text>
<font>
<opifont.name fontName="Segoe UI" height="9" style="0">Default</opifont.name>
</font>
<width>249</width>
<border_style>3</border_style>
<pv_value />
<maximum>1.7976931348623157E308</maximum>
<border_width>1</border_width>
<minimum>-1.7976931348623157E308</minimum>
<show_units>true</show_units>
<wuid>-650ce9c2:14d9f742786:-624f</wuid>
<rotation_angle>0.0</rotation_angle>
<style>0</style>
<name>hadCon</name>
<format_type>4</format_type>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<selector_type>0</selector_type>
<transparent>false</transparent>
<pv_name>loc://hadCon_$(DID)&lt;VString&gt;("ee-raspi0112")</pv_name>
<foreground_color>
<color red="0" green="0" blue="0" />
</foreground_color>
<precision>0</precision>
<backcolor_alarm_sensitive>false</backcolor_alarm_sensitive>
<confirm_message></confirm_message>
<rules />
<limits_from_pv>false</limits_from_pv>
<horizontal_alignment>1</horizontal_alignment>
<border_color>
<color name="Header_Background" red="77" green="77" blue="77" />
</border_color>
<y>0</y>
<actions hook="false" hook_all="false" />
<x>312</x>
<tooltip>$(pv_name)
$(pv_value)</tooltip>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.gridLayout" version="1.0.0">
<wuid>-78ec1f26:14db340fe4d:-7512</wuid>
<number_of_columns>23</number_of_columns>
<name>Grid Layout</name>
<fill_grids>false</fill_grids>
<widget_type>Grid Layout</widget_type>
<grid_gap>2</grid_gap>
</widget>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.groupingContainer" version="1.0.0">
<macros>
<include_parent_macros>true</include_parent_macros>
</macros>
<visible>true</visible>
<wuid>-78ec1f26:14db340fe4d:-6980</wuid>
<scripts>
<path pathString="LoadLinkingContainer_withMacros.js" checkConnect="true" sfe="false" seoe="false">
<pv trig="false">sim://const("dynamicPorts.opi")</pv>
<pv trig="false">sim://const("controls")</pv>
<pv trig="false">sim://const("hadcon")</pv>
<pv trig="true">loc://hadCon_$(DID)&lt;VString&gt;("ee-raspi0112")</pv>
</path>
</scripts>
<height>891</height>
<name>controls</name>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<transparent>true</transparent>
<show_scrollbar>false</show_scrollbar>
<foreground_color>
<color red="192" green="192" blue="192" />
</foreground_color>
<background_color>
<color name="OPI_Background" red="255" green="255" blue="255" />
</background_color>
<enabled>true</enabled>
<widget_type>Grouping Container</widget_type>
<font>
<opifont.name fontName="Segoe UI" height="9" style="0">Default</opifont.name>
</font>
<width>609</width>
<border_style>14</border_style>
<rules />
<fc>false</fc>
<lock_children>false</lock_children>
<border_width>0</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<y>79</y>
<actions hook="false" hook_all="false" />
<x>0</x>
<tooltip></tooltip>
<widget typeId="org.csstudio.opibuilder.widgets.Label" version="1.0.0">
<visible>true</visible>
<vertical_alignment>1</vertical_alignment>
<wuid>-6995f18d:14db369c602:-58e3</wuid>
<auto_size>true</auto_size>
<scripts />
<height>15</height>
<name>Label</name>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<transparent>true</transparent>
<show_scrollbar>false</show_scrollbar>
<background_color>
<color red="255" green="255" blue="255" />
</background_color>
<foreground_color>
<color red="0" green="0" blue="0" />
</foreground_color>
<widget_type>Label</widget_type>
<enabled>true</enabled>
<text>uses script to call linking container with correct macro</text>
<font>
<opifont.name fontName="Segoe UI" height="9" style="1">Default Bold</opifont.name>
</font>
<width>300</width>
<border_style>0</border_style>
<rules />
<border_width>1</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<horizontal_alignment>1</horizontal_alignment>
<actions hook="false" hook_all="false" />
<y>0</y>
<wrap_words>true</wrap_words>
<tooltip></tooltip>
<x>0</x>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.linkingContainer" version="1.0.0">
<macros>
<include_parent_macros>true</include_parent_macros>
</macros>
<visible>true</visible>
<wuid>-6995f18d:14db369c602:-7a25</wuid>
<auto_size>false</auto_size>
<scripts />
<zoom_to_fit>false</zoom_to_fit>
<height>869</height>
<name>Linking Container</name>
<scale_options>
<width_scalable>true</width_scalable>
<height_scalable>true</height_scalable>
<keep_wh_ratio>false</keep_wh_ratio>
</scale_options>
<opi_file>dynamicPorts.opi</opi_file>
<foreground_color>
<color red="192" green="192" blue="192" />
</foreground_color>
<background_color>
<color red="240" green="240" blue="240" />
</background_color>
<group_name>controls</group_name>
<enabled>false</enabled>
<widget_type>Linking Container</widget_type>
<font>
<opifont.name fontName="Segoe UI" height="9" style="0">Default</opifont.name>
</font>
<width>604</width>
<border_style>3</border_style>
<rules />
<border_width>1</border_width>
<border_color>
<color red="0" green="128" blue="255" />
</border_color>
<y>17</y>
<actions hook="false" hook_all="false" />
<x>0</x>
<tooltip></tooltip>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.gridLayout" version="1.0.0">
<wuid>9d57dd:14e8d3a7236:3aa3</wuid>
<number_of_columns>1</number_of_columns>
<name>Grid Layout</name>
<fill_grids>false</fill_grids>
<widget_type>Grid Layout</widget_type>
<grid_gap>2</grid_gap>
</widget>
</widget>
<widget typeId="org.csstudio.opibuilder.widgets.gridLayout" version="1.0.0">
<wuid>-78ec1f26:14db340fe4d:-6919</wuid>
<number_of_columns>1</number_of_columns>
<name>Grid Layout</name>
<fill_grids>true</fill_grids>
<widget_type>Grid Layout</widget_type>
<grid_gap>10</grid_gap>
</widget>
</display>
\ No newline at end of file
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
var portsOffset=0;
var typeOffset=8;
var debugOffset=11;
var templateOffset=7;
var debug = PVUtil.getLong(pvs[debugOffset]);
types = [ "PIN" , "PORT" ,"DDR" ];
ports = [ "A","B","C","D","E","F","G" ];
if ( null == widget.getVar("templateName"))
{
widget.setVar("templateName", PVUtil.getString(pvs[templateOffset]));
widget.setVar("templateFile", widget.getWidget(widget.getVar("templateName")).getPropertyValue("opi_file"));
widget.setVar("templateGroupName", widget.getWidget(widget.getVar("templateName")).getPropertyValue("group_name"));
}
var templateFile = widget.getVar("templateFile") ;
var templateGroupName = widget.getVar("templateGroupName");
if (0 != debug) {
ConsoleUtil.writeInfo("DEBUG: " + "templateName " + widget.getVar("templateName"));
ConsoleUtil.writeInfo("DEBUG: " + "templateFile " + templateFile);
ConsoleUtil.writeInfo("DEBUG: " + "templateGroupName " + templateGroupName);
}
widget.removeAllChildren();
for(var i=0; i<ports.length; i++){
if (0 == PVUtil.getLong(pvs[i + portsOffset]))
{
if (0 != debug) { ConsoleUtil.writeInfo("DEBUG: " + "port " + ports[i] + " skipped");}
continue;
}
else
{
if (0 != debug) { ConsoleUtil.writeInfo( "DEBUG: " + "port " + ports[i] + " chosen");}
}
for(var j=0; j<types.length; j++){
var insert = PVUtil.getLong(pvs[j + typeOffset] );
if (0 != debug) {ConsoleUtil.writeInfo( "DEBUG: " + ports[i] + "/" + j + " --- " + types[j] + ports[i] + " (" + pvs[j+typeOffset] + ")");}
if ( 0 == insert)
{
if (0 != debug) {ConsoleUtil.writeInfo( "DEBUG: " + types[j] + "x " + insert + " skip");}
continue;
}
else
{
if (0 != debug) {ConsoleUtil.writeInfo( "DEBUG: " + types[j] + "x " + insert + " show");}
}
//create linking container
var linkingContainer = WidgetUtil.createWidgetModel("org.csstudio.opibuilder.widgets.linkingContainer");
// linkingContainer.setPropertyValue("opi_file", opiPath);
linkingContainer.setPropertyValue("opi_file", templateFile);
linkingContainer.setPropertyValue("auto_size", true);
linkingContainer.setPropertyValue("zoom_to_fit", false);
// linkingContainer.setPropertyValue("group_name", "Controls");
linkingContainer.setPropertyValue("group_name", templateGroupName);
linkingContainer.setPropertyValue("name", ("Controls" + types[j] + ports[i]));
linkingContainer.setPropertyValue("border_style", 0);
//add macros
linkingContainer.addMacro("index", i);
linkingContainer.addMacro("RegName", types[j]+ports[i]);
linkingContainer.addMacro("NAME", ":" + ports[i]);
//add linking container to widget
widget.addChildToBottom(linkingContainer);
}
}
widget.performAutosize();
display.performAutosize();
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
importPackage(Packages.java.lang);
var opiPathIndex = 0;
var opiPath = PVUtil.getString(pvs[opiPathIndex]);
var groupNameIndex = 1;
var groupName = PVUtil.getString(pvs[groupNameIndex]);
var macroNameIndex = 2;
var macroName = PVUtil.getString(pvs[macroNameIndex]);
var macroValueIndex = 3;
var macroValue = PVUtil.getString(pvs[macroValueIndex]);
widget.removeAllChildren();
//create linking container
var linkingContainer = WidgetUtil.createWidgetModel("org.csstudio.opibuilder.widgets.linkingContainer");
linkingContainer.setPropertyValue("opi_file", opiPath.toString());
linkingContainer.setPropertyValue("auto_size", true);
linkingContainer.setPropertyValue("zoom_to_fit", false);
linkingContainer.setPropertyValue("border_style", 14);
linkingContainer.setPropertyValue("group_name", groupName.toString());
linkingContainer.setPropertyValue("border_color", "Header_Background");
//add macros
linkingContainer.addMacro(macroName.toString(), macroValue.toString());
//add linking container to widget
widget.addChildToBottom(linkingContainer);
widget.performAutosize();
display.performAutosize();
<?xml version="1.0" encoding="UTF-8"?>
<display typeId="org.csstudio.opibuilder.Display" version="1.0">
<auto_zoom_to_fit_all>false</auto_zoom_to_fit_all>
<macros>
<include_parent_macros>true</include_parent_macros>
</macros>
<wuid>-17cc1c3d:13cba022955:-7035</wuid>
<boy_version>3.1.4.20121219</boy_version>
<scripts />
<show_ruler>true</show_ruler>
<height>800</height>
<name>All Atmel Ports</name>
<snap_to_geometry>true</snap_to_geometry>
<show_grid>true</show_grid>
<background_color>
<color red="240" green="240" blue="240" />
</background_color>
<foreground_color>
<color red="192" green="192" blue="192" />
</foreground_color>
<widget_type>Display</widget_type>
<show_close_button>true</show_close_button>
<width>600</width>
<rules />
<show_edit_range>true</show_edit_range>
<grid_space>6</grid_space>
<auto_scale_widgets>
<auto_scale_widgets>false</auto_scale_widgets>
<min_width>-1</min_width>
<min_height>-1</min_height>
</auto_scale_widgets>
<actions hook="false" hook_all="false"