# HG changeset patch # User Raimund Renkert # Date 1354550823 -3600 # Node ID bb267a0aa8c215bfd9018f0467ae6e49a601c81f # Parent 89322548b04485024c797eed19e74f842ce9431a Generate flow velocity facets based on the type the user selected. diff -r 89322548b044 -r bb267a0aa8c2 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java Mon Dec 03 17:04:28 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FlowVelocityState.java Mon Dec 03 17:07:03 2012 +0100 @@ -68,34 +68,61 @@ int idx = 0; for (FlowVelocityData d: data) { - logger.error("TODO: Implement Facet creation for chart!"); - - newFacets.add(new FlowVelocityFacet( - idx, - FLOW_VELOCITY_MAINCHANNEL, - buildMainChannelName(artifact, context, d), - ComputeType.ADVANCE, - id, - hash - )); + if (d.getType().equals("main")) { + newFacets.add(new FlowVelocityFacet( + idx, + FLOW_VELOCITY_MAINCHANNEL, + buildMainChannelName(artifact, context, d), + ComputeType.ADVANCE, + id, + hash + )); - newFacets.add(new FlowVelocityFacet( - idx, - FLOW_VELOCITY_TOTALCHANNEL, - buildTotalChannelName(artifact, context, d), - ComputeType.ADVANCE, - id, - hash - )); - - newFacets.add(new FlowVelocityFacet( - idx, - FLOW_VELOCITY_TAU, - buildTauName(artifact, context, d), - ComputeType.ADVANCE, - id, - hash - )); + newFacets.add(new FlowVelocityFacet( + idx, + FLOW_VELOCITY_TAU, + buildTauName(artifact, context, d), + ComputeType.ADVANCE, + id, + hash + )); + } + else if (d.getType().equals("total")) { + newFacets.add(new FlowVelocityFacet( + idx, + FLOW_VELOCITY_TOTALCHANNEL, + buildTotalChannelName(artifact, context, d), + ComputeType.ADVANCE, + id, + hash + )); + } + else if(d.getType().equals("main_total")) { + newFacets.add(new FlowVelocityFacet( + idx, + FLOW_VELOCITY_MAINCHANNEL, + buildMainChannelName(artifact, context, d), + ComputeType.ADVANCE, + id, + hash + )); + newFacets.add(new FlowVelocityFacet( + idx, + FLOW_VELOCITY_TAU, + buildTauName(artifact, context, d), + ComputeType.ADVANCE, + id, + hash + )); + newFacets.add(new FlowVelocityFacet( + idx, + FLOW_VELOCITY_TOTALCHANNEL, + buildTotalChannelName(artifact, context, d), + ComputeType.ADVANCE, + id, + hash + )); + } newFacets.add(new FlowVelocityFacet( idx,