Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityExporter.java @ 8616:594b0bbc7011
Clean up bad code from 8614:e7a2234e7c3f
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 25 Mar 2015 18:12:16 +0100 |
parents | e7a2234e7c3f |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8615:054d1b57ae4a | 8616:594b0bbc7011 |
---|---|
105 for (int i = 0, n = data.size(); i < n; i++) { | 105 for (int i = 0, n = data.size(); i < n; i++) { |
106 NumberFormat kmF = Formatter.getFlowVelocityKM(context); | 106 NumberFormat kmF = Formatter.getFlowVelocityKM(context); |
107 NumberFormat valF = Formatter.getFlowVelocityValues(context); | 107 NumberFormat valF = Formatter.getFlowVelocityValues(context); |
108 NumberFormat qF = Formatter.getFlowVelocityQ(context); | 108 NumberFormat qF = Formatter.getFlowVelocityQ(context); |
109 | 109 |
110 if (data.getType().equals("main")) { | 110 String vMain = ""; |
111 /* Only a main channel value selected */ | 111 String vTotal = ""; |
112 writer.writeNext(new String[] { | 112 |
113 kmF.format(data.getKM(i)), | 113 if (data.getType().equals("main") || data.getType().equals("main_total")) { |
114 valF.format(data.getVMain(i)), | 114 vMain = valF.format(data.getVMain(i)); |
115 "", | |
116 valF.format(data.getTauMain(i)), | |
117 qF.format(data.getQ(i)) + "=" + data.getZone(), | |
118 RiverUtils.getLocationDescription(flys, data.getKM(i)), | |
119 }); | |
120 } else if (data.getType().equals("total")) { | |
121 /* Only a total channel value selected */ | |
122 writer.writeNext(new String[] { | |
123 kmF.format(data.getKM(i)), | |
124 "", | |
125 valF.format(data.getVTotal(i)), | |
126 valF.format(data.getTauMain(i)), | |
127 qF.format(data.getQ(i)) + "=" + data.getZone(), | |
128 RiverUtils.getLocationDescription(flys, data.getKM(i)), | |
129 }); | |
130 } else { | |
131 /* In this case the type is main_total */ | |
132 writer.writeNext(new String[] { | |
133 kmF.format(data.getKM(i)), | |
134 valF.format(data.getVMain(i)), | |
135 valF.format(data.getVTotal(i)), | |
136 valF.format(data.getTauMain(i)), | |
137 qF.format(data.getQ(i)) + "=" + data.getZone(), | |
138 RiverUtils.getLocationDescription(flys, data.getKM(i)), | |
139 }); | |
140 } | 115 } |
116 if (data.getType().equals("total") || data.getType().equals("main_total")) { | |
117 vTotal = valF.format(data.getVTotal(i)); | |
118 } | |
119 writer.writeNext(new String[] { | |
120 kmF.format(data.getKM(i)), | |
121 vMain, | |
122 vTotal, | |
123 valF.format(data.getTauMain(i)), | |
124 qF.format(data.getQ(i)) + "=" + data.getZone(), | |
125 RiverUtils.getLocationDescription(flys, data.getKM(i)), | |
126 }); | |
141 } | 127 } |
142 } | 128 } |
143 } | 129 } |
144 | 130 |
145 | 131 |