Closed YuChunTsao closed 1 week ago
@YuChunTsao some points of clarification:
EN_saveinpfile
is executed.ExportDataBase
function in the GUI will correctly write an ID name whose length is greater than 16 characters to file.saveinpfile
function in the Toolkit please write ID names using a %-31s
format specifier and not %-16s
.Thanks for the clarification!
I'm using the Epanet toolkit to generate INP files.
The
EN_saveinpfile
function does not include comments for properties in each section when it generates an INP file. This is inconsistent with the output from the EPANET GUI, which does include these comments. These comments can increase readability when user opening the INP file using a text editor.For example, this is a junction section of an INP file generated using the
EN_saveinpfile
function. (I openedNet1.inp
and exported a new file.)However, when we use EPANET 2.2 to export a network, the INP file will include property comments.
Maybe we can refer ExportDataBase function in Epanet 2.2 to update the saveinpfile function in the
inpfile.c
.I modified some code in junction section for testing.
This is the modified result.
There is a issue may need to be discussed about output format. The length of the ID is 31. However, the length of the output format in the EPANET 2.2 ExportDataBase function is 16.