Fixes #172 (adjust controls when node/link is deleted) & EN_addrule added

- Deleting controls with node/link deletion made conditional.
- New EN_addrule function added along with a test file.
- Rule structures re-named & rules.c heavily modified.
- Issue with exceeding limit on number of temporary file names fixed.
- VB declaration and DEF files updated.
This commit is contained in:
Lew Rossman
2018-11-07 23:09:47 -05:00
parent ee335ab077
commit 7443cea9d4
25 changed files with 2197 additions and 1800 deletions

View File

@@ -52,7 +52,7 @@ char setreactflag(EN_Project *pr)
{
for (i = 1; i <= net->Nlinks; i++)
{
if (net->Link[i].Type <= EN_PIPE)
if (net->Link[i].Type <= PIPE)
{
if (net->Link[i].Kb != 0.0 || net->Link[i].Kw != 0.0) return 1;
}
@@ -127,7 +127,7 @@ void reactpipes(EN_Project *pr, long dt)
for (k = 1; k <= net->Nlinks; k++)
{
// Skip non-pipe links (pumps & valves)
if (net->Link[k].Type != EN_PIPE) continue;
if (net->Link[k].Type != PIPE) continue;
rsum = 0.0;
vsum = 0.0;