diff --git a/src/CNRECS.DEF b/src/CNRECS.DEF index 49ca8fc43..328a16ee3 100644 --- a/src/CNRECS.DEF +++ b/src/CNRECS.DEF @@ -4200,9 +4200,10 @@ RECORD DHWSYS "DHWSYS" *RAT // input / runtime DHW system *i TI ws_centralDHWSYSi // index of central (parent) DHWSYS, 0 if none // child DHWSYSs specify unit-specfic draws only // but have no heaters etc - *declare "int ws_HasCentralDHWSYS() const { return ws_centralDHWSYSi > 0; }" + *declare "bool ws_HasCentralDHWSYS() const { return ws_centralDHWSYSi > 0; }" *declare "DHWSYS* ws_GetCentralDHWSYS() const;" - *declare "int ws_IsCentralDHWSYS() const;" + *declare "bool ws_IsCentralDHWSYS() const;" + *declare "DHWSYS* ws_GetPrimaryDHWSYS() const { return ws_HasCentralDHWSYS() ? ws_GetCentralDHWSYS() : const_cast(this); }" *i FLOAT_GEZ ws_mult; // multiplier: model as ws_mult identical systems // fractional values supported diff --git a/src/dhwcalc.cpp b/src/dhwcalc.cpp index 2a616f27b..2a33c583f 100644 --- a/src/dhwcalc.cpp +++ b/src/dhwcalc.cpp @@ -828,7 +828,7 @@ DHWSYS* DHWSYS::ws_GetCentralDHWSYS() const return pWS; } // DHWSYS::ws_GetCentralDHWSYS //----------------------------------------------------------------------------- -int DHWSYS::ws_IsCentralDHWSYS() const +bool DHWSYS::ws_IsCentralDHWSYS() const { // note: dicey for input records // ws_childSYSCount is derived in ws_Init() pass 1 #if defined( _DEBUG) @@ -1169,8 +1169,9 @@ RC DHWSYS::ws_Init( // init for run (including children) // total target warmup water waste, gal/day ws_dayWaste = ws_dayWasteVol + ws_dayWasteBranchVolF * ws_branchTotals.st_vol; - if (!ws_HasDHWDAYUSEDraws()) - { // no DHWDAYUSE (on this or any child): info msgs re draw-related input + if (!ws_GetPrimaryDHWSYS()->ws_HasDHWDAYUSEDraws()) + { // info msgs re draw-related input if no wsDayUse draws + // check for DAYUSE draws in parent iff child, else self const char* when = "-- there are no wsDayUse draws."; ignoreN(when, DHWSYS_DAYWASTEVOL, DHWSYS_DAYWASTEBRANCHVOLF, 0); for (int iEU=1; iEU