How lausiv1024/aircondcontrol works
Project Type & Purpose
• This project is a suite of components aimed at analyzing infrared (IR) signals and controlling air conditioners. It includes a web-based interface, command‐line utilities for IR signal generation and data collection, and shared libraries for managing IR formats.
Analyzing the File Structure
• There are multiple solutions:
• AEHAFmtSender: Contains a web client (with Blazor/Razor pages such as MainLayout.razor and Pages like AircondControl.razor) along with backend components (e.g. IRFormats, RPi/PWMSender for physical signal transmission) indicating the core application.
• AircondSignalGen: A utility project that likely generates the IR control codes.
• ByteDatagetter: Another tool possibly used for capturing or processing data bytes from remote signals.
• In addition, folders like “irCodes” hold raw IR signal text files and “Spesifications” (with Aircond.md) offer documentation on air conditioner specifications, serving as reference material.
Main Components
a. AEHAFmtSender Module:
• AEHAFmtSender.Client: The frontend web UI built with Razor/Blazor pages. This component lets the user interact with the system.
• AEHAFmtSender (Backend): Contains business logic, shared IR format code (in the IRFormats folder), and startup/configuration (Program.cs). It handles commands coming from the front end.
• RPi/PWMSender: A submodule under the AEHAFmtSender backend that deals with sending commands via PWM to physical hardware (likely running on a Raspberry Pi).
b. AircondSignalGen:
• A separate service/utility that generates IR signals (as evidenced by files like NP081.cs and RemoteControlBase.cs). This can be visualized as an independent tool that contributes to the overall IR command generation.
c. ByteDatagetter:
• Another independent utility for data collection or IR signal byte processing.
d. External Data/Specifications:
• The “irCodes” folder serves as a repository of sample or actual IR command codes used by the system.
• The “Spesifications” folder provides the technical and functional guidance for interfacing with the air conditioner.
Relationships and Interactions
• The user interacts with the AEHAFmtSender.Client (web UI) which issues control commands.
• These commands flow through the AEHAFmtSender backend, which may consult shared libraries (IRFormats) to interpret and format commands appropriately.
• The RPi/PWMSender module is responsible for translating these commands into physical IR signals that control the air conditioner.
• Meanwhile, AircondSignalGen can be used to generate or validate these IR control signals independently.
• ByteDatagetter might be integrated in scenarios where the system requires monitoring or logging of IR signal data.
• The “irCodes” repository provides the raw command configurations that may be referenced by both the main backend processing and the standalone tools.
Architectural Patterns & Design Principles
• Modular Separation: The system is split into distinct projects, each handling a dedicated responsibility (UI, signal generation, data collection).
• Clear API/Communication Channels: While the AEHAFmtSender client and backend work together for live control, the command-line tools are kept separate for offline processing or signal generation.
• Use of Shared Libraries: Common functionality related to IR control (e.g., NP081Model, IRFormats) is centralized to promote code reuse.