MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / fixRange

Method fixRange

src/openms_gui/source/VISUAL/DIALOGS/Plot1DGoToDialog.cpp:50–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

showGoToDialogMethod · 0.80

Calls 4

numberFunction · 0.85
toFloatMethod · 0.80
setTextMethod · 0.80
swapFunction · 0.50

Tested by

no test coverage detected