Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculation.java @ 8879:64ca63f79f6f
Further work on SINFO-FlowDepth
author | gernotbelger |
---|---|
date | Fri, 09 Feb 2018 13:27:10 +0100 |
parents | 9f7a285b0ee3 |
children | f762fadc5313 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculation.java Fri Feb 09 13:20:16 2018 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/FlowDepthCalculation.java Fri Feb 09 13:27:10 2018 +0100 @@ -12,6 +12,7 @@ import java.util.Collection; import java.util.List; +import org.dive4elements.artifacts.ArtifactDatabase; import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.BedHeightsArtifact; import org.dive4elements.river.artifacts.model.Calculation; @@ -41,8 +42,12 @@ public CalculationResult calculate(final SINFOArtifact sinfo) { - // FIXME: find user of this artifact; probably only possible by selecting the collection that contains this artifact... - final String user = "unbekannt"; + /* + * find the user of this artifact, sadly this is not part of the calling context, so instead we determine the + * owner oft the artifact + */ + final ArtifactDatabase database = this.context.getDatabase(); + final String user = database.findArtifactUser(sinfo.identifier()); /* access input data */ final FlowDepthAccess access = new FlowDepthAccess(sinfo); @@ -98,13 +103,18 @@ // FIXME: woher bekommen? final int wspYear = 0; + // FIXME: angeblich metadatum bestimmter wsps? + // Könnte 'source' an 'wst_columns' sein + final String wspSource = "FIXME"; + // FIXME: Umsetzung IDENTISCH zu allen möglichen Arten wie ein WSPL berechnet wird.... + final String wspGauge = "FIXME"; final String wspLabel = wstKms.getName(); final String soundingLabel = bedHeight.getDescription(); final String label = String.format("%s - %s", wspLabel, soundingLabel); final BedHeightInfo sounding = BedHeightInfo.from(bedHeight); - final WstInfo wstInfo = new WstInfo(wspLabel, wspYear); + final WstInfo wstInfo = new WstInfo(wspLabel, wspYear, wspSource, wspGauge); final FlowDepthCalculationResult resultData = new FlowDepthCalculationResult(label, wstInfo, sounding); @@ -150,7 +160,6 @@ final double tkh = 0; final double flowDepthTkh = flowDepth - tkh; - // REMARK: access the location once only during calculation final String location = LocationProvider.getLocation(river.getName(), km);