Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7561e7d
Update HPWHsim
chipbarnaby Apr 2, 2020
172e597
HPWHsim update
chipbarnaby Apr 2, 2020
80acef8
HPWHsim CxA-20 branch
chipbarnaby Apr 2, 2020
b753eda
Update HPWHsim
chipbarnaby Apr 10, 2020
13cae91
Update HPWHsim
chipbarnaby Apr 16, 2020
225d52e
Solar fraction debug progress
chipbarnaby Apr 18, 2020
a78cb9b
Merge branch 'master' of https://github.com/cse-sim/cse
chipbarnaby Apr 20, 2020
a780999
Merge branch 'master' into dhwfix3
chipbarnaby Apr 20, 2020
01a697a
Cleanup
chipbarnaby Apr 20, 2020
bcb5a2f
Solar DHW progress
chipbarnaby Apr 24, 2020
5325046
Merge branch 'master' of https://github.com/cse-sim/cse
chipbarnaby Apr 24, 2020
7efa73a
Merge branch 'master' into dhwfix3
chipbarnaby Apr 24, 2020
e641a4a
update test ref files re HPWH tank geometry fix
chipbarnaby Apr 24, 2020
f4b0084
Solar DHW progress
chipbarnaby Apr 27, 2020
68c3f30
HPWHsim update
chipbarnaby Apr 27, 2020
4baede2
Update test ref files re HPWH tank geometry change
chipbarnaby Apr 27, 2020
85f1a0f
Merge HPWHTankGeom; test ref file updates
chipbarnaby Apr 27, 2020
256ab36
dhwsolar POA update
chipbarnaby Apr 27, 2020
88203b6
Hi temp limit based on tank outlet temp; experimental wh_tInlet
chipbarnaby Apr 28, 2020
7f8baf4
Merge branch 'pvupdate' into dhwfix3
chipbarnaby Apr 28, 2020
712304a
Merge from master
chipbarnaby Apr 29, 2020
05e58d3
Merge branch 'master' into dhwfix3
chipbarnaby Apr 30, 2020
6c5108f
Solar collector incidence angle modifier
chipbarnaby May 8, 2020
a7383ab
Update HPWH (tank geometry)
chipbarnaby May 8, 2020
f065971
Collector flow rate correction
chipbarnaby May 11, 2020
affc970
Merge from master
chipbarnaby May 11, 2020
e73422b
Stable version after merge from master
chipbarnaby May 12, 2020
6d2321e
DHW solar IAM and flow correction
chipbarnaby May 18, 2020
8d5f091
Add DHWSOLARCOLLECTOR sc_IAM = average IAM
chipbarnaby May 21, 2020
79ea05f
HPWH add'l presets for large HPWHs
chipbarnaby May 22, 2020
b6e6dac
WIP dhw changes to support large HPWHs with whType=BUILTUP
chipbarnaby May 27, 2020
6bb31cd
Merge HPWHsim defrost
chipbarnaby May 28, 2020
5d05216
WIP DHWHEATER whType=Builtup
chipbarnaby May 29, 2020
efd8d2f
DHW input check WIP; update HPWH
chipbarnaby Jun 1, 2020
1d57306
Large HPWH input checking
chipbarnaby Jun 2, 2020
4c549cb
Update HPWHsim
chipbarnaby Jun 2, 2020
44b4047
Merge branch 'largeHPWHs' into dhwfix3
chipbarnaby Jun 2, 2020
a6d3748
DHWSOLARCOLLECTOR simplify (with #if-outs)
chipbarnaby Jun 4, 2020
22c2eba
dhw solar pre-qTank rework
chipbarnaby Jun 11, 2020
fb1e459
DHW solar tank update rework
chipbarnaby Jun 11, 2020
c2c786c
Updated HPWHsim
chipbarnaby Jun 11, 2020
7a8ed24
Merge branch 'largeHPWHs' into New_NEEA_Presets
chipbarnaby Jun 11, 2020
dc99e4f
Update HPWHsim, 2nd try
chipbarnaby Jun 11, 2020
4c3314b
New NEEA presets
chipbarnaby Jun 12, 2020
5e91f74
Merge branch 'New_NEEA_Presets' into dhwfix3
chipbarnaby Jun 12, 2020
64bd47c
dhw solar cleanup; updated HPWHsim
chipbarnaby Jun 13, 2020
e5d1c01
dhw_solar.cse test IAM, flow correction, piping loss
chipbarnaby Jun 15, 2020
3921298
WIP DHWSYSRES
chipbarnaby Jun 16, 2020
b091f24
IVLCH_S / _HS reorder
chipbarnaby Jun 17, 2020
8694ea8
Fix 1zattic.cse conflict
chipbarnaby Jun 17, 2020
d327101
Update HPWHsim
chipbarnaby Jun 17, 2020
750343f
Add choices for Nyle CWP HPWHs
chipbarnaby Jun 17, 2020
47337ff
Update HPWHsim
chipbarnaby Jun 18, 2020
6beed6a
WIP DHWSYSRES
chipbarnaby Jun 20, 2020
54a4d53
HPWHsim new Rheem models
chipbarnaby Jun 23, 2020
026f430
Pkg AC and ASHP test version
chipbarnaby Jun 23, 2020
b71652c
PkgRoom defaults and fixes; add ACPkgRoomFurnace and ACPkgRoomRes
chipbarnaby Jun 24, 2020
c980f9f
RSYS rs_mode bug fixes
chipbarnaby Jun 30, 2020
e1670a3
update to HPWH 1.10.0
chipbarnaby Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 30 additions & 53 deletions src/ANCREC.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@
// class record: base class for application records.
// destructor: inline, ancrec.h.
//***************************************************************************************************************************
record::record(BP _b, TI i, SI noZ/*=0*/) // construct record i of basAnc b, zero all members unless noZ
{
/* possible conditional statSetup elimination:
if (i==0 (and at least b->rt matches if no validate()) and b->p==0 and b->n < b->mn,
set b->p=this, mn/n/nAl 1 record, RFSTAT. BE SURE to override mn: 1-->0.
if (i > 0 and b RFSTAT and b->p consistent and b->n==i-1,
b->n++ : additional record in static array.
CAUTION can be called from statSetup (til eliminated). */

_b->validate("record::record"); // abort if base bad -- we depend on it for size
if (!noZ) // can be suppressed for data-init (static) records
memset((char *)this + SZVFTP, 0, _b->eSz - SZVFTP); /* zero all members of DERIVED CLASS record
except virtFcnTblPtr in 1st 2 or 4 bytes (ancrec.h define) */
b = _b;
rt = _b->rt;
ss = i; // set base class members, for appl and anchor class use
gud = 1; // say space in use and record good
} // record::record
//---------------------------------------------------------------------------------------------------------------------------
void* record::field( int fn) // point to member in record by FIELD #
{ return (void *)((char *)this + b->fir[fn].off); }
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -87,63 +106,10 @@ int record::DType( int fn) const
return dt;
} // record::DType
//-----------------------------------------------------------------------------
record::record( BP _b, TI i, SI noZ/*=0*/) // construct record i of basAnc b, zero all members unless noZ
{
/* possible conditional statSetup elimination:
if (i==0 (and at least b->rt matches if no validate()) and b->p==0 and b->n < b->mn,
set b->p=this, mn/n/nAl 1 record, RFSTAT. BE SURE to override mn: 1-->0.
if (i > 0 and b RFSTAT and b->p consistent and b->n==i-1,
b->n++ : additional record in static array.
CAUTION can be called from statSetup (til eliminated). */

_b->validate("record::record"); // abort if base bad -- we depend on it for size
if (!noZ) // can be suppressed for data-init (static) records
memset( (char *)this+SZVFTP, 0, _b->eSz-SZVFTP); /* zero all members of DERIVED CLASS record
except virtFcnTblPtr in 1st 2 or 4 bytes (ancrec.h define) */
b = _b;
rt = _b->rt;
ss = i; // set base class members, for appl and anchor class use
gud = 1; // say space in use and record good
} // record::record
//---------------------------------------------------------------------------------------------------------------------------
#if 0
x // 7-20-92: NOT COMPLETED: believe nothing would set virt fcn tbl ptr.
x
x not completed, believe won't work without further changes cuz virtual fcn table pointer of record won't get set.
x Instead, do same thing as record::record in record::init.
x User derived class constructors won't work (none anyway). Tested here, ancrec.h. 7-20-92. */
x // failed cuz our operator= does not copy front members; = probably never copies vft.
x construct-in-place thoughts:
x 1. won't work as now cuz virt fcn tbl ptr not init since not constructed.
x 2. would be constructed if alloc'd with 'new'.. .p = new BLAHRAT[n].
x --> interface record::new to dmAl( , WRN | DMZERO)
x then set .b, .i, etc on return (maybe at add(), in .init)?
x problem: no way to add records, unless we copy the virt fcn tbl ptr?
x x3. make = non-virtual, init on stack and copy. maybe provide an afterCopy virt fcn to dup ptrs. failed (above).
x 4. init on stack and memcpy!
x
x record::init( BP _b, TI i, SI noZ/*=0*/) // pseudo-construct record i of basAnc b, zero all members unless noZ.
x
x /* used to 'construct' previously-allocated record in place at use (when .add()'d) under BC 3.1,
x cuz couldn't get compiler to recognize call to constructor for method used under BC 3.0 (see ancrec.h).
x ***** --> derived class constructors won't override (but derived class init() should). 7-20-92. */
x{
x _b->validate("record::init"); // abort if base bad -- we depend on it for size
x if (!noZ) // can be suppressed for data-init (static) records
x memset( (char *)this+2, 0, _b->eSz-2); // zero all members of DERIVED CLASS record except virtFcnTblPtr in 1st 2 bytes
x b = _b; rt = _b->rt; ss = i; // set base class members, for appl and anchor class use
x gud = 1; // say space in use and record good
x} // record::init
#endif
//-----------------------------------------------------------------------------
int record::IsNameMatch( const char* _name) const
{
#if 0 // 7-2-2013
x return strMatch( _name, name);
#else
// Note: prior (1994) version disregarded unexpected excess chars
return !_strnicmp( _name, name, sizeof(ANAME)-1);
#endif
} // record::IsNameMatch
//-----------------------------------------------------------------------------
/*virtual*/ record& record::CopyFrom(
Expand Down Expand Up @@ -257,6 +223,17 @@ const char* record::getChoiTx(

} // record::getChoiTx
//-----------------------------------------------------------------------------
record* record::getOwner() const
// return ptr to owner record
// NULL if linkage bad
{
BP bOf = b->ownB;
record* r = bOf ? bOf->GetAtSafe(ownTi) : NULL;
if (!r)
oer("getOwner() fail for %s", objIdTx());
return r;
} // record::getOwner
//-----------------------------------------------------------------------------
const char* record::whatIn() const // return basAnc record owner text
// e.g. "zone 'Z1'" or "sgdist 'foo' of glazing 'gl1' of zone 'Z1'"
{
Expand Down
30 changes: 29 additions & 1 deletion src/ANCREC.H
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class basAnc // base class for record anchors: basAnc<recordName>
// members set at construction only
SFIR* fir; // pointer to record type's "small fields-in-record table" (in srfd.cpp)
USI nFlds; // number of fields excluding base-class members (front overhead)
char* what; // name of the record group (for probes, error messages)
const char* what; // name of the record group (for probes, error messages)
USI eSz; // record size
USI sOff; // offset in record to "status byte" array at end
USI ancN; // anchor number
Expand Down Expand Up @@ -262,6 +262,7 @@ class record // base class for records

RC oerI( int shoTx, int shoFnLn, int isWarn, const char* fmt, va_list ap) const;

record* getOwner() const;
const char* whatIn() const;
const char* objIdTx( int op=0) const;
const char* classObjTx( int op=0) const;
Expand Down Expand Up @@ -306,6 +307,7 @@ template <class T> class anc : public basAnc
virtual void * recMbr(TI i, USI off) { return (void *)((char *)(p + i) + off); } // point record i member by offset
RC add( T **r, int erOp, TI i = 0) { return basAnc::add((record * *)r, erOp, i); }
RC RunDup( const anc< T> &src, BP _ownB=NULL, int erOp=ABT);
RC AllocResultsRecs(basAnc& src);
void statSetup( T &r, TI n=1, SI noZ=0, SI inHeap=0) { basAnc::statSetup( r, n, noZ, inHeap); }
int GetCount( int options=0) const;

Expand Down Expand Up @@ -438,6 +440,32 @@ template <class T> RC anc<T>::RunDup( // duplicate records for run
return rc;
} // anc<T>::RunDup
//-----------------------------------------------------------------------------
template <class T> RC anc<T>::AllocResultsRecs( // allocate/init results records
basAnc& src) // Source run records
// allocates N+1 results record< T>s (1..N paired with run recs; N+1 = sum)
// sets names to match src; 0s all values
// returns RCOK iff success
{
RC rc = RCOK;
int i = src.n + 1;
rc = al(i, WRN); // alloc all recs at once for less fragmentation. destroys old.
T* pR;
if (!rc) do
{ rc |= add(&pR, WRN, i); // init (to 0) results record, 1 thru i.
const char* name;
if (i > src.n)
name = strtprintf("sum_of_%s", src.what);
else
{ name = src.rec(i).name;
if (IsBlank(name))
name = strtprintf("%s_%d", src.what, i);
pR->SetName(name); // results records have same name as their source
}
} while (--i > 0);

return rc;
} // anc< T>::AllocResultsRecs
//-----------------------------------------------------------------------------
#if defined( _DEBUG)
template <class T> T* anc<T>::GetAt( int i) const
{
Expand Down
Loading