fix: Use two semicolons in each heading line

This commit is contained in:
Yu Chun Tsao
2024-06-19 00:38:05 +08:00
parent 317990a8d1
commit 96cb4c9c88

View File

@@ -152,7 +152,7 @@ int saveinpfile(Project *pr, const char *fname)
// (Leave demands for [DEMANDS] section) // (Leave demands for [DEMANDS] section)
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_JUNCTIONS); 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"); "ID", "Elev", "Demand", "Pattern");
for (i = 1; i <= net->Njuncs; i++) for (i = 1; i <= net->Njuncs; i++)
{ {
@@ -164,7 +164,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [RESERVOIRS] section // Write [RESERVOIRS] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_RESERVOIRS); fprintf(f, s_RESERVOIRS);
fprintf(f, "\n;%-31s\t%-12s\t%-31s", fprintf(f, "\n;;%-31s\t%-12s\t%-31s",
"ID", "Head", "Pattern"); "ID", "Head", "Pattern");
for (i = 1; i <= net->Ntanks; i++) for (i = 1; i <= net->Ntanks; i++)
{ {
@@ -183,7 +183,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [TANKS] section // Write [TANKS] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_TANKS); 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"); "ID", "Elevation", "InitLevel", "MinLevel", "MaxLevel", "Diameter", "MinVol", "VolCurve", "Overflow");
for (i = 1; i <= net->Ntanks; i++) for (i = 1; i <= net->Ntanks; i++)
{ {
@@ -210,7 +210,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [PIPES] section // Write [PIPES] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_PIPES); 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"); "ID", "Node1", "Node2", "Length", "Diameter", "Roughness", "MinorLoss", "Status");
for (i = 1; i <= net->Nlinks; i++) for (i = 1; i <= net->Nlinks; i++)
{ {
@@ -237,7 +237,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [PUMPS] section // Write [PUMPS] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_PUMPS); 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"); "ID", "Node1", "Node2", "Parameters");
for (i = 1; i <= net->Npumps; i++) for (i = 1; i <= net->Npumps; i++)
{ {
@@ -288,7 +288,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [VALVES] section // Write [VALVES] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_VALVES); 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"); "ID", "Node1", "Node2", "Diameter", "Type", "Setting", "MinorLoss");
for (i = 1; i <= net->Nvalves; i++) for (i = 1; i <= net->Nvalves; i++)
{ {
@@ -338,7 +338,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [DEMANDS] section // Write [DEMANDS] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_DEMANDS); 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"); "Junction", "Demand", "Pattern", "Category");
ucf = pr->Ucf[DEMAND]; ucf = pr->Ucf[DEMAND];
for (i = 1; i <= net->Njuncs; i++) for (i = 1; i <= net->Njuncs; i++)
@@ -359,7 +359,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [EMITTERS] section // Write [EMITTERS] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_EMITTERS); fprintf(f, s_EMITTERS);
fprintf(f, "\n;%-31s\t%-14s", fprintf(f, "\n;;%-31s\t%-14s",
"Junction", "Coefficient"); "Junction", "Coefficient");
for (i = 1; i <= net->Njuncs; i++) for (i = 1; i <= net->Njuncs; i++)
{ {
@@ -372,7 +372,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [STATUS] section // Write [STATUS] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_STATUS); fprintf(f, s_STATUS);
fprintf(f, "\n;%-31s\t%-12s", fprintf(f, "\n;;%-31s\t%-12s",
"ID", "Status/Setting"); "ID", "Status/Setting");
for (i = 1; i <= net->Nlinks; i++) for (i = 1; i <= net->Nlinks; i++)
{ {
@@ -415,7 +415,7 @@ int saveinpfile(Project *pr, const char *fname)
// (Use 6 pattern factors per line) // (Use 6 pattern factors per line)
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_PATTERNS); fprintf(f, s_PATTERNS);
fprintf(f, "\n;%-31s\t%-12s", fprintf(f, "\n;;%-31s\t%-12s",
"ID", "Multipliers"); "ID", "Multipliers");
for (i = 1; i <= net->Npats; i++) for (i = 1; i <= net->Npats; i++)
{ {
@@ -430,7 +430,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [CURVES] section // Write [CURVES] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_CURVES); 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"); "ID", "X-Value", "Y-Value");
for (i = 1; i <= net->Ncurves; i++) for (i = 1; i <= net->Ncurves; i++)
{ {
@@ -523,7 +523,7 @@ int saveinpfile(Project *pr, const char *fname)
// (Skip nodes with default quality of 0) // (Skip nodes with default quality of 0)
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_QUALITY); 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++) for (i = 1; i <= net->Nnodes; i++)
{ {
node = &net->Node[i]; node = &net->Node[i];
@@ -534,7 +534,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [SOURCES] section // Write [SOURCES] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_SOURCES); 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++) for (i = 1; i <= net->Nnodes; i++)
{ {
node = &net->Node[i]; node = &net->Node[i];
@@ -553,7 +553,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [MIXING] section // Write [MIXING] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_MIXING); 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++) for (i = 1; i <= net->Ntanks; i++)
{ {
tank = &net->Tank[i]; tank = &net->Tank[i];
@@ -584,7 +584,7 @@ int saveinpfile(Project *pr, const char *fname)
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_REACTIONS); 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 // Pipe-specific parameters
for (i = 1; i <= net->Nlinks; i++) for (i = 1; i <= net->Nlinks; i++)
@@ -821,7 +821,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [COORDINATES] section // Write [COORDINATES] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_COORDS); 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++) for (i = 1; i <= net->Nnodes; i++)
{ {
node = &net->Node[i]; node = &net->Node[i];
@@ -832,7 +832,7 @@ int saveinpfile(Project *pr, const char *fname)
// Write [VERTICES] section // Write [VERTICES] section
fprintf(f, "\n\n"); fprintf(f, "\n\n");
fprintf(f, s_VERTICES); 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++) for (i = 1; i <= net->Nlinks; i++)
{ {
link = &net->Link[i]; link = &net->Link[i];