Merge branch 'dev' into 683-request-better-logging-functionality

This commit is contained in:
Sam Hatchett
2023-01-19 09:01:43 -05:00
committed by GitHub
26 changed files with 437 additions and 42 deletions

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 02/03/2020
Last Updated: 08/13/2022
******************************************************************************
*/
@@ -862,7 +862,7 @@ int findtank(Network *network, int index)
/*----------------------------------------------------------------
** Input: index = node index
** Output: none
** Returns: index of tank with given node id, or NOTFOUND if tank not found
** Returns: index of tank with given node index, or NOTFOUND if tank not found
** Purpose: for use in the deletenode function
**----------------------------------------------------------------
*/
@@ -879,7 +879,7 @@ int findpump(Network *network, int index)
/*----------------------------------------------------------------
** Input: index = link ID
** Output: none
** Returns: index of pump with given link id, or NOTFOUND if pump not found
** Returns: index of pump with given link index, or NOTFOUND if pump not found
** Purpose: for use in the deletelink function
**----------------------------------------------------------------
*/
@@ -896,7 +896,7 @@ int findvalve(Network *network, int index)
/*----------------------------------------------------------------
** Input: index = link ID
** Output: none
** Returns: index of valve with given link id, or NOTFOUND if valve not found
** Returns: index of valve with given link index, or NOTFOUND if valve not found
** Purpose: for use in the deletelink function
**----------------------------------------------------------------
*/
@@ -1012,7 +1012,7 @@ void adjustcurves(Network *network, int index)
**----------------------------------------------------------------
*/
{
int j, k, setting;
int j, k, curve;
// Adjust tank volume curves
for (j = 1; j <= network->Ntanks; j++)
@@ -1027,15 +1027,25 @@ void adjustcurves(Network *network, int index)
adjustcurve(&network->Pump[j].Ecurve, index);
}
// Adjust GPV curves
// Adjust PCV & GPV curves
for (j = 1; j <= network->Nvalves; j++)
{
k = network->Valve[j].Link;
if (network->Link[k].Type == PCV)
{
if ((curve = network->Valve[j].Curve) > 0)
{
adjustcurve(&curve, index);
network->Valve[j].Curve = curve;
if (curve == 0)
network->Link[k].Kc = 0.0;
}
}
if (network->Link[k].Type == GPV)
{
setting = INT(network->Link[k].Kc);
adjustcurve(&setting, index);
network->Link[k].Kc = setting;
curve = INT(network->Link[k].Kc);
adjustcurve(&curve, index);
network->Link[k].Kc = curve;
}
}
}