Class PVWidgetEditpartDelegate
java.lang.Object
org.csstudio.opibuilder.editparts.PVWidgetEditpartDelegate
- All Implemented Interfaces:
IPVWidgetEditpart
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.csstudio.opibuilder.editparts.IPVWidgetEditpart
IPVWidgetEditpart.ISetPVValueListener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
calculateAlarmColor
(boolean isSensitive, Color saveColor) org.eclipse.draw2d.Border
void
void
protected void
fireSetPVValue
(String pvPropId, Object value) String[]
getPV()
Get the PV corresponding to thePV Name
property.Get the pv by PV property id.getPVValue
(String pvPropId) Get value from one of the attached PVs.int
void
initFigure
(org.eclipse.draw2d.IFigure figure) boolean
void
markAsControlPV
(String pvPropId, String pvValuePropId) For PV Control widgets, mark this PV as control PV.void
void
setControlEnabled
(boolean enabled) Set whether the editpart is enabled for PV control.void
setIgnoreOldPVValue
(boolean ignoreOldValue) void
setPVValue
(String pvPropId, Object value) Set PV to given value.void
setUpdateSuppressTime
(int updateSuppressTime) Set the time needed to suppress reading back from PV after writing.void
void
startPVs()
Start all PVs.protected void
Start the updateSuppressTimer.void
-
Field Details
-
timerTask
-
updateSuppressTimer
-
-
Constructor Details
-
PVWidgetEditpartDelegate
- Parameters:
editpart
- the editpart to be delegated. It must implementedIPVWidgetEditpart
-
-
Method Details
-
getWidgetModel
-
doActivate
public void doActivate() -
startPVs
public void startPVs()Start all PVs. This should be called as the last step in editpart.activate(). -
doDeActivate
public void doDeActivate() -
getControlPV
- Specified by:
getControlPV
in interfaceIPVWidgetEditpart
- Returns:
- the control PV. null if no control PV on this widget.
-
getPV
Get the PV corresponding to thePV Name
property. It is same as callinggetPV("pv_name")
.- Specified by:
getPV
in interfaceIPVWidgetEditpart
- Returns:
- the PV corresponding to the
PV Name
property. null if PV Name is not configured for this widget.
-
getPV
Get the pv by PV property id.- Specified by:
getPV
in interfaceIPVWidgetEditpart
- Parameters:
pvPropId
- the PV property id.- Returns:
- the corresponding pv for the pvPropId. null if the pv doesn't exist.
-
getPVValue
Get value from one of the attached PVs.- Specified by:
getPVValue
in interfaceIPVWidgetEditpart
- Parameters:
pvPropId
- the property id of the PV. It is "pv_name" for the main PV.- Returns:
- the IValue of the PV.
-
getUpdateSuppressTime
public int getUpdateSuppressTime()- Returns:
- the time needed to suppress reading back from PV after writing. No need to suppress if returned value <=0
-
setUpdateSuppressTime
public void setUpdateSuppressTime(int updateSuppressTime) Set the time needed to suppress reading back from PV after writing. No need to suppress if returned value <=0- Parameters:
updateSuppressTime
-
-
initFigure
public void initFigure(org.eclipse.draw2d.IFigure figure) -
markAsControlPV
For PV Control widgets, mark this PV as control PV.- Parameters:
pvPropId
- the propId of the PV.
-
isPVControlWidget
public boolean isPVControlWidget()- Specified by:
isPVControlWidget
in interfaceIPVWidgetEditpart
-
registerBasePropertyChangeHandlers
public void registerBasePropertyChangeHandlers() -
stopPulsing
public void stopPulsing() -
startPulsing
public void startPulsing() -
startUpdateSuppressTimer
protected void startUpdateSuppressTimer()Start the updateSuppressTimer. All property change listeners of PV_Value property will temporarily removed until timer is due. -
calculateBorder
public org.eclipse.draw2d.Border calculateBorder() -
calculateBackColor
-
calculateForeColor
-
calculateAlarmColor
-
setPVValue
Set PV to given value. Should accept Double, Double[], Integer, String, maybe more.- Specified by:
setPVValue
in interfaceIPVWidgetEditpart
- Parameters:
pvPropId
-value
-
-
setIgnoreOldPVValue
public void setIgnoreOldPVValue(boolean ignoreOldValue) -
getAllPVNames
- Specified by:
getAllPVNames
in interfaceIPVWidgetEditpart
- Returns:
- A String array with all PV names from PV properties. It only returns the visible and nonempty PV properties.
-
getPVName
- Specified by:
getPVName
in interfaceIPVWidgetEditpart
- Returns:
- name of the major PV.
-
addSetPVValueListener
- Specified by:
addSetPVValueListener
in interfaceIPVWidgetEditpart
-
fireSetPVValue
-
setControlEnabled
public void setControlEnabled(boolean enabled) Set whether the editpart is enabled for PV control. Disabled editparts have greyed-out figures, and the cursor is set to a cross.- Specified by:
setControlEnabled
in interfaceIPVWidgetEditpart
-
addAlarmSeverityListener
-