Ignore errors in coords. read from file

Ignores errors when reading node & link vertex coordinates from an input file. Also when saving a project to an input file, the [DEMANDS] section only includes non-zero demands.
See issues #603 and #174 .
This commit is contained in:
Lew Rossman
2023-01-26 12:50:26 -05:00
parent 7dab25e867
commit f60102105a
2 changed files with 18 additions and 11 deletions

View File

@@ -332,6 +332,7 @@ int saveinpfile(Project *pr, const char *fname)
node = &net->Node[i];
for (demand = node->D; demand != NULL; demand = demand->next)
{
if (demand->Base == 0.0) continue;
sprintf(s, " %-31s %14.6f", node->ID, ucf * demand->Base);
if ((j = demand->Pat) > 0) sprintf(s1, " %-31s", net->Pattern[j].ID);
else strcpy(s1, " ");