Generation working and Compilation of MARTe components
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright (c) : 2010-2019 ITER Organization,
|
||||
CS 90 046
|
||||
13067 St. Paul-lez-Durance Cedex
|
||||
France
|
||||
|
||||
This product is part of ITER CODAC software.
|
||||
For the terms and conditions of redistribution or use of this software
|
||||
refer to the file ITER-LICENSE.TXT located in the top level directory
|
||||
of the distribution package.
|
||||
*/
|
||||
|
||||
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
|
||||
|
||||
var t = new Date(PVUtil.getTimeInMilliseconds(pvs[0])).toTimeString();
|
||||
var st = t.split(" ");
|
||||
|
||||
widget.setPropertyValue("on_label", st[0]);
|
||||
widget.setPropertyValue("off_label", st[0]);
|
||||
@@ -0,0 +1,14 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=display.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
ScriptUtil.openOPI(display.getWidget("SystemDetailsTable"), "/opt/codac/opi/epics-sysmon/boy/ITER-SYSM-SYS_Mimic.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
importClass(Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener);
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var selectedrow= table.getSelection();
|
||||
var cuName=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
var plcIocHlts =selectedrow[0][6];
|
||||
var cuType=selectedrow[0][7];
|
||||
// change $(CU) substitution
|
||||
macroInput = DataUtil.createMacrosInput(true)
|
||||
macroInput.put("CU", cuName)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
macroInput.put("CU_TYPE", cuType)
|
||||
if (plcIocHlts == "") {
|
||||
macroInput.put("SHOW_PLC_IOC", "false")
|
||||
}
|
||||
else {
|
||||
macroInput.put("SHOW_PLC_IOC", "true")
|
||||
}
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if (cuType == "POC with CA") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-POCWithCADetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "POC without CA") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-POCWithoutCADetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "Plant System Host") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-PSHDetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "Fast Controller") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-PCFDetails.opi", 1, macroInput)
|
||||
}
|
||||
else if (cuType == "Server") {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-SRVDetails.opi", 1, macroInput)
|
||||
}
|
||||
else {
|
||||
ScriptUtil.openOPI(widget, fct_name+"-CtrlUnitDetails.opi", 1, macroInput)
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,38 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuName=""
|
||||
phyName=""
|
||||
plcIocHlts =""
|
||||
cuType=""
|
||||
for row in selection:
|
||||
phyName=row[1]
|
||||
cuName=row[0]
|
||||
plcIocHlts=row[6]
|
||||
cuType=row[7];
|
||||
# change $(CU) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CU", cuName)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
macroInput.put("CU_TYPE", cuType)
|
||||
if plcIocHlts == "":
|
||||
macroInput.put("SHOW_PLC_IOC", "false")
|
||||
else:
|
||||
macroInput.put("SHOW_PLC_IOC", "true")
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if cuType == "POC with CA":
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-POCWithCADetails.opi", 1, macroInput)
|
||||
elif cuType == "POC without CA":
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-POCWithoutCADetails.opi", 1, macroInput)
|
||||
else:
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CtrlUnitDetails.opi", 1, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,23 @@
|
||||
importClass(Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener);
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name = widget.getPropertyValue("name");
|
||||
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var selectedrow= table.getSelection();
|
||||
var cuIndex=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
|
||||
// change $(CU_INDEX) substitution
|
||||
var macroInput = DataUtil.createMacrosInput(true);
|
||||
macroInput.put("CUB", cuIndex);
|
||||
macroInput.put("PHY_NAME", phyName);
|
||||
macroInput.put("FCT_NAME", fct_name);
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(widget, fct_name+"-"+cuIndex+"-CubicleContents.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,24 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuIndex=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
cuIndex=row[0];
|
||||
phyName=row[1]
|
||||
# change $(CU_INDEX) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CUB", cuIndex)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-"+cuIndex+"-CubicleContents.opi", 1, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,14 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=display.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
ScriptUtil.openOPI(display.getWidget("CubicleDetailsTable"), "/opt/codac/opi/epics-sysmon/boy/ITER-SYSM-CUB_Mimic.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,31 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
|
||||
var selectedrow= table.getSelection();
|
||||
var cuIndex=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
var loc=selectedrow[0][5];
|
||||
var pppp=selectedrow[0][6];
|
||||
var pp=selectedrow[0][7];
|
||||
var nnnn=selectedrow[0][8];
|
||||
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
macroInput.put("CUB", cuIndex)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
macroInput.put("PPPP", pppp)
|
||||
macroInput.put("PP", pp)
|
||||
macroInput.put("NNNN", nnnn)
|
||||
macroInput.put("CUB_LOC", "Location: "+loc)
|
||||
|
||||
ScriptUtil.openOPI(widget, fct_name+"-CubicleDetails.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,24 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuIndex=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
cuIndex=row[0];
|
||||
phyName=row[1]
|
||||
# change $(CU_INDEX) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CUB", cuIndex)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CubicleDetails.opi", 1, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,14 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
|
||||
import datetime
|
||||
|
||||
pv = pvs[0]
|
||||
|
||||
s = PVUtil.getTimeInMilliseconds(pv)
|
||||
t = datetime.datetime.fromtimestamp(float(s)/1000.)
|
||||
|
||||
format = "%H:%M:%S"
|
||||
|
||||
widget.setPropertyValue("on_label", t.strftime(format))
|
||||
widget.setPropertyValue("off_label", t.strftime(format))
|
||||
@@ -0,0 +1,57 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
|
||||
//Fill PV Name only once
|
||||
if (widget.getVar("firstTime") == null) {
|
||||
widget.setVar("firstTime", true);
|
||||
// Fill table only with non EGU pv's
|
||||
for (var i=0;pv=pvs[i];i++) {
|
||||
// earlier when by default pv.getName() was giving name with 'epics://' prefix. Ripping it off before showing was done below
|
||||
table.setCellText(i, 0, pv.getName().trim());
|
||||
if (!pv.isConnected()) {
|
||||
table.setCellText(i/2, 1, "Disconnected");
|
||||
}
|
||||
}
|
||||
// Based on value of macro SHOW_PLC_IOC, enable visibility of PLCIOCDetailsTable
|
||||
if (widget.getPropertyValue("name") == 'PLCIOCDetailsTable') {
|
||||
if (display.getMacroValue("SHOW_PLC_IOC") == "true") {
|
||||
widget.setPropertyValue("visible", "true");
|
||||
display.getWidget("PLCIOCDetailsLabel").setPropertyValue("visible", "true");
|
||||
}
|
||||
}
|
||||
}
|
||||
//find index of the trigger PV
|
||||
var i=0;
|
||||
while (triggerPV != pvs[i]) {
|
||||
i+=1;
|
||||
}
|
||||
|
||||
var pvValue = PVUtil.getString(triggerPV).trim();
|
||||
var eugValue = table.getCellText(i, 4);
|
||||
if (eugValue != "") {
|
||||
pvValue = pvValue+" "+eugValue;
|
||||
}
|
||||
table.setCellText(i, 1, pvValue);
|
||||
table.setCellText(i, 2, PVUtil.getStatus(triggerPV).trim());
|
||||
table.setCellText(i, 3, PVUtil.getSeverityString(triggerPV).trim());
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
|
||||
color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
|
||||
|
||||
table.setCellBackground(i, 3, color);
|
||||
@@ -0,0 +1,49 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
# from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
table = widget.getTable()
|
||||
|
||||
#Fill PV Name only once
|
||||
if widget.getVar("firstTime") == None:
|
||||
widget.setVar("firstTime", True)
|
||||
i=0
|
||||
# Fill table only with non EGU pv's
|
||||
for pv in pvs:
|
||||
# earlier when by default pv.getName() was giving name with 'epics://' prefix. Ripping it off before showing was done below
|
||||
table.setCellText(i, 0, pv.getName().strip())
|
||||
if not pv.isConnected():
|
||||
table.setCellText(i/2, 1, "Disconnected")
|
||||
i+=1
|
||||
# Based on value of macro SHOW_PLC_IOC, enable visibility of PLCIOCDetailsTable
|
||||
if widget.getPropertyValue("name") == 'PLCIOCDetailsTable':
|
||||
if display.getMacroValue("SHOW_PLC_IOC") == "true":
|
||||
widget.setPropertyValue("visible", "true")
|
||||
display.getWidget("PLCIOCDetailsLabel").setPropertyValue("visible", "true")
|
||||
|
||||
#find index of the trigger PV
|
||||
i=0
|
||||
while triggerPV != pvs[i]:
|
||||
i+=1
|
||||
|
||||
pvValue = PVUtil.getString(triggerPV).strip();
|
||||
eugValue = table.getCellText(i, 4);
|
||||
if eugValue != "":
|
||||
pvValue = pvValue+" "+eugValue;
|
||||
table.setCellText(i, 1, pvValue)
|
||||
table.setCellText(i, 2, PVUtil.getStatus(triggerPV).strip())
|
||||
table.setCellText(i, 3, PVUtil.getSeverityString(triggerPV).strip())
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(i, 3, color)
|
||||
@@ -0,0 +1,92 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
// from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
var func = display.getPropertyValue("name");
|
||||
var type = widget.getPropertyValue("name");
|
||||
var widgetType = "ellipse";
|
||||
var varName = "XXXXXXX";
|
||||
|
||||
if (type.indexOf("PSH") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("PCF") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("SRV") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("PLC") != -1) {
|
||||
varName = "-PLCHLTS";
|
||||
}
|
||||
if (type.indexOf("COM") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
if (type.indexOf("CHS") != -1) {
|
||||
varName = "-SYSHLTS";
|
||||
}
|
||||
// if ("IOM" in type.indexOf() != -1) {
|
||||
// varName = "-BS";
|
||||
if (type.indexOf("CUB") != -1) {
|
||||
varName = "-CUBHLTS";
|
||||
}
|
||||
if (type.indexOf("Box") != -1) {
|
||||
widgetType = "rectangle";
|
||||
}
|
||||
|
||||
if (triggerPV.getName().indexOf(varName) != -1) {
|
||||
// ConsoleUtil.writeInfo("Trigger PV found) { " +triggerPV.getName());
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
|
||||
color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
|
||||
if ("ellipse" == widgetType) {
|
||||
widget.setPropertyValue("foreground_color", color);
|
||||
}
|
||||
|
||||
var tooltip = PVUtil.getString(triggerPV);
|
||||
widget.setPropertyValue("tooltip", tooltip);
|
||||
}
|
||||
|
||||
if (type.indexOf("IOM") != -1) {
|
||||
if (triggerPV.getName().indexOf(".SIMM") == -1) {
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
var color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
else if( s == 4) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
|
||||
widget.setPropertyValue("foreground_color", color);
|
||||
|
||||
var tooltip = PVUtil.getString(triggerPV);
|
||||
widget.setPropertyValue("tooltip", tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
# from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
func = display.getPropertyValue("name")
|
||||
type = widget.getPropertyValue("name")
|
||||
widgetType = "ellipse";
|
||||
varName = "XXXXXXX";
|
||||
|
||||
if "PSH" in type:
|
||||
varName = "-SYSHLTS";
|
||||
if "PCF" in type:
|
||||
varName = "-SYSHLTS";
|
||||
if "SRV" in type:
|
||||
varName = "-SYSHLTS";
|
||||
if "PLC" in type:
|
||||
varName = "-PLCHLTS";
|
||||
if "COM" in type:
|
||||
varName = "-SYSHLTS";
|
||||
if "CHS" in type:
|
||||
varName = "-SYSHLTS";
|
||||
# if "IOM" in type:
|
||||
# varName = "-BS";
|
||||
if "CUB" in type:
|
||||
varName = "-CUBHLTS";
|
||||
if "Box" in type:
|
||||
widgetType = "rectangle";
|
||||
|
||||
if varName in triggerPV.getName():
|
||||
# ConsoleUtil.writeInfo("Trigger PV found: " +triggerPV.getName());
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
elif s == 4:
|
||||
color = ColorFontUtil.GREEN
|
||||
|
||||
if "ellipse" == widgetType:
|
||||
widget.setPropertyValue("foreground_color", color)
|
||||
|
||||
tooltip = PVUtil.getString(triggerPV)
|
||||
widget.setPropertyValue("tooltip", tooltip)
|
||||
|
||||
if "IOM" in type:
|
||||
if ".SIMM" not in triggerPV.getName():
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
elif s == 4:
|
||||
color = ColorFontUtil.GREEN
|
||||
|
||||
widget.setPropertyValue("foreground_color", color)
|
||||
|
||||
tooltip = PVUtil.getString(triggerPV)
|
||||
widget.setPropertyValue("tooltip", tooltip)
|
||||
@@ -0,0 +1,57 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var nbColPVs=2;
|
||||
// find index of the trigger PV
|
||||
var i=0;
|
||||
while (i< pvs.length) {
|
||||
if(pvs[i].isConnected()==true){
|
||||
|
||||
|
||||
var s = PVUtil.getSeverity(pvs[i]);
|
||||
}else{
|
||||
|
||||
var s =3;
|
||||
}
|
||||
|
||||
var color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
else if( s == 4) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
|
||||
|
||||
if (pvs[i].getName().indexOf("-CUBHLTS") != -1) {
|
||||
if(pvs[i].isConnected()==true){
|
||||
table.setCellText(i/nbColPVs, 3, PVUtil.getString(pvs[i]));
|
||||
}else{
|
||||
table.setCellText(i/nbColPVs, 3, "disconnected");
|
||||
}
|
||||
table.setCellBackground(i/nbColPVs, 3, color);
|
||||
}
|
||||
if (pvs[i].getName().indexOf("-PLCHLTS") != -1) {
|
||||
if(pvs[i].isConnected()==true){
|
||||
table.setCellText(i/nbColPVs, 4, PVUtil.getString(pvs[i]));
|
||||
}else{
|
||||
table.setCellText(i/nbColPVs, 4, "disconnected");
|
||||
}
|
||||
table.setCellBackground(i/nbColPVs, 4, color);
|
||||
}
|
||||
i=i+1;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
|
||||
|
||||
table = widget.getTable()
|
||||
nbColPVs=2
|
||||
#find index of the trigger PV
|
||||
i=0
|
||||
while triggerPV != pvs[i]:
|
||||
i+=1
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
elif s == 4:
|
||||
color = ColorFontUtil.GREEN
|
||||
# table.setCellBackground(i/nbColPVs, i%nbColPVs + 3, color)
|
||||
if "-CUBHLTS" in triggerPV.getName():
|
||||
table.setCellText(i/nbColPVs, 3, PVUtil.getString(triggerPV))
|
||||
table.setCellBackground(i/nbColPVs, 3, color)
|
||||
if "-PLCHLTS" in triggerPV.getName():
|
||||
table.setCellText(i/nbColPVs, 4, PVUtil.getString(triggerPV))
|
||||
table.setCellBackground(i/nbColPVs, 4, color)
|
||||
@@ -0,0 +1,55 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
|
||||
|
||||
var table = widget.getTable();
|
||||
|
||||
//Fill PV Name only once
|
||||
if (widget.getVar("firstTime") == null)
|
||||
{
|
||||
widget.setVar("firstTime", true);
|
||||
|
||||
for (var i=0;pv=pvs[i];i++) {
|
||||
// earlier when by default pv.getName() was giving name with 'epics://' prefix. Ripping it off before showing was done below
|
||||
table.setCellText(i, 0, pv.getName().trim())
|
||||
if (!pv.isConnected()) {
|
||||
table.setCellText(i, 1, "Disconnected");
|
||||
}
|
||||
}
|
||||
// Based on value of macro SHOW_PLC_IOC, enable visibility of PLCIOCDetailsTable
|
||||
if (widget.getPropertyValue("name") == 'PLCIOCDetailsTable') {
|
||||
if (display.getMacroValue("SHOW_PLC_IOC") == "true") {
|
||||
widget.setPropertyValue("visible", "true");
|
||||
display.getWidget("PLCIOCDetailsLabel").setPropertyValue("visible", "true");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//find index of the trigger PV
|
||||
var i=0;
|
||||
while (triggerPV != pvs[i]) {
|
||||
i+=1;
|
||||
}
|
||||
|
||||
table.setCellText(i, 1, PVUtil.getString(triggerPV).trim());
|
||||
table.setCellText(i, 2, PVUtil.getStatus(triggerPV).trim());
|
||||
table.setCellText(i, 3, PVUtil.getSeverityString(triggerPV).trim());
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
|
||||
var color = ColorFontUtil.WHITE
|
||||
color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
table.setCellBackground(i, 3, color);
|
||||
@@ -0,0 +1,45 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
|
||||
|
||||
table = widget.getTable()
|
||||
|
||||
#Fill PV Name only once
|
||||
if widget.getVar("firstTime") == None:
|
||||
widget.setVar("firstTime", True)
|
||||
i=0
|
||||
for pv in pvs:
|
||||
# earlier when by default pv.getName() was giving name with 'epics://' prefix. Ripping it off before showing was done below
|
||||
table.setCellText(i, 0, pv.getName().strip())
|
||||
if not pv.isConnected():
|
||||
table.setCellText(i, 1, "Disconnected")
|
||||
i+=1
|
||||
# Based on value of macro SHOW_PLC_IOC, enable visibility of PLCIOCDetailsTable
|
||||
if widget.getPropertyValue("name") == 'PLCIOCDetailsTable':
|
||||
if display.getMacroValue("SHOW_PLC_IOC") == "true":
|
||||
widget.setPropertyValue("visible", "true")
|
||||
display.getWidget("PLCIOCDetailsLabel").setPropertyValue("visible", "true")
|
||||
|
||||
|
||||
#find index of the trigger PV
|
||||
i=0
|
||||
while triggerPV != pvs[i]:
|
||||
i+=1
|
||||
|
||||
table.setCellText(i, 1, PVUtil.getString(triggerPV).strip())
|
||||
table.setCellText(i, 2, PVUtil.getStatus(triggerPV).strip())
|
||||
table.setCellText(i, 3, PVUtil.getSeverityString(triggerPV).strip())
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(i, 3, color)
|
||||
@@ -0,0 +1,74 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil.*);
|
||||
|
||||
var table = widget.getTable();
|
||||
var func = display.getPropertyValue("name");
|
||||
|
||||
var i = 0;
|
||||
var row = 0;
|
||||
var col = 3;
|
||||
// ConsoleUtil.writeInfo("Trigger PV : " + triggerPV.getName());
|
||||
while (triggerPV != pvs[i]) {
|
||||
// ConsoleUtil.writeInfo("pvs[i] : " + pvs[i].getName());
|
||||
if (col == 5) {
|
||||
if (pvs[i+1].getName().indexOf("PLC-IOCHLTS") != -1) {
|
||||
col = col+1;
|
||||
}
|
||||
else {
|
||||
col = 3
|
||||
row = row+1;
|
||||
}
|
||||
}
|
||||
else if (col == 3) {
|
||||
if ( (pvs[i+1].getName().indexOf("-SYSHLTS") != -1) || (pvs[i+1].getName().indexOf("-HLTS") != -1)) {
|
||||
col = 3;
|
||||
row = row+1;
|
||||
}
|
||||
else if (pvs[i+1].getName().indexOf("-IOCHLTS") != -1) {
|
||||
if (pvs[i+1].getName().indexOf("CORE-IOCHLTS") != -1) {
|
||||
col = 4;
|
||||
}
|
||||
else {
|
||||
col = 5;
|
||||
}
|
||||
}
|
||||
else {
|
||||
col += 1;
|
||||
if (col > 5) {
|
||||
row += 1;
|
||||
col = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
col += 1;
|
||||
if (col > 6) {
|
||||
row += 1;
|
||||
col = 3;
|
||||
}
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
table.setCellText(row, col, PVUtil.getString(triggerPV))
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK
|
||||
}
|
||||
table.setCellBackground(row, col, color)
|
||||
@@ -0,0 +1,55 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
|
||||
|
||||
table = widget.getTable()
|
||||
func = display.getPropertyValue("name")
|
||||
|
||||
i = 0
|
||||
row = 0
|
||||
col = 3
|
||||
# ConsoleUtil.writeInfo("Trigger PV : " + triggerPV.getName());
|
||||
while triggerPV != pvs[i]:
|
||||
# ConsoleUtil.writeInfo("pvs[i] : " + pvs[i].getName());
|
||||
if col == 5:
|
||||
if "PLC-IOCHLTS" in pvs[i+1].getName():
|
||||
col = col+1
|
||||
else:
|
||||
col = 3
|
||||
row = row+1
|
||||
elif col == 3:
|
||||
if "-SYSHLTS" in pvs[i+1].getName() or "-HLTS" in pvs[i+1].getName():
|
||||
col =3
|
||||
row = row+1
|
||||
elif "-IOCHLTS" in pvs[i+1].getName():
|
||||
if "CORE-IOCHLTS" in pvs[i+1].getName():
|
||||
col = 4
|
||||
else:
|
||||
col = 5
|
||||
else:
|
||||
col += 1
|
||||
if col > 5:
|
||||
row += 1
|
||||
col = 3
|
||||
else:
|
||||
col += 1
|
||||
if col > 6:
|
||||
row += 1
|
||||
col = 3
|
||||
i += 1
|
||||
|
||||
table.setCellText(row, col, PVUtil.getString(triggerPV))
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(row, col, color)
|
||||
@@ -0,0 +1,34 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
importPackage(Packages.org.csstudio.opibuilder.scriptUtil.*);
|
||||
|
||||
var table = widget.getTable();
|
||||
var nbColPVs=4;
|
||||
|
||||
//find index of the trigger PV
|
||||
|
||||
var i=0;
|
||||
while (triggerPV != pvs[i]) {
|
||||
i+=1;
|
||||
}
|
||||
|
||||
table.setCellText(i/nbColPVs, i%nbColPVs +3, PVUtil.getString(triggerPV));
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
|
||||
var color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
|
||||
table.setCellBackground(i/nbColPVs, i%nbColPVs + 3, color);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
|
||||
|
||||
table = widget.getTable()
|
||||
nbColPVs=4
|
||||
#find index of the trigger PV
|
||||
i=0
|
||||
while triggerPV != pvs[i]:
|
||||
i+=1
|
||||
|
||||
table.setCellText(i/nbColPVs, i%nbColPVs +3, PVUtil.getString(triggerPV))
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(i/nbColPVs, i%nbColPVs + 3, color)
|
||||
@@ -0,0 +1,31 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ColorFontUtil);
|
||||
|
||||
|
||||
var table = widget.getTable();
|
||||
var nbColPVs=3;
|
||||
//find index of the trigger PV
|
||||
var i=0;
|
||||
while (triggerPV != pvs[i]) {
|
||||
i+=1;
|
||||
}
|
||||
|
||||
table.setCellText(i/nbColPVs, i%nbColPVs +3, PVUtil.getString(triggerPV));
|
||||
|
||||
var s = PVUtil.getSeverity(triggerPV);
|
||||
|
||||
var color = ColorFontUtil.WHITE;
|
||||
if( s == 0) {
|
||||
color = ColorFontUtil.GREEN;
|
||||
}
|
||||
else if( s == 1) {
|
||||
color = ColorFontUtil.RED;
|
||||
}
|
||||
else if( s == 2) {
|
||||
color = ColorFontUtil.YELLOW;
|
||||
}
|
||||
else if( s == 3) {
|
||||
color = ColorFontUtil.PINK;
|
||||
}
|
||||
|
||||
table.setCellBackground(i/nbColPVs, i%nbColPVs + 3, color);
|
||||
@@ -0,0 +1,27 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ColorFontUtil
|
||||
|
||||
|
||||
table = widget.getTable()
|
||||
nbColPVs = 3
|
||||
#find index of the trigger PV
|
||||
i = 0
|
||||
while triggerPV != pvs[i]:
|
||||
i += 1
|
||||
|
||||
|
||||
table.setCellText(i / nbColPVs, i % nbColPVs + 3, PVUtil.getString(triggerPV))
|
||||
|
||||
s = PVUtil.getSeverity(triggerPV)
|
||||
|
||||
color = ColorFontUtil.WHITE
|
||||
if s == 0:
|
||||
color = ColorFontUtil.GREEN
|
||||
elif s == 1:
|
||||
color = ColorFontUtil.RED
|
||||
elif s == 2:
|
||||
color = ColorFontUtil.YELLOW
|
||||
elif s == 3:
|
||||
color = ColorFontUtil.PINK
|
||||
|
||||
table.setCellBackground(i / nbColPVs, i % nbColPVs + 3, color)
|
||||
@@ -0,0 +1,14 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=display.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
ScriptUtil.openOPI(display.getWidget("SystemDetailsTable"), "/opt/codac/opi/epics-sysmon/boy/ITER-SYSM-IOC_Mimic.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,14 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=display.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var macroInput = DataUtil.createMacrosInput(true)
|
||||
ScriptUtil.openOPI(display.getWidget("GeneralTable"), "/opt/codac/opi/epics-sysmon/boy/ITER-SYSM-PLC_Mimic.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,29 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
|
||||
var selectionListener = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
var selectedrow= table.getSelection();
|
||||
var cuName=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
|
||||
var macroInput = DataUtil.createMacrosInput(true);
|
||||
macroInput.put("CU", cuName);
|
||||
macroInput.put("PHY_NAME", phyName);
|
||||
macroInput.put("FCT_NAME", fct_name);
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if (cuName.indexOf("P") == 0) {
|
||||
ScriptUtil.openOPI(widget, fct_name + "-" + cuName + "-PLCDetails.opi", 1, macroInput);
|
||||
}
|
||||
else {
|
||||
ScriptUtil.openOPI(widget, fct_name+"-CubiclePLCDetails.opi", 0, macroInput);
|
||||
}
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionListener);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuName=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
phyName=row[1]
|
||||
cuName=row[0];
|
||||
# change $(CU) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CU", cuName)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
if cuName.startswith('P'):
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-PLCDetails.opi", 1, macroInput)
|
||||
else:
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CubiclePLCDetails.opi", 0, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
@@ -0,0 +1,26 @@
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.DataUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.PVUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ScriptUtil);
|
||||
importClass(Packages.org.csstudio.opibuilder.scriptUtil.ConsoleUtil);
|
||||
|
||||
var table = widget.getTable();
|
||||
var fct_name=widget.getPropertyValue("name");
|
||||
var selectionChanged = new Packages.org.csstudio.swt.widgets.natives.SpreadSheetTable.ITableSelectionChangedListener() {
|
||||
selectionChanged: function(selection) {
|
||||
|
||||
var selectedrow= table.getSelection();
|
||||
var cuName=selectedrow[0][0];
|
||||
var phyName=selectedrow[0][1];
|
||||
|
||||
// change $(CU) substitution
|
||||
var macroInput = DataUtil.createMacrosInput(true);
|
||||
macroInput.put("CU", cuName);
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name);
|
||||
macroInput.put("SHOW_PLC_IOC", "false");
|
||||
// open OPI
|
||||
// see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(widget, fct_name+"-"+cuName+"-SRVDetails.opi", 1, macroInput);
|
||||
}
|
||||
};
|
||||
table.addSelectionChangedListener(selectionChanged);
|
||||
@@ -0,0 +1,26 @@
|
||||
from org.csstudio.opibuilder.scriptUtil import PVUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import DataUtil
|
||||
from org.csstudio.opibuilder.scriptUtil import ScriptUtil
|
||||
from org.csstudio.swt.widgets.natives.SpreadSheetTable import ITableSelectionChangedListener
|
||||
from java.util import Arrays
|
||||
|
||||
table = widget.getTable()
|
||||
fct_name=display.getPropertyValue("name")
|
||||
class SelectionListener(ITableSelectionChangedListener):
|
||||
def selectionChanged(self, selection):
|
||||
cuName=""
|
||||
phyName=""
|
||||
for row in selection:
|
||||
phyName=row[1]
|
||||
cuName=row[0]
|
||||
|
||||
# change $(CU) substitution
|
||||
macroInput = DataUtil.createMacrosInput(True)
|
||||
macroInput.put("CU", cuName)
|
||||
macroInput.put("PHY_NAME", phyName)
|
||||
macroInput.put("FCT_NAME", fct_name)
|
||||
macroInput.put("SHOW_PLC_IOC", "false")
|
||||
# open OPI
|
||||
# see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java
|
||||
ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CtrlUnitDetails.opi", 1, macroInput)
|
||||
table.addSelectionChangedListener(SelectionListener())
|
||||
Reference in New Issue
Block a user