Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 455:7137ef65c17c
Reintroduced titles for the "W for unausgeglichene Abfluesse".
flys-artifacts/trunk@1952 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 19 May 2011 09:54:57 +0000 |
parents | 5aef92ea71a6 |
children | af1b64ec7250 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Thu May 19 09:45:29 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Thu May 19 09:54:57 2011 +0000 @@ -628,9 +628,12 @@ results.add(new WQKms(okms, oqs, ows)); } } - // TODO: set names - return results.toArray(new WQKms[results.size()]); + WQKms [] wqkms = results.toArray(new WQKms[results.size()]); + + setDischargeLongitudinalSectionNames(wqkms, iqs, isQ() ? "Q" : "W"); + + return wqkms; } protected static String joinDoubles(double [] x) { @@ -659,40 +662,31 @@ /** * Sets the name for discharge longitudinal section curves where each WQKms * in <i>r</i> represents a column. - * - * @param wqkms A longitudinal section curve. - * @param allValues The input values of the computations. - * @param col The requested column in the table of Ws or Qs. - * @param wq The WQ mode - can be one of "W" or "Q". */ public static void setDischargeLongitudinalSectionNames( - WQKms wqkms, - double[][] allValues, - int col, - String wq) - { + WQKms [] wqkms, + double [][] iqs, + String wq + ) { logger.debug("WINFOArtifact.setDischargeLongitudinalSectionNames"); - StringBuilder sb = new StringBuilder(" ("); - boolean first = true; - - int rows = allValues.length; - - for (int i = 0; i < rows; i++) { - double[] values = allValues[i]; + // TODO: I18N - if (!first) { - sb.append("; "); - } - - sb.append(Double.toString(values[col])); + for (int j = 0; j < wqkms.length; ++j) { + StringBuilder sb = new StringBuilder(wq) + .append(" benutzerdefiniert ("); - first = false; - } + double [] iqsi = iqs[j]; + for (int i = 0; i < iqsi.length; i++) { + if (i > 0) { + sb.append("; "); + } + sb.append(iqsi[i]); + } + sb.append(")"); - sb.append(")"); - - wqkms.setName(wq + " Benutzerdefiniert" + sb.toString()); + wqkms[j].setName(sb.toString()); + } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :