Skip to content

Commit

Permalink
fix: Use two semicolons in each heading line
Browse files Browse the repository at this point in the history
  • Loading branch information
YuChunTsao committed Jun 18, 2024
1 parent 317990a commit 96cb4c9
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/inpfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int saveinpfile(Project *pr, const char *fname)
// (Leave demands for [DEMANDS] section)
fprintf(f, "\n\n");
fprintf(f, s_JUNCTIONS);
fprintf(f, "\n;%-31s\t%-12s\t%-12s\t%-31s",
fprintf(f, "\n;;%-31s\t%-12s\t%-12s\t%-31s",
"ID", "Elev", "Demand", "Pattern");
for (i = 1; i <= net->Njuncs; i++)
{
Expand All @@ -164,7 +164,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [RESERVOIRS] section
fprintf(f, "\n\n");
fprintf(f, s_RESERVOIRS);
fprintf(f, "\n;%-31s\t%-12s\t%-31s",
fprintf(f, "\n;;%-31s\t%-12s\t%-31s",
"ID", "Head", "Pattern");
for (i = 1; i <= net->Ntanks; i++)
{
Expand All @@ -183,7 +183,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [TANKS] section
fprintf(f, "\n\n");
fprintf(f, s_TANKS);
fprintf(f, "\n;%-31s\t%-12s\t%-12s\t%-12s\t%-12s\t%-12s\t%-12s\t%-31s\t%-12s",
fprintf(f, "\n;;%-31s\t%-12s\t%-12s\t%-12s\t%-12s\t%-12s\t%-12s\t%-31s\t%-12s",
"ID", "Elevation", "InitLevel", "MinLevel", "MaxLevel", "Diameter", "MinVol", "VolCurve", "Overflow");
for (i = 1; i <= net->Ntanks; i++)
{
Expand All @@ -210,7 +210,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [PIPES] section
fprintf(f, "\n\n");
fprintf(f, s_PIPES);
fprintf(f, "\n;%-31s\t%-31s\t%-31s\t%-12s\t%-12s\t%-12s\t%-12s\t%-6s",
fprintf(f, "\n;;%-31s\t%-31s\t%-31s\t%-12s\t%-12s\t%-12s\t%-12s\t%-6s",
"ID", "Node1", "Node2", "Length", "Diameter", "Roughness", "MinorLoss", "Status");
for (i = 1; i <= net->Nlinks; i++)
{
Expand All @@ -237,7 +237,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [PUMPS] section
fprintf(f, "\n\n");
fprintf(f, s_PUMPS);
fprintf(f, "\n;%-31s\t%-31s\t%-31s\t%-12s",
fprintf(f, "\n;;%-31s\t%-31s\t%-31s\t%-12s",
"ID", "Node1", "Node2", "Parameters");
for (i = 1; i <= net->Npumps; i++)
{
Expand Down Expand Up @@ -288,7 +288,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [VALVES] section
fprintf(f, "\n\n");
fprintf(f, s_VALVES);
fprintf(f, "\n;%-31s\t%-31s\t%-31s\t%-12s\t%-6s\t%-12s\t%-12s",
fprintf(f, "\n;;%-31s\t%-31s\t%-31s\t%-12s\t%-6s\t%-12s\t%-12s",
"ID", "Node1", "Node2", "Diameter", "Type", "Setting", "MinorLoss");
for (i = 1; i <= net->Nvalves; i++)
{
Expand Down Expand Up @@ -338,7 +338,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [DEMANDS] section
fprintf(f, "\n\n");
fprintf(f, s_DEMANDS);
fprintf(f, "\n;%-31s\t%-14s\t%-31s\t%-31s",
fprintf(f, "\n;;%-31s\t%-14s\t%-31s\t%-31s",
"Junction", "Demand", "Pattern", "Category");
ucf = pr->Ucf[DEMAND];
for (i = 1; i <= net->Njuncs; i++)
Expand All @@ -359,7 +359,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [EMITTERS] section
fprintf(f, "\n\n");
fprintf(f, s_EMITTERS);
fprintf(f, "\n;%-31s\t%-14s",
fprintf(f, "\n;;%-31s\t%-14s",
"Junction", "Coefficient");
for (i = 1; i <= net->Njuncs; i++)
{
Expand All @@ -372,7 +372,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [STATUS] section
fprintf(f, "\n\n");
fprintf(f, s_STATUS);
fprintf(f, "\n;%-31s\t%-12s",
fprintf(f, "\n;;%-31s\t%-12s",
"ID", "Status/Setting");
for (i = 1; i <= net->Nlinks; i++)
{
Expand Down Expand Up @@ -415,7 +415,7 @@ int saveinpfile(Project *pr, const char *fname)
// (Use 6 pattern factors per line)
fprintf(f, "\n\n");
fprintf(f, s_PATTERNS);
fprintf(f, "\n;%-31s\t%-12s",
fprintf(f, "\n;;%-31s\t%-12s",
"ID", "Multipliers");
for (i = 1; i <= net->Npats; i++)
{
Expand All @@ -430,7 +430,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [CURVES] section
fprintf(f, "\n\n");
fprintf(f, s_CURVES);
fprintf(f, "\n;%-31s\t%-12s\t%-12s",
fprintf(f, "\n;;%-31s\t%-12s\t%-12s",
"ID", "X-Value", "Y-Value");
for (i = 1; i <= net->Ncurves; i++)
{
Expand Down Expand Up @@ -523,7 +523,7 @@ int saveinpfile(Project *pr, const char *fname)
// (Skip nodes with default quality of 0)
fprintf(f, "\n\n");
fprintf(f, s_QUALITY);
fprintf(f, "\n;%-31s\t%-14s", "ID", "InitQual");
fprintf(f, "\n;;%-31s\t%-14s", "ID", "InitQual");
for (i = 1; i <= net->Nnodes; i++)
{
node = &net->Node[i];
Expand All @@ -534,7 +534,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [SOURCES] section
fprintf(f, "\n\n");
fprintf(f, s_SOURCES);
fprintf(f, "\n;%-31s\t%-9s\t%-14s\t%-31s", "ID", "Type", "Quality", "Pattern");
fprintf(f, "\n;;%-31s\t%-9s\t%-14s\t%-31s", "ID", "Type", "Quality", "Pattern");
for (i = 1; i <= net->Nnodes; i++)
{
node = &net->Node[i];
Expand All @@ -553,7 +553,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [MIXING] section
fprintf(f, "\n\n");
fprintf(f, s_MIXING);
fprintf(f, "\n;%-31s\t%-8s", "ID", "Model");
fprintf(f, "\n;;%-31s\t%-8s", "ID", "Model");
for (i = 1; i <= net->Ntanks; i++)
{
tank = &net->Tank[i];
Expand Down Expand Up @@ -584,7 +584,7 @@ int saveinpfile(Project *pr, const char *fname)

fprintf(f, "\n\n");
fprintf(f, s_REACTIONS);
fprintf(f, "\n;%-9s\t%-31s\t%-12s", "Type", "Pipe/Tank", "Coefficient");
fprintf(f, "\n;;%-9s\t%-31s\t%-12s", "Type", "Pipe/Tank", "Coefficient");

// Pipe-specific parameters
for (i = 1; i <= net->Nlinks; i++)
Expand Down Expand Up @@ -821,7 +821,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [COORDINATES] section
fprintf(f, "\n\n");
fprintf(f, s_COORDS);
fprintf(f, "\n;%-31s\t%-14s\t%-14s", "ID", "X-Coord", "Y-Coord");
fprintf(f, "\n;;%-31s\t%-14s\t%-14s", "ID", "X-Coord", "Y-Coord");
for (i = 1; i <= net->Nnodes; i++)
{
node = &net->Node[i];
Expand All @@ -832,7 +832,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [VERTICES] section
fprintf(f, "\n\n");
fprintf(f, s_VERTICES);
fprintf(f, "\n;%-31s\t%-14s\t%-14s", "ID", "X-Coord", "Y-Coord");
fprintf(f, "\n;;%-31s\t%-14s\t%-14s", "ID", "X-Coord", "Y-Coord");
for (i = 1; i <= net->Nlinks; i++)
{
link = &net->Link[i];
Expand Down

0 comments on commit 96cb4c9

Please sign in to comment.