HIGH:
- SAVE CSV more often
- DROP DEVICE THAT CANNOT BE REACH
MEDIUM:
- NEED UPDATE update once in a while to see if we still have the phones/ not gettting update while it is called multiple time
-
- Then if we loos one lunch 2-3 search see if we can find it again
- Check if device is recrording using DeviceHandler print_recording [update the function print_recording]
LOW:
- Work on the UI layout
-
- UPDATED
This project provides an interface to discover and control Pupil Labs devices using their Realtime API. It is built with Python's Tkinter for the user interface, and asyncio for managing the asynchronous communication with the devices.
- Discover Pupil Labs devices on the network
- Start/Stop recording on each individual device
- Start/Stop recording on all devices simultaneously
- Send a message to all devices
These instructions will get you a copy of the project up and running on your local machine.
- Python 3.10+
- Pupil Labs Realtime API package (pip install pupil_labs)
- Start the application and click on "Discover Devices" button to discover the Pupil Labs devices in the network.
- The discovered devices are displayed with their name, IP, battery level, and glasses serial number.
- Use "Start Recording" button next to each device to start/stop recording on that specific device.
- Use "Start Recording All" button to start/stop recording on all devices simultaneously.
- Use "Send Message" button to send a predefined message to all devices.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Thanks to Pupil Labs for providing the Realtime API
The App
class is the main class that drives the functionality of the GUI application. The App
class makes use of several other components such as Tkinter
for the GUI, asyncio
for asynchronous operations, and the DeviceHandler
class for handling device-related functionalities.
Below is an explanation of each part of the App
class:
This is the constructor for the App
class. It initializes the main Tkinter root widget, an asyncio event loop, a list to hold DeviceHandler
instances, and a frame within the main root widget to hold the device information. It also creates and packs a 'Discover Devices' button into the Tkinter root widget.
This function controls the recording state of a device. It takes in two arguments: a DeviceHandler
instance and a Tkinter button. Depending on the current recording state of the device, it will either start or stop the recording and update the text on the button accordingly.
This function is responsible for sending a message to a device. It uses asyncio
to run the send_message
coroutine in the DeviceHandler
class in a threadsafe manner.
This function is used to start the discovery of devices in a threadsafe way.
This coroutine uses the Pupil Labs API to discover devices. It will continue to find devices until it times out. It also checks if a device is already in the handlers list before adding it, thereby preventing duplicate devices. Each discovered device is initialized and its recording state is set to False
.
This coroutine returns a list of device information for each DeviceHandler
in the handlers list.
This function displays the information of all discovered devices. It first clears the device frame of any previously displayed information. For each device, it creates a label with the device information, a button to start/stop recording, and a button to send a message. It uses closures to bind each button to its specific handler and to maintain the current state of the recording button.
This is the entry point of the application when it's run as a script. It creates the main Tkinter root widget and asyncio event loop, then instantiates the App
class. It also creates and starts a new thread to run the asyncio event loop so that it can run in parallel with the Tkinter mainloop.
This entire application functions as a simple graphical user interface to interact with Pupil Labs devices. It provides functionalities to discover devices, display device information, start and stop recording on a device, and send a message to a device.