| 48 | } |
| 49 | |
| 50 | void Plot1DGoToDialog::fixRange() |
| 51 | { |
| 52 | // load from GUI |
| 53 | float min_mz = ui_->min_->text().toFloat(); |
| 54 | float max_mz = ui_->max_->text().toFloat(); |
| 55 | |
| 56 | // ensure correct order of min and max |
| 57 | if (min_mz > max_mz) swap(min_mz, max_mz); |
| 58 | |
| 59 | // do not allow range of 0 --> extend to 1 |
| 60 | if (min_mz == max_mz) |
| 61 | { |
| 62 | min_mz -= 0.5; |
| 63 | max_mz += 0.5; |
| 64 | } |
| 65 | |
| 66 | // store in GUI |
| 67 | ui_->min_->setText(QString::number(min_mz)); |
| 68 | ui_->max_->setText(QString::number(max_mz)); |
| 69 | } |
| 70 | |
| 71 | float Plot1DGoToDialog::getMin() const |
| 72 | { |
no test coverage detected