Class CameraBase

All Implemented Interfaces:
Device, Configurable, Findable, Camera, ImageScaleProvider, gda.observable.IObservable
Direct Known Subclasses:
DummyOpticalCamera, MxOpticalCameraBase

public abstract class CameraBase extends DeviceBase implements Camera
Base class for object implementing the Camera interface
  • Field Details

    • UNSET_ARRAY_INDEX

      public static final int UNSET_ARRAY_INDEX
      See Also:
    • cameraZoomIndexStatus

      protected int cameraZoomIndexStatus
    • cameraName

      protected String cameraName
    • imageFile

      protected String imageFile
  • Constructor Details

    • CameraBase

      public CameraBase()
  • Method Details

    • updateCameraToIndexedSettings

      protected abstract void updateCameraToIndexedSettings(int verifiedIndex) throws DeviceException
      Invoked (indirectly) by setZoom(double) for indexed zoom levels,
      Parameters:
      verifiedIndex - settings index; already verified to lie within range
      Throws:
      DeviceException
    • getImageFileName

      public String getImageFileName() throws DeviceException
      Description copied from interface: Camera
      get the name of the file that image is written to
      Specified by:
      getImageFileName in interface Camera
      Returns:
      string - filename
      Throws:
      DeviceException
    • setImageFile

      public void setImageFile(String imageFile)
    • getCameraName

      public String getCameraName() throws DeviceException
      Specified by:
      getCameraName in interface Camera
      Returns:
      string - name of the camera
      Throws:
      DeviceException
    • selectZoomAt

      public void selectZoomAt(int targetIndex) throws DeviceException
      Description copied from interface: Camera
      Sets the zoom level via an index, based on array values (see Camera.getZoomLevels()):
      Specified by:
      selectZoomAt in interface Camera
      Parameters:
      targetIndex - array index of new zoom level, ignored if out of range
      Throws:
      DeviceException
    • getZoomIndex

      public final int getZoomIndex()
      Specified by:
      getZoomIndex in interface Camera
      Returns:
      the zoom index of the present zoom setting, else -1 if no zoom level is set, or no levels are present
    • setZoomIndex

      protected final void setZoomIndex(int index)
    • getZoomSimilarityTolerance

      protected abstract double getZoomSimilarityTolerance()
    • setZoom

      public final void setZoom(double zoom) throws DeviceException
      Description copied from interface: Camera
      Sets the zoom level. Number must be a member of the list returned by Camera.getZoomLevels().
      Specified by:
      setZoom in interface Camera
      Parameters:
      zoom -
      Throws:
      DeviceException
    • areSimilar

      protected static boolean areSimilar(double x, double reference, double tol)
      Checks a value against a reference value, indicating if they are similar to within a plus/minus tolerance
      Parameters:
      x - a value to check for similarity
      reference - the expected value
      tol - the tolerance
      Returns:
      true iff |x - ref| invalid input: '<' |tol|