Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WWAxisTypes.java @ 2256:dd93a8e1377a
First steps to serve the data in cm if we are are gauges only.
flys-artifacts/trunk@3910 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 03 Feb 2012 18:03:26 +0000 |
parents | |
children | 08bb95e1fc41 |
comparison
equal
deleted
inserted
replaced
2255:eab357067e06 | 2256:dd93a8e1377a |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import de.intevation.flys.artifacts.math.Function; | |
4 import de.intevation.flys.artifacts.math.Identity; | |
5 import de.intevation.flys.artifacts.math.LinearFilterFunction; | |
6 | |
7 public class WWAxisTypes | |
8 { | |
9 protected boolean inCm1; | |
10 protected boolean inCm2; | |
11 | |
12 public WWAxisTypes() { | |
13 inCm1 = inCm2 = true; | |
14 } | |
15 | |
16 public WWAxisTypes(WW ww) { | |
17 this(); | |
18 classify(ww); | |
19 } | |
20 | |
21 public void classify(WW ww) { | |
22 if (!ww.startAtGauge()) inCm1 = false; | |
23 if (!ww.endAtGauge()) inCm2 = false; | |
24 } | |
25 | |
26 public boolean getInCm1() { | |
27 return inCm1; | |
28 } | |
29 | |
30 public void setInCm1(boolean inCm1) { | |
31 this.inCm1 = inCm1; | |
32 } | |
33 | |
34 public boolean getInCm2() { | |
35 return inCm2; | |
36 } | |
37 | |
38 public void setInCm2(boolean inCm2) { | |
39 this.inCm2 = inCm2; | |
40 } | |
41 | |
42 public WW.ApplyFunctionIterator transform(WW ww) { | |
43 Function function1 = inCm1 | |
44 ? new LinearFilterFunction(100d, -ww.getStartDatum()) | |
45 : Identity.IDENTITY; | |
46 | |
47 Function function2 = inCm2 | |
48 ? new LinearFilterFunction(100d, -ww.getEndDatum()) | |
49 : Identity.IDENTITY; | |
50 | |
51 return new WW.ApplyFunctionIterator(ww, function1, function2); | |
52 } | |
53 } | |
54 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |