How alejandrotejero/invernadero works
Purpose and entry point
A terminal-based C++ greenhouse simulator. It authenticates users, exposes sensor readings/control through menus, and persists users and sensor data across runs. Program startup is Ficheros/main.cpp; the build target is defined in Ficheros/Makefile.
Application orchestration
Administrador is the likely system-level coordinator for greenhouse entities and operational actions, while Interfaz owns terminal interaction and menu navigation. main should construct/wire these services, then hand control to login/UI flow.
• Ficheros/main.cpp
• Ficheros/Administrador.h
• Ficheros/Interfaz.h
Authentication and user domain
Login is a boundary before access to the greenhouse interface. Login performs authentication against a user repository; Usuario represents user records, and BDUsuarios handles durable storage in the text file.
• Ficheros/Login.cpp
• Ficheros/Usuario.h
• Ficheros/BDUsuarios.cpp
• Ficheros/users.txt
Sensor model and specialization
The core domain is a polymorphic sensor set. SensorCamara appears to define the common sensor/camera abstraction; specialized types model temperature, humidity, air, lighting, RGB, and thermal capabilities. This permits the administrator/UI to work with a common sensor boundary while dispatching type-specific behavior.
• Ficheros/SensorCamara.h
• Ficheros/STemp.h
• Ficheros/SHumedad.h
• Ficheros/SAire.h
• Ficheros/SIluminacion.h
• Ficheros/CRgb.h
• Ficheros/CTermica.h
Readings persistence
BDSensores is the persistence boundary for sensor state/readings, backed by binary sensors.dat. Runtime sensor operations should flow from UI/administrator into the sensor objects, then through this repository for save/load rather than directly coupling domain classes to file formats.
• Ficheros/BDSensores.h
• Ficheros/BDSensores.cpp
• Ficheros/sensors.dat
Alarm handling
Alarma encapsulates alarm-related state or evaluation, separating exceptional greenhouse conditions from ordinary sensor representation. Sensor values likely feed alarm checks, whose results are presented through the interface or handled by the administrator.
• Ficheros/Alarma.h
• Ficheros/Alarma.cpp
• Ficheros/Administrador.cpp
Runtime and boundaries
The application is a native C++ executable compiled with g++ via make; it has no indicated network, database server, or web runtime. Its external dependencies are terminal I/O and local filesystem persistence. Exception provides an application-level error boundary for invalid operations, authentication/storage failures, or domain errors.
• Ficheros/Makefile
• Ficheros/Exception.h
• Ficheros/README.md
Main entry points: Administrador.h Administrador · Interfaz.h Interfaz · main.cpp Program entry · Login.cpp Login
Components 15
Runtime
- Make build · Compiles the native C++ executable with g++.
Ficheros/Makefile - Program entry · Constructs application services and starts the login/UI flow.
Ficheros/main.cpp - Terminal I/O
Application
- Interfaz · Owns menus and user interaction.
Ficheros/Interfaz.h - Login
Ficheros/Login.cpp - Administrador · Coordinates greenhouse entities and operational actions.
Ficheros/Administrador.h - Exception · Application-level invalid-operation and failure handling.
Ficheros/Exception.h
Greenhouse domain
- Usuario
Ficheros/Usuario.h - SensorCamara · Common polymorphic boundary for sensors and cameras.
Ficheros/SensorCamara.h - Sensor specializations · Temperature, humidity, air, lighting, RGB, and thermal sensor/camera types.
Ficheros/STemp.h - Alarma · Evaluates exceptional greenhouse conditions from sensor values.
Ficheros/Alarma.cpp
Local persistence
- BDUsuarios · Durable user-record storage.
Ficheros/BDUsuarios.cpp - users.txt
Ficheros/users.txt - BDSensores · Loads and saves sensor state/readings.
Ficheros/BDSensores.h - sensors.dat
Ficheros/sensors.dat
Connections 17
- Make build → Program entry: builds
- Program entry → Interfaz: starts
- Program entry → Administrador: wires
- Interfaz → Terminal I/O: reads and displays
- Interfaz → Login: requests authentication
- Login → BDUsuarios: authenticates through
- BDUsuarios → Usuario: loads
- BDUsuarios → users.txt: persists
- Interfaz → Administrador: invokes operations
- Administrador → SensorCamara: manages
- Sensor specializations → SensorCamara: specialize
- Administrador → BDSensores: loads and saves readings
- BDSensores → sensors.dat: persists
- SensorCamara → Alarma: supplies values for
- Alarma → Administrador: reports conditions to
- Administrador → Exception: raises failures through
- Login → Exception: reports failures through