Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e506cb6
NANDAT WIP
chipbarnaby Feb 27, 2023
125e887
NANDAT progress
chipbarnaby Feb 28, 2023
484bd45
Merge branch 'main' into nandat
chipbarnaby Feb 28, 2023
5db4d3f
CULT changes re NCHOICE
chipbarnaby Mar 2, 2023
c73896d
Merge cultdump
chipbarnaby Mar 2, 2023
dcedf87
Resolve cncult.cpp merge conflicts
chipbarnaby Mar 2, 2023
982a71e
CULSTR initial implementation
chipbarnaby Mar 8, 2023
f51c5b8
Merge branch 'main' into alt-string-ptrs
chipbarnaby Mar 8, 2023
d3551cf
CULSTR conversion (compiles, does not run)
chipbarnaby Mar 8, 2023
b5abdfb
CULSTR progress
chipbarnaby Mar 10, 2023
a2ee030
CULSTR WIP (before ANAME change)
chipbarnaby Mar 13, 2023
cba1c49
CULSTR WIP
chipbarnaby Mar 15, 2023
024e2a3
CULSTR WIP
chipbarnaby Mar 16, 2023
ec4d49a
Fixed all CULSTR uses in application code
chipbarnaby Mar 16, 2023
91183d6
Merge branch 'nandat' into alt-string-ptrs
chipbarnaby Mar 16, 2023
138b39d
VALDNT reorg WIP
chipbarnaby Mar 16, 2023
2539865
VALNDT progress
chipbarnaby Mar 17, 2023
544bf8d
Destructor rework
chipbarnaby Mar 20, 2023
049e632
CULSTR natvis; debug progress
chipbarnaby Mar 22, 2023
4037cbb
CULSTR progress
chipbarnaby Mar 26, 2023
0d12fe1
Merge from main
chipbarnaby Apr 21, 2023
09aa8dc
Fix cnglob.h
chipbarnaby Apr 21, 2023
99fbe63
Merge branch 'main' into alt-string-ptrs
chipbarnaby May 1, 2023
dcbe9a1
Merge from main
chipbarnaby May 20, 2023
aba2fc1
Restart work branch
chipbarnaby May 22, 2023
0892721
Debugging progress
chipbarnaby May 23, 2023
064b17e
Change 'name' to 'Name()'
chipbarnaby May 24, 2023
bf611fd
Merge branch 'main' into alt-string-ptrs
chipbarnaby May 24, 2023
059d305
CULSTR progress
chipbarnaby May 31, 2023
4a4bfcf
CULSTR tweaks
chipbarnaby May 31, 2023
fd5e7d0
Merge branch 'main' into alt-string-ptrs
chipbarnaby Jun 4, 2023
6ad207f
Debug progress
chipbarnaby Jun 12, 2023
3cd2999
Merge in branch main
chipbarnaby Jun 14, 2023
6b18753
All tests OK (w/o exman USEVECT)
chipbarnaby Jul 14, 2023
a11d3f6
Cleanup; some tweaks re 64 bit
chipbarnaby Jul 16, 2023
c73cc3c
New test commands.cse and associated fixes
chipbarnaby Jul 17, 2023
4217460
Testable 32-bit version; add commands.cse test
chipbarnaby Jul 17, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/test/error_handling/*.spl
# !/test/*.exe see below

test2/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange, but mostly harmless.


# User-specific files
*.suo
*.user
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ set(source
vrpak.cpp
wfpak.cpp
yacam.cpp
culstr.natvis
"${CMAKE_CURRENT_BINARY_DIR}/srfd.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/untab.cpp"
)
Expand Down
8 changes: 4 additions & 4 deletions src/CNDTYPES.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ FLOATP -- "float *"
VOIDP -- "void *"
DOW -- "short" // day of week, sun=0 in tdpak (1 less than DOWCH)
MONTH -- "short" // month, jan=1 in tdpak
CH XCH "char"
CHP -- "char *"
CH XCH "char"
CULSTR -- "struct CULSTR"
UCH -- "unsigned char"
TI -- "SI" // (rat) table index (subscript); 0 means unset.

Expand All @@ -100,8 +100,8 @@ MASSLAYERP -- "struct MASSLAYER *"
MASSMODELP -- "class MASSMODEL *"
IZXRATP -- "class IZXRAT *"

VALNDT -- "struct { void *val; USI ty; }" // value and data type, for user-defined reports
// code in cul.cpp,exman.cpp assumes .val is 1st member.*/
VALNDT -- "struct VALNDT" // value and data type, for user-defined reports
// code in cul.cpp,exman.cpp assumes .val is 1st member.*/

// change ids to be like ZHXTY (bits already match)?
// TCCM -- // terminal capability control method
Expand Down
3 changes: 1 addition & 2 deletions src/CNFIELDS.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ DOY DOY LMDOY UNNONE
SHOY SHOY LMNONE UNNONE
USI USI LMNONE UNNONE
LI LI LMNONE UNNONE
//CH CH LMNONE UNNONE unused 5-95, restore when desired
CHP CHP LMNONE UNNONE
CULSTR CULSTR LMNONE UNNONE
FLOAT FLOAT LMNONE UNNONE
FLOAT_GEZ FLOAT LMGEZ UNNONE
FLOAT_GZ FLOAT LMGZ UNNONE
Expand Down
68 changes: 33 additions & 35 deletions src/CNRECS.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
*declare "RC tp_FazInit();"
*declare "void tp_ClearAuszFlags();"
*declare "RC tp_Wfile( int* pHotMo);"
*declare "RC tp_WthrInit();"
*declare "RC tp_LocInit();"
*declare "RC tp_LocDone();"
*declare "int tp_AuszWthrSource() const;"
Expand Down Expand Up @@ -180,8 +179,8 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
// see tp_SetCheckTimesteps()

//TOP: inputs: location/air properties/ground properties
*f CHP tp_wfName // weather file path string
*f CHP tp_TDVfName // TDV (time dependent value) file path string
*f CULSTR tp_wfName // weather file path string
*f CULSTR tp_TDVfName // TDV (time dependent value) file path string
*r LEN elevation // site elevation (for determining air density) (ft). defaults from weather file 1-95.
*f TEMP refTemp // temp for computing the hum ratio (w) used in air-density calculations, default 70 F
*f FRAC_GZ refRH // relative humidity (as fraction) ditto, default .6 (60%).
Expand Down Expand Up @@ -299,35 +298,35 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
*i *ARRAY 13 TI tp_coolDsCond // TI[ 13] DESCOND idx(s) + 0 terminator

//TOP: inputs: reporting and exporting
*r CHP tp_exePath // full path to current .exe
*r CHP tp_exeInfo // info about current .exe (from header)
*r CULSTR tp_exePath // full path to current .exe
*r CULSTR tp_exeInfo // info about current .exe (from header)
// build timestame, linker version, code size
*r INT tp_exeCodeSize // code size, bytes (from exe header)
*r CHP tp_progVersion // program version identifier as string (for probing); set from ::ProgVersion
*r CHP tp_HPWHVersion // Ecotope HPWH (heat pump water heater) model version
*r CHP tp_cmdLineArgs // command line args for current input file
*r CULSTR tp_progVersion // program version identifier as string (for probing); set from ::ProgVersion
*r CULSTR tp_HPWHVersion // Ecotope HPWH (heat pump water heater) model version
*r CULSTR tp_cmdLineArgs // command line args for current input file
// updated during session if multiple input files specified on command line
*i SI runSerial // run #, 000-999, per (future 11-91) status file (meanwhile, see cnguts:cnRunSerial 7-92).
*i CHP runTitle // user text for report titles, footers, export title 11-22-91.
*r CHP runDateTime // run date & time string, set by cncult2.cpp:topStarPrf2(), used in reports & bin res file, 9-94.
*i CULSTR runTitle // user text for report titles, footers, export title 11-22-91.
*r CULSTR runDateTime // run date & time string, set by cncult2.cpp:topStarPrf2(), used in reports & bin res file, 9-94.
//inputs for binary results files, for NREL, rob 11-93. *r cuz settable from cmd line switches.
*r NOYESCH tp_brs // YES to generate basic binary results file, default NO. From input file or cmd line switch.
*r NOYESCH tp_brHrly // YES to generate hourly binary results file, default NO. From input file or cmd line.
// brf and brfHrly are intended to be independent, except monthly-hourly averages
// in basic file may only be computed if brfHrly is also on, 11-20-93.
*i CHP tp_brFileName // file name for binary results, extension .brs and/or .bhr added. default: input file name.
// settable in DLL version only, only by command line switches. Default is file output (if brs/brHrly) only.
*i CULSTR tp_brFileName // file name for binary results, extension .brs and/or .bhr added. default: input file name.
// settable in DLL version only, only by command line switches. Default is file output (if brs/brHrly) only.
*r BOO tp_brMem // Put binary results in Windows global memory and return handles; do not write file.
*r BOO tp_brDiscardable // Put binary results in discardable memory as well as file, return handles. overrides brfMem.

//TOP: inputs: report page formatting 11-91
*i CHP repHdrL // user-spec'd text for left end of report header line
*i CHP repHdrR // .. right
//TOP: inputs: report page formatting
*i CULSTR repHdrL // user-spec'd text for left end of report header line
*i CULSTR repHdrR // .. right
*i SI repCpl // report characters per line
*i SI repLpp // total number of lines per page (paper size)
*i SI repTopM // top margin in lines; # newlines written above header
*i SI repBotM // bottom margin in lines; not actually output
*i CHP tp_repTestPfx // prefix pre-pended to e.g. footer lines re hiding lines re automated testing
*i CULSTR tp_repTestPfx // prefix pre-pended to e.g. footer lines re hiding lines re automated testing
// "" for normal runs, "!" re 3-2010 test framework. new 3-28-10
*declare "const char* tp_RepTestPfx() const;"

Expand Down Expand Up @@ -443,9 +442,9 @@ RECORD TOPRAT "top" *RAT /* top level RAT: contains control info and all once-on
*declare "int tp_NHrTicks() const { return tp_nSubSteps*tp_nSubhrTicks; }"

//TOP: runtime: simulation date/time variables
*m ANAME monStr // Month being simulated as (non-heap) string
*m CULSTR monStr // Month being simulated
// autoSizing: "heating design day", or month for cooling.
*d CHP dateStr // Date being simulated as heap string
*d CULSTR dateStr // Date being simulated as heap string
// autoSizing: eg "heating design day" or "Jul cooling design day".
*d IDATE tp_date // Date: .month is 1-12, .mday 1-31, .wday 0-6. set/used: cnguts. used:cuparse;cgsolar;cgresult;cgenbal.
// autoSizing: cool: near-mid-month day as used for solar calcs; heat: Dec 21. jDay ditto.
Expand Down Expand Up @@ -1683,14 +1682,14 @@ RECORD FNDBLOCK "foundationBlock" *RAT // foundation component input info

//========================================================================================================
RECORD RFI "reportFile" *RAT // REPORTFILE (RfiB) and EXPORTFILE (XfiB) (.what altered) input records.
*exdes // cncult4.cpp: frees .fileName
*prefix rf_
*ovrcopy
*declare "RC rf_CkF( int isExport);"
*declare "RC rf_CkF2( int isExport);"
*declare "RC rf_CheckForDupFileName();"
*declare "int rf_CheckAccessAndAlias( const char* fName, char* &fNameAlias, const char** ppMsg=NULL);"
//input
*i CHP fileName // file name, path optional, in dm (or pseudocode, but not "text"). *i cuz VEOI in cncult.
*i CULSTR rf_fileName // file name, path optional, in dm (or pseudocode, but not "text"). *i cuz VEOI in cncult.
*r FILESTATCH fileStat // fresh(overwrite,default)/new(err if exists)/append
*i NOYESCH pageFmt // page formatting on no/yes
//derived
Expand All @@ -1701,7 +1700,6 @@ RECORD RFI "reportFile" *RAT // REPORTFILE (RfiB) and EXPORTFILE (XfiB) (.what a
//=============================================================================
RECORD RI "report" *RAT // REPORT (RiB) and EXPORT (XiB) (.what altered) input records
*prefix ri_
*exdes // cncult4.cpp: frees .rpTitle
*ovrcopy
*declare "RC ri_CkF();"
*declare "RC ri_oneRxp();"
Expand All @@ -1719,7 +1717,7 @@ RECORD RI "report" *RAT // REPORT (RiB) and EXPORT (XiB) (.what altered) input r
*i DOY rpDayEnd // end ..
*i FLOAT_GZ rpBtuSf // energy (Btu) scale factor
*s *e LI rpCond // condition: if given, rpt lines omitted when FALSE (SI; LI used to hold NAN) (LI currently unprobeable)
*i CHP rpTitle // title, for UDT, in dm
*i CULSTR rpTitle // title, for UDT, in dm
*i SI rpCpl // chars per line, inputtable re UDT's (default -1="as wide as needed")
*i RPTHDCH rpHeader // table header or export header yes/no (default yes)
*i NOYESCH rpFooter // table footer (summary line) or export footer (just blank line?) yes/no (default yes)
Expand All @@ -1742,19 +1740,18 @@ RECORD COL "reportCol" *RAT // holds info for columns in user-defined table repo
*declare "virtual RC Validate( int options=0);"

//input .ownTi is RI subscript of owning report/export. Column order is order of input.
*i CHP colHead // column head string, in dm. *i cuz VEOI in cncult.cpp:rpColT[].
*i CULSTR colHead // column head string, in dm. *i cuz VEOI in cncult.cpp:rpColT[].
*i SI_GEZ colGap // space to left of column, default 1
*i SI colWid // column width
*i SI colDec // colDecimals: max digits after point
*i JUSTCH colJust // justification: C_JUSTCH_L or _R
*s *p VALNDT colVal // value .val and data type .dt (TYFL/TYSTR in input, DTFLOAT/DTCHP in run), used at end report interval.
//derived
*s *p VALNDT colVal // value vt_val and data type vt_dt (TYFL/TYSTR in input, DTFLOAT/DTCULSTR in run), used at end report interval.
// derived
TI nxColi // for runtime: COL subscript of next column in this report, 0 if last one
*END // COL
//=============================================================================
RECORD DVRI "dvri" *hideall *RAT // Date-dependent Virtual Report Info -- at runtime (DvriB)
*prefix dv_
*exdes // cncult4.cpp. frees rpTitle
*ovrcopy
*declare "void dv_vpDHWMtrRow( struct RXPORTINFO* rxt, TI dhwMtri=-1);"
*declare "void dv_vpAfMtrRow( struct RXPORTINFO* rxt, TI afMtri=-1);"
Expand All @@ -1775,7 +1772,7 @@ RECORD DVRI "dvri" *hideall *RAT // Date-dependent Virtual Report Info -- at run
*r float rpBtuSf // energy (Btu) scale factor
*s LI rpCond // condition: if given, report lines omitted when FALSE (SI; LI used to hold NAN for expression)
*r SI rpCondGiven // nz if user-given condition: may be reflected in title (when 0, rpCond is TRUE).
*r CHP rpTitle // title, for UDT, in dm
*r CULSTR rpTitle // title, for UDT, in dm
*r SI rpCpl // chars per line, inputtable for UDT's
*r RPTHDCH rpHeader // table header or export header yes/no/col (default yes)
*r NOYESCH rpFooter // table footer (summary line) or export footer (just blank line) yes/no (default yes)
Expand All @@ -1791,6 +1788,7 @@ RECORD DVRI "dvri" *hideall *RAT // Date-dependent Virtual Report Info -- at run
*END // DVRI
//=============================================================================
RECORD IMPF "importFile" *RAT // IMPORTFILE input (Impfib) and run (ImpfiB) records
*prefix im_
*exdes // destructor (cncult4.cpp) frees heap items
*ovrcopy
*declare "BOO FC scanHdr();" // impf.ccp member fcns
Expand All @@ -1801,9 +1799,9 @@ RECORD IMPF "importFile" *RAT // IMPORTFILE input (Impfib) and run (ImpfiB) reco
*declare "void FC close();"
*declare "void FC fnrtAl(SI nNfnr);"
//input. name is required.
*f CHP fileName // file name, path optional, in heap or pseudocode. *i cuz VEOI in cncult. RQD.
*f CHP imTitle // title string. If given, file's must match.
*z SI imPhaseSpare // for possible future AUTOSIZE/MAINSIM/BOTH choice 6-95
*f CULSTR im_fileName // file name, path optional, in heap or pseudocode. *i cuz VEOI in cncult. RQD.
*f CULSTR im_title // title string. If given, file's must match.
// *z SI imPhaseSpare .. idea for possible future AUTOSIZE/MAINSIM/BOTH choice
*i IVLCH imFreq // frequency of record reads, Y M D H; HS and Subhour not allowed. RQD.
*f NOYESCH hasHeader // file has header no/yes, default yes.
*i *hide NOYESCH imBinary // possible future binary file option. default no.
Expand All @@ -1816,7 +1814,7 @@ RECORD IMPF "importFile" *RAT // IMPORTFILE input (Impfib) and run (ImpfiB) reco
*declare "FILE* fh;" // file handle. Initial value, NULL, is not a valid file handle.
*r LI posEndHdr // file pointer after header, for repositioning file after warmup
//buffer
*r *hide CHP buf // file buffer, in heap
*declare "char* buf;" // file buffer, in heap
*r USI bufSz // 0 or allocated size of buffer (actually 1 larger to hold \0)
*h USI bufN // number of characters in buffer === subscript of 1st unused byte
*h BOO eofRead // TRUE after end file has been input to buffer (unused records may remain in buffer)
Expand Down Expand Up @@ -3409,7 +3407,7 @@ x *declare "RC rs_SetDefaultsClg();"
*declare "enum { rsmOFF, rsmHEAT, rsmCOOL, rsmOAV, rsmCOUNT };"

*i RSYSTY rs_type // system type (ACFURN, ACRES, ASHP, AC, FURN, RES)
*i CHP rs_desc // optional description string (e.g. model #)
*i CULSTR rs_desc // optional description string (e.g. model #)
// included in perf map,
*i NOYESCH rs_perfMap // if YES, make performance map (development aid)
// writes file <PM_name>.csv
Expand Down Expand Up @@ -4251,10 +4249,10 @@ RECORD DHWSYS "DHWSYS" *RAT // input / runtime DHW system
*s *e FLOAT ws_tOutPrimLT; // primary water heater outlet temp, F
// for HPWH only, re DHWLOOPHEATER entering temp
// best estimate from prior 1-min tick
*d TI ws_dayUsei; // idx of DHWDAYUSE
*d CHP ws_dayUseName; // name of DHWDAYUSE (resolved at runtime)
*d TI ws_dayUsei; // idx of DHWDAYUSE
*d CULSTR ws_dayUseName; // name of DHWDAYUSE (resolved at runtime)
*r INT ws_childDHWDAYUSEFlag; // nz iff at least one child DHWSYS has specified ws_dayUseName
*declare "bool ws_HasDHWDAYUSEDraws() const { return ws_dayUseName != NULL || ws_childDHWDAYUSEFlag; }"
*declare "bool ws_HasDHWDAYUSEDraws() const { return ws_dayUseName.IsSet() || ws_childDHWDAYUSEFlag; }"
*h FLOAT_GEZ ws_parElec; // electrical parasitic power, W
// for e.g. unmodeled recirculation pumps
*i FLOAT_GZ ws_SDLM; // standard distribution loss multiplier
Expand Down
Loading