Helper tools
This commit is contained in:
2941
docs/PowerLogic-PM8000/PM8000_Modbus_Map.h
Normal file
2941
docs/PowerLogic-PM8000/PM8000_Modbus_Map.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -17,14 +17,20 @@ typedef struct
|
||||
} pm8000_reg_map_t;
|
||||
|
||||
pm8000_reg_map_t pm8000_reg_map[] = {
|
||||
|
||||
[replace]
|
||||
};
|
||||
"""
|
||||
|
||||
lines = ""
|
||||
for d in range(1, len(data)):
|
||||
if not data[d][1].isnumeric():
|
||||
continue
|
||||
print("{} @ {}:{} ({}) Tag: {}".format(data[d][0], data[d][1] ,data[d][2] ,data[d][3],data[d][7]))
|
||||
|
||||
#print("{} @ {}:{} ({}) Tag: {}".format(data[d][0], data[d][1] ,data[d][2] ,data[d][3],data[d][7]))
|
||||
lines += " { " + data[d][1] + ", " + data[d][2] + ", \"" + data[d][3] + "\", \"" + data[d][0].encode('ascii',"ignore").decode('ascii') + "\" },\n"
|
||||
#
|
||||
|
||||
print(header.replace("[replace]", lines))
|
||||
|
||||
file = open("PM8000_Modbus_Map.h", "w")
|
||||
file.write(header.replace("[replace]", lines))
|
||||
file.close()
|
||||
Reference in New Issue
Block a user