update dumps

This commit is contained in:
proddy
2024-10-19 12:14:59 +02:00
parent 5f0d49e13b
commit f60c692d59
5 changed files with 2277 additions and 2249 deletions

View File

@@ -1,6 +1,5 @@
import fileinput
import csv
import sys
from itertools import groupby
# static data

View File

@@ -3,4 +3,3 @@
make clean
make ARGS=-DEMSESP_STANDALONE
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py | python3 ./scripts/generate-modbus-register-doc.py

View File

@@ -3,28 +3,28 @@
# Update modbus parameters from entity definitions.
# This script generates c++ code for the modbus parameter definitions.
#
# Run this script from the EMS-ESP32 root directory with the command `sh ./scripts/update_modbus_registers.sh`.
# Run this script from the EMS-ESP32 root directory with the command `bash ./scripts/update_modbus_registers.sh`.
while [[ $# -gt 0 ]]; do
case $1 in
--reset)
RESET=YES
shift
;;
--force)
FORCE=YES
shift
;;
*|-*|--*)
echo "Unknown option $1"
exit 1
;;
--reset)
RESET=YES
shift
;;
--force)
FORCE=YES
shift
;;
* | -* | --*)
echo "Unknown option $1"
exit 1
;;
esac
done
if [ "$RESET" = "YES" ]; then
if [ "$FORCE" != "YES" ]; then
read -p "Are you sure you want to reset all modbus entity parameters, potentially generating new register mappings? WARNING: This might introduce breaking changes for end users. [yes/no] " CONFIRMATION
read -p "Are you sure you want to reset all modbus entity parameters, potentially generating new register mappings? WARNING: This might introduce breaking changes for end users. [yes/no] " CONFIRMATION
if [ "$CONFIRMATION" != "yes" ]; then
echo "Aborted."
exit 1
@@ -60,6 +60,5 @@ fi
make clean
make ARGS=-DEMSESP_STANDALONE
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py | python3 ./scripts/update_modbus_registers.py > ./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
echo "Modbus entity parameters written to ./src/modbus_entity_parameters.hpp."