Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityExporter.java @ 2703:aa4391648a05
Finalized the CSV export of MINFO flow velocity calculation.
flys-artifacts/trunk@4419 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 16 May 2012 09:11:02 +0000 |
parents | 4c00cf83fff1 |
children |
comparison
equal
deleted
inserted
replaced
2702:4c00cf83fff1 | 2703:aa4391648a05 |
---|---|
11 | 11 |
12 import au.com.bytecode.opencsv.CSVWriter; | 12 import au.com.bytecode.opencsv.CSVWriter; |
13 | 13 |
14 import de.intevation.artifacts.CallContext; | 14 import de.intevation.artifacts.CallContext; |
15 | 15 |
16 import de.intevation.flys.artifacts.FLYSArtifact; | |
16 import de.intevation.flys.artifacts.model.CalculationResult; | 17 import de.intevation.flys.artifacts.model.CalculationResult; |
17 import de.intevation.flys.artifacts.model.FlowVelocityData; | 18 import de.intevation.flys.artifacts.model.FlowVelocityData; |
19 import de.intevation.flys.utils.FLYSUtils; | |
18 import de.intevation.flys.utils.Formatter; | 20 import de.intevation.flys.utils.Formatter; |
19 | 21 |
20 | 22 |
21 /** | 23 /** |
22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
94 | 96 |
95 | 97 |
96 protected void data2CSV(CSVWriter writer, FlowVelocityData[] fData) { | 98 protected void data2CSV(CSVWriter writer, FlowVelocityData[] fData) { |
97 logger.debug("Add next FlowVelocityData to CSV"); | 99 logger.debug("Add next FlowVelocityData to CSV"); |
98 | 100 |
101 FLYSArtifact flys = (FLYSArtifact) master; | |
102 | |
99 for (FlowVelocityData data: fData) { | 103 for (FlowVelocityData data: fData) { |
100 for (int i = 0, n = data.size(); i < n; i++) { | 104 for (int i = 0, n = data.size(); i < n; i++) { |
101 NumberFormat kmF = Formatter.getFlowVelocityKM(context); | 105 NumberFormat kmF = Formatter.getFlowVelocityKM(context); |
102 NumberFormat valF = Formatter.getFlowVelocityValues(context); | 106 NumberFormat valF = Formatter.getFlowVelocityValues(context); |
103 NumberFormat qF = Formatter.getFlowVelocityQ(context); | 107 NumberFormat qF = Formatter.getFlowVelocityQ(context); |
106 kmF.format(data.getKM(i)), | 110 kmF.format(data.getKM(i)), |
107 valF.format(data.getVMain(i)), | 111 valF.format(data.getVMain(i)), |
108 valF.format(data.getVTotal(i)), | 112 valF.format(data.getVTotal(i)), |
109 valF.format(data.getTauMain(i)), | 113 valF.format(data.getTauMain(i)), |
110 qF.format(data.getQ(i)) + "=" + data.getZone(), | 114 qF.format(data.getQ(i)) + "=" + data.getZone(), |
111 "TODO: add Location for km"// TODO Add Locations | 115 FLYSUtils.getLocationDescription(flys, data.getKM(i)), |
112 }); | 116 }); |
113 } | 117 } |
114 } | 118 } |
115 } | 119 } |
116 | 120 |