Class MuDaq

  • All Implemented Interfaces:
    Io

    public class MuDaq
    extends java.lang.Object
    implements Io

    The MuDaq class ecapsulates the interactions with a PDMDB module through the muDaq hardware interface

    • Constructor Summary

      Constructors 
      Constructor Description
      MuDaq()
      No-argument constructor called by the unmarshaller
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String configure​(java.lang.String[] args)
      Configures the muDaq registers
      void dumpDaqBuffers​(java.lang.String fileNamePrefix)
      Reads DAQ buffer until empty.
      void endDAQ()  
      void fuseGbtx()
      Triggers GBTX e-fusing
      void get​(int offset, byte[] regBuf)
      Reads a byte array from the hardware.
      java.nio.ByteBuffer getBER()
      Reads the bitflip counters from hardware
      java.lang.String getId()  
      void init​(JniAdeptDepp depp, java.util.prefs.Preferences prefs)
      Called after unmarshalling to initialise the instance and its children
      javax.swing.JMenu makeMenu​(java.lang.String title)
      Convenience function that builds a main menu.
      GuiJPanel makePanel()
      Convenience method that builds a GUI panel
      void prepareBER()
      Prepares for a bit error rate test
      void prepareDAQ​(int runNumber)
      Prepares for DAQ with TFC.
      void put​(int offset, byte[] regBuf)
      Writes a byte array to the hardware.
      void readConfigurationFile​(java.lang.String fileName)
      Reads a MuDaq register file into the register mirror.
      void reset()
      Resets muDaq
      void setStateFromPreferences()
      Reads saved settings from Preferences and updates the configuration register mirror
      (package private) void setStateShutdown()
      Puts MuDaq into the low power shutdown state
      void startDaqTask​(java.lang.String[] args)
      Start free-running DAQ.
      void stopDaqTask​(java.lang.String[] args)
      Stop free-running DAQ.
      void toggle​(java.lang.String regName)
      Toggles a configuration register (on, then off)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • prefs

        java.util.prefs.Preferences prefs
      • daqProxy

        DaqProxy daqProxy

        The DaqProxy

      • id

        java.lang.String id
      • tableList

        java.util.ArrayList<RegisterIoTable> tableList

        List of tables that display FPGA register content

      • mux

        DaqMux mux

        List of DAQ buffer instances

      • mgts

        java.util.ArrayList<MGTControl> mgts

        List of FPGA MGT instances

      • pdmdbs

        java.util.ArrayList<PdmdbMaster> pdmdbs

        The PDMDB instances

      • drp

        DrpPanel drp

        Controls for the FPGA DRP port

      • pdmdbJF

        javax.swing.JFrame pdmdbJF
      • testerJF

        javax.swing.JFrame testerJF
      • programJF

        javax.swing.JFrame programJF
      • muDaqJF

        javax.swing.JFrame muDaqJF
      • runNumber

        int runNumber
      • muDaq

        public static MuDaq muDaq

        Static member containing the MuDaq instance referenced by exec()

      • statusFrame

        javax.swing.JFrame statusFrame
      • triggerNumberTF

        javax.swing.JTextField triggerNumberTF
      • daqActive

        boolean daqActive
      • cfg

        public static Csr cfg

        Configuration register mirror

      • status

        static Csr status

        Status register mirror

      • statusIo

        Io statusIo
    • Constructor Detail

      • MuDaq

        public MuDaq()

        No-argument constructor called by the unmarshaller

    • Method Detail

      • getId

        public java.lang.String getId()
      • makePanel

        public GuiJPanel makePanel()

        Convenience method that builds a GUI panel

        Returns:
        The panel.
      • makeMenu

        public javax.swing.JMenu makeMenu​(java.lang.String title)

        Convenience function that builds a main menu.

        Parameters:
        title - The menu title.
        Returns:
        The menu.
      • init

        public void init​(JniAdeptDepp depp,
                         java.util.prefs.Preferences prefs)

        Called after unmarshalling to initialise the instance and its children

        Parameters:
        depp - The I/O interface.
        prefs - The preference path.
      • put

        public void put​(int offset,
                        byte[] regBuf)

        Writes a byte array to the hardware.

        Specified by:
        put in interface Io
        Parameters:
        offset - Offset to location where to start writing.
        regBuf - Array of register values.
      • get

        public void get​(int offset,
                        byte[] regBuf)

        Reads a byte array from the hardware.

        Specified by:
        get in interface Io
        Parameters:
        offset - Offset to location where to start reading.
        regBuf - Array of register values.
      • reset

        public void reset()

        Resets muDaq

      • readConfigurationFile

        public void readConfigurationFile​(java.lang.String fileName)

        Reads a MuDaq register file into the register mirror.

        Parameters:
        fileName - File name path.
      • configure

        public java.lang.String configure​(java.lang.String[] args)

        Configures the muDaq registers

        Callable by Command.

        Parameters:
        args - Not used.
        Returns:
        Command response.
      • setStateShutdown

        void setStateShutdown()

        Puts MuDaq into the low power shutdown state

      • setStateFromPreferences

        public void setStateFromPreferences()

        Reads saved settings from Preferences and updates the configuration register mirror

        Does not write the settings to the hardware.

      • fuseGbtx

        public void fuseGbtx()

        Triggers GBTX e-fusing

      • toggle

        public void toggle​(java.lang.String regName)

        Toggles a configuration register (on, then off)

        Parameters:
        regName - The register name as described in XML.
      • prepareBER

        public void prepareBER()

        Prepares for a bit error rate test

        Enables a fixed data pattern and resets the bitflip counters.

      • getBER

        public java.nio.ByteBuffer getBER()

        Reads the bitflip counters from hardware

        Returns:
        Byte buffer containing the counters
      • prepareDAQ

        public void prepareDAQ​(int runNumber)

        Prepares for DAQ with TFC.

        Enables the TFC commands and resets the DAQ.

        Data are acquired through DAQ proxy process.

        Parameters:
        runNumber - The number assigned to the run.
      • endDAQ

        public void endDAQ()
      • startDaqTask

        public void startDaqTask​(java.lang.String[] args)

        Start free-running DAQ.

        Parameters:
        args - Not currently used
      • stopDaqTask

        public void stopDaqTask​(java.lang.String[] args)

        Stop free-running DAQ.

        Parameters:
        args - Not yet used
      • dumpDaqBuffers

        public void dumpDaqBuffers​(java.lang.String fileNamePrefix)

        Reads DAQ buffer until empty.

        This is intended only for diagnostic use.

        Parameters:
        fileNamePrefix - Name of file where to write data.