Class LiveStreamWrapper

java.lang.Object
uk.ac.gda.client.live.stream.LiveStreamWrapper
All Implemented Interfaces:
org.eclipse.january.dataset.IDatasetConnector, org.eclipse.january.dataset.IDynamicShape, org.eclipse.january.dataset.IFileConnection

public class LiveStreamWrapper extends Object implements org.eclipse.january.dataset.IDatasetConnector
Wraps an IDatasetConnector with reference counting to allow it to be shared by multiple connections.
  • Constructor Details

  • Method Details

    • connect

      public String connect() throws org.eclipse.january.DatasetException
      Connect to an existing dataset.
      Callers should use isConfigCompatible(CameraConfiguration, StreamType) to check that the wrapped stream is compatible before calling this function.
      Specified by:
      connect in interface org.eclipse.january.dataset.IDatasetConnector
      Throws:
      org.eclipse.january.DatasetException
    • disconnect

      public void disconnect()
      Specified by:
      disconnect in interface org.eclipse.january.dataset.IDatasetConnector
    • isConfigCompatible

      public boolean isConfigCompatible(CameraConfiguration cameraConfig, StreamType streamType)
      Check that the given CameraConfiguration invalid input: '&' StreamType are compatible with the values used to create this wrapper.

      We check the parameters that are used to create the stream, not the ones that are GUI-related.

    • getConnectionCount

      public int getConnectionCount()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPath

      public String getPath()
      Specified by:
      getPath in interface org.eclipse.january.dataset.IFileConnection
    • setPath

      public void setPath(String path)
      Specified by:
      setPath in interface org.eclipse.january.dataset.IFileConnection
    • getDataset

      public org.eclipse.january.dataset.ILazyDataset getDataset()
      Specified by:
      getDataset in interface org.eclipse.january.dataset.IDynamicShape
    • resize

      public boolean resize(int... newShape)
      Specified by:
      resize in interface org.eclipse.january.dataset.IDynamicShape
    • getMaxShape

      public int[] getMaxShape()
      Specified by:
      getMaxShape in interface org.eclipse.january.dataset.IDynamicShape
    • setMaxShape

      public void setMaxShape(int... maxShape)
      Specified by:
      setMaxShape in interface org.eclipse.january.dataset.IDynamicShape
    • startUpdateChecker

      public void startUpdateChecker(int milliseconds, org.eclipse.january.dataset.IDatasetChangeChecker checker)
      Specified by:
      startUpdateChecker in interface org.eclipse.january.dataset.IDynamicShape
    • refreshShape

      public boolean refreshShape()
      Specified by:
      refreshShape in interface org.eclipse.january.dataset.IDynamicShape
    • addDataListener

      public void addDataListener(org.eclipse.january.dataset.IDataListener l)
      Specified by:
      addDataListener in interface org.eclipse.january.dataset.IDynamicShape
    • removeDataListener

      public void removeDataListener(org.eclipse.january.dataset.IDataListener l)
      Specified by:
      removeDataListener in interface org.eclipse.january.dataset.IDynamicShape
    • fireDataListeners

      public void fireDataListeners()
      Specified by:
      fireDataListeners in interface org.eclipse.january.dataset.IDynamicShape
    • getDatasetName

      public String getDatasetName()
      Specified by:
      getDatasetName in interface org.eclipse.january.dataset.IDatasetConnector
    • setDatasetName

      public void setDatasetName(String datasetName)
      Specified by:
      setDatasetName in interface org.eclipse.january.dataset.IDatasetConnector
    • setWritingExpected

      public void setWritingExpected(boolean expectWrite)
      Specified by:
      setWritingExpected in interface org.eclipse.january.dataset.IDatasetConnector
    • isWritingExpected

      public boolean isWritingExpected()
      Specified by:
      isWritingExpected in interface org.eclipse.january.dataset.IDatasetConnector
    • connect

      public String connect(long time, TimeUnit unit) throws org.eclipse.january.DatasetException
      Specified by:
      connect in interface org.eclipse.january.dataset.IDatasetConnector
      Throws:
      org.eclipse.january.DatasetException