Skip to content

Commit

Permalink
Added operating cash flow by category with escalation table.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGlazer committed Aug 16, 2019
1 parent 540d127 commit bc2235a
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion src/EnergyPlus/EconomicLifeCycleCost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,7 @@ namespace EconomicLifeCycleCost {
rowHead.deallocate();
columnWidth.deallocate();
tableBody.deallocate();
//---- Operating Cash Flow by Category
//---- Operating Cash Flow by Category (Without Escalation)
rowHead.allocate(lengthStudyYears);
columnHead.allocate(10);
columnWidth.allocate(10);
Expand Down Expand Up @@ -2472,6 +2472,61 @@ namespace EconomicLifeCycleCost {
rowHead.deallocate();
columnWidth.deallocate();
tableBody.deallocate();
//---- Operating Cash Flow by Category (With Escalation)
rowHead.allocate(lengthStudyYears);
columnHead.allocate(10);
columnWidth.allocate(10);
columnWidth = 14; // array assignment - same for all columns
tableBody.allocate(10, lengthStudyYears);
tableBody = "";
columnHead(1) = "Energy";
columnHead(2) = "Water";
columnHead(3) = "Maintenance";
columnHead(4) = "Repair";
columnHead(5) = "Operation";
columnHead(6) = "Replacement";
columnHead(7) = "MinorOverhaul";
columnHead(8) = "MajorOverhaul";
columnHead(9) = "OtherOperational";
columnHead(10) = "Total";

for (iYear = 1; iYear <= lengthStudyYears; ++iYear) {
rowHead(iYear) = MonthNames(baseDateMonth) + ' ' + IntToStr(baseDateYear + iYear - 1);
tableBody(1, iYear) = RealToStr(EscalatedTotEnergy(iYear), 2);
tableBody(2, iYear) = RealToStr(CashFlow(costCatWater).yrAmount(iYear), 2);
tableBody(3, iYear) = RealToStr(CashFlow(costCatMaintenance).yrAmount(iYear), 2);
tableBody(4, iYear) = RealToStr(CashFlow(costCatRepair).yrAmount(iYear), 2);
tableBody(5, iYear) = RealToStr(CashFlow(costCatOperation).yrAmount(iYear), 2);
tableBody(6, iYear) = RealToStr(CashFlow(costCatReplacement).yrAmount(iYear), 2);
tableBody(7, iYear) = RealToStr(CashFlow(costCatMinorOverhaul).yrAmount(iYear), 2);
tableBody(8, iYear) = RealToStr(CashFlow(costCatMajorOverhaul).yrAmount(iYear), 2);
tableBody(9, iYear) = RealToStr(CashFlow(costCatOtherOperational).yrAmount(iYear), 2);
Real64 yearly_total_cost =
CashFlow(costCatTotOper).yrAmount(iYear) + EscalatedTotEnergy(iYear) - CashFlow(costCatTotEnergy).yrAmount(iYear);
tableBody(10, iYear) = RealToStr(yearly_total_cost, 2);
}
WriteSubtitle("Operating Cash Flow by Category (With Escalation)");
WriteTable(tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
rowHead,
columnHead,
"Life-Cycle Cost Report",
"Entire Facility",
"Operating Cash Flow by Category (With Escalation)");
}
if (ResultsFramework::OutputSchema->timeSeriesAndTabularEnabled()) {
ResultsFramework::OutputSchema->TabularReportsCollection.addReportTable(tableBody,
rowHead,
columnHead,
"Life-Cycle Cost Report",
"Entire Facility",
"Operating Cash Flow by Category (With Escalation)");
}
columnHead.deallocate();
rowHead.deallocate();
columnWidth.deallocate();
tableBody.deallocate();
//---- DEBUG ONLY - Monthly Cash Flows
bool showMonthlyCashFlows = false;
if (showMonthlyCashFlows) {
Expand Down

6 comments on commit bc2235a

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2506 of 2506 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (9 of 9 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1136 of 1136 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - Win64-Windows-10-VisualStudio-16: OK (2466 of 2466 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (666 of 669 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 666
  • Failed: 1
  • Timeout: 2

Build Badge Test Badge Coverage Badge

Please sign in to comment.