diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argaze/TobiiGlassesPro2/TobiiController.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/argaze/TobiiGlassesPro2/TobiiController.py b/src/argaze/TobiiGlassesPro2/TobiiController.py index 7be289f..d61d6ab 100644 --- a/src/argaze/TobiiGlassesPro2/TobiiController.py +++ b/src/argaze/TobiiGlassesPro2/TobiiController.py @@ -49,6 +49,8 @@ class TobiiController(TobiiNetworkInterface.TobiiNetworkInterface): self.__data_stream = None self.__video_stream = None + self.__record_event_thread = None + super().wait_for_status('/api/system/status', 'sys_status', ['ok']) == 'ok' def __get_current_datetime(self, timeformat=TOBII_DATETIME_FORMAT): @@ -269,20 +271,17 @@ class TobiiController(TobiiNetworkInterface.TobiiNetworkInterface): def get_recordings(self): return super().get_request('/api/recordings') - # EVENT AND VARIABLES + # EVENTS AND EXPERIMENTAL VARIABLES - def send_custom_event(self, event_type, event_tag = ''): + def __post_recording_data(self, event_type: str, event_tag = ''): data = {'type': event_type, 'tag': event_tag} super().post_request('/api/events', data, wait_for_response=False) - def send_tobiipro_event(self, event_type, event_value): - self.send_custom_event('JsonEvent', "{'event_type': '%s','event_value': '%s'}" % (event_type, event_value)) - - def send_experimental_var(self, variable_name, variable_value): - self.send_custom_event('#%s#' % variable_name, variable_value) + def send_event(self, event_type: str, event_value = None): + self.__post_recording_data('JsonEvent', "{'event_type': '%s','event_value': '%s'}" % (event_type, event_value)) - def send_experimental_vars(self, variable_names_list, variable_values_list): - self.send_custom_event('@%s@' % str(variable_names_list), str(variable_values_list)) + def send_variable(self, variable_name: str, variable_value = None): + self.__post_recording_data(str(variable_name), str(variable_value)) # MISC |