changeset 4409:d6c38a22c71e

client: use meter values for fairwayavailability depth
author Fadi Abbud <fadi.abbud@intevation.de>
date Tue, 17 Sep 2019 16:06:54 +0200
parents 911b1349a9bd
children 3759b47f20f3
files client/src/components/fairway/AvailableFairwayDepth.vue client/src/components/fairway/AvailableFairwayDepthDialogue.vue client/src/components/fairway/AvailableFairwayDepthLNWL.vue
diffstat 3 files changed, 36 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Tue Sep 17 12:52:29 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Tue Sep 17 16:06:54 2019 +0200
@@ -192,12 +192,16 @@
       if (this.depthlimit1D !== this._depthlimit2D) {
         result = [
           `> LDC`,
-          `>= ${upperBound}`,
-          `< ${upperBound}`,
-          `< ${lowerBound}`
+          `>= ${upperBound / 100} [m]`,
+          `< ${upperBound / 100} [m]`,
+          `< ${lowerBound / 100} [m]`
         ];
       } else {
-        result = [`> LDC`, `>= ${upperBound}`, `< ${upperBound}`];
+        result = [
+          `> LDC`,
+          `>= ${upperBound / 100} [m]`,
+          `< ${upperBound / 100} [m]`
+        ];
       }
       return result;
     },
--- a/client/src/components/fairway/AvailableFairwayDepthDialogue.vue	Tue Sep 17 12:52:29 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepthDialogue.vue	Tue Sep 17 16:06:54 2019 +0200
@@ -162,7 +162,7 @@
         <div v-if="depthLimitVisible" class="d-flex mt-2" :key="1">
           <div class="d-flex flex-column w-50 mr-1">
             <small for="from" class="my-auto text-muted">
-              <translate>Depthlimit 1 (in cm)</translate>
+              <translate>Depthlimit 1 [m]</translate>
             </small>
             <input
               id="depthlimit1"
@@ -170,6 +170,7 @@
               class="form-control form-control-sm"
               type="number"
               min="0"
+              step="0.1"
             />
           </div>
           <div
@@ -178,7 +179,7 @@
             :key="2"
           >
             <small for="to" class="my-auto text-muted">
-              <translate>Depthlimit 2 ( in cm)</translate>
+              <translate>Depthlimit 2 [m]</translate>
             </small>
             <input
               id="depthlimit2"
@@ -186,13 +187,14 @@
               class="form-control form-control-sm"
               type="number"
               min="0"
+              step="0.1"
             />
           </div>
         </div>
         <div v-if="widthLimitVisible" class="d-flex mt-2" :key="3">
           <div class="d-flex flex-column w-50 mr-1">
             <small for="from" class="my-auto text-muted">
-              <translate>Widthlimit 1</translate>
+              <translate>Widthlimit 1 [m]</translate>
             </small>
             <input
               id="widthLimit"
@@ -208,7 +210,7 @@
             :key="4"
           >
             <small for="from" class="my-auto text-muted">
-              <translate>Widthlimit 2</translate>
+              <translate>Widthlimit 2 [m]</translate>
             </small>
             <input
               id="widthLimit"
@@ -379,18 +381,24 @@
     },
     depthLimit1: {
       get() {
-        return this.depthlimit1;
+        return this.depthlimit1 / 100;
       },
       set(value) {
-        this.$store.commit("fairwayavailability/setDepthlimit1", value);
+        this.$store.commit(
+          "fairwayavailability/setDepthlimit1",
+          Math.round(value * 100)
+        );
       }
     },
     depthLimit2: {
       get() {
-        return this.depthlimit2;
+        return this.depthlimit2 / 100;
       },
       set(value) {
-        this.$store.commit("fairwayavailability/setDepthlimit2", value);
+        this.$store.commit(
+          "fairwayavailability/setDepthlimit2",
+          Math.round(value * 100)
+        );
       }
     },
     widthLimit1: {
@@ -502,8 +510,8 @@
           frequency: this.frequency,
           LOS: this.los,
           type: this.type,
-          depthLimit1: this.depthLimit1,
-          depthLimit2: this.depthLimit2,
+          depthLimit1: this.depthlimit1,
+          depthLimit2: this.depthlimit2,
           widthLimit1: this.widthLimit1,
           widthLimit2: this.widthLimit2,
           limitingFactor: this.limitingFactor
@@ -535,8 +543,8 @@
           frequency: this.frequency,
           LOS: this.los,
           type: this.type,
-          depthLimit1: this.depthLimit1,
-          depthLimit2: this.depthLimit2,
+          depthLimit1: this.depthlimit1,
+          depthLimit2: this.depthlimit2,
           widthLimit1: this.widthLimit1,
           widthLimit2: this.widthLimit2,
           limitingFactor: this.limitingFactor
--- a/client/src/components/fairway/AvailableFairwayDepthLNWL.vue	Tue Sep 17 12:52:29 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepthLNWL.vue	Tue Sep 17 16:06:54 2019 +0200
@@ -191,12 +191,16 @@
       if (this.depthlimit1D !== this.depthlimit2D) {
         result = [
           `> LDC`,
-          `< ${lowerBound}`,
-          `< ${upperBound}`,
-          `>= ${upperBound}`
+          `< ${lowerBound / 100} [m]`,
+          `< ${upperBound / 100} [m]`,
+          `>= ${upperBound / 100} [m]`
         ];
       } else {
-        result = [`> LDC`, `< ${upperBound}`, `>= ${upperBound}`];
+        result = [
+          `> LDC`,
+          `< ${upperBound / 100} [m]`,
+          `>= ${upperBound / 100} [m]`
+        ];
       }
       return result;
     },