This project provides a graphical user interface (GUI) for both an SDC (Service-Oriented Device Connectivity) provider and a client. The provider simulates an SDC device, while the client connects to and retrieves data from an SDC device. The GUIs are built using tkinter and support real-time data visualization using matplotlib.
Ensure you have Python 3.8 or later installed. You need the following Python packages:
tkinter: For building the GUI.matplotlib: For plotting data.pillow: For handling images (used for icons and graphics in the GUI).neurokit2: For simulating physiological signals.sdc11073: For interacting with SDC devices.
- On Ubuntu, you might need additional system libraries for
tkinter:sudo apt-get install python3-tk
-
Clone the Repository
git clone https://github.com/wollooo/sdc11073/tree/GUI.git cd sdc11073 -
Set Up a Virtual Environment (Optional but recommended)
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install Required Packages
pip install tkinter matplotlib pillow neurokit2 sdc11073
The SDC provider GUI simulates an SDC device that generates physiological signals and updates metrics.
-
Configure the Provider
Optional: Modify the following details in the GUI or pyhtonfile:
- Adapter (default:
Ethernet) - Manufacturer (default:
Draeger) - Model Name (default:
TestDevice) - Model Version (default:
1.0) - Model URL (default:
www.draeger.com/model) - Firmware Version (default:
Version1) - Friendly Name (default:
TestDevice) - Initial Metric Value (default:
0.0) - Active Determination Period (default:
1494554822450) - Validity (default:
Vld) - Activation State (default:
On)
- Adapter (default:
-
Start the Provider
Click the "Start" button to simulate the device. Logs will appear in the console section of the GUI.
-
Stop the Provider
Click the "Stop" button to terminate the simulation.
The SDC client GUI discovers and connects to SDC devices, retrieving metrics and visualizing them.
-
Configure the Client
There is no direct configuration for the client via GUI. It will automatically search for available devices/providers based on the UUID on the network.
-
Start the Client
Click the "Run" button to start the client. It will display device information and real-time metrics in the console and plots.
-
Stop the Client
Click the "Stop" button to disconnect and stop retrieving metrics.
The SDC Client will automatically search for SDC devices using WS-Discovery over the preconfigured "Ethernet" network interface. Ensure your devices and the client are on the same network and can communicate via WS-Discovery.
The provider uses an MDIB (Medical Device Information Base) file named mdib.xml. Ensure this file exists in the project directory with valid device descriptions.
Logs from both the client and provider are shown in the GUI. The provider simulates data using neurokit2, and the client visualizes this data using matplotlib.
-
Execute the Script
python3 sdc_provider_gui.py
-
Follow the Configuration and Usage Instructions
Configure the provider using the GUI and start the simulation.
-
Execute the Script
python3 sdc_client_gui.py
-
Follow the Configuration and Usage Instructions
Run the client using the GUI to discover and visualize data from SDC devices.
- Simulates SDC Device: Uses
neurokit2to generate ECG, respiratory, and EMG signals. - Updates Metrics: Sends simulated metrics to connected clients.
- GUI: Built using
tkinterwith fields for device configuration and a console for logs.
- Discovers SDC Devices: Uses WS-Discovery to find SDC devices on the network.
- Retrieves Metrics: Connects to discovered devices and retrieves metric updates.
- Visualizes Data: Plots real-time metrics using
matplotliband updates a console with received data.
- Queue for Data: Both GUIs use a queue to handle data updates between threads and the main GUI thread.
- Threading: The client and provider run in separate threads to keep the GUI responsive while performing network and data processing tasks.
- Matplotlib Integration:
matplotlibis used for data visualization, embedded in thetkinterGUI usingFigureCanvasTkAgg.
This screenshot shows the SDC Provider GUI. It allows configuration of the simulated SDC device's details, such as manufacturer, model name, firmware version, and initial metric values. Logs for the provider are displayed in the console log section at the bottom.
This screenshot shows the command line output for the SDC Consumer script. It logs the connection and subscription details of the SDC Client.
This screenshot shows the SDC Consumer GUI. It includes real-time plots for three data streams (Data1 = EMG signal, Data2 = respiratory signal, and Data3 = EMG signal) and a console for updates.
- Error Handling: Basic error handling is included. Ensure proper network setup for discovery and communication.
- Dependencies: Make sure all dependencies are correctly installed and the environment is properly configured.
For further questions or issues, please refer to the repository's issue tracker or contact the maintainer.