mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 17:49:08 +03:00
auto comments
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
# This script generates c++ code for the modbus parameter definitions.
|
||||
#
|
||||
# Usage:
|
||||
# - first, dump all entities to csv by running 'scripts/dump_entities.sh'
|
||||
# - first, dump all entities to csv by running 'sh ./scripts/dump_entities.sh'
|
||||
# - then run 'cat ../dump_entities.csv | python3 update_modbus_registers.py > ../src/modbus_entity_parameters.hpp'
|
||||
# from the "scripts" folder
|
||||
# OR
|
||||
# run `sh ./scripts/update_modbus_registers.sh` from the root folder
|
||||
|
||||
import fileinput
|
||||
import csv
|
||||
@@ -114,6 +116,12 @@ device_type_names = [
|
||||
cpp_file_template = Template('''#include "modbus.h"
|
||||
#include "emsdevice.h"
|
||||
|
||||
/*
|
||||
* This file is auto-generated by the update_modbus_registers.sh script. Do not modify.
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
using dt = EMSdevice::DeviceType;
|
||||
@@ -125,7 +133,10 @@ using dt = EMSdevice::DeviceType;
|
||||
const std::initializer_list<Modbus::EntityModbusInfo> Modbus::modbus_register_mappings = {
|
||||
$entries};
|
||||
|
||||
} // namespace emsesp''')
|
||||
} // namespace emsesp
|
||||
|
||||
// clang-format off
|
||||
''')
|
||||
# cpp_entry_template = Template(
|
||||
# ' {std::make_tuple($devtype, $tagtype, std::string(\"$shortname\")), {$registeroffset, $registercount}},\n')
|
||||
cpp_entry_template = Template(
|
||||
|
||||
Reference in New Issue
Block a user