# HG changeset patch # User Sascha L. Teichmann # Date 1345636728 0 # Node ID 7196f06e092898364caa23c67345da47d4822b54 # Parent 2382b26079acb92203a1b5a7e3f0aaa48a0e3d6b FixA: Made indices of analysis periods QWs zero based. flys-artifacts/trunk@5232 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 2382b26079ac -r 7196f06e0928 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Wed Aug 22 11:02:56 2012 +0000 +++ b/flys-artifacts/ChangeLog Wed Aug 22 11:58:48 2012 +0000 @@ -1,3 +1,8 @@ +2012-08-20 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java: + Made indices of analysis periods QWs zero based. + 2012-08-20 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/model/fixings/QW.java: diff -r 2382b26079ac -r 7196f06e0928 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java Wed Aug 22 11:02:56 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java Wed Aug 22 11:58:48 2012 +0000 @@ -26,6 +26,7 @@ import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.List; import org.apache.commons.math.stat.descriptive.moment.StandardDeviation; @@ -128,6 +129,9 @@ IdsFilter idsFilter = new IdsFilter(events); + HashMap col2index = new HashMap(); + + for (int row = 0, R = parameters.size(); row < R; ++row) { double km = parameters.get(row, kmIndex); parameters.get(row, parameterIndices, parameterValues); @@ -199,11 +203,18 @@ Date date = column.getDate(); String description = column.getDescription(); + Integer colIdx = column.getIndex(); + Integer index = col2index.get(colIdx); + if (index == null) { + index = col2index.size(); + col2index.put(colIdx, index); + } + QWD qwd = new QWD( wq[1], wq[0], description, date, true, - dw, column.getIndex()); + dw, index); qwds.add(qwd);