Skip to content

Commit

Permalink
Parametrize event column
Browse files Browse the repository at this point in the history
  • Loading branch information
dojeda committed May 23, 2019
1 parent f26eeb1 commit 610b29b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions timeflux_amti/nodes/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ForceDriver(Node):
)
"""Supported sampling rates (in Hz) for the AMTI force platform."""

def __init__(self, rate=500, dll_dir=None, device_index=0, zero_trigger=None):
def __init__(self, rate=500, dll_dir=None, device_index=0, zero_trigger=None, event_label='label'):
super().__init__()
if rate not in ForceDriver.SAMPLING_RATES:
raise ValueError('Invalid sampling rate')
Expand All @@ -144,6 +144,7 @@ def __init__(self, rate=500, dll_dir=None, device_index=0, zero_trigger=None):
self._dev_index = device_index
self._channel_names = ('counter', 'Fx', 'Fy', 'Fz', 'Mx', 'My', 'Mz', 'trigger')
self._zero_trigger = zero_trigger
self._event_label = event_label
self._dll = None
self._buffer = None
self._start_timestamp = None
Expand Down Expand Up @@ -172,7 +173,7 @@ def update(self):

# Manage device zeroing
if self._zero_trigger is not None and self.i.ready():
trigger = np.any(self._zero_trigger == self.i.data.label)
trigger = np.any(self.i.data[self._event_label] == self._zero_trigger)
if trigger:
self._zero()

Expand Down

0 comments on commit 610b29b

Please sign in to comment.