Skip to content

Commit 4db0c38

Browse files
committed
Clear inputs slots when no data is incoming
1 parent 1d4a928 commit 4db0c38

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/goofi/nodes/signal/eegheadsetdetection.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import numpy as np
2-
from goofi.data import Data, DataType
2+
3+
from goofi.data import DataType
34
from goofi.node import Node
4-
from goofi.params import FloatParam, IntParam
5+
from goofi.params import FloatParam
6+
57

68
class EEGHeadsetDetection(Node):
79
def config_params():
810
return {
9-
"threshold": {
10-
"average_value": FloatParam(500.0, 0.0, 10000.0), # Threshold for average signal value
11-
},
11+
"threshold": {"average_value": FloatParam(500.0, 0.0, 10000.0, doc="Threshold for average signal value")},
12+
"common": {"autotrigger": True},
1213
}
1314

1415
def config_input_slots():
@@ -34,4 +35,7 @@ def process(self, eeg_data=None):
3435
else:
3536
headset_worn = np.array(2) # Worn (average below threshold)
3637

38+
# handle the case where the EEG LSL cuts out
39+
self.input_slots["eeg_data"].clear()
40+
3741
return {"headset_status": (headset_worn, {})}

0 commit comments

Comments
 (0)