Class AbstractCalibratedAxesProvider
java.lang.Object
uk.ac.gda.client.live.stream.calibration.AbstractCalibratedAxesProvider
- All Implemented Interfaces:
CalibratedAxesProvider
- Direct Known Subclasses:
BeamPositionCalibration,CameraOffsetCalibration
public abstract class AbstractCalibratedAxesProvider
extends Object
implements CalibratedAxesProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleThe width of each pixel of the camera, in the units used by the x-axis scannable.protected ScannableThe scannable for the horizontal axis of the cameraprotected CalibratedAxesDatasetUpdaterupdates horizontal axis when x scannable movesprotected doubleThe height of each pixel of the camera in the units used by the y-axis scannable.protected ScannableThe scannable for the vertical axis of the camera.protected CalibratedAxesDatasetUpdaterupdates vertical axis when y scannable moves -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCalibratedAxesProvider(Scannable xAxisScannable, double xAxisPixelScaling, Scannable yAxisScannable, double yAxisPixelScaling) Creates a new instance of AbstractCalibratedAxesProvider -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Called when the stream connection has been established.protected abstract voidShould be overridden to create two instances of classes implementing CalibratedAxesDatasetUpdater, one for each axis, which will create the datasets when the scannables move, image is resized, or a new frame is received.voidCalled when the stream connection has been closed.org.eclipse.january.dataset.IDatasetReturns a calibrated horizontal axis.org.eclipse.january.dataset.IDatasetReturns a calibrated vertical axis.voidresizeStream(int[] newShape) Called when the stream data changes shape ([y, x])protected void
-
Field Details
-
xAxisScannable
The scannable for the horizontal axis of the camera -
xAxisPixelScaling
protected double xAxisPixelScalingThe width of each pixel of the camera, in the units used by the x-axis scannable. -
yAxisScannable
The scannable for the vertical axis of the camera. -
yAxisPixelScaling
protected double yAxisPixelScalingThe height of each pixel of the camera in the units used by the y-axis scannable. -
xAxisUpdater
updates horizontal axis when x scannable moves -
yAxisUpdater
updates vertical axis when y scannable moves
-
-
Constructor Details
-
AbstractCalibratedAxesProvider
protected AbstractCalibratedAxesProvider(Scannable xAxisScannable, double xAxisPixelScaling, Scannable yAxisScannable, double yAxisPixelScaling) Creates a new instance of AbstractCalibratedAxesProvider- Parameters:
xAxisScannable- The scannable for the horizontal axis of the cameraxAxisPixelScaling- The width of each pixel of the camera, in the units used by the x-axis scannableyAxisScannable- The scannable for the vertical axis of the camerayAxisPixelScaling- The height of each pixel of the camera in the units used by the y-axis scannable
-
-
Method Details
-
connect
public void connect()Description copied from interface:CalibratedAxesProviderCalled when the stream connection has been established. There is no need to do work until this point- Specified by:
connectin interfaceCalibratedAxesProvider
-
disconnect
public void disconnect()Description copied from interface:CalibratedAxesProviderCalled when the stream connection has been closed. No more work is needed, listeners can be disposed, etc.- Specified by:
disconnectin interfaceCalibratedAxesProvider
-
getXAxisDataset
public org.eclipse.january.dataset.IDataset getXAxisDataset()Description copied from interface:CalibratedAxesProviderReturns a calibrated horizontal axis. Called with each new frame.- Specified by:
getXAxisDatasetin interfaceCalibratedAxesProvider
-
getYAxisDataset
public org.eclipse.january.dataset.IDataset getYAxisDataset()Description copied from interface:CalibratedAxesProviderReturns a calibrated vertical axis. Called with each new frame.- Specified by:
getYAxisDatasetin interfaceCalibratedAxesProvider
-
resizeStream
public void resizeStream(int[] newShape) Description copied from interface:CalibratedAxesProviderCalled when the stream data changes shape ([y, x])- Specified by:
resizeStreamin interfaceCalibratedAxesProvider
-
updateDatasets
protected void updateDatasets() -
createAxesUpdaters
protected abstract void createAxesUpdaters()Should be overridden to create two instances of classes implementing CalibratedAxesDatasetUpdater, one for each axis, which will create the datasets when the scannables move, image is resized, or a new frame is received. In your concrete class, you should call this once all required properties in set, using one of the following: 1. Create a constructor which calls it. 2. Set the init-method property on your spring bean. 3. Implement InitializingBean and create an afterPropertiesSet() method which calls it.
-