Revision: 6521 http://sourceforge.net/p/jump-pilot/code/6521 Author: edso Date: 2020-09-23 16:12:47 +0000 (Wed, 23 Sep 2020) Log Message: ----------- commented some debug output extended Reporter a bit
Modified Paths: -------------- core/trunk/src/org/geotools/shapefile/Shapefile.java Modified: core/trunk/src/org/geotools/shapefile/Shapefile.java =================================================================== --- core/trunk/src/org/geotools/shapefile/Shapefile.java 2020-09-23 10:46:11 UTC (rev 6520) +++ core/trunk/src/org/geotools/shapefile/Shapefile.java 2020-09-23 16:12:47 UTC (rev 6521) @@ -148,7 +148,7 @@ } try{ body = handler.read(file,geometryFactory,contentLength); - Logger.debug("" + recordNumber + " : from " + (pos-4) + " for " + contentLength + " (" + body.getNumPoints() + " pts)"); + //Logger.trace("" + recordNumber + " : from " + (pos-4) + " for " + contentLength + " (" + body.getNumPoints() + " pts)"); pos += contentLength; list.add(body); count++; @@ -417,7 +417,7 @@ raf.getChannel().read(bb, offset*2 + 8); shp = new EndianDataInputStream(new ByteArrayInputStream(bytes)); body = handler.read(shp, geometryFactory, length); - Logger.trace("" + recordNumber + " : from " + offset + " for " + length + " (" + body.getNumPoints() + " pts)"); + //Logger.trace("" + recordNumber + " : from " + offset + " for " + length + " (" + body.getNumPoints() + " pts)"); list.add(body); // report to gui r.report(recordNumber); @@ -472,6 +472,8 @@ * @author ed */ private class Reporter { + int totalCount = -1; + long init = Timer.now(); int sampleSize = -1; long samplePeriod = 500; //ms @@ -478,6 +480,13 @@ int lastUpdateCount = 0; long lastUpdateTime = init; + public Reporter() { + } + + public Reporter(int totalCount) { + this.totalCount = totalCount; + } + public void report(int count) { // show status every sampleSize calculated by the samplePeriod given if (sampleSize < 0 && (init + samplePeriod) <= Timer.now()) { @@ -500,8 +509,12 @@ private void print(int count) { lastUpdateTime = Timer.now(); lastUpdateCount = count; - TaskMonitorUtil.report(getTaskMonitor(), - I18N.getMessage("Reader.parsed-{0}-features", String.format("%,10d", count))); + if (totalCount >= 0) + TaskMonitorV2Util.report(getTaskMonitor(), + I18N.getMessage("Reader.parsed-{0}-of-totally-{1}-features", String.format("%,10d", count), totalCount)); + else + TaskMonitorV2Util.report(getTaskMonitor(), + I18N.getMessage("Reader.parsed-{0}-features", String.format("%,10d", count))); } } _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel