ingo@2706: package de.intevation.flys.artifacts.model; ingo@2706: ingo@2706: import de.intevation.artifactdatabase.state.Facet; ingo@2706: ingo@2706: import de.intevation.artifacts.Artifact; ingo@2706: import de.intevation.artifacts.CallContext; ingo@2706: ingo@2706: import de.intevation.flys.artifacts.FLYSArtifact; ingo@2706: rrenkert@4626: import de.intevation.flys.artifacts.access.RiverAccess; rrenkert@4626: import de.intevation.flys.artifacts.context.FLYSContext; teichmann@4630: teichmann@4630: import de.intevation.flys.artifacts.math.MovingAverage; ingo@2706: import de.intevation.flys.artifacts.states.DefaultState.ComputeType; ingo@2706: ingo@2706: import org.apache.log4j.Logger; ingo@2706: ingo@2706: /** ingo@2706: * Facet of a FlowVelocity curve. ingo@2706: */ ingo@2706: public class FlowVelocityFacet extends DataFacet { ingo@2706: ingo@2706: private static Logger logger = Logger.getLogger(FlowVelocityFacet.class); ingo@2706: ingo@2706: public FlowVelocityFacet() { ingo@2706: // required for clone operation deepCopy() ingo@2706: } ingo@2706: ingo@2706: ingo@2706: public FlowVelocityFacet( ingo@2706: int idx, ingo@2706: String name, ingo@2706: String description, ingo@2706: ComputeType type, ingo@2706: String stateId, ingo@2706: String hash ingo@2706: ) { ingo@2706: super(idx, name, description, type, hash, stateId); ingo@2706: } ingo@2706: ingo@2706: ingo@2706: public Object getData(Artifact artifact, CallContext context) { ingo@2706: logger.debug("Get data for flow velocity at index: " + index); ingo@2706: ingo@2706: FLYSArtifact flys = (FLYSArtifact) artifact; ingo@2706: ingo@2706: CalculationResult res = (CalculationResult) ingo@2706: flys.compute(context, hash, stateId, type, false); ingo@2706: ingo@2706: FlowVelocityData[] data = (FlowVelocityData[]) res.getData(); ingo@2706: ingo@2706: return data[index]; ingo@2706: } ingo@2706: ingo@2706: ingo@2706: /** Copy deeply. */ ingo@2706: @Override ingo@2706: public Facet deepCopy() { ingo@2706: FlowVelocityFacet copy = new FlowVelocityFacet(); ingo@2706: copy.set(this); ingo@2706: copy.type = type; ingo@2706: copy.hash = hash; ingo@2706: copy.stateId = stateId; ingo@2706: return copy; ingo@2706: } ingo@2706: } ingo@2706: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :