Skip to content

Commit 468d57d

Browse files
committed
dhwcalc hpwh debug dump enhancement
Experiments re reducing windows dependency
1 parent cbf478d commit 468d57d

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

src/CNGLOB.H

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ typedef long long LLI; // signed 64 bit integer
8787
typedef unsigned long long ULLI;
8888
//typedef int BOOL; if needed: // 16 or 32 bit Boolean, matches windows.h.
8989

90+
#undef ELIMINATE_WINDOWS // #define to eliminate Windows dependencies
91+
// work in progress, 10-2017
92+
#if defined( ELIMINATE_WINDOWS)
93+
// typedefs based on windows.h
94+
typedef unsigned long DWORD;
95+
typedef unsigned int UINT;
96+
typedef unsigned int BOOL;
97+
typedef unsigned short WORD;
98+
typedef char TCHAR;
99+
typedef unsigned char BYTE;
100+
#define _T(s) s
101+
#endif
102+
90103
#define LOCAL static // for file-local functions: a clearer word than "static"
91104
#define STATIC static // for local data; static un-doable for (former) debugging
92105
#define REFDATA static // For readonly, pak-specific data which could be overlayed
@@ -141,7 +154,9 @@ struct CULT;
141154

142155
#else
143156

157+
#if !defined( ELIMINATE_WINDOWS)
144158
#include <windows.h>
159+
#endif
145160

146161
#include <string.h>
147162
#include <stddef.h>

src/DHWCalc.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,21 +1607,28 @@ RC DHWHEATER::wh_HPWHDoSubhr( // HPWH subhour
16071607
static FILE* pF = NULL; // file
16081608
if (bWriteCSV)
16091609
{ if (!pF)
1610-
{ const char* fName = strtprintf( "HPWH_%s.csv", name);
1610+
{
1611+
#if 1
1612+
// dump file name = <cseFile>_hpwh.csv
1613+
const char* fName =
1614+
strsave( strffix2( strtprintf( "%s_hpwh", InputFilePathNoExt), ".csv", 1));
1615+
#else
1616+
x const char* fName = strtprintf( "HPWH_%s.csv", name);
1617+
#endif
16111618
pF = fopen( fName, "wt");
16121619
if (!pF)
16131620
err( PWRN, "HPWH report failure for '%s'", fName);
16141621
else
16151622
{ // headings
1616-
fprintf( pF, "%s\n",wh_desc, Top.runDateTime);
1617-
fprintf( pF, "%s%s %s %s HPWH %s %s\n",
1623+
fprintf( pF, "%s,%s,%s\n",wh_desc, Top.repHdrL,Top.runDateTime);
1624+
fprintf( pF, "%s%s %s %s HPWH %s\n",
16181625
Top.tp_RepTestPfx(), ProgName, ProgVersion, ProgVariant,
1619-
Top.tp_HPWHVersion, Top.runDateTime);
1626+
Top.tp_HPWHVersion);
16201627
#if defined( HPWH_DUMPSMALL)
16211628
fprintf( pF, "minYear,draw( L)\n");
16221629
#else
16231630
wh_pHPWH->WriteCSVHeading( pF, "month,day,hr,min,minDay,"
1624-
"tEnv (C),tSrcAir (C),"
1631+
"tOut (C),tEnv (C),tSrcAir (C),"
16251632
"tInlet (C),tSetpoint (C),draw (gal),draw (L),");
16261633
#endif
16271634
}
@@ -1634,9 +1641,9 @@ RC DHWHEATER::wh_HPWHDoSubhr( // HPWH subhour
16341641
fprintf( pF, "%0.2f,%0.3f\n", minYear, GAL_TO_L( drawForTick));
16351642
#else
16361643
wh_pHPWH->WriteCSVRow( pF, strtprintf(
1637-
"%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.3f,%0.3f,",
1644+
"%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f,%0.2f, %0.3f,%0.3f,",
16381645
Top.tp_date.month, Top.tp_date.mday, Top.iHr+1, minHr, minDay,
1639-
DegFtoC( wh_tEx), DegFtoC( wh_ashpTSrc),
1646+
DegFtoC( Top.tDbOSh),DegFtoC( wh_tEx),DegFtoC( wh_ashpTSrc),
16401647
DegFtoC( pWS->ws_tInlet), DegFtoC( pWS->ws_tSetpoint),
16411648
drawForTick, GAL_TO_L( drawForTick)));
16421649
#endif

src/csevrsn.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
// version # for current build
1515
// change ONLY here
1616
#define CSEVRSN_MAJOR 0
17-
#define CSEVRSN_MINOR 843
17+
#define CSEVRSN_MINOR 844
1818

1919
// version # as quoted text ("x.xxx")
2020
#define CSEVRSN_TEXT MAKE_LIT(CSEVRSN_MAJOR##.##CSEVRSN_MINOR)
2121

2222
// ONLY comments below here
2323

2424
/* History:
25+
0.844: ...
2526
0.843: BATTERY last hour values; DESCOND prelim version; 10-10-17
2627
0.842: btChgReq eval stage bug fix (cncult.cpp), 9-12-2017
2728
0.841: release version with post-ivl evaluation, autosize refinements, 9-12-2017

0 commit comments

Comments
 (0)