| 150 | } |
| 151 | |
| 152 | void AbsoluteQuantitationMethodFile::setCastValue_(const String& key, const String& value, Param& params) const |
| 153 | { |
| 154 | const std::vector<String> param_doubles { |
| 155 | "slope", "intercept", "wavelength", "span", "delta", "x_datum_min", "y_datum_min", "x_datum_max", "y_datum_max" |
| 156 | }; |
| 157 | const std::vector<String> param_ints {"num_nodes", "boundary_condition", "num_iterations"}; |
| 158 | if (std::find(param_doubles.begin(), param_doubles.end(), key) != param_doubles.end()) |
| 159 | { |
| 160 | params.setValue(key, value.empty() ? 0 : std::stod(value)); |
| 161 | } |
| 162 | else if (std::find(param_ints.begin(), param_ints.end(), key) != param_ints.end()) |
| 163 | { |
| 164 | params.setValue(key, value.empty() ? 0 : std::stoi(value)); |
| 165 | } |
| 166 | else |
| 167 | { |
| 168 | params.setValue(key,value); |
| 169 | } |
| 170 | } |
| 171 | } // namespace OpenMS |