Skip to content

Commit 085ca0e

Browse files
committed
FIX: Ridge Smoothing/Threshold + SSG Noise Strength UI Settings
- once again QValidators have failed me Changes to be committed: modified: pyboat/ui/analysis.py modified: pyboat/ui/synth_gen.py
1 parent 06211a6 commit 085ca0e

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

pyboat/ui/analysis.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,13 @@ def qset_power_thresh(self, text):
324324
if not text:
325325
return
326326
text = text.replace(",", ".")
327-
power_thresh = float(text)
328-
self.power_thresh = power_thresh
327+
328+
try:
329+
power_thresh = float(text)
330+
self.power_thresh = power_thresh
331+
# no parsable input
332+
except ValueError:
333+
return
329334

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

337342
def qset_ridge_smooth(self, text):
338343

339-
# text = text.replace(',','.')
344+
'''
345+
rsmooth is the window size for
346+
the savgol filter
347+
'''
340348

341349
# catch empty line edit
342350
if not text:
343351
return
344352

345-
rsmooth = int(text)
353+
text = text.replace(',', '.')
354+
try:
355+
rsmooth = float(text)
356+
rsmooth = int(text)
357+
# no parsable input
358+
except ValueError:
359+
return
346360

347361
# make an odd window length
348362
if rsmooth == 0:

pyboat/ui/synth_gen.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,9 +979,12 @@ def create_signal(self):
979979
return
980980

981981
# Noise amplitude
982-
if not self.d_edit.hasAcceptableInput():
982+
try:
983+
d = float(self.d_edit.text())
984+
985+
except ValueError:
983986
self.OutOfBounds = MessageWindow(
984-
"Missing noise amplitude!", "Value Error"
987+
"Missing Noise Strength parameter!", "Value Error"
985988
)
986989
return
987990

0 commit comments

Comments
 (0)