Package gda.device.temperature
Class TemperatureBase
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.scannable.ScannableMotionBase
gda.device.temperature.TemperatureBase
- All Implemented Interfaces:
INeXusInfoWriteable,Device,Scannable,ScannableMotion,Temperature,Configurable,Findable,gda.observable.IObservable,AlarmListener
- Direct Known Subclasses:
DummyTemp,DummyTemperature,Eurotherm2K,GdaLakeshore340,Lauda,LinkamCI,LinkamT95,Marlow,OxfordCryostream700,SimpleEpicsTemperatureController
public abstract class TemperatureBase
extends ScannableMotionBase
implements AlarmListener, Temperature
A base implementation for all temperature controllers. Handles the basic parts of all operations wherever possible.
The actual commands are sent to hardware by the template methods which are implemented by the sub-classes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayList<double[]> protected booleanprotected intprotected intprotected doubleprotected DataFileWriterprotected DataWriterprotected Stringprotected static final longprotected longprotected doubleprotected static final longprotected longprotected List<TemperatureRamp> protected doubleprotected static final longprotected doubleprotected doubleprotected doubleFields inherited from class gda.device.scannable.ScannableMotionBase
numberTries, toleranceFields inherited from class gda.device.scannable.ScannableBase
__doc__, DEFAULT_INPUT_NAME, DEFAULT_OUTPUT_FORMAT, extraNames, inputNames, level, outputFormatFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLEFields inherited from interface gda.device.ScannableMotion
FIRSTINPUTLIMITS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRamp(TemperatureRamp ramp) Adds a ramp to the internal list of rampsvoidCalled when the holdTimeAlarm goes off.voidbegin()perform the start/restart up procedure of the temperature controller properly running hardware warm-up or cool-down procedures perform the start/restart up procedure of the controllervoidCancel an alarm if setvoidClears all ramps from the listvoidDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.protected abstract voiddoStart()protected abstract voiddoStop()voidend()perform the shutdown procedure of the temperature controller, i.e.doubleString[]getCurrentPositionArray(Object position, Scannable scannable) converts object to String arrayint[]Get the output file suffix.doubleGets the minimum temperature limitlongGet the poll time for update (used by Castor)Get probe namesdoublegets the ramp ratedoubleGet the target temperaturedoubleGets the maximum temperature limitbooleanCheck the current temperature against the target temperaturebooleanisBusy()Check if the Scannable is moving/operating.booleanGets the running state of the controllervoidrawAsynchronousMoveTo(Object position) [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.[Consider abstract] Read the position in its internal (user) representation.readout()abstract voidrunRamp()Run the ramp sequence.protected abstract voidsendRamp(int ramp) voidsetAccuracy(double accuracy) voidsetFileSuffix(String fileSuffix) Set the output file suffix.protected abstract voidsetHWLowerTemp(double lowerTemp) protected abstract voidsetHWUpperTemp(double upperTemp) voidsetLowerTemp(double lowerTemp) Sets the minimum temperature limitvoidsetPolltime(long polltime) Set the poll time for updates.voidAdd probe names one at a timevoidsetProbeNames(List<String> probeNames) Set the temperature probe namesvoidsetRampRate(double rate) sets the ramp ratevoidsetRamps(List<TemperatureRamp> newRamps) Sets the array of ramps.voidsetTargetTemperature(double targetTemp) Template method for starting a move towards a targetTemperature.protected voidsetUpdatePeriod(long delay) voidsetUpperTemp(double upperTemp) Sets the maximum temperature limit obtainablevoidstart()Starts ramping (compare setTargetTemperature which starts towards a single target temperature).voidprotected abstract voidvoidstarts a poller thread to check and update temperatureprotected abstract voidShould send hardware commands to start heating or cooling towards a single targetTempvoidstop()Stops whatever is happening.voidinterrupt poller thread to stop updating temperatureprotected abstract voidvoidWaits for the device to reach its target temperatureMethods inherited from class gda.device.scannable.ScannableMotionBase
a, addPositionValidator, ar, asynchronousMoveTo, checkPositionValid, checkPositionWithinGdaLimits, checkPositionWithinGdaLimits, completeInstantiation, externalToInternal, generateScannableLimitsReport, getAdditionalPositionValidators, getAttribute, getFirstInputLimits, getInputLimits, getInputLimits, getLimitsComponent, getLowerGdaLimits, getNumberTries, getOffset, getScalingFactor, getTolerances, getUpperGdaLimits, internalToExternal, isAt, moveTo, r, rawIsBusy, removePositionValidator, setAdditionalPositionValidators, setLimitsComponent, setLowerGdaLimits, setLowerGdaLimits, setNumberTries, setOffset, setOffsetAndScalingComponent, setScalingFactor, setTolerance, setTolerances, setUpperGdaLimits, setUpperGdaLimits, toFormattedString, writeNeXusInformation, writeNeXusInformationLimitsMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, throwExceptionIfInvalidTarget, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString, waitWhileBusyMethods inherited from interface gda.device.Temperature
getCurrentTemperature, hold
-
Field Details
-
LONG_POLL_TIME
protected static final long LONG_POLL_TIME- See Also:
-
SHORT_POLL_TIME
protected static final long SHORT_POLL_TIME- See Also:
-
POLL_TIME
protected static final long POLL_TIME- See Also:
-
pollTime
protected long pollTime -
longPollTime
protected long longPollTime -
timeSinceStart
protected double timeSinceStart -
lowerTemp
protected double lowerTemp -
upperTemp
protected double upperTemp -
targetTemp
protected double targetTemp -
currentTemp
protected volatile double currentTemp -
setPoint
protected double setPoint -
rampList
-
busy
protected volatile boolean busy -
currentRamp
protected int currentRamp -
probeNameList
-
count
protected int count -
dataFileWriter
-
dataWriter
-
bufferedData
-
fileSuffix
-
-
Constructor Details
-
TemperatureBase
public TemperatureBase()
-
-
Method Details
-
configure
Description copied from class:ConfigurableBaseDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
setPolltime
public void setPolltime(long polltime) Set the poll time for updates.- Parameters:
polltime- the poll time in msec
-
getPolltime
public long getPolltime()Get the poll time for update (used by Castor)- Returns:
- the poll time in msec
-
getAccuracy
public double getAccuracy()- Returns:
- Returns the accuracy.
-
setAccuracy
public void setAccuracy(double accuracy) - Parameters:
accuracy- The accuracy to set.
-
addRamp
Adds a ramp to the internal list of ramps- Specified by:
addRampin interfaceTemperature- Parameters:
ramp- the TemperatureRamp to add
-
alarm
Called when the holdTimeAlarm goes off. See method startTimer(). This implements the AlarmListener interface.- Specified by:
alarmin interfaceAlarmListener- Parameters:
theAlarm- the Alarm which has gone off
-
cancelAlarm
public void cancelAlarm()Cancel an alarm if set -
clearRamps
public void clearRamps()Clears all ramps from the list- Specified by:
clearRampsin interfaceTemperature
-
startPoller
public void startPoller()starts a poller thread to check and update temperature -
stopPoller
public void stopPoller()interrupt poller thread to stop updating temperature -
setUpdatePeriod
protected void setUpdatePeriod(long delay) -
getLowerTemp
Gets the minimum temperature limit- Specified by:
getLowerTempin interfaceTemperature- Returns:
- the minimum temperature obtainable
- Throws:
DeviceException
-
setProbeNames
Set the temperature probe names- Parameters:
probeNames- the probe name (used by Castor)
-
getProbeNames
Description copied from interface:TemperatureGet probe names- Specified by:
getProbeNamesin interfaceTemperature- Returns:
- an array of probe names
- Throws:
DeviceException
-
getTargetTemperature
Get the target temperature- Specified by:
getTargetTemperaturein interfaceTemperature- Returns:
- the target temperature
- Throws:
DeviceException
-
getUpperTemp
Gets the maximum temperature limit- Specified by:
getUpperTempin interfaceTemperature- Returns:
- the maximum temperature
- Throws:
DeviceException
-
isAtTargetTemperature
Description copied from interface:TemperatureCheck the current temperature against the target temperature- Specified by:
isAtTargetTemperaturein interfaceTemperature- Returns:
- true if current temperature equals target temperature
- Throws:
DeviceException
-
setLowerTemp
Sets the minimum temperature limit- Specified by:
setLowerTempin interfaceTemperature- Parameters:
lowerTemp- the minimum temperature- Throws:
DeviceException
-
setProbe
Add probe names one at a time- Specified by:
setProbein interfaceTemperature- Parameters:
probeName- the probe name- Throws:
DeviceException
-
setUpperTemp
Sets the maximum temperature limit obtainable- Specified by:
setUpperTempin interfaceTemperature- Parameters:
upperTemp- the maximum temperature- Throws:
DeviceException
-
rawAsynchronousMoveTo
Description copied from class:ScannableBase[Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.- Overrides:
rawAsynchronousMoveToin classScannableBase- Parameters:
position- Position in its internal/hardware representation. e.g. with units and offsets removed- Throws:
DeviceException- See Also:
-
rawGetPosition
Description copied from class:ScannableBase[Consider abstract] Read the position in its internal (user) representation.- Overrides:
rawGetPositionin classScannableBase- Returns:
- the value represented by this Scannable
- Throws:
DeviceException- See Also:
-
isBusy
Description copied from class:ScannableMotionBaseCheck if the Scannable is moving/operating.. Calls onto rawIsBusy for historical reasons, although there is currently no need for this.- Specified by:
isBusyin interfaceScannable- Overrides:
isBusyin classScannableMotionBase- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException- See Also:
-
setTargetTemperature
Template method for starting a move towards a targetTemperature. Subclasses must provide method startTowardsTarget which will send the necessary commands.- Specified by:
setTargetTemperaturein interfaceTemperature- Parameters:
targetTemp- the target temperature- Throws:
DeviceException
-
setRamps
Sets the array of ramps.- Specified by:
setRampsin interfaceTemperature- Parameters:
newRamps- an ArrayListof ramps to be set
-
start
public void start()Starts ramping (compare setTargetTemperature which starts towards a single target temperature).- Specified by:
startin interfaceTemperature
-
startHoldTimer
public void startHoldTimer() -
stop
public void stop()Stops whatever is happening. Applications should call this method and not the subclass implementations of doStop.- Specified by:
stopin interfaceScannable- Specified by:
stopin interfaceTemperature- Overrides:
stopin classScannableBase- See Also:
-
end
perform the shutdown procedure of the temperature controller, i.e. properly running hardware warm-up or cool-down procedures perform the shutdown procedure of the controller- Specified by:
endin interfaceTemperature- Throws:
DeviceException- See Also:
-
begin
perform the start/restart up procedure of the temperature controller properly running hardware warm-up or cool-down procedures perform the start/restart up procedure of the controller- Specified by:
beginin interfaceTemperature- Throws:
DeviceException- See Also:
-
waitForTemp
Waits for the device to reach its target temperature- Specified by:
waitForTempin interfaceTemperature- Throws:
DeviceException
-
isRunning
Description copied from interface:TemperatureGets the running state of the controller- Specified by:
isRunningin interfaceTemperature- Returns:
- true if controller is running a program or moving to a target false otherwise
- Throws:
DeviceException
-
temperatureUpdate
protected abstract void temperatureUpdate() -
doStart
- Throws:
DeviceException
-
doStop
- Throws:
DeviceException
-
sendRamp
- Throws:
DeviceException
-
startNextRamp
- Throws:
DeviceException
-
startTowardsTarget
Should send hardware commands to start heating or cooling towards a single targetTemp- Throws:
DeviceException
-
setHWLowerTemp
- Parameters:
lowerTemp-- Throws:
DeviceException
-
setHWUpperTemp
- Parameters:
upperTemp-- Throws:
DeviceException
-
runRamp
Run the ramp sequence.- Throws:
DeviceException
-
getFileSuffix
Get the output file suffix.- Returns:
- the file suffix (used by Castor)
-
setFileSuffix
Set the output file suffix.- Parameters:
fileSuffix- the file suffix
-
setRampRate
sets the ramp rate- Specified by:
setRampRatein interfaceTemperature- Parameters:
rate-- Throws:
DeviceException
-
getRampRate
gets the ramp rate- Specified by:
getRampRatein interfaceTemperature- Returns:
- the ramp rate
- Throws:
DeviceException
-
getCurrentPositionArray
converts object to String array- Parameters:
position-scannable-- Returns:
- String Array
-
readout
-
getDataDimensions
public int[] getDataDimensions()
-