changeset 2167:40f26fbc505f

client: pdf-gen: add reference_water_level to details * If we have a reference_water_level, we display it for the selected bottleneck and survey.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 08 Feb 2019 15:30:16 +0100
parents 69c49301d689
children b868cb653c4d
files client/src/components/Pdftool.vue
diffstat 1 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Pdftool.vue	Fri Feb 08 14:56:29 2019 +0100
+++ b/client/src/components/Pdftool.vue	Fri Feb 08 15:30:16 2019 +0100
@@ -272,8 +272,8 @@
         self.addAboutBox(pdf, width, height);
 
         if (self.getLayerByName("Bottleneck isolines").isVisible) {
-          self.addBottleneckInfo(pdf, 13, width, height);
-          self.addLegend(pdf, 14, width, height);
+          self.addBottleneckInfo(pdf, 15.5, width, height);
+          self.addLegend(pdf, 16.5, width, height);
         }
 
         pdf.save("map.pdf");
@@ -500,12 +500,14 @@
       str = this.selectedBottleneck;
       this.addText(doc, docWidth - 51 + w, 4, 8, "black", 46, str);
 
+      let survey = this.selectedSurvey;
+
       doc.setFontStyle("italic");
       name = this.$gettext("Survey date") + ": ";
       w = doc.getTextWidth(name);
       this.addText(doc, docWidth - 51, 7.5, 8, "black", 46, name);
       doc.setFontStyle("normal");
-      str = this.selectedSurvey.date_info;
+      str = survey.date_info;
       this.addText(doc, docWidth - 51 + w, 7.5, 8, "black", 46, str);
 
       doc.setFontStyle("italic");
@@ -513,8 +515,21 @@
       w = doc.getTextWidth(name);
       this.addText(doc, docWidth - 51, 11, 8, "black", 46, name);
       doc.setFontStyle("normal");
-      str = this.selectedSurvey.gauge_objname;
+      str = survey.gauge_objname;
       this.addText(doc, docWidth - 51 + w, 11, 8, "black", 46, str);
+
+      doc.setFontStyle("italic");
+      name = this.$gettext("Depth relativ to") + ": ";
+      w = doc.getTextWidth(name);
+      this.addText(doc, docWidth - 51, 14.5, 8, "black", 46, name);
+      doc.setFontStyle("normal");
+      str = survey.depth_reference + " = ";
+      if (survey.hasOwnProperty("waterlevel_value")) {
+        str += survey.waterlevel_value + " cm";
+      } else {
+        str += "?";
+      }
+      this.addText(doc, docWidth - 51 + w, 14.5, 8, "black", 46, str);
     }
   }
 };