Class PVWidgetEditpartDelegate

java.lang.Object
org.csstudio.opibuilder.editparts.PVWidgetEditpartDelegate
All Implemented Interfaces:
IPVWidgetEditpart

public class PVWidgetEditpartDelegate extends Object implements IPVWidgetEditpart
  • Field Details

    • timerTask

      protected Runnable timerTask
    • updateSuppressTimer

      protected OPITimer updateSuppressTimer
  • Constructor Details

  • Method Details

    • getWidgetModel

      public IPVWidgetModel 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

      public IPV getControlPV()
      Specified by:
      getControlPV in interface IPVWidgetEditpart
      Returns:
      the control PV. null if no control PV on this widget.
    • getPV

      public IPV getPV()
      Get the PV corresponding to the PV Name property. It is same as calling getPV("pv_name").
      Specified by:
      getPV in interface IPVWidgetEditpart
      Returns:
      the PV corresponding to the PV Name property. null if PV Name is not configured for this widget.
    • getPV

      public IPV getPV(String pvPropId)
      Get the pv by PV property id.
      Specified by:
      getPV in interface IPVWidgetEditpart
      Parameters:
      pvPropId - the PV property id.
      Returns:
      the corresponding pv for the pvPropId. null if the pv doesn't exist.
    • getPVValue

      public VType getPVValue(String pvPropId)
      Get value from one of the attached PVs.
      Specified by:
      getPVValue in interface IPVWidgetEditpart
      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

      public void markAsControlPV(String pvPropId, String pvValuePropId)
      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 interface IPVWidgetEditpart
    • 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

      public Color calculateBackColor()
    • calculateForeColor

      public Color calculateForeColor()
    • calculateAlarmColor

      public Color calculateAlarmColor(boolean isSensitive, Color saveColor)
    • setPVValue

      public void setPVValue(String pvPropId, Object value)
      Set PV to given value. Should accept Double, Double[], Integer, String, maybe more.
      Specified by:
      setPVValue in interface IPVWidgetEditpart
      Parameters:
      pvPropId -
      value -
    • setIgnoreOldPVValue

      public void setIgnoreOldPVValue(boolean ignoreOldValue)
    • getAllPVNames

      public String[] getAllPVNames()
      Specified by:
      getAllPVNames in interface IPVWidgetEditpart
      Returns:
      A String array with all PV names from PV properties. It only returns the visible and nonempty PV properties.
    • getPVName

      public String getPVName()
      Specified by:
      getPVName in interface IPVWidgetEditpart
      Returns:
      name of the major PV.
    • addSetPVValueListener

      public void addSetPVValueListener(IPVWidgetEditpart.ISetPVValueListener listener)
      Specified by:
      addSetPVValueListener in interface IPVWidgetEditpart
    • fireSetPVValue

      protected void fireSetPVValue(String pvPropId, Object value)
    • 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 interface IPVWidgetEditpart
    • addAlarmSeverityListener

      public void addAlarmSeverityListener(AlarmSeverityListener listener)