Class PlotServerBase

All Implemented Interfaces:
Device, Configurable, Findable, gda.observable.IObservable, PlotServer, PlotServerDevice, PlotService

@ServiceInterface(PlotServerDevice.class) public class PlotServerBase extends DeviceBase implements PlotServerDevice
This is the fundamental class for all the PlotServer functionality, it is basically a store of all the GUI specific information so that they are synchronised across all the servers, as well as containing the plot information which should be displayed on all the GUI windows.
  • Constructor Details

    • PlotServerBase

      public PlotServerBase()
  • Method Details

    • configure

      public void configure()
      Description copied from class: ConfigurableBase
      Default implementation for classes that do not have to do any specific configuration.
      Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.
      Specified by:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
    • getPlotServer

      public static PlotServer getPlotServer()
    • getData

      public DataBean getData(String guiName) throws Exception
      Description copied from interface: PlotService
      This method should return the plotData which is currently connected to a particular GUI
      Specified by:
      getData in interface PlotService
      Parameters:
      guiName - the name of the GUI which is requesting the data, or the GUI name of the data which a third party is trying to look at
      Returns:
      The GUI data for the named GUI
      Throws:
      Exception - If there is a problem with communication with the object.
    • getGuiState

      public GuiBean getGuiState(String guiName) throws Exception
      Description copied from interface: PlotService
      This method allows for interested parties to get relevant GUI information about a particular GUI panel
      Specified by:
      getGuiState in interface PlotService
      Parameters:
      guiName - The name of the GUI panel from which the data is to be retrieved
      Returns:
      The data which specifies the requested GUI panels attributes
      Throws:
      Exception - If there is a problem with communication with the object.
    • setData

      public void setData(String guiName, DataBean data) throws Exception
      Description copied from interface: PlotService
      This method should set the data that is to be plotted on the client of a specific name
      Specified by:
      setData in interface PlotService
      Parameters:
      guiName - The name of the GUI panel to plot to
      data - The data which requires plotting (can be null to reset server's cached data)
      Throws:
      Exception - If there is a problem with communication with the object.
    • updateData

      public void updateData(String guiName) throws Exception
      Description copied from interface: PlotService
      This method should report to all observers that there is some data available on the server for plotting. It just sends out the name of the panel for which additional data is available, and it is up to the specific observers as to whether they try to retrieve that data or not using the getPlotData method
      Specified by:
      updateData in interface PlotService
      Parameters:
      guiName -
      Throws:
      Exception
    • updateGui

      public void updateGui(String guiName, GuiBean guiData) throws Exception
      Description copied from interface: PlotService
      This method should be called whenever some GUI information changes, this will then set the GUI's bean which contains all the state information, so that it can be obtained from other GUIs and interested parties. This also fires off a message to all observers to let them know there has been a change of the GUI data, and this information is also sent with the update
      Specified by:
      updateGui in interface PlotService
      Parameters:
      guiName - The name of the GUI which is being updated
      guiData - The data which specifies that GUI panel
      Throws:
      Exception - If there is a problem with communication with the object.
    • addIObserver

      public void addIObserver(gda.observable.IObserver observer)
      Specified by:
      addIObserver in interface gda.observable.IObservable
      Overrides:
      addIObserver in class DeviceBase
    • deleteIObserver

      public void deleteIObserver(gda.observable.IObserver observer)
      Specified by:
      deleteIObserver in interface gda.observable.IObservable
      Overrides:
      deleteIObserver in class DeviceBase
    • deleteIObservers

      public void deleteIObservers()
      Specified by:
      deleteIObservers in interface gda.observable.IObservable
      Overrides:
      deleteIObservers in class DeviceBase
    • isServerLocal

      public boolean isServerLocal() throws Exception
      Specified by:
      isServerLocal in interface PlotService
      Returns:
      true if plot server is local (i.e. sees the same file system)
      Throws:
      Exception - If there is a problem with communication with the object.
    • getGuiNames

      public String[] getGuiNames() throws Exception
      Description copied from interface: PlotService
      Return a list of all the names known to the plot server. That is any guiName that has a data or gui bean
      Specified by:
      getGuiNames in interface PlotService
      Returns:
      the list of names
      Throws:
      Exception - If there is a problem with communication with the object.
    • toString

      public String toString()
      Overrides:
      toString in class Object