diff artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineAccess.java @ 9391:2da486c7c05f

salix historical sounding workflow changed
author gernotbelger
date Thu, 09 Aug 2018 17:25:13 +0200
parents a978b601a034
children 439699ff9b2d
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineAccess.java	Thu Aug 09 15:22:31 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixLineAccess.java	Thu Aug 09 17:25:13 2018 +0200
@@ -10,9 +10,11 @@
 
 package org.dive4elements.river.artifacts.uinfo.salix;
 
+import org.dive4elements.river.artifacts.access.BedHeightAccess;
 import org.dive4elements.river.artifacts.access.RangeAccess;
 import org.dive4elements.river.artifacts.uinfo.UINFOArtifact;
 import org.dive4elements.river.artifacts.uinfo.UinfoCalcMode;
+import org.dive4elements.river.model.BedHeight;
 
 /**
  * Access to the flow depth calculation type specific SInfo artifact data.
@@ -97,17 +99,21 @@
         return super.getString("supraregional_table");
     }
 
-    public Integer getYear() {
-        if (getString("ye_select").equals("state.uinfo.year")) {
-            return super.getInteger("singleyear");
+    public BedHeight getBedHeight() { // TODO: make lazy? Aber achtung, falls der user zurückgeht und ne andere Peilung auswählt...
+        final BedHeightAccess access = new BedHeightAccess(this.artifact);
+        final int[] ids = access.getBedHeightIDs();
+        if (ids != null && ids.length > 0) {
+            return BedHeight.getBedHeightById(ids[0]); // es nur eine bedheight ausgewählt werden; ist aber noch nicht implementiert...
         }
         return null;
     }
 
-    public Integer getEpoch() {
-        if (getString("ye_select").equals("state.uinfo.epoch")) {
-            return super.getInteger("singleepoch");
+    public Integer getYearEpoch() { // TODO: make lazy?
+        final BedHeight bh = this.getBedHeight();
+        if (bh != null) {
+            return bh.getYear();
         }
         return null;
     }
+
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org