How ss0vinicius/electrical-impedance-tomography works
Analyze the File Structure
• Top-Level Directories and Files:
• .dockerignore & Dockerfile: Used for containerization, likely to streamline deployment or environment setup.
• README.md: Documentation and setup instructions.
• TCC_DANIEL/Prog: Contains the primary Python application, including GUI components (AppTie.ui, WindowsEIT.ui) and data handling scripts.
• TCC_DANIEL/SPI_TEST: Houses Arduino sketches (.ino files), C++ source (eit.cpp, eit.h), and Python scripts for SPI communication (dadosSpi.py).
• Patterns and Architectural Choices:
• Modular Structure: Separation between the main application (Prog) and SPI testing/communication (SPI_TEST).
• Use of PyQt5: Indicates an MVC-like pattern where the UI is defined separately from the application logic.
• Data Management: Multiple CSV files suggest handling of configuration, calibration, or measurement data.
• Configuration and Deployment:
• Docker: Presence of Docker-related files implies possible container-based deployment or environment replication.
• Build Scripts: Although not extensive, installation commands in the README indicate dependency management without elaborate build scripts.
Examine the README for Additional Insights
• Dependencies and Setup:
• Python 3.11.3 with specific libraries like PyQt5, OpenCV, and spidev.
• Challenges with virtual environments and GUI rendering on Docker or other virtual setups.
• Hardware Integration:
• Emphasis on running directly on Raspberry Pi 4.
• Issues with X11 for GUI rendering, highlighting the need for proper graphical environment setup.
• Project Functionality:
• GUI-based application (AppTie.py, WindowsEIT.py) likely for interacting with EIT hardware.
• SPI communication scripts and Arduino code indicating real-time data acquisition and control.
User Interface (UI)
• PyQt5 GUI: AppTie.py, WindowsEIT.py, associated .ui files.
Application Logic
• EIT Modules: EIT directory containing core processing scripts (MatEIT.py, eit.py).
• Data Handling: Scripts for managing CSV data (Vobj.csv, Jn.csv, etc.).
Hardware Communication
• SPI Communication:
• Python Scripts: dadosSpi.py for interfacing with SPI.
• Arduino Firmware: .ino files (SPI_TEST.ino, convert.ino, func.ino) handling SPI protocol.
• C++ Components: eit.cpp, eit.h for low-level hardware interactions.
Deployment Environment
• Raspberry Pi 4: Host machine running the application and managing hardware interfaces.
• Docker Container: Defined by Dockerfile and .dockerignore, though GUI challenges suggest limited use.
Data Storage
• CSV Files: Located in DataCSV and Prog directories for storing configuration and measurement data.
b. Determine Relationships and Interactions
• User ↔ PyQt5 GUI: Users interact with the application through the GUI, triggering actions.
• GUI ↔ Application Logic: GUI components communicate with EIT processing scripts to perform operations.
• Application Logic ↔ SPI Communication: EIT modules send commands and receive data via SPI.
• SPI Communication ↔ Arduino Firmware: Python scripts communicate over SPI to Arduino, which controls hardware.
• Application ↔ Data Storage: Reading from and writing to CSV files for data persistence and configuration.
c. Highlight Architectural Patterns and Design Principles
• Modular Architecture: Clear separation between UI, application logic, and hardware communication.
• Layered Approach: UI layer interacts with the application layer, which in turn communicates with the hardware layer.
• Dependency Management: Use of Docker and system-level package installations for managing dependencies, despite challenges with virtual environments.
d. Include Relevant Technologies, Frameworks, and Libraries
• Programming Languages: Python 3.11.3, C++, Arduino C.
• Frameworks/Libraries: PyQt5 for GUI, OpenCV for image processing, spidev for SPI communication, RPi.GPIO for GPIO interactions.
• Deployment Tools: Docker for containerization.
• Operating Systems: Raspberry Pi OS (Raspbian) utilizing X11 for GUI rendering.
Detailed Architectural Elements
• Frontend (PyQt5 GUI):
• User interacts with the application through windows defined by .ui files.
• Backend (EIT Processing):
• Processes data, performs computations related to Electrical Impedance Tomography.
• Communication Layer (SPI):
• Handles data exchange between Python scripts and Arduino firmware.
• Hardware Layer:
• Arduino manages low-level SPI communication and controls EIT hardware.
• Data Management:
• CSV files store necessary data for processing and configuration.
• Deployment:
• Dockerfile indicates containerization attempts, with a fallback to native Raspberry Pi execution due to GUI constraints.