Mercurial > gemma
comparison pkg/controllers/srimports.go @ 5407:850f5847d18a marking-single-beam
Re-establish compat with old single-beam interface.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 06 Jul 2021 15:26:20 +0200 |
parents | 85f19e924a43 |
children | 5f47eeea988d |
comparison
equal
deleted
inserted
replaced
5406:6d73836bc2fb | 5407:850f5847d18a |
---|---|
108 negateZ = false | 108 negateZ = false |
109 default: | 109 default: |
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 } | |
114 | |
115 // Kept this in for compat. | |
116 if v := req.FormValue("single-beam"); v != "" { | |
117 var surveyType models.SurveyType | |
118 switch strings.ToLower(v) { | |
119 case "true", "1", "singlebeam", "single-beam": | |
120 surveyType = models.SurveyTypeSingleBeam | |
121 case "false", "0", "multibeam", "multi-beam": | |
122 surveyType = models.SurveyTypeMultiBeam | |
123 default: | |
124 return fmt.Errorf("unknown single-beam '%s'", v) | |
125 } | |
126 sr.SurveyType = &surveyType | |
113 } | 127 } |
114 | 128 |
115 if v := req.FormValue("survey-type"); v != "" { | 129 if v := req.FormValue("survey-type"); v != "" { |
116 var surveyType models.SurveyType | 130 var surveyType models.SurveyType |
117 switch strings.ToLower(v) { | 131 switch strings.ToLower(v) { |