| 233 | } |
| 234 | |
| 235 | bool Plot2DCanvas::finishAdding_() |
| 236 | { |
| 237 | // deselect all peaks |
| 238 | selected_peak_.clear(); |
| 239 | measurement_start_.clear(); |
| 240 | |
| 241 | auto& layer = getCurrentLayer(); |
| 242 | layer.updateRanges(); // required for minIntensity() below and hasRange() |
| 243 | if (layer.getRange().hasRange() == HasRangeType::NONE) |
| 244 | { |
| 245 | popIncompleteLayer_("Cannot add a dataset that contains no data. Aborting!"); |
| 246 | return false; |
| 247 | } |
| 248 | // overall values update |
| 249 | recalculateRanges_(); |
| 250 | |
| 251 | // pick dimensions to show (based on data) |
| 252 | |
| 253 | |
| 254 | update_buffer_ = true; |
| 255 | |
| 256 | if (getLayerCount() == 1) |
| 257 | { |
| 258 | resetZoom(false); //no repaint as this is done in intensityModeChange_() anyway |
| 259 | } |
| 260 | else if (getLayerCount() == 2) |
| 261 | { |
| 262 | setIntensityMode(IM_PERCENTAGE); |
| 263 | } |
| 264 | intensityModeChange_(); |
| 265 | |
| 266 | emit layerActivated(this); |
| 267 | |
| 268 | // warn if negative intensities are contained |
| 269 | if (getCurrentMinIntensity() < 0) |
| 270 | { |
| 271 | QMessageBox::warning(this, "Warning", "This dataset contains negative intensities. Use it at your own risk!"); |
| 272 | } |
| 273 | |
| 274 | return true; |
| 275 | } |
| 276 | |
| 277 | void Plot2DCanvas::removeLayer(Size layer_index) |
| 278 | { |
nothing calls this directly
no test coverage detected