teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5863: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5863: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.artifacts.model.minfo; felix@4452: teichmann@5831: import org.dive4elements.artifacts.Artifact; teichmann@5831: import org.dive4elements.artifacts.CallContext; teichmann@5831: import org.dive4elements.river.artifacts.FlowVelocityMeasurementArtifact; teichmann@5831: import org.dive4elements.river.artifacts.model.BlackboardDataFacet; teichmann@5831: import org.dive4elements.river.artifacts.model.FacetTypes; felix@4452: felix@4452: felix@4452: /** Facet to show measured flow velocity. */ felix@4452: public class FlowVelocityMeasurementFacet felix@4452: extends BlackboardDataFacet felix@4452: implements FacetTypes { felix@4452: felix@4452: public FlowVelocityMeasurementFacet(String description) { felix@4452: this(FLOW_VELOCITY_MEASUREMENT, description); felix@4452: } felix@4452: felix@4452: felix@4452: public FlowVelocityMeasurementFacet(String name, String description) { felix@4452: this.name = name; felix@4452: this.description = description; felix@4452: this.index = 0; felix@4452: } felix@4452: felix@4452: felix@4452: /** felix@4452: * Returns the data this facet requires. felix@4452: * felix@4452: * @param artifact the owner artifact. felix@4452: * @param context the CallContext (ignored). felix@4452: * felix@4452: * @return the data. felix@4452: */ felix@4452: @Override felix@4452: public Object getData(Artifact artifact, CallContext context) { felix@4452: FlowVelocityMeasurementArtifact staticData = felix@4452: (FlowVelocityMeasurementArtifact) artifact; felix@4464: return staticData.getFlowVelocityMeasurementValue(); felix@4452: } felix@4452: felix@4452: felix@4452: /** felix@4452: * Create a deep copy of this Facet. felix@4452: * @return a deep copy. felix@4452: */ felix@4452: @Override felix@4452: public FlowVelocityMeasurementFacet deepCopy() { felix@4452: FlowVelocityMeasurementFacet copy = new FlowVelocityMeasurementFacet(description); felix@4452: copy.set(this); felix@4452: return copy; felix@4452: } felix@4452: } felix@4452: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :