ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter2/ReportMaker.java
(Generate patch)

Comparing projects/cms/source/reports/DBReporter2/ReportMaker.java (file contents):
Revision 1.2 by pjm2, Sat Feb 3 17:26:07 2001 UTC vs.
Revision 1.5 by pjm2, Sat Feb 3 21:49:36 2001 UTC

# Line 10 | Line 10 | import uk.ac.ukc.iscream.util.*;
10   public class ReportMaker {
11  
12      // Constructor.  This takes the database Statement.    
13 <    public ReportMaker(Statement stmt, String dateDir, long startTime, long endTime) {
13 >    public ReportMaker(Statement stmt, String webDir, String dateDir, long startTime, long endTime) {
14          _stmt = stmt;
15 +        _webDir = webDir;
16          _dateDir = dateDir;
17          _startTime = startTime;
18          _endTime = endTime;
# Line 61 | Line 62 | public class ReportMaker {
62                      Report report = (Report)reportIt.next();
63                      String reportField = report.getReportField();
64                      long x = rs.getLong("receipt_date");
65 <                    double y;
65 >                    double y = 0.0;
66                      try {
67                          y = Double.parseDouble(packet.getParam(reportField));
68                      }
# Line 69 | Line 70 | public class ReportMaker {
70                          System.out.println("Skipped a non-numerical field for " + reportField + ".");
71                          continue;
72                      }
73 +                    catch (NullPointerException e) {
74 +                        continue;
75 +                    }
76                      plotData.addPoint(x, y);
77                  }
78              }
# Line 96 | Line 100 | public class ReportMaker {
100              }
101              BufferedImage img = chart.drawChart(plotData, SHTMLLayout.CHART_WIDTH, SHTMLLayout.CHART_HEIGHT, 24, 10, maxY);
102              IscreamChartWriter imgWriter = new IscreamChartWriter();
103 <            imgWriter.writeChart(img, _dateDir + "_" + machine + "_" + reportField + ".gif");
103 >            IscreamFilePlacer placer = new IscreamFilePlacer(_webDir);
104 >            File destination = placer.makeDirs(_dateDir, machine, reportField);
105 >            imgWriter.writeChart(img, new File(destination, "chart.gif"));
106              System.out.println("[DEBUG]Point count: " + plotData.countPoints());            
107          }
108          
109      }
110      
111      private Statement _stmt = null;
112 +    private String _webDir;
113      private String _dateDir;
114      private long _startTime;
115      private long _endTime;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines