comparison 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
comparison
equal deleted inserted replaced
454:2c0c22e0935d 455:7137ef65c17c
626 } 626 }
627 else { 627 else {
628 results.add(new WQKms(okms, oqs, ows)); 628 results.add(new WQKms(okms, oqs, ows));
629 } 629 }
630 } 630 }
631 // TODO: set names 631
632 632 WQKms [] wqkms = results.toArray(new WQKms[results.size()]);
633 return results.toArray(new WQKms[results.size()]); 633
634 setDischargeLongitudinalSectionNames(wqkms, iqs, isQ() ? "Q" : "W");
635
636 return wqkms;
634 } 637 }
635 638
636 protected static String joinDoubles(double [] x) { 639 protected static String joinDoubles(double [] x) {
637 if (x == null) { 640 if (x == null) {
638 return ""; 641 return "";
657 660
658 661
659 /** 662 /**
660 * Sets the name for discharge longitudinal section curves where each WQKms 663 * Sets the name for discharge longitudinal section curves where each WQKms
661 * in <i>r</i> represents a column. 664 * in <i>r</i> represents a column.
662 *
663 * @param wqkms A longitudinal section curve.
664 * @param allValues The input values of the computations.
665 * @param col The requested column in the table of Ws or Qs.
666 * @param wq The WQ mode - can be one of "W" or "Q".
667 */ 665 */
668 public static void setDischargeLongitudinalSectionNames( 666 public static void setDischargeLongitudinalSectionNames(
669 WQKms wqkms, 667 WQKms [] wqkms,
670 double[][] allValues, 668 double [][] iqs,
671 int col, 669 String wq
672 String wq) 670 ) {
673 {
674 logger.debug("WINFOArtifact.setDischargeLongitudinalSectionNames"); 671 logger.debug("WINFOArtifact.setDischargeLongitudinalSectionNames");
675 672
676 StringBuilder sb = new StringBuilder(" ("); 673 // TODO: I18N
677 boolean first = true; 674
678 675 for (int j = 0; j < wqkms.length; ++j) {
679 int rows = allValues.length; 676 StringBuilder sb = new StringBuilder(wq)
680 677 .append(" benutzerdefiniert (");
681 for (int i = 0; i < rows; i++) { 678
682 double[] values = allValues[i]; 679 double [] iqsi = iqs[j];
683 680 for (int i = 0; i < iqsi.length; i++) {
684 if (!first) { 681 if (i > 0) {
685 sb.append("; "); 682 sb.append("; ");
686 } 683 }
687 684 sb.append(iqsi[i]);
688 sb.append(Double.toString(values[col])); 685 }
689 686 sb.append(")");
690 first = false; 687
691 } 688 wqkms[j].setName(sb.toString());
692 689 }
693 sb.append(")");
694
695 wqkms.setName(wq + " Benutzerdefiniert" + sb.toString());
696 } 690 }
697 } 691 }
698 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 692 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org