Class 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 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

      protected List<TemperatureRamp> rampList
    • busy

      protected volatile boolean busy
    • currentRamp

      protected int currentRamp
    • probeNameList

      protected List<String> probeNameList
    • count

      protected int count
    • dataFileWriter

      protected DataFileWriter dataFileWriter
    • dataWriter

      protected DataWriter dataWriter
    • bufferedData

      protected ArrayList<double[]> bufferedData
    • fileSuffix

      protected String fileSuffix
  • Constructor Details

    • TemperatureBase

      public TemperatureBase()
  • Method Details

    • configure

      public void configure() throws FactoryException
      Description copied from class: ConfigurableBase
      Default 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:
      configure in interface Configurable
      Overrides:
      configure in class ConfigurableBase
      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

      public void addRamp(TemperatureRamp ramp)
      Adds a ramp to the internal list of ramps
      Specified by:
      addRamp in interface Temperature
      Parameters:
      ramp - the TemperatureRamp to add
    • alarm

      public void alarm(Alarm theAlarm)
      Called when the holdTimeAlarm goes off. See method startTimer(). This implements the AlarmListener interface.
      Specified by:
      alarm in interface AlarmListener
      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:
      clearRamps in interface Temperature
    • 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

      public double getLowerTemp() throws DeviceException
      Gets the minimum temperature limit
      Specified by:
      getLowerTemp in interface Temperature
      Returns:
      the minimum temperature obtainable
      Throws:
      DeviceException
    • setProbeNames

      public void setProbeNames(List<String> probeNames)
      Set the temperature probe names
      Parameters:
      probeNames - the probe name (used by Castor)
    • getProbeNames

      public List<String> getProbeNames() throws DeviceException
      Description copied from interface: Temperature
      Get probe names
      Specified by:
      getProbeNames in interface Temperature
      Returns:
      an array of probe names
      Throws:
      DeviceException
    • getTargetTemperature

      public double getTargetTemperature() throws DeviceException
      Get the target temperature
      Specified by:
      getTargetTemperature in interface Temperature
      Returns:
      the target temperature
      Throws:
      DeviceException
    • getUpperTemp

      public double getUpperTemp() throws DeviceException
      Gets the maximum temperature limit
      Specified by:
      getUpperTemp in interface Temperature
      Returns:
      the maximum temperature
      Throws:
      DeviceException
    • isAtTargetTemperature

      public boolean isAtTargetTemperature() throws DeviceException
      Description copied from interface: Temperature
      Check the current temperature against the target temperature
      Specified by:
      isAtTargetTemperature in interface Temperature
      Returns:
      true if current temperature equals target temperature
      Throws:
      DeviceException
    • setLowerTemp

      public void setLowerTemp(double lowerTemp) throws DeviceException
      Sets the minimum temperature limit
      Specified by:
      setLowerTemp in interface Temperature
      Parameters:
      lowerTemp - the minimum temperature
      Throws:
      DeviceException
    • setProbe

      public void setProbe(String probeName) throws DeviceException
      Add probe names one at a time
      Specified by:
      setProbe in interface Temperature
      Parameters:
      probeName - the probe name
      Throws:
      DeviceException
    • setUpperTemp

      public void setUpperTemp(double upperTemp) throws DeviceException
      Sets the maximum temperature limit obtainable
      Specified by:
      setUpperTemp in interface Temperature
      Parameters:
      upperTemp - the maximum temperature
      Throws:
      DeviceException
    • rawAsynchronousMoveTo

      public void rawAsynchronousMoveTo(Object position) throws DeviceException
      Description copied from class: ScannableBase
      [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.
      Overrides:
      rawAsynchronousMoveTo in class ScannableBase
      Parameters:
      position - Position in its internal/hardware representation. e.g. with units and offsets removed
      Throws:
      DeviceException
      See Also:
    • rawGetPosition

      public Object rawGetPosition() throws DeviceException
      Description copied from class: ScannableBase
      [Consider abstract] Read the position in its internal (user) representation.
      Overrides:
      rawGetPosition in class ScannableBase
      Returns:
      the value represented by this Scannable
      Throws:
      DeviceException
      See Also:
    • isBusy

      public boolean isBusy() throws DeviceException
      Description copied from class: ScannableMotionBase
      Check if the Scannable is moving/operating.. Calls onto rawIsBusy for historical reasons, although there is currently no need for this.
      Specified by:
      isBusy in interface Scannable
      Overrides:
      isBusy in class ScannableMotionBase
      Returns:
      true - if operation carried out by moveTo has not completed yet
      Throws:
      DeviceException
      See Also:
    • setTargetTemperature

      public void setTargetTemperature(double targetTemp) throws DeviceException
      Template method for starting a move towards a targetTemperature. Subclasses must provide method startTowardsTarget which will send the necessary commands.
      Specified by:
      setTargetTemperature in interface Temperature
      Parameters:
      targetTemp - the target temperature
      Throws:
      DeviceException
    • setRamps

      public void setRamps(List<TemperatureRamp> newRamps)
      Sets the array of ramps.
      Specified by:
      setRamps in interface Temperature
      Parameters:
      newRamps - an ArrayList of ramps to be set
    • start

      public void start()
      Starts ramping (compare setTargetTemperature which starts towards a single target temperature).
      Specified by:
      start in interface Temperature
    • 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:
      stop in interface Scannable
      Specified by:
      stop in interface Temperature
      Overrides:
      stop in class ScannableBase
      See Also:
    • end

      public void end() throws DeviceException
      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:
      end in interface Temperature
      Throws:
      DeviceException
      See Also:
    • begin

      public void begin() throws DeviceException
      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:
      begin in interface Temperature
      Throws:
      DeviceException
      See Also:
    • waitForTemp

      public void waitForTemp() throws DeviceException
      Waits for the device to reach its target temperature
      Specified by:
      waitForTemp in interface Temperature
      Throws:
      DeviceException
    • isRunning

      public boolean isRunning() throws DeviceException
      Description copied from interface: Temperature
      Gets the running state of the controller
      Specified by:
      isRunning in interface Temperature
      Returns:
      true if controller is running a program or moving to a target false otherwise
      Throws:
      DeviceException
    • temperatureUpdate

      protected abstract void temperatureUpdate()
    • doStart

      protected abstract void doStart() throws DeviceException
      Throws:
      DeviceException
    • doStop

      protected abstract void doStop() throws DeviceException
      Throws:
      DeviceException
    • sendRamp

      protected abstract void sendRamp(int ramp) throws DeviceException
      Throws:
      DeviceException
    • startNextRamp

      protected abstract void startNextRamp() throws DeviceException
      Throws:
      DeviceException
    • startTowardsTarget

      protected abstract void startTowardsTarget() throws DeviceException
      Should send hardware commands to start heating or cooling towards a single targetTemp
      Throws:
      DeviceException
    • setHWLowerTemp

      protected abstract void setHWLowerTemp(double lowerTemp) throws DeviceException
      Parameters:
      lowerTemp -
      Throws:
      DeviceException
    • setHWUpperTemp

      protected abstract void setHWUpperTemp(double upperTemp) throws DeviceException
      Parameters:
      upperTemp -
      Throws:
      DeviceException
    • runRamp

      public abstract void runRamp() throws DeviceException
      Run the ramp sequence.
      Throws:
      DeviceException
    • getFileSuffix

      public String getFileSuffix()
      Get the output file suffix.
      Returns:
      the file suffix (used by Castor)
    • setFileSuffix

      public void setFileSuffix(String fileSuffix)
      Set the output file suffix.
      Parameters:
      fileSuffix - the file suffix
    • setRampRate

      public void setRampRate(double rate) throws DeviceException
      sets the ramp rate
      Specified by:
      setRampRate in interface Temperature
      Parameters:
      rate -
      Throws:
      DeviceException
    • getRampRate

      public double getRampRate() throws DeviceException
      gets the ramp rate
      Specified by:
      getRampRate in interface Temperature
      Returns:
      the ramp rate
      Throws:
      DeviceException
    • getCurrentPositionArray

      public String[] getCurrentPositionArray(Object position, Scannable scannable)
      converts object to String array
      Parameters:
      position -
      scannable -
      Returns:
      String Array
    • readout

      public Object readout()
    • getDataDimensions

      public int[] getDataDimensions()