Package org.eclipse.scanning.api.points
Class AbstractPosition
java.lang.Object
org.eclipse.scanning.api.points.AbstractPosition
- All Implemented Interfaces:
Serializable,IPosition
- Direct Known Subclasses:
MapPosition,Point,Scalar,StaticPosition
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a composite position with the values of this position and the values of the passed in position.booleanfinal booleanDo not override equals.This method makes dimensionNames if they are null.getDimensionNames(int dimension) doubleGet the exposure time to be used for the detector, in seconds.intgetIndex(int dimension) Get the data index of this point for a given scan dimension.intMost scans have rank 1 event though they move more motors line a line scan or a spiral scan.intThe step where the position was in a scan, if it is a position being generated from a scan.inthashCode()voidsetDimensionNames(List<List<String>> dNames) voidsetExposureTime(double exposureTime) Call to set the exposure time for the position Exposure time is normally set before a 2D scan however for energy scans bands of different energies can be created each with a different step increment and potentially different exposure time.voidsetStepIndex(int stepIndex) The step where the position was in a scan, if it is a position being generated from a scan.toString()
-
Constructor Details
-
AbstractPosition
public AbstractPosition()
-
-
Method Details
-
compound
Description copied from interface:IPositionCreates a composite position with the values of this position and the values of the passed in position. The passed in position is assumed to be the parent in the scan.NOTE The scan names are not calculated on the call to compound because maintaining the list of names in each dimension is inefficient to calculate for each point (they do not change). Instead the names are created once and set into the position using setDimensionNames(...) available on abstract position.
-
hashCode
public int hashCode() -
equals
Do not override equals. MapPostion("x:1,y:1") should equal Point("x", 1, "y",1) because they represent the same motor values.- Parameters:
obj-checkStep-- Returns:
-
equals
-
toString
-
getDimensionNames
-
getDimensionNames
This method makes dimensionNames if they are null. It must be synchronized because getDimensionNames() is called within the thread pool, for instance when neXus writing positions. Quite a lot of tests were intermittently failing the tests because of this issue. Be careful when creating member data in this class that things are thread safe.- Specified by:
getDimensionNamesin interfaceIPosition- Returns:
- dimensionNames- a List with an entry for each dimension, where each entry is a Set of the axes in that dimension
-
setDimensionNames
- Specified by:
setDimensionNamesin interfaceIPosition
-
getScanRank
public int getScanRank()Description copied from interface:IPositionMost scans have rank 1 event though they move more motors line a line scan or a spiral scan. As scans are aggregated these scan dimensions sum together. Some scans start out as having two dimensions like a grid or raster scan.- Specified by:
getScanRankin interfaceIPosition- Returns:
- scan rank
-
getIndex
public int getIndex(int dimension) Description copied from interface:IPositionGet the data index of this point for a given scan dimension. For instance -
getStepIndex
public int getStepIndex()Description copied from interface:IPositionThe step where the position was in a scan, if it is a position being generated from a scan. If not the value will be -1- Specified by:
getStepIndexin interfaceIPosition- Returns:
- position in a scan or -1
-
setStepIndex
public void setStepIndex(int stepIndex) Description copied from interface:IPositionThe step where the position was in a scan, if it is a position being generated from a scan. If not the value will be -1- Specified by:
setStepIndexin interfaceIPosition- Parameters:
stepIndex-
-
getExposureTime
public double getExposureTime()Description copied from interface:IPositionGet the exposure time to be used for the detector, in seconds. Exposure time is normally set before a 2D scan however for energy scans bands of different energies can be created each with a different step increment and potentially different exposure time. It is not possible to set different detectors with different exposure times during the scan; that would require a map here. Anthony Hull and I decided this should be part of a future change, when required.- Specified by:
getExposureTimein interfaceIPosition- Returns:
- the exposure time in seconds. Can be zero but not negative. If zero then no change is made to the detector's exposure time setting.
-
setExposureTime
public void setExposureTime(double exposureTime) Description copied from interface:IPositionCall to set the exposure time for the position Exposure time is normally set before a 2D scan however for energy scans bands of different energies can be created each with a different step increment and potentially different exposure time. It is not possible to set different detectors with different exposure times during the scan with the mechanism. This can achieved in a malcolm scan by settingIDetectorModel.setExposureTime(double)for each detector in theIMalcolmModel.- Specified by:
setExposureTimein interfaceIPosition- Parameters:
exposureTime- exposure time.
-