Print

Print


Commit in lcsim/src/org/lcsim/job on MAIN
AidaSaveDriver.java+29-221.1 -> 1.2
JobControlManager.java+14-31.34 -> 1.35
+43-25
2 modified files


lcsim/src/org/lcsim/job
AidaSaveDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- AidaSaveDriver.java	8 Oct 2009 18:54:08 -0000	1.1
+++ AidaSaveDriver.java	6 May 2010 20:53:33 -0000	1.2
@@ -7,26 +7,33 @@
 
 public class AidaSaveDriver extends Driver 
 {
-	String outputFileName = "plots.aida";
-	
-	public AidaSaveDriver()
-	{}
-	
-	public void setOutputFileName(String outputFileName)
-	{
-		this.outputFileName = outputFileName;
-	}
-	
-	public void endOfData()
-	{
-		try 
-		{
-                        System.out.println("saving AIDA file to " + outputFileName);
-			AIDA.defaultInstance().saveAs(outputFileName);
-		}
-		catch (IOException x)
-		{
-			throw new RuntimeException("Problem saving AIDA file to " + outputFileName + ".", x);
-		}
-	}
+    String outputFileName = "plots.aida";
+    boolean verbose = false;
+
+    public AidaSaveDriver()
+    {}
+
+    public void setOutputFileName(String outputFileName)
+    {
+        this.outputFileName = outputFileName;
+    }
+    
+    public void setVerbose(boolean verbose)
+    {
+        this.verbose = verbose;
+    }
+
+    public void endOfData()
+    {
+        try 
+        {
+            if (verbose)
+                System.out.println("Saving AIDA file to " + outputFileName + " ...");
+            AIDA.defaultInstance().saveAs(outputFileName);
+        }
+        catch (IOException x)
+        {
+            throw new RuntimeException("Problem saving AIDA file to " + outputFileName + ".", x);
+        }
+    }
 }

lcsim/src/org/lcsim/job
JobControlManager.java 1.34 -> 1.35
diff -u -r1.34 -r1.35
--- JobControlManager.java	14 Apr 2010 17:30:11 -0000	1.34
+++ JobControlManager.java	6 May 2010 20:53:33 -0000	1.35
@@ -65,7 +65,7 @@
 	int maxEvents = -1;
 	int skipEvents = -1;
 	File cacheDirectory;
-	FileCache fileCache;
+	FileCache fileCache; // Start with default dir.
 	ClassLoader loader;
 	boolean printDriverStatistics;
 	boolean printSystemProperties;
@@ -86,7 +86,16 @@
 	 * Default no-argument constructor.
 	 */
 	public JobControlManager()
-	{}
+	{
+	    try 
+	    {
+	        fileCache = new FileCache();
+	    }
+	    catch (IOException x)
+	    {
+	        throw new RuntimeException(x);
+	    }
+	}
 	
 	/**
 	 * Simple frontend method taking the name of the XML steering file.
@@ -112,7 +121,7 @@
 	public void run()
 	{
 		if (!wasSetup)
-			throw new RuntimeException("Aborting job!  The setup() method was never called.");
+			throw new RuntimeException("Aborting job!  The setup method was never called.");
 		
 		if (printVersion)
 		{			
@@ -682,6 +691,8 @@
 	
 	private void setupFileCache()
 	{
+	    if (cacheDirectory == null)
+	        return;
 		try
 		{
 			fileCache = new FileCache();
CVSspam 0.2.8