Mercurial > dive4elements > river
changeset 3420:7f7ab030a4e3
FixA: Minor refactoring
flys-artifacts/trunk@5074 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 19 Jul 2012 16:57:44 +0000 |
parents | da7cf0e3ccaa |
children | c44ff50f4970 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java |
diffstat | 3 files changed, 23 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Jul 19 16:35:14 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jul 19 16:57:44 2012 +0000 @@ -1,3 +1,11 @@ +2012-07-19 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java: + Some minor refactoring. + + * src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java: + Call super constructor to retrieve the common data from the artifact. + 2012-07-19 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/model/fixings/FixCalculation.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java Thu Jul 19 16:35:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAnalysisCalculation.java Thu Jul 19 16:57:44 2012 +0000 @@ -1,5 +1,7 @@ package de.intevation.flys.artifacts.model.fixings; +import de.intevation.artifacts.common.utils.StringUtils; + import de.intevation.flys.artifacts.access.FixAnalysisAccess; import de.intevation.flys.artifacts.math.fitting.Function; @@ -47,6 +49,11 @@ public static final double EPSILON = 1e-4; + // TODO: Move to base class? + public static final String [] STANDARD_COLUMNS = { + "km", "chi_sqr", "max_q", "std-dev" + }; + protected DateRange referencePeriod; protected DateRange [] analysisPeriods; @@ -135,7 +142,8 @@ String [] parameterNames = func.getParameterNames(); Parameters results = - new Parameters(createColumnNames(parameterNames)); + new Parameters( + StringUtils.join(STANDARD_COLUMNS, parameterNames)); boolean invalid = false; @@ -540,15 +548,5 @@ return columns; } - - protected static String [] createColumnNames(String [] parameters) { - String [] result = new String[parameters.length + 4]; - result[0] = "km"; - result[1] = "chi_sqr"; - result[2] = "max_q"; - result[3] = "std-dev"; - System.arraycopy(parameters, 0, result, 4, parameters.length); - return result; - } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java Thu Jul 19 16:35:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java Thu Jul 19 16:57:44 2012 +0000 @@ -22,6 +22,8 @@ } public FixRealizingCalculation(FixRealizingAccess access) { + super(access); + Boolean isQ = access.isQ(); List<Segment> segments = access.getSegments(); @@ -42,8 +44,11 @@ } public CalculationResult calculate() { + if (hasProblems()) { + return new CalculationResult(this); + } // TODO: Implement me! - return null; + return new CalculationResult(this); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :