LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  September 2016

HPS-SVN September 2016

Subject:

r4500 - /java/trunk/record-util/src/main/java/org/hps/record/daqconfig/DAQConfigDriver.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Tue, 27 Sep 2016 15:49:14 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (74 lines)

Author: [log in to unmask]
Date: Tue Sep 27 08:49:10 2016
New Revision: 4500

Log:
Updated DAQConfigDriver to support pending modifications for reading runtime configurations from the database.

Modified:
    java/trunk/record-util/src/main/java/org/hps/record/daqconfig/DAQConfigDriver.java

Modified: java/trunk/record-util/src/main/java/org/hps/record/daqconfig/DAQConfigDriver.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/daqconfig/DAQConfigDriver.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/daqconfig/DAQConfigDriver.java	Tue Sep 27 08:49:10 2016
@@ -161,10 +161,39 @@
             reader[i] = new BufferedReader(fr[i]);
         }
         
+        // Convert the reader streams into line-delimited strings.
+        String[][] data = getDataFileArrays(reader);
+        
+        // Close the readers.
+        for(int i = 0; i < dataFiles.length; i++) {
+            reader[i].close();
+            fr[i].close();
+        }
+        
+        // Return the data array.
+        return data;
+    }
+    
+    /**
+     * Converts DAQ configuration data streams into an array of strings
+     * where each array entry represents a line in the configuration
+     * file. The first array index of the returned object corresponds
+     * to the stream, and the second array index corresponds to the line.
+     * @param reader - An array of <code>BufferedReader</code> objects
+     * containing DAQ trigger configuration crate data.
+     * @return Returns a two-dimensional array of <code>String</code>
+     * objects where the first array index corresponds to the object
+     * of the same index in the <code>BufferedReader</code> array and
+     * the second array index corresponds to the lines in the stream
+     * referenced by the <code>BufferedReader</code> object.
+     * @throws IOException Occurs if there is an issue with reading
+     * data stream.
+     */
+    protected static final String[][] getDataFileArrays(BufferedReader[] reader) throws IOException {
         // Generate String arrays where each entry in the array is
         // a line from the data file.
-        String[][] data = new String[dataFiles.length][0];
-        for(int i = 0; i < dataFiles.length; i++) {
+        String[][] data = new String[reader.length][0];
+        for(int i = 0; i < reader.length; i++) {
             // Create a list to hold the raw strings.
             List<String> rawData = new ArrayList<String>();
             
@@ -182,6 +211,16 @@
         // Return the data array.
         return data;
     }
+    
+    /**
+     * Gets the run number that the DAQConfigDriver is set to use. This
+     * will be <code>-1</code> in the event that the driver reads from
+     * an EvIO file.
+     * @return Returns the run number as an <code>int</code> primitive.
+     * Will return <code>-1</code> if the driver is set to read from an
+     * EvIO file.
+     */
+    protected final int getRunNumber() { return runNumber; }
     
     /**
      * Sets the run number of the DAQ configuration being processed.

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use