ddetommaso / TobiiGlassesPyController

Tobii Pro Glasses 2 Python controller
GNU General Public License v3.0
56 stars 28 forks source link

Add support for eye tracking frequency, and participants query #5

Closed HamAndChris closed 5 years ago

HamAndChris commented 5 years ago

Hello, I have added the following functions to my controller.py which enables changing the default eye tracking frequency:


    def get_et_freq(self):
        return self.get_configuration()['sys_et_freq']

    def get_et_frequencies(self):
        return self.get_status()['sys_et']['frequencies']

    def set_et_freq_50(self):
        data = {'sys_et_freq': 50}
        json_data = self.__post_request__('/api/system/conf', data)

    def set_et_freq_100(self):
        """May not be available. Check get_et_frequencies() first."""
        data = {'sys_et_freq': 100}
        json_data = self.__post_request__('/api/system/conf', data)

Also, this allows querying the list of participants and projects directly:

    def get_projects(self):
        return self.__get_request__('/api/projects')

    def get_participants(self):
        return self.__get_request__('/api/participants')

I would just make a pull request but I'm too lazy.

Thanks,

ddetommaso commented 5 years ago

Hi @HamAndChris,

thank you for your code enhancements. I just included in the last commit 1b95aa8 which has also an alphabetically reorder of all the methods.

HamAndChris commented 5 years ago

One more for you:

    def get_recordings(self):
        return self.__get_request__('/api/recordings')

Thanks,