Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/WaterlevelExporter.java @ 4859:e31231d0a720
WaterlevelExporter: Updated to use RangeAccess instead of FLYSUtils.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 23 Jan 2013 13:04:16 +0100 |
parents | 01e82da3f919 |
children | 4c76c5f69eaf |
comparison
equal
deleted
inserted
replaced
4858:56fbdcdb7ff2 | 4859:e31231d0a720 |
---|---|
30 import de.intevation.artifacts.CallMeta; | 30 import de.intevation.artifacts.CallMeta; |
31 import de.intevation.artifacts.common.utils.Config; | 31 import de.intevation.artifacts.common.utils.Config; |
32 | 32 |
33 import de.intevation.flys.model.Gauge; | 33 import de.intevation.flys.model.Gauge; |
34 | 34 |
35 import de.intevation.flys.artifacts.access.RangeAccess; | |
35 import de.intevation.flys.artifacts.FLYSArtifact; | 36 import de.intevation.flys.artifacts.FLYSArtifact; |
36 import de.intevation.flys.artifacts.WINFOArtifact; | 37 import de.intevation.flys.artifacts.WINFOArtifact; |
37 import de.intevation.flys.artifacts.model.CalculationResult; | 38 import de.intevation.flys.artifacts.model.CalculationResult; |
38 import de.intevation.flys.artifacts.model.WQCKms; | 39 import de.intevation.flys.artifacts.model.WQCKms; |
39 import de.intevation.flys.artifacts.model.WQKms; | 40 import de.intevation.flys.artifacts.model.WQKms; |
292 | 293 |
293 | 294 |
294 protected void writeCSVMeta(CSVWriter writer) { | 295 protected void writeCSVMeta(CSVWriter writer) { |
295 logger.info("WaterlevelExporter.writeCSVMeta"); | 296 logger.info("WaterlevelExporter.writeCSVMeta"); |
296 | 297 |
298 // TODO use Access instead of FLYSUtils | |
299 | |
297 CallMeta meta = context.getMeta(); | 300 CallMeta meta = context.getMeta(); |
298 | 301 |
299 FLYSArtifact flys = (FLYSArtifact) master; | 302 FLYSArtifact flys = (FLYSArtifact) master; |
300 | 303 |
301 writer.writeNext(new String[] { | 304 writer.writeNext(new String[] { |
331 CSV_META_RIVER, | 334 CSV_META_RIVER, |
332 CSV_META_RIVER, | 335 CSV_META_RIVER, |
333 new Object[] { FLYSUtils.getRivername(flys) }) | 336 new Object[] { FLYSUtils.getRivername(flys) }) |
334 }); | 337 }); |
335 | 338 |
336 double[] kms = FLYSUtils.getKmRange(flys); | 339 RangeAccess rangeAccess = new RangeAccess(flys, null); |
340 double[] kms = rangeAccess.getKmRange(); | |
337 writer.writeNext(new String[] { | 341 writer.writeNext(new String[] { |
338 Resources.getMsg( | 342 Resources.getMsg( |
339 meta, | 343 meta, |
340 CSV_META_RANGE, | 344 CSV_META_RANGE, |
341 CSV_META_RANGE, | 345 CSV_META_RANGE, |
652 Locale locale = Resources.getLocale(meta); | 656 Locale locale = Resources.getLocale(meta); |
653 DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); | 657 DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); |
654 | 658 |
655 source.addMetaData("date", df.format(new Date())); | 659 source.addMetaData("date", df.format(new Date())); |
656 | 660 |
657 double[] kms = FLYSUtils.getKmRange(flys); | 661 RangeAccess rangeAccess = new RangeAccess(flys, null); |
662 double[] kms = rangeAccess.getKmRange(); | |
658 source.addMetaData("range", kms[0] + " - " + kms[kms.length-1]); | 663 source.addMetaData("range", kms[0] + " - " + kms[kms.length-1]); |
659 | 664 |
660 source.addMetaData("gauge", FLYSUtils.getGaugename(flys)); | 665 source.addMetaData("gauge", FLYSUtils.getGaugename(flys)); |
661 | 666 |
662 source.addMetaData("calculation", Resources.getMsg( | 667 source.addMetaData("calculation", Resources.getMsg( |