Class CoboldTDC

All Implemented Interfaces:
AsynchronousDetector, CoboldDetector, Detector, Device, Scannable, Configurable, Findable, gda.observable.IObservable, AlarmListener, Serializable
Direct Known Subclasses:
DummyCoboldTDC, OfflineCoboldTDC

public class CoboldTDC extends DetectorBase implements CoboldDetector, AlarmListener
Class to implement a Cobold Time to Digital Converter for data acquisition using a Micro Channel Plate (MCP) detector for Ion Imaging Spectrometry (IIS)
See Also:
  • Field Details

    • coboldPCCMD

      protected String coboldPCCMD
    • lmfName

      protected String lmfName
    • dataDir

      protected String dataDir
    • saveDCFsBetweenRuns

      protected boolean saveDCFsBetweenRuns
    • readFromHardware

      protected boolean readFromHardware
  • Constructor Details

    • CoboldTDC

      public CoboldTDC()
      Constructor
  • Method Details

    • configure

      public void configure()
      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
    • prepareForCollection

      public void prepareForCollection()
      Description copied from class: DetectorBase
      Default which should be overridden by subclasses.
      Specified by:
      prepareForCollection in interface Detector
      Overrides:
      prepareForCollection in class DetectorBase
      See Also:
    • setCollectTime

      public void setCollectTime(int t)
      Parameters:
      t - the collection time
    • setZ1

      public void setZ1(int z1)
      Set the value of 1st hit on channel z1 via parameter 99 to stream data into the current LMF event
      Parameters:
      z1 - the value to set z1 to in LMF event
    • setReadFromHardware

      public void setReadFromHardware(boolean b)
      Parameters:
      b - true to read from hardware
    • setMaxNumEvents

      public void setMaxNumEvents(int events)
      Parameters:
      events -
    • createsOwnFiles

      public boolean createsOwnFiles() throws DeviceException
      Description copied from interface: Detector
      Returns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.
      Specified by:
      createsOwnFiles in interface Detector
      Returns:
      true if readout() returns filenames
      Throws:
      DeviceException
    • getChannelLabelList

      public ArrayList<String> getChannelLabelList() throws DeviceException
      Get the label string for the channel specified
      Specified by:
      getChannelLabelList in interface CoboldDetector
      Returns:
      label the label string
      Throws:
      DeviceException - // * @see gda.device.CounterTimer#getChannelLabel(int)
    • setChannelLabelList

      public void setChannelLabelList(ArrayList<String> channelLabelList)
    • addChannelLabel

      public void addChannelLabel(String label)
      Add channel label
      Parameters:
      label - the label string
    • setChannelLabel

      public void setChannelLabel(int channel, String label) throws DeviceException
      Set the label string for the channel specified
      Specified by:
      setChannelLabel in interface CoboldDetector
      Parameters:
      channel - int
      label - String
      Throws:
      DeviceException
    • getChannelLabel

      public String getChannelLabel(int channel) throws DeviceException
      Get the label string for the channel specified
      Specified by:
      getChannelLabel in interface CoboldDetector
      Parameters:
      channel - who's label is to be returned
      Returns:
      label the label string
      Throws:
      DeviceException
    • waitForStatus

      protected void waitForStatus(int state) throws DeviceException, InterruptedException
      Throws:
      DeviceException
      InterruptedException
    • alarm

      public void alarm(Alarm anAlarm)
      Description copied from interface: AlarmListener
      Alarm callback.
      Specified by:
      alarm in interface AlarmListener
      Parameters:
      anAlarm - the alarm performing the callback
    • updateSpectrum

      public void updateSpectrum()
      update the spectrum
    • collectData

      public void collectData() throws DeviceException
      Description copied from interface: Detector
      Tells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.
      Specified by:
      collectData in interface Detector
      Throws:
      DeviceException
    • countAsync

      public void countAsync(double collectionTime) throws DeviceException
      Start counting asynchronously (don't wit till finished)
      Specified by:
      countAsync in interface AsynchronousDetector
      Parameters:
      collectionTime -
      Throws:
      DeviceException
      See Also:
    • sendAsynchronousCommand

      public void sendAsynchronousCommand(String command)
      Send a command to CoboldPC without waiting for command to execute
      Parameters:
      command - the CoboldPC command String
    • sendSynchronousCommand

      public void sendSynchronousCommand(String command)
      Send a command to CoboldPC waiting for it to finish execution
      Parameters:
      command - String containing the CoboldPC command
    • startCoboldScan

      public void startCoboldScan(String newCommand) throws InterruptedException
      Start the Cobold scan letting the scanTimer alarm end the collection and scheduling regular spectrum updates
      Parameters:
      newCommand -
      Throws:
      InterruptedException
    • startCollecting

      protected void startCollecting()
    • getStatus

      public int getStatus()
      Description copied from interface: Detector
      Returns the current collecting state of the device.
      Specified by:
      getStatus in interface Detector
      Returns:
      BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
    • readout

      public Object readout()
      Returns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.

      If LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLY is true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. See Detector.waitWhileBusy() and ConcurrentScan. Readout must block until the detector is ready to respond quickly to Detector.collectData() again. Return the file name created by the asynchronous detector since createsOwnFiles()

      Specified by:
      readout in interface Detector
      Returns:
      the data collected
    • endCollection

      public void endCollection()
      End the Cobold data collection by sending STOP_COMMAND and cancelling the timer and the spectrum updater
      Specified by:
      endCollection in interface Detector
      Overrides:
      endCollection in class DetectorBase
      See Also:
    • setStandAlone

      public void setStandAlone(boolean b)
      Parameters:
      b - true to set stand alone mode
    • saveCurrentDcf

      public String saveCurrentDcf()
      Save current Cobold Document File
      Returns:
      String name of DCF file
    • restart

      public void restart()
      Restart the CoboldPC by clearing all parameters, coordinates and spectra
    • setLmfName

      public void setLmfName(String name)
      Set LMF name
      Parameters:
      name - String full path name of lmf file to be used in creation of New Acquisition command
    • setSaveDCFsBetweenRuns

      public void setSaveDCFsBetweenRuns(boolean b)
      Set whether to auto-save DCFs between runs
      Parameters:
      b -
    • showParams

      public void showParams()
      Show the defined Cobold parameters from the CoboldPC GUI
    • showSpectra

      public void showSpectra()
      Show the defined Cobold spectra from the CoboldPC GUI
    • setComment

      public void setComment(String comment)
      Set the comment to be used in the LMF header
      Parameters:
      comment - String the user defined comment
    • executeCoboldCommandFile

      public void executeCoboldCommandFile(String ccf)
      Execute a file of Cobold commands for setting up an experiment in terms of pareameters, coordinates, conditions and spectra. Correct syntax assumed (see CoboldPC user manual)
      Parameters:
      ccf -
    • getDescription

      public String getDescription() throws DeviceException
      Specified by:
      getDescription in interface Detector
      Overrides:
      getDescription in class DetectorBase
      Returns:
      A description of the detector.
      Throws:
      DeviceException
    • getDetectorID

      public String getDetectorID() throws DeviceException
      Specified by:
      getDetectorID in interface Detector
      Overrides:
      getDetectorID in class DetectorBase
      Returns:
      A identifier for this detector.
      Throws:
      DeviceException
    • getDetectorType

      public String getDetectorType() throws DeviceException
      Specified by:
      getDetectorType in interface Detector
      Overrides:
      getDetectorType in class DetectorBase
      Returns:
      The type of detector.
      Throws:
      DeviceException