mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
v3.7.2
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Builds the dump CSV files, modbus headers and documentation.
|
||||
# Called by /scripts/generate_csv_and_headers.sh
|
||||
# Builds the dump_*.csv files, modbus headers and modbus documentation.
|
||||
# Run as `sh scripts/generate_csv_and_headers.sh` from the root of the repository.
|
||||
|
||||
# build dummy modbus_entity_parameters.hpp so it compiles
|
||||
cat >./src/modbus_entity_parameters.hpp <<EOL
|
||||
# create a dummy modbus_entity_parameters.hpp so the first pass compiles
|
||||
cat >./src/core/modbus_entity_parameters.hpp <<EOL
|
||||
#include "modbus.h"
|
||||
#include "emsdevice.h"
|
||||
|
||||
@@ -31,29 +31,29 @@ const std::initializer_list<Modbus::EntityModbusInfo> Modbus::modbus_register_ma
|
||||
|
||||
EOL
|
||||
|
||||
# build emsesp for standalone
|
||||
# First generate Modbus entity parameters
|
||||
# build the modbus_entity_parameters.hpp header file
|
||||
make clean
|
||||
make -s ARGS=-DEMSESP_MODBUS
|
||||
rm -f ./src/core/modbus_entity_parameters.hpp ./docs/dump_entities.csv
|
||||
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py > ./docs/dump_entities.csv
|
||||
cat ./docs/dump_entities.csv | python3 ./scripts/update_modbus_registers.py > ./src/core/modbus_entity_parameters.hpp
|
||||
|
||||
# regenerate dump_entities.csv but without the Modbus entity parameters
|
||||
make clean
|
||||
make -s ARGS=-DEMSESP_STANDALONE
|
||||
|
||||
# Generate Modbus entity parameters
|
||||
# One to build the modbus_entity_parameters.hpp header file
|
||||
# And then run entity_dump test again to create the dump_entities.csv file with the correct modbus counts
|
||||
rm -f ./src/modbus_entity_parameters.hpp
|
||||
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py | python3 ./scripts/update_modbus_registers.py >./src/modbus_entity_parameters.hpp
|
||||
ls -al ./src/modbus_entity_parameters.hpp
|
||||
|
||||
# dump_entities.csv
|
||||
make -s ARGS=-DEMSESP_STANDALONE
|
||||
rm -f ./docs/dump_entities.csv
|
||||
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py >./docs/dump_entities.csv
|
||||
ls -al ./docs/dump_entities.csv
|
||||
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py > ./docs/dump_entities.csv
|
||||
|
||||
# generate Modbus doc - Modbus-Entity-Registers.md used in the emsesp.org documentation
|
||||
rm -f ./docs/Modbus-Entity-Registers.md
|
||||
cat ./docs/dump_entities.csv | python3 ./scripts/generate-modbus-register-doc.py > ./docs/Modbus-Entity-Registers.md
|
||||
|
||||
# dump_telegrams.csv
|
||||
rm -f ./docs/dump_telegrams.csv
|
||||
echo "test telegram_dump" | ./emsesp | python3 ./scripts/strip_csv.py >./docs/dump_telegrams.csv
|
||||
ls -al ./docs/dump_telegrams.csv
|
||||
echo "test telegram_dump" | ./emsesp | python3 ./scripts/strip_csv.py > ./docs/dump_telegrams.csv
|
||||
|
||||
# generate doc - Modbus-Entity-Registers.md used in the emsesp.org documentation
|
||||
rm -f ./docs/Modbus-Entity-Registers.md
|
||||
cat ./docs/dump_entities.csv | python3 ./scripts/generate-modbus-register-doc.py >./docs/Modbus-Entity-Registers.md
|
||||
ls -al ./src/core/modbus_entity_parameters.hpp
|
||||
ls -al ./docs/Modbus-Entity-Registers.md
|
||||
ls -al ./docs/dump_entities.csv
|
||||
ls -al ./docs/dump_telegrams.csv
|
||||
|
||||
Reference in New Issue
Block a user