Skip to content

Commit

Permalink
FIX: Ridge Smoothing/Threshold + SSG Noise Strength UI Settings
Browse files Browse the repository at this point in the history
- once again QValidators have failed me

Changes to be committed:
	modified:   pyboat/ui/analysis.py
	modified:   pyboat/ui/synth_gen.py
  • Loading branch information
tensionhead committed Feb 15, 2022
1 parent 06211a6 commit 085ca0e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
22 changes: 18 additions & 4 deletions pyboat/ui/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,13 @@ def qset_power_thresh(self, text):
if not text:
return
text = text.replace(",", ".")
power_thresh = float(text)
self.power_thresh = power_thresh

try:
power_thresh = float(text)
self.power_thresh = power_thresh
# no parsable input
except ValueError:
return

if self.DEBUG:
print("power thresh set to: ", self.power_thresh)
Expand All @@ -336,13 +341,22 @@ def qset_power_thresh(self, text):

def qset_ridge_smooth(self, text):

# text = text.replace(',','.')
'''
rsmooth is the window size for
the savgol filter
'''

# catch empty line edit
if not text:
return

rsmooth = int(text)
text = text.replace(',', '.')
try:
rsmooth = float(text)
rsmooth = int(text)
# no parsable input
except ValueError:
return

# make an odd window length
if rsmooth == 0:
Expand Down
7 changes: 5 additions & 2 deletions pyboat/ui/synth_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,12 @@ def create_signal(self):
return

# Noise amplitude
if not self.d_edit.hasAcceptableInput():
try:
d = float(self.d_edit.text())

except ValueError:
self.OutOfBounds = MessageWindow(
"Missing noise amplitude!", "Value Error"
"Missing Noise Strength parameter!", "Value Error"
)
return

Expand Down

0 comments on commit 085ca0e

Please sign in to comment.