Mercurial > gemma
changeset 5404:47b12e8308bf marking-single-beam
SR-Upload dialogue migrated towards "surveytype"
In order to handle the import of singlebeam profiles of the type "marking"
the upload dialogue was chnaged, that there is now the configuration key "survey-type"
available, which has the three possible values "single", "multi", marking.
This key is present in the meta.json as well.
As before unless otherwise specified "multi" is the default type.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 06 Jul 2021 12:35:57 +0200 |
parents | 85f19e924a43 |
children | 5e7fca6ef935 |
files | client/src/components/importconfiguration/types/Soundingresults.vue |
diffstat | 1 files changed, 21 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/importconfiguration/types/Soundingresults.vue Tue Jul 06 01:20:44 2021 +0200 +++ b/client/src/components/importconfiguration/types/Soundingresults.vue Tue Jul 06 12:35:57 2021 +0200 @@ -254,6 +254,7 @@ this.token = null; this.eMailNotification = false; this.messages = []; + this.beamType = ""; }, fileSelected(e) { const files = e.target.files || e.dataTransfer.files; @@ -299,7 +300,7 @@ if (response.data.meta) { const { bottleneck, date, epsg } = response.data.meta; const depthReference = response.data.meta["depth-reference"]; - const singlebeam = response.data.meta["single-beam"]; + const surveyType = response.data.meta["survey-type"]; this.negateZ = response.data.meta["negate-z"]; this.bottleneck = this.bottlenecks.find( bn => bn.properties.objnam === bottleneck @@ -307,9 +308,20 @@ this.depthReference = depthReference; this.importDate = new Date(date).toISOString().split("T")[0]; this.projection = epsg; - this.beamType = singlebeam - ? this.$options.BEAMTYPES.SINGLEBEAM - : this.$options.BEAMTYPES.MULTIBEAM; + switch (surveyType) { + case "single": + this.beamType = this.$options.BEAMTYPES.SINGLEBEAM; + break; + case "multi": + this.beamType = this.$options.BEAMTYPES.MULTIBEAM; + break; + case "marking": + this.beamType = this.$options.BEAMTYPES.MARKING; + break; + default: + this.beamType = this.$options.BEAMTYPES.MULTIBEAM; + break; + } } this.importState = IMPORTSTATE.EDIT; this.token = response.data.token; @@ -337,11 +349,7 @@ if (this.depthReference) formData.append("depth-reference", this.depthReference); if (this.projection) formData.append("epsg", this.projection); - if (this.beamType) - formData.append( - "single-beam", - this.beamType === this.$options.BEAMTYPES.SINGLEBEAM - ); + if (this.beamType) formData.append("survey-type", this.beamType); formData.append("negate-z", this.negateZ == true); HTTP.post("/imports/sr", formData, { headers: { @@ -458,8 +466,7 @@ "depth-reference": this.depthReference, bottleneck: this.bottleneck.properties.objnam, date: this.importDate, - "single-beam": - this.beamType === this.$options.BEAMTYPES.SINGLEBEAM, + "survey-type": this.beamType, epsg: Number(this.projection), "negate-z": this.negateZ == true }) @@ -487,8 +494,9 @@ } }, BEAMTYPES: { - MULTIBEAM: "multi-beam", - SINGLEBEAM: "single-beam" + MULTIBEAM: "multi", + SINGLEBEAM: "single", + MARKING: "marking" }, UPLOADLABEL: "choose a .zip or .txt file", on: "on",