How arsbelkin/lukoil-boiler-project works
This is a boiler simulation with OPC UA, temperature control, a REST API/UI, and historical logging. The main workflow models tank and valve behavior, exposes process values through OPC UA, and lets a PID controller adjust the inlet valves; the API serves live data and history graphs. History is stored through interchangeable SQLite/PostgreSQL strategies. Dashed links mark runtime relationships suggested by the documented architecture or module references where the relevant call sites were not excerpted.
Main entry points: controllers.py API routes · opc_client.py OPC client · fabric.py DB strategy factory · db_repository.py DB repository
Components 22
Boiler simulation
- Model runner
src/model/run_model.py - Boiler model
src/model/model.py - Valve model
src/model/valve.py - Boiler options
src/model/optionsBoiler.py
OPC and control
- OPC UA server
src/opc/opc_server.py - OPC tags
src/opc/opc_tags.py - OPC client
src/opc/opc_client.py - PID controller
src/pid/pid_controller.py
API and UI
- Browser UI
src/ui/js/script.js - UI page
src/ui/template/index.html - API routes
src/api/controllers.py - API server
src/api/api_server.py - Value DTO
src/api/api_model.py - History graphs
src/api/graph.py
History storage
- History logger
src/db/history_logger.py - DB repository
src/db/db_repository.py - DB config
src/db/config.py - DB strategy factory
src/db/fabric.py - DB strategy contract
src/db/strategies/abs_strategy.py - SQLite strategy
src/db/strategies/sqlite_strategy.py - PostgreSQL strategy
src/db/strategies/pg_stategy.py
Other components
- Operator
Connections 24
- Operator → Browser UI: uses
- Browser UI → API routes: requests data
- API routes → UI page: serves page
src/api/controllers.py - API server → API routes: registers routes
src/api/api_server.py - API routes → Value DTO: accepts values
src/api/controllers.py - API routes → OPC client: reads and writes
src/api/controllers.py - API routes → History graphs: requests graph
src/api/controllers.py - History graphs → DB repository: reads history
src/api/graph.py - Model runner → Boiler model: steps simulation
src/model/run_model.py - Boiler model → Boiler options: uses options
src/model/model.py - Boiler model → Valve model: steps valves
src/model/model.py - Model runner → OPC client: updates process values
- OPC UA server → OPC tags: defines variables
src/opc/opc_server.py - OPC client → OPC UA server: reads and writes tags
- PID controller → OPC client: reads and sets values
src/pid/pid_controller.py - History logger → OPC client: reads process data
src/db/history_logger.py - History logger → DB repository: logs readings
src/db/history_logger.py - DB repository → DB config: selects database
src/db/db_repository.py - DB repository → DB strategy factory: creates strategy
src/db/db_repository.py - DB strategy factory → DB config: loads settings
src/db/fabric.py - DB strategy factory → SQLite strategy: creates SQLite
src/db/fabric.py - DB strategy factory → PostgreSQL strategy: creates PostgreSQL
src/db/fabric.py - SQLite strategy → DB strategy contract: implements
src/db/strategies/sqlite_strategy.py - PostgreSQL strategy → DB strategy contract: implements
src/db/strategies/pg_stategy.py