Skip to content

Commit

Permalink
Fixed limits on spinboxes
Browse files Browse the repository at this point in the history
related to issue #11
  • Loading branch information
TimothyOlsson committed Apr 1, 2019
1 parent d219065 commit a0c6fb5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions dependencies/ui/tab3/parameter_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ def __init__(self, parameter, nf_settings_path):
self.nf_settings_parser = custom_config_parser()
self.nf_settings_parser.load(self.nf_settings_path)
self.parameter = parameter
self.setMaximum(9999999)
if self.parameter == "params.missed_clevages":
self.setMaximum(500)
self.setSuffix(" clevages")
elif self.parameter == "params.max_missing":
self.setMaximum(1000)
self.setSuffix(" features")
else:
self.setMaximum(9999999)
self.default()
self.valueChanged.connect(self.check_value)

Expand All @@ -33,6 +40,11 @@ def __init__(self, parameter, nf_settings_path):
self.nf_settings_parser = custom_config_parser()
self.nf_settings_parser.load(self.nf_settings_path)
self.parameter = parameter
if self.parameter == "params.precursor_window": # Crux
self.setSuffix(" ppm")
self.setMaximum(9999999)
elif self.parameter == "params.fold_change_eval": # Triqler
self.setSingleStep(0.05)
self.default()
self.valueChanged.connect(self.check_value)

Expand All @@ -45,9 +57,5 @@ def check_value(self):
self.blockSignals(False)

def default(self):
if self.parameter == "precursor_window": # Crux
self.setSuffix(" ppm")
if self.parameter == "fold_change_eval": # Triqler
self.setSingleStep(0.05)
value = float(self.nf_settings_parser.get(f"{self.parameter}"))
self.setValue(value)

0 comments on commit a0c6fb5

Please sign in to comment.