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  July 2015

HPS-SVN July 2015

Subject:

r3299 - in /java/trunk: monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/ record-util/src/main/java/org/hps/record/epics/ record-util/src/main/java/org/hps/record/evio/crawler/

From:

[log in to unmask]

Reply-To:

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

Date:

Thu, 30 Jul 2015 00:30:14 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (161 lines)

Author: [log in to unmask]
Date: Wed Jul 29 17:30:12 2015
New Revision: 3299

Log:
Change method name.

Modified:
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SampleZeroHVBiasChecker.java
    java/trunk/record-util/src/main/java/org/hps/record/epics/EpicsData.java
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EpicsLog.java
    java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunSummaryUpdater.java

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SampleZeroHVBiasChecker.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SampleZeroHVBiasChecker.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SampleZeroHVBiasChecker.java	Wed Jul 29 17:30:12 2015
@@ -226,7 +226,7 @@
 
         if (epicsData != null) {
             logger.info(epicsData.toString());
-            if (epicsData.getUsedNames().contains("SVT:bias:top:0:v_sens")) {
+            if (epicsData.getKeys().contains("SVT:bias:top:0:v_sens")) {
 
                 epicsBiasValue = epicsData.getValue("SVT:bias:top:0:v_sens");
                 logger.info("epicsBiasValue = " + Double.toString(epicsBiasValue));

Modified: java/trunk/record-util/src/main/java/org/hps/record/epics/EpicsData.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/epics/EpicsData.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/epics/EpicsData.java	Wed Jul 29 17:30:12 2015
@@ -12,8 +12,9 @@
 import org.lcsim.event.GenericObject;
 
 /**
- * This is an API for reading and writing EPICS data to LCIO events, as well as parsing the data from a CDATA section within an EVIO
- * string data bank. The {@link #read(EventHeader)} method should be used to create one of these objects from an LCIO event.
+ * This is an API for reading and writing EPICS data to LCIO events, as well as parsing the data from a CDATA section
+ * within an EVIO string data bank. The {@link #read(EventHeader)} method should be used to create one of these objects
+ * from an LCIO event.
  *
  * @author <a href="mailto:[log in to unmask]">Jeremy McCormick</a>
  */
@@ -82,12 +83,12 @@
     /**
      * Get the static list of all available EPICs variable names.
      * <p>
-     * This could be different than the variable names which were actually written into the collection header. For this, instead use the method
-     * {@link #getUsedNames()}.
+     * This could be different than the variable names which were actually written into the collection header. For this,
+     * instead use the method {@link #getKeys()}.
      *
      * @return the set of default EPICS variable names
      */
-    public static Set<String> getDefaultNames() {
+    public static Set<String> getDefaultKeys() {
         return DESCRIPTIONS.keySet();
     };
 
@@ -104,8 +105,8 @@
      * <p>
      * Read data into this object from an LCIO event using the default collection name.
      * <p>
-     * This is the primary method for users to read the EPICS data into their Drivers in the {@link org.lcsim.util.Driver#process(EventHeader)}
-     * method.
+     * This is the primary method for users to read the EPICS data into their Drivers in the
+     * {@link org.lcsim.util.Driver#process(EventHeader)} method.
      *
      * @param event the LCIO event
      * @return the EPICS data from the event
@@ -141,7 +142,8 @@
     private final Map<String, Double> dataMap = new LinkedHashMap<String, Double>();
 
     /**
-     * Given a list of names, read the double values from the {@link org.lcsim.event.GenericObject} into the data map of this object.
+     * Given a list of names, read the double values from the {@link org.lcsim.event.GenericObject} into the data map of
+     * this object.
      *
      * @param object the <code>GenericObject</code> with the data values
      * @param names The list of names.
@@ -174,11 +176,12 @@
     /**
      * Get the list of EPICS variables used by this object.
      * <p>
-     * This could potentially be different than the list of default names from {@link #getDefaultNames()} but it will usually be the same.
+     * This could potentially be different than the list of default names from {@link #getDefaultKeys()} but it will
+     * usually be the same.
      *
      * @return the list of used EPICS variable names
      */
-    public Set<String> getUsedNames() {
+    public Set<String> getKeys() {
         return this.dataMap.keySet();
     }
 
@@ -189,6 +192,15 @@
      */
     public Double getValue(final String name) {
         return this.dataMap.get(name);
+    }
+
+    /**
+     * Return <code>true</code> if the data has the given key.
+     *
+     * @return <code>true</code> if data has the given key
+     */
+    public boolean hasKey(final String key) {
+        return this.getKeys().contains(key);
     }
 
     /**
@@ -233,7 +245,8 @@
     }
 
     /**
-     * Write this object's data into a <code>GenericObject</code> collection in the LCIO event using the default collection name.
+     * Write this object's data into a <code>GenericObject</code> collection in the LCIO event using the default
+     * collection name.
      *
      * @param event the LCIO event
      */

Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EpicsLog.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EpicsLog.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/EpicsLog.java	Wed Jul 29 17:30:12 2015
@@ -50,7 +50,7 @@
         System.out.println(this.logData);
 
         // Compute means for all EPICS variables.
-        for (final String name : this.logData.getUsedNames()) {
+        for (final String name : this.logData.getKeys()) {
             final double total = this.logData.getValue(name);
             final double mean = total / this.counts.get(name);
             this.logData.setValue(name, mean);
@@ -83,8 +83,8 @@
      */
     private void update() {
         if (this.currentEpicsData != null) {
-            for (final String name : this.currentEpicsData.getUsedNames()) {
-                if (!this.logData.getUsedNames().contains(name)) {
+            for (final String name : this.currentEpicsData.getKeys()) {
+                if (!this.logData.getKeys().contains(name)) {
                     this.logData.setValue(name, 0.);
                 }
                 if (!this.counts.keySet().contains(name)) {

Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunSummaryUpdater.java
 =============================================================================
--- java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunSummaryUpdater.java	(original)
+++ java/trunk/record-util/src/main/java/org/hps/record/evio/crawler/RunSummaryUpdater.java	Wed Jul 29 17:30:12 2015
@@ -197,7 +197,7 @@
                 .prepareStatement("INSERT INTO run_epics (run, variable_name, value) values (?, ?, ?)");
         final EpicsData data = runSummary.getEpicsData();
         if (data != null) {
-            for (final String variableName : data.getUsedNames()) {
+            for (final String variableName : data.getKeys()) {
                 statement.setInt(1, this.run);
                 statement.setString(2, variableName);
                 statement.setDouble(3, data.getValue(variableName));

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