Mercurial > dive4elements > river
changeset 7066:39237f4985a7
issue1494: Spawn Q facet only if Q data is there.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 20 Sep 2013 14:22:44 +0200 |
parents | b17634649e61 |
children | 99527ef3f151 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticWQKmsState.java |
diffstat | 1 files changed, 24 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticWQKmsState.java Thu Sep 19 12:53:11 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/StaticWQKmsState.java Fri Sep 20 14:22:44 2013 +0200 @@ -10,6 +10,8 @@ import java.util.List; +import gnu.trove.TDoubleArrayList; + import org.apache.log4j.Logger; import org.dive4elements.artifacts.CallContext; @@ -79,18 +81,30 @@ name = STATIC_WQKMS; } */ + // Spawn Q Facet only if at least one discharge value + // is != -1 + boolean qEmpty = true; + TDoubleArrayList qs = wqkms.allQs(); + for (int i = 0; i < qs.size(); i++) { + if (qs.getQuick(i) != -1d) { + qEmpty = false; + break; + } + } String wkmsName = wqkms.getName(); - Facet qfacet = new WQKmsFacet( - STATIC_WQKMS_Q, - wkmsName - // TODO re-enable translations. - /* - Resources.getMsg( - metaLocale, - wkmsName, - wkmsName)*/); - facets.add(qfacet); + if (!qEmpty) { + Facet qfacet = new WQKmsFacet( + STATIC_WQKMS_Q, + wkmsName + // TODO re-enable translations. + /* + Resources.getMsg( + metaLocale, + wkmsName, + wkmsName)*/); + facets.add(qfacet); + } Facet rpFacet = new RelativePointFacet(wkmsName); facets.add(rpFacet);