Mercurial > gemma
comparison pkg/controllers/srimports.go @ 5403:85f19e924a43 marking-single-beam
Adjusted the import model to be able to handle marking single beam scans.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 06 Jul 2021 01:20:44 +0200 |
parents | 6237e6165041 |
children | 850f5847d18a |
comparison
equal
deleted
inserted
replaced
5402:f5063fa7f666 | 5403:85f19e924a43 |
---|---|
110 return fmt.Errorf("unknown negate-z '%s'", v) | 110 return fmt.Errorf("unknown negate-z '%s'", v) |
111 } | 111 } |
112 sr.NegateZ = &negateZ | 112 sr.NegateZ = &negateZ |
113 } | 113 } |
114 | 114 |
115 if v := req.FormValue("single-beam"); v != "" { | 115 if v := req.FormValue("survey-type"); v != "" { |
116 var singleBeam bool | 116 var surveyType models.SurveyType |
117 switch strings.ToLower(v) { | 117 switch strings.ToLower(v) { |
118 case "true", "1", "singlebeam", "single-beam": | 118 case "2", "marking": |
119 singleBeam = true | 119 surveyType = models.SurveyTypeMarking |
120 case "false", "0", "multibeam", "multi-beam": | 120 case "true", "1", "singlebeam", "single-beam", "single": |
121 singleBeam = false | 121 surveyType = models.SurveyTypeSingleBeam |
122 case "false", "0", "multibeam", "multi-beam", "multi": | |
123 surveyType = models.SurveyTypeMultiBeam | |
122 default: | 124 default: |
123 return fmt.Errorf("unknown single-beam '%s'", v) | 125 return fmt.Errorf("unknown survey-type '%s'", v) |
124 } | 126 } |
125 sr.SingleBeam = &singleBeam | 127 sr.SurveyType = &surveyType |
126 } | 128 } |
127 | 129 |
128 return nil | 130 return nil |
129 } | 131 } |
130 | 132 |