Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
# compiler: clang
# experimental: true
- os: macos
os_ver: "13"
os_ver: "14"
config: Release
arch: "64"
compiler: clang
Expand Down
19 changes: 9 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,36 +33,35 @@ macro(c_preprocess defFile)
-Dcompiler_arch=${CSE_BUILD_ARCHITECTURE}
-P "${PROJECT_SOURCE_DIR}/cmake/preprocess.cmake"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${defFile}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cndefns.h"
)
endmacro()

foreach(defFile ${defs})
c_preprocess(${defFile})
endforeach()


# Run RCDEF
add_custom_command(
OUTPUT
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/rcdef_success.txt"
BYPRODUCTS # RCDEF will not update these files if there are no detected changes, therefore they are not OUTPUTs
"${CMAKE_CURRENT_BINARY_DIR}/dtypes.h"
"${CMAKE_CURRENT_BINARY_DIR}/rccn.h"
"${CMAKE_CURRENT_BINARY_DIR}/dttab.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/srfd.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/untab.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/rcdef.sum"
COMMAND RCDEF "${CMAKE_CURRENT_BINARY_DIR}/cndtypes.i" "${CMAKE_CURRENT_BINARY_DIR}/cnunits.i" "${CMAKE_CURRENT_BINARY_DIR}/dtlims.i" "${CMAKE_CURRENT_BINARY_DIR}/cnfields.i" "${CMAKE_CURRENT_BINARY_DIR}/cnrecs.i" . NUL NUL NUL .
DEPENDS RCDEF "${CMAKE_CURRENT_BINARY_DIR}/cndtypes.i" "${CMAKE_CURRENT_BINARY_DIR}/cnunits.i" "${CMAKE_CURRENT_BINARY_DIR}/dtlims.i" "${CMAKE_CURRENT_BINARY_DIR}/cnfields.i" "${CMAKE_CURRENT_BINARY_DIR}/cnrecs.i"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)

# Needed to establish dependency for other targets that depend on generated RCDEF outputs
add_custom_target(generate_rcdef_outputs DEPENDS
"${CSE_BINARY_DIR}/src/dtypes.h"
"${CSE_BINARY_DIR}/src/rccn.h"
"${CSE_BINARY_DIR}/src/dttab.cpp"
"${CSE_BINARY_DIR}/src/srfd.cpp"
"${CSE_BINARY_DIR}/src/untab.cpp"
add_custom_target(generate_rcdef_outputs
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rcdef_success.txt
)


# Set CSE Version
add_custom_target(version_header
DEPENDS "${PROJECT_SOURCE_DIR}/src/csevrsn.in.h"
Expand Down Expand Up @@ -118,7 +117,6 @@ set(source
datfcns.cpp
dhwcalc.cpp
dhwsolar.cpp
dttab.cpp
exman.cpp
foundation.cpp
gmutil.cpp
Expand All @@ -138,6 +136,7 @@ set(source
wfpak.cpp
yacam.cpp
culstr.natvis
"${CMAKE_CURRENT_BINARY_DIR}/dttab.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/srfd.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/untab.cpp"
)
Expand Down Expand Up @@ -283,7 +282,7 @@ if(KIVA_GROUND_PLOT)
target_link_libraries(CSE PUBLIC groundplot)
endif()

add_dependencies(CSE version_header)
add_dependencies(CSE version_header generate_rcdef_outputs)

if (${CSE_COMPILER_NAME} STREQUAL "msvc" AND ${CSE_BUILD_ARCHITECTURE} STREQUAL "32")
set(executable_name "CSE")
Expand Down
38 changes: 5 additions & 33 deletions src/CNDTYPES.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Name Name Decl
------- ----- ------------------------- */
// char and variants: always 8 bits
CH -- "char"
UCH -- "unsigned char"

// SI and variants: always 16 bits
SI -- "int16_t"
Expand All @@ -78,38 +77,24 @@ TI -- "int32_t" // (rat) table index (subscript); 0 means unset.
LI -- "int64_t"
ULI -- "uint64_t"
#else
LI -- "int32_t"
ULI -- "uint32_t"
LI -- "int32_t"
ULI -- "uint32_t"
#endif

FLOAT -- "float"
FLOATP -- "float *"
// PERCENT -- "float" // restoring PERCENT restores code in cvpak.cpp
FLOAT -- "float"
DBL -- "double"

CULSTR -- "struct CULSTR" // string accessed via 4 byte handle

VOIDP -- "void *"

DOW -- "short" // day of week, sun=0 in tdpak (1 less than DOWCH)
MONTH -- "short" // month, jan=1 in tdpak

IDATE -- "struct {SI year;SI month;SI mday;SI wday;}"
ITIME -- "struct {SI hour;SI min;SI sec;}"
DOY -- "short"
SHOY -- "unsigned" // subhour of year: (jday*24 + ihr)*4 + subhr
// using jDay 1..365, ihr 0..23, subhr 0..3.
// value 0 thus reserved for unset. Rob 11-93.
// CAUTION: code in tdpak.cpp (at least) assumes IDATETIME is same as an IDATE followed by an ITIME. 9-89.
IDATETIME -- "struct {SI year;SI month;SI mday;SI wday;SI hour;SI min;SI sec;}"
LDATETIME -- "time_t"
SGTARGP -- "struct SGTARG *" // pointer to SGTARG for SGRAT.targ
MASSLAYERP -- "struct MASSLAYER *"
MASSMODELP -- "class MASSMODEL *"
IZXRATP -- "class IZXRAT *"


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

// change ids to be like ZHXTY (bits already match)?
// TCCM -- // terminal capability control method
Expand Down Expand Up @@ -149,14 +134,8 @@ AHMODE -- "enum { ahOFF=0,ahFAN=1,ahHEATBIT=2,ahHEATING=3,ahCOOLBIT=4,ahCOOL
// tldMAX: full power, tpTs >= setpoint
TOWLOADCASE -- "enum { tldMIN, tldSP, tldMAX }"

// pointer to XFILE structure (xiopak.h), added 1-94 for use in WFILE.
XFILEP -- "XFILE *"
//
WFileFormat -- "enum WFileFormat { UNK=-1,BSGS=1,BSGSdemo,ET1,ET2,CSW,T24DLL,EPW }"
// open wthr file type (comments: wfpak.h)
YACAMP -- "class YACAM *"
WDYEARP -- "class WDYEAR *"


// for radiant internal gains 11-95
// Radiant internal gains distribution table entry
Expand All @@ -177,13 +156,6 @@ RIGTARGTY -- "enum { nul,znTot,znTotO,znTotIz,znCAir,massI,massO }" // RIGDIST
RIGTARG -- "float" // rad int gain target (accum mbr)
RIGDIST -- "struct { RIGTARGTY targTy; TI targTi; float targFr; RIGTARG * targP; }" // comments above
// rIg distrib info table entry
RIGDISTP -- "RIGDIST *" // (array) ptr, for ZNR.rIgDist

ZNRP -- "class ZNR *"
XSURFP -- "struct XSURF *"
DUCTSEGP -- "class DUCTSEG*"
PIPESEGP -- "class PIPESEG*"


///////////////////////////////////////////////////////////////////////////////
// Choices: text <-> constant mapping
Expand Down
15 changes: 1 addition & 14 deletions src/CNFIELDS.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ FLOAT_LZ FLOAT LMLZ UNNONE
FRAC FLOAT LMFR UNNONE
FRAC_GZ FLOAT LMFGZ UNNONE
DBL DBL LMNONE UNNONE
//VOIDP VOIDP LMNONE UNNONE unused 5-95
IDATE IDATE LMNONE UNNONE

//----- Types required re RATs (Record Array Tables):
// for reference (subscript) to a RAT or table:
Expand Down Expand Up @@ -92,7 +90,7 @@ HUMRAT_GZ FLOAT LMFGZ UNNONE // humidity ratio. unitless; field a
ENERGY FLOAT LMNONE UNENERGY // Btu
POWER FLOAT LMNONE UNPOWER // Btuh
POWER_NZ FLOAT LMNZ UNPOWER // Many "POWER" fields actually
POWER_GZ FLOAT LMGZ UNPOWER // should be "ENERGY".
POWER_GZ FLOAT LMGZ UNPOWER // should be "ENERGY"
POWER_GEZ FLOAT LMGEZ UNPOWER // otta review them, 6-92.
//POWER_LEZ FLOAT LMLEZ UNPOWER // unused 9-92
KW_GZ FLOAT LMGZ UNELPWR2 // power entered in kW, internally in Btuh
Expand All @@ -116,10 +114,6 @@ HC_AREA FLOAT LMGEZ UNHEATCAP_AREA
//HC_AREA_GZ FLOAT LMGZ UNHEATCAP_AREA
HC_VOL FLOAT LMGZ UNHEATCAP_VOL
HOURS FLOAT LMGEZ UNHOURS // time interval in hours, rob 6-92
SGTARGP SGTARGP LMNONE UNNONE // pointer to an SGTARG
MASSLAYERP MASSLAYERP LMNONE UNNONE
MASSMODELP MASSMODELP LMNONE UNNONE
IZXRATP IZXRATP LMNONE UNNONE
TCCM TCCM LMNONE UNNONE // term capab ctrl method: enum { cmNONE, cmSo, ...
ZHXTY ZHXTY LMNONE UNNONE // zone hvac xfer type enum 3-92
TCUSE TCUSE LMNONE UNNONE // terminal capability use this subhour enum
Expand All @@ -128,15 +122,8 @@ TOWLOADCASE TOWLOADCASE LMNONE UNNONE // TOWERPLANT load case enum 9-92
COILUSED COILUSED LMNONE UNNONE // AH coil used 12-92

WFileFormat WFileFormat LMNONE UNNONE // open weather file type (see wfpak.h)
YACAMP YACAMP LMNONE UNNONE
WDYEARP WDYEARP LMNONE UNNONE

RIGTARG RIGTARG LMNONE UNNONE // radiant internal gain target (accumulator)
RIGDISTP RIGDISTP LMNONE UNNONE // ptr to array of above, for ZNR::rIgDist
ZNRP ZNRP LMNONE UNNONE
XSURFP XSURFP LMNONE UNNONE
DUCTSEGP DUCTSEGP LMNONE UNNONE
PIPESEGP PIPESEGP LMNONE UNNONE

// choice (choicb) types
NOYESCH NOYESCH LMNONE UNNONE
Expand Down
Loading