Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | cde863b2dae3 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
33 */ | 33 */ |
34 public class FixWQCurveFacet | 34 public class FixWQCurveFacet |
35 extends FixingsFacet | 35 extends FixingsFacet |
36 implements FacetTypes { | 36 implements FacetTypes { |
37 | 37 |
38 /** House logger. */ | 38 /** House log. */ |
39 private static Logger logger = Logger.getLogger(FixWQCurveFacet.class); | 39 private static Logger log = Logger.getLogger(FixWQCurveFacet.class); |
40 | 40 |
41 | 41 |
42 /** Trivial Constructor. */ | 42 /** Trivial Constructor. */ |
43 public FixWQCurveFacet() { | 43 public FixWQCurveFacet() { |
44 } | 44 } |
65 * @return the data. | 65 * @return the data. |
66 */ | 66 */ |
67 @Override | 67 @Override |
68 public Object getData(Artifact artifact, CallContext context) { | 68 public Object getData(Artifact artifact, CallContext context) { |
69 | 69 |
70 logger.debug("getData"); | 70 log.debug("getData"); |
71 if (!(artifact instanceof D4EArtifact)) { | 71 if (!(artifact instanceof D4EArtifact)) { |
72 logger.debug("Not an instance of D4EArtifact / FixationArtifact."); | 72 log.debug("Not an instance of D4EArtifact / FixationArtifact."); |
73 return null; | 73 return null; |
74 } | 74 } |
75 | 75 |
76 D4EArtifact flys = (D4EArtifact)artifact; | 76 D4EArtifact flys = (D4EArtifact)artifact; |
77 FixAnalysisAccess access = new FixAnalysisAccess(flys); | 77 FixAnalysisAccess access = new FixAnalysisAccess(flys); |
82 false); | 82 false); |
83 | 83 |
84 FixResult result = (FixResult) res.getData(); | 84 FixResult result = (FixResult) res.getData(); |
85 double currentKm = getCurrentKm(context); | 85 double currentKm = getCurrentKm(context); |
86 | 86 |
87 logger.debug("getData: km = " + currentKm); | 87 log.debug("getData: km = " + currentKm); |
88 | 88 |
89 String function = access.getFunction(); | 89 String function = access.getFunction(); |
90 Function ff = FunctionFactory.getInstance().getFunction(function); | 90 Function ff = FunctionFactory.getInstance().getFunction(function); |
91 | 91 |
92 if (ff == null) { | 92 if (ff == null) { |
93 logger.warn("getData: ff == null"); | 93 log.warn("getData: ff == null"); |
94 return null; | 94 return null; |
95 } | 95 } |
96 | 96 |
97 Parameters params = result.getParameters(); | 97 Parameters params = result.getParameters(); |
98 String[] paramNames = ff.getParameterNames(); | 98 String[] paramNames = ff.getParameterNames(); |
99 | 99 |
100 double [] coeffs = params.interpolateWithLimit( | 100 double [] coeffs = params.interpolateWithLimit( |
101 "km", currentKm, paramNames, access.getStep() / 1000 + 1E-3); | 101 "km", currentKm, paramNames, access.getStep() / 1000 + 1E-3); |
102 | 102 |
103 if (coeffs == null) { | 103 if (coeffs == null) { |
104 logger.warn("getData: coeffs not in interpolation limits"); | 104 log.warn("getData: coeffs not in interpolation limits"); |
105 return null; | 105 return null; |
106 } | 106 } |
107 | 107 |
108 org.dive4elements.river.artifacts.math.Function mf = | 108 org.dive4elements.river.artifacts.math.Function mf = |
109 ff.instantiate(coeffs); | 109 ff.instantiate(coeffs); |
110 | 110 |
111 double maxQ = FixFacetUtils.getMaxQ(params, currentKm); | 111 double maxQ = FixFacetUtils.getMaxQ(params, currentKm); |
112 logger.debug("getData: maxQ = " + maxQ); | 112 log.debug("getData: maxQ = " + maxQ); |
113 | 113 |
114 FixFunction fix = new FixFunction( | 114 FixFunction fix = new FixFunction( |
115 ff.getName(), | 115 ff.getName(), |
116 ff.getDescription(), | 116 ff.getDescription(), |
117 mf, | 117 mf, |