uk.ac.imperial.ph.hep.service
Class DaqService

java.lang.Object
  extended by uk.ac.imperial.ph.hep.service.DaqService

public class DaqService
extends java.lang.Object

This class represents the Daq itself. The gui components give this candidate runs to run, and tell this class when buttons like "Sequence end" and such like, have been pressed.

Author:
Jamie Ballin, HEP, Imperial College London

Nested Class Summary
static class DaqService.DaqStatus
          An enumeration of possible DAQ states.
 
Method Summary
 void dispose()
          Should be called for a successful shutdown by users.
 void endConfig()
           
 void endRun()
           
 void endSequence()
           
 void finalize()
           
 java.lang.String getCmdPath()
           
static DaqService getDaqService()
          The DaqService is a singleton.
 java.lang.String[] getRuntimeEnvironment()
           
 DaqService.DaqStatus getStatus()
           
 void panic()
           
 DaqService.DaqStatus refreshStatus()
          Checks output of currentRun +j: 0=> Daq not up, 1=> slowReadout, 2=> non-slow readout, no data taking run, other => runNumber
 void registerDaqRunChangedListener(DaqRunChangedListener r)
           
 void registerDaqStatusListener(DaqStatusListener l)
           
 void removeDaqRunChangedListener(DaqRunChangedListener r)
           
 void removeDaqStatusListener(DaqStatusListener l)
           
 void shutdown()
           
 void startRun()
           
 void startRun(CandidateRun cr)
          Instructs the Daq to start running the CandidateRun provided.
 void startup()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRuntimeEnvironment

public java.lang.String[] getRuntimeEnvironment()
Returns:
String[] of things like PLATFORM=Linux, key=value pairs, which should be passed in as environment variables when Runtime.getRuntime().exec(String cmd, String[] env) calls are made.

getCmdPath

public java.lang.String getCmdPath()
Returns:
the fully qualified path for Daq commands

getDaqService

public static DaqService getDaqService()
The DaqService is a singleton.

Returns:

startRun

public void startRun(CandidateRun cr)
              throws DaqStatusException
Instructs the Daq to start running the CandidateRun provided.

Parameters:
cr - - a well-formed candidate run.
Throws:
DaqStatusException

startRun

public void startRun()
              throws DaqStatusException
Throws:
DaqStatusException

endSequence

public void endSequence()

endConfig

public void endConfig()

endRun

public void endRun()

panic

public void panic()

startup

public void startup()

shutdown

public void shutdown()

getStatus

public DaqService.DaqStatus getStatus()

registerDaqStatusListener

public void registerDaqStatusListener(DaqStatusListener l)

removeDaqStatusListener

public void removeDaqStatusListener(DaqStatusListener l)

registerDaqRunChangedListener

public void registerDaqRunChangedListener(DaqRunChangedListener r)

removeDaqRunChangedListener

public void removeDaqRunChangedListener(DaqRunChangedListener r)

refreshStatus

public DaqService.DaqStatus refreshStatus()
Checks output of currentRun +j: 0=> Daq not up, 1=> slowReadout, 2=> non-slow readout, no data taking run, other => runNumber

Returns:
the DaqStatus

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

dispose

public void dispose()
Should be called for a successful shutdown by users. The status monitor thread will hang indefinitely otherwise.