comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthFacet.java @ 8891:f431aec10d2c

Implemented access to bed measurements
author gernotbelger
date Wed, 14 Feb 2018 19:06:21 +0100
parents 7a8c12706834
children
comparison
equal deleted inserted replaced
8890:90b7f45ff4ae 8891:f431aec10d2c
45 45
46 final CalculationResult res = (CalculationResult) flys.compute(context, this.hash, this.stateId, this.type, false); 46 final CalculationResult res = (CalculationResult) flys.compute(context, this.hash, this.stateId, this.type, false);
47 47
48 final FlowDepthCalculationResults data = (FlowDepthCalculationResults) res.getData(); 48 final FlowDepthCalculationResults data = (FlowDepthCalculationResults) res.getData();
49 49
50 final FlowDepthCalculationResult result = data.getResults().get(this.index); 50 return data.getResults().get(this.index);
51
52 // FIXME: variable mean computation depending on current scale
53
54 // Double start = (Double)context.getContextValue("startkm");
55 // Double end = (Double)context.getContextValue("endkm");
56 // if(start != null && end != null) {
57 // RiverContext fc = (RiverContext)context.globalContext();
58 // ZoomScale scales = (ZoomScale)fc.get("zoomscale");
59 // RiverAccess access = new RiverAccess((D4EArtifact)artifact);
60 // String river = access.getRiverName();
61 //
62 // double radius = scales.getRadius(river, start, end);
63 // FlowVelocityData oldData = data[index];
64 // FlowVelocityData newData = new FlowVelocityData();
65 // double[][] q = oldData.getQPoints();
66 // double[][] totalV = MovingAverage.weighted(oldData.getTotalChannelPoints(), radius);
67 // double[][] mainV = MovingAverage.weighted(oldData.getMainChannelPoints(), radius);
68 // double[][] tau = MovingAverage.weighted(oldData.getTauPoints(), radius);
69 // for(int j = 0; j < q[0].length; j++) {
70 // newData.addKM(q[0][j]);
71 // newData.addQ(q[1][j]);
72 // newData.addTauMain(tau[1][j]);
73 // newData.addVMain(mainV[1][j]);
74 // newData.addVTotal(totalV[1][j]);
75 // }
76 // return newData;
77 // }
78
79 return result;
80 } 51 }
81 52
82 /** Copy deeply. */ 53 /** Copy deeply. */
83 @Override 54 @Override
84 public Facet deepCopy() { 55 public Facet deepCopy() {
56 // FIXME: why not simply use the full constructor instead?
85 final FlowDepthFacet copy = new FlowDepthFacet(); 57 final FlowDepthFacet copy = new FlowDepthFacet();
86 // FIXME: why does DataFacet does not override set? Bad access to variables of parent! 58 // FIXME: why does DataFacet does not override set? Bad access to variables of parent!
87 copy.set(this); 59 copy.set(this);
88 copy.type = this.type; 60 copy.type = this.type;
89 copy.hash = this.hash; 61 copy.hash = this.hash;

http://dive4elements.wald.intevation.org