Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion paintwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class DataThread(QThread):
'downSampling': None, 'downSamplingFactor': None, 'downSamplingBuffer': None,
'inlet': None, 'stream_idx': None, 'is_marker': False}

DOWN_SAMPLING_THRESHOLD = 1024

def __init__(self, parent):
super().__init__(parent)
self.chunksPerScreen = 50 # For known sampling rate data, divide the screen into this many segments.
Expand Down Expand Up @@ -55,7 +57,7 @@ def update_streams(self):
if self.sig_strm_idx < 0:
self.sig_strm_idx = k
srate = stream.nominal_srate()
stream_params['downSampling'] = srate > 1000
stream_params['downSampling'] = srate > DOWN_SAMPLING_THRESHOLD
stream_params['chunkSize'] = round(srate / self.chunksPerScreen * self.seconds_per_screen)
if stream_params['downSampling']:
stream_params['downSamplingFactor'] = round(srate / 1000)
Expand Down