comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 637:f0c1250d1e7b

Make "Berechnungsart 4" work independent of flow direction. Commented out back jump correction temporarily. flys-artifacts/trunk@2013 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 26 May 2011 16:54:16 +0000
parents acf3b49ec31f
children 6695e03e9b82
comparison
equal deleted inserted replaced
636:58276db49b16 637:f0c1250d1e7b
1 package de.intevation.flys.artifacts; 1 package de.intevation.flys.artifacts;
2 2
3 import java.util.ArrayList;
3 import java.util.Collection; 4 import java.util.Collection;
4 import java.util.HashMap; 5 import java.util.HashMap;
5 import java.util.List; 6 import java.util.List;
6 import java.util.Map; 7 import java.util.Map;
7 import java.util.Set; 8 import java.util.Set;
771 } 772 }
772 773
773 return qs; 774 return qs;
774 } 775 }
775 776
777 protected double [][] getRanges() {
778 logger.debug("getRanges");
779
780 StateData data = getData("wq_values");
781
782 if (data == null) {
783 logger.warn("Missing wq values!");
784 return new double [0][0];
785 }
786
787 String dataString = (String)data.getValue();
788 String [] ranges = dataString.split(":");
789
790 ArrayList<double []> rs = new ArrayList<double []>();
791
792 for (String range: ranges) {
793 String [] parts = range.split(";");
794
795 if (parts.length < 2) {
796 logger.warn("invalid number of parts in range line");
797 continue;
798 }
799 try {
800 double from = Double.parseDouble(parts[0]);
801 double to = Double.parseDouble(parts[1]);
802 rs.add(new double [] { from, to });
803 }
804 catch (NumberFormatException nfe) {
805 logger.warn("invalid double values in range line");
806 }
807 }
808
809 return rs.toArray(new double [rs.size()][]);
810 }
811
776 812
777 /** 813 /**
778 * This method returns the given W or Q values for a specific range 814 * This method returns the given W or Q values for a specific range
779 * (inserted in the WQ input panel for discharge longitudinal sections). 815 * (inserted in the WQ input panel for discharge longitudinal sections).
780 * 816 *

http://dive4elements.wald.intevation.org