Interface IScannableDeviceService

All Known Implementing Classes:
MockScannableConnector, ScannableDeviceConnectorService

public interface IScannableDeviceService
Clients do not need to consume this service, it is used to provide connection to devices which already exist, like those in GDA8.

A bundle implements this service and the scanning consumes the service. The tests provide the service directly.

This service is designed to be implemented by GDA8 to provide scannables (existing ones) to the new system. This can be done easily as IScannable is a subset of Scannable in GDA8.

It also provides IWritableDetector's. These are analogous to, but not the same as Detector in GDA. The service wraps both gda.device.Detector into IWritableDetector and gda.px.detector.Detector into IWritableDetector. In the first case the model provides the collection time and anything else required. In the later case the model provides the file path and omegaStart required.

It mirrors the other connector services like the JMS one, which push the details of getting connections outside the core scanning API using declarative services.

  • Method Details

    • register

      <T> void register(IScannable<T> scannable)
      Used to register a device. This is required so that spring may create detectors and call the register method by telling the detector to register itself.
      Parameters:
      device -
    • getScannableNames

      List<String> getScannableNames() throws ScanningException
      Get the names of all scannables known to the connector.
      Returns:
      Throws:
      ScanningException
    • getScannable

      <T> IScannable<T> getScannable(String name) throws ScanningException
      Get a scannable by name.
      Parameters:
      name - name of scannable to find
      Returns:
      scannable, never null
      Throws:
      ScanningException - if no scannable with the given name could be found
    • getScannables

      default List<IScannable<?>> getScannables(IPosition position) throws ScanningException
      Returns a list of the scannables for the given IPositions.
      Parameters:
      position - an IPosition
      Returns:
      list of scannables for the given position
      Throws:
      ScanningException - if one or more of the scannables cannot be found
    • getScannables

      default List<IScannable<?>> getScannables(List<String> scannableNames) throws ScanningException
      Returns a list of the scannables with the given names
      Parameters:
      scannableNames - a list of scannable names
      Returns:
      list of scannables for the given names
      Throws:
      ScanningException - if one or more of the scannables cannot be found
    • getGlobalPerScanMonitorNames

      @Deprecated(since="GDA 9.3", forRemoval=true) default Set<String> getGlobalPerScanMonitorNames()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use
      invalid reference
      IDefaultScanConfigurations
      instead TODO this method should eventually be removed
      Returns the set of global per-scan monitors that should be added to all scans. This is used to support legacy (GDA8) spring configurations. Should not be called by client code.
      Returns:
      global per-scan monitor names
    • getRequiredPerScanMonitorNames

      @Deprecated(since="GDA 9.3", forRemoval=true) default Set<String> getRequiredPerScanMonitorNames(String scannableName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this feature should not be used for new code, if this behaviour is required we should add a GDA9 way to do define scannable dependencies
      Returns the set of the names required per-scan monitors for the given scannable name. This is used to support legacy (GDA8) spring configurations. Should not be called by client code.
      Parameters:
      scannableName - scannable to get required per-scan monitor names for
      Returns:
      names of required per-scan monitors for the scannable with the given name
    • handleDeviceError

      default void handleDeviceError(String name, Exception e)