use of org.eclipse.scanning.api.event.scan.DeviceValueMultiPosition in project gda-core by openGDA.
the class NexusSlitsWrapper method setPosition.
@Override
public DeviceValueMultiPosition setPosition(DeviceValueMultiPosition value, IPosition position) throws ScanningException {
logger.debug("setPosition({}, {}) called on {}", value, position, getName());
if (value != null) {
logger.warn("non null setPosition() not expected on {}, ignoring...", getName());
}
if (position != null) {
try {
DeviceValueMultiPosition currentLocation = getPosition();
write(value, currentLocation, position);
return currentLocation;
} catch (DatasetException e) {
throw new ScanningException("Could not set position of scannable: " + getName(), e);
}
}
return null;
}
use of org.eclipse.scanning.api.event.scan.DeviceValueMultiPosition in project gda-core by openGDA.
the class NexusSlitsWrapper method getPosition.
// implements IScannable<DeviceValueMultiPosition>
@Override
public DeviceValueMultiPosition getPosition() throws ScanningException {
DeviceValueMultiPosition position = new DeviceValueMultiPosition();
try {
position.put(NXslit.NX_X_GAP, (double) x_gap.getPosition());
position.put(NXslit.NX_Y_GAP, (double) y_gap.getPosition());
return position;
} catch (DeviceException e) {
throw new ScanningException("Could not get position of scannable: " + getName(), e);
}
}
Aggregations