Skip to content

Commit

Permalink
Merge pull request #8432 from energy-plus/global-state-outputReportTa…
Browse files Browse the repository at this point in the history
…bular

Global OutputReportTabular
  • Loading branch information
mitchute authored Dec 30, 2020
2 parents e8db4c1 + d8b9057 commit c871da1
Show file tree
Hide file tree
Showing 21 changed files with 4,055 additions and 4,347 deletions.
16 changes: 6 additions & 10 deletions src/EnergyPlus/ChillerAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@
#include <EnergyPlus/PlantUtilities.hh>
#include <EnergyPlus/UtilityRoutines.hh>

namespace EnergyPlus {

namespace ChillerAbsorption {
namespace EnergyPlus::ChillerAbsorption {

// MODULE INFORMATION:
// AUTHOR Dan Fisher
Expand Down Expand Up @@ -231,7 +229,7 @@ namespace ChillerAbsorption {
// METHODOLOGY EMPLOYED:
// EnergyPlus input processor

static std::string const RoutineName("GetBLASTAbsorberInput: "); // include trailing blank space
constexpr const char * RoutineName("GetBLASTAbsorberInput: "); // include trailing blank space

int AbsorberNum; // Absorber counter
int NumAlphas; // Number of elements in the alpha array
Expand Down Expand Up @@ -602,7 +600,7 @@ namespace ChillerAbsorption {
// METHODOLOGY EMPLOYED:
// Uses the status flags to trigger initializations.

static std::string const RoutineName("InitBLASTAbsorberModel");
constexpr const char * RoutineName("InitBLASTAbsorberModel");

// Init more variables
if (this->MyOneTimeFlag) {
Expand Down Expand Up @@ -870,8 +868,8 @@ namespace ChillerAbsorption {

// Real64 SteamMassFlowRate; // steam mass flow rate through generator

static std::string const RoutineName("SizeAbsorpChiller");
static std::string const RoutineNameLong("SizeAbsorptionChiller");
constexpr const char * RoutineName("SizeAbsorpChiller");
constexpr const char * RoutineNameLong("SizeAbsorptionChiller");

int PltSizSteamNum(0); // Plant Sizing index for steam heating loop
int PltSizHeatingNum(0); // Plant Sizing index for how water heating loop
Expand Down Expand Up @@ -1371,7 +1369,7 @@ namespace ChillerAbsorption {
// 1. BLAST User Manual
// 2. Absorber User Manual

static std::string const RoutineName("CalcBLASTAbsorberModel");
constexpr const char * RoutineName("CalcBLASTAbsorberModel");

Real64 EvapDeltaTemp(0.0); // C - evaporator temperature difference, water side

Expand Down Expand Up @@ -1802,6 +1800,4 @@ namespace ChillerAbsorption {
}
}

} // namespace ChillerAbsorption

} // namespace EnergyPlus
4 changes: 2 additions & 2 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace EnergyPlus {
this->dataOutdoorAirUnit = std::make_unique<OutdoorAirUnitData>();
this->dataOutput = std::make_unique<OutputsData>();
this->dataOutputProcessor = std::make_unique<OutputProcessorData>();
this->dataOutputReportTabular = std::make_unique<OutputReportTabularData>();
this->dataOutRptTab = std::make_unique<OutputReportTabularData>();
this->dataOutputReportTabularAnnual = std::make_unique<OutputReportTabularAnnualData>();
this->dataOutsideEnergySrcs = std::make_unique<OutsideEnergySourcesData>();
this->dataPTHP = std::make_unique<PackagedTerminalHeatPumpData>();
Expand Down Expand Up @@ -437,7 +437,7 @@ namespace EnergyPlus {
this->dataOutdoorAirUnit->clear_state();
this->dataOutput->clear_state();
this->dataOutputProcessor->clear_state();
this->dataOutputReportTabular->clear_state();
this->dataOutRptTab->clear_state();
this->dataOutputReportTabularAnnual->clear_state();
this->dataOutsideEnergySrcs->clear_state();
this->dataPTHP->clear_state();
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<OutputProcessorData> dataOutputProcessor;
std::unique_ptr<OutputReportPredefinedData> dataOutRptPredefined;
std::unique_ptr<OutputReportTabularAnnualData> dataOutputReportTabularAnnual;
std::unique_ptr<OutputReportTabularData> dataOutputReportTabular;
std::unique_ptr<OutputReportTabularData> dataOutRptTab;
std::unique_ptr<OutputsData> dataOutput;
std::unique_ptr<OutsideEnergySourcesData> dataOutsideEnergySrcs;
std::unique_ptr<PVWattsData> dataPVWatts;
Expand Down
35 changes: 17 additions & 18 deletions src/EnergyPlus/EconomicLifeCycleCost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,6 @@ namespace EconomicLifeCycleCost {
using OutputReportTabular::WriteReportHeaders;
using OutputReportTabular::WriteSubtitle;
using OutputReportTabular::WriteTable;
using OutputReportTabular::displayLifeCycleCostReport;

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
Expand Down Expand Up @@ -2126,11 +2125,11 @@ namespace EconomicLifeCycleCost {
int numYears;
Real64 totalPV;

if (LCCparamPresent && displayLifeCycleCostReport) {
if (LCCparamPresent && state.dataOutRptTab->displayLifeCycleCostReport) {
//---------------------------------
// Life-Cycle Cost Verification and Results Report
//---------------------------------
WriteReportHeaders("Life-Cycle Cost Report", "Entire Facility", OutputProcessor::StoreType::Averaged);
WriteReportHeaders(state, "Life-Cycle Cost Report", "Entire Facility", OutputProcessor::StoreType::Averaged);
//---- Life-Cycle Cost Parameters
rowHead.allocate(11);
columnHead.allocate(1);
Expand Down Expand Up @@ -2209,7 +2208,7 @@ namespace EconomicLifeCycleCost {
}
}
columnWidth = 14; // array assignment - same for all columns
WriteSubtitle("Life-Cycle Cost Parameters");
WriteSubtitle(state, "Life-Cycle Cost Parameters");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2248,7 +2247,7 @@ namespace EconomicLifeCycleCost {
tableBody(jObj, iYear + 2) = RealToStr(UsePriceEscalation(jObj).Escalation(iYear), 6);
}
}
WriteSubtitle("Use Price Escalation");
WriteSubtitle(state, "Use Price Escalation");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2285,7 +2284,7 @@ namespace EconomicLifeCycleCost {
tableBody(jObj, iYear + 1) = RealToStr(UseAdjustment(jObj).Adjustment(iYear), 6);
}
}
WriteSubtitle("Use Adjustment");
WriteSubtitle(state, "Use Adjustment");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2326,7 +2325,7 @@ namespace EconomicLifeCycleCost {
tableBody(jObj, iYear + 1) = RealToStr(CashFlow(curCashFlow).yrAmount(iYear), 2);
}
}
WriteSubtitle("Cash Flow for Recurring and Nonrecurring Costs (Without Escalation)");
WriteSubtitle(state, "Cash Flow for Recurring and Nonrecurring Costs (Without Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2370,7 +2369,7 @@ namespace EconomicLifeCycleCost {
for (iYear = 1; iYear <= lengthStudyYears; ++iYear) {
tableBody(jObj, iYear) = RealToStr(CashFlow(costCatTotEnergy).yrAmount(iYear) + CashFlow(costCatWater).yrAmount(iYear), 2);
}
WriteSubtitle("Energy and Water Cost Cash Flows (Without Escalation)");
WriteSubtitle(state, "Energy and Water Cost Cash Flows (Without Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2420,7 +2419,7 @@ namespace EconomicLifeCycleCost {
for (iYear = 1; iYear <= lengthStudyYears; ++iYear) {
tableBody(jObj, iYear) = RealToStr(EscalatedTotEnergy(iYear) + CashFlow(costCatWater).yrAmount(iYear), 2);
}
WriteSubtitle("Energy and Water Cost Cash Flows (With Escalation)");
WriteSubtitle(state, "Energy and Water Cost Cash Flows (With Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2461,7 +2460,7 @@ namespace EconomicLifeCycleCost {
tableBody(3, iYear) = RealToStr(CashFlow(costCatOtherCapital).yrAmount(iYear), 2);
tableBody(4, iYear) = RealToStr(CashFlow(costCatTotCaptl).yrAmount(iYear), 2);
}
WriteSubtitle("Capital Cash Flow by Category (Without Escalation)");
WriteSubtitle(state, "Capital Cash Flow by Category (Without Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2514,7 +2513,7 @@ namespace EconomicLifeCycleCost {
tableBody(9, iYear) = RealToStr(CashFlow(costCatOtherOperational).yrAmount(iYear), 2);
tableBody(10, iYear) = RealToStr(CashFlow(costCatTotOper).yrAmount(iYear), 2);
}
WriteSubtitle("Operating Cash Flow by Category (Without Escalation)");
WriteSubtitle(state, "Operating Cash Flow by Category (Without Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2569,7 +2568,7 @@ namespace EconomicLifeCycleCost {
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)");
WriteSubtitle(state, "Operating Cash Flow by Category (With Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2626,7 +2625,7 @@ namespace EconomicLifeCycleCost {
tableBody(jObj, kMonth) = RealToStr(CashFlow(jObj).mnAmount(kMonth), 2);
}
}
WriteSubtitle("DEBUG ONLY - Monthly Cash Flows");
WriteSubtitle(state, "DEBUG ONLY - Monthly Cash Flows");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2659,7 +2658,7 @@ namespace EconomicLifeCycleCost {
tableBody(kMonth, iYear) = RealToStr(CashFlow(costCatTotGrand).mnAmount((iYear - 1) * 12 + kMonth), 2);
}
}
WriteSubtitle("Monthly Total Cash Flow (Without Escalation)");
WriteSubtitle(state, "Monthly Total Cash Flow (Without Escalation)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2747,7 +2746,7 @@ namespace EconomicLifeCycleCost {
}
}
tableBody(4, numRows + 1) = RealToStr(totalPV, 2);
WriteSubtitle("Present Value for Recurring, Nonrecurring and Energy Costs (Before Tax)");
WriteSubtitle(state, "Present Value for Recurring, Nonrecurring and Energy Costs (Before Tax)");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(tableBody,
Expand Down Expand Up @@ -2812,7 +2811,7 @@ namespace EconomicLifeCycleCost {
tableBody(1, 15) = RealToStr(CashFlow(costCatTotCaptl).presentValue, 2);
tableBody(1, 16) = RealToStr(CashFlow(costCatTotGrand).presentValue, 2);

WriteSubtitle("Present Value by Category");
WriteSubtitle(state, "Present Value by Category");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2852,7 +2851,7 @@ namespace EconomicLifeCycleCost {
rowHead(lengthStudyYears + 1) = "TOTAL";
tableBody(3, lengthStudyYears + 1) = RealToStr(totalPV, 2);

WriteSubtitle("Present Value by Year");
WriteSubtitle(state, "Present Value by Year");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down Expand Up @@ -2894,7 +2893,7 @@ namespace EconomicLifeCycleCost {
rowHead(lengthStudyYears + 1) = "TOTAL";
tableBody(5, lengthStudyYears + 1) = RealToStr(totalPV, 2);

WriteSubtitle("After Tax Estimate");
WriteSubtitle(state, "After Tax Estimate");
WriteTable(state, tableBody, rowHead, columnHead, columnWidth);
if (sqlite) {
sqlite->createSQLiteTabularDataRecords(
Expand Down
Loading

5 comments on commit c871da1

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

develop (mitchute) - x86_64-MacOS-10.15-clang-11.0.0: OK (2274 of 2274 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.

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2294 of 2294 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.

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1556 of 1556 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (721 of 721 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.

develop (mitchute) - Win64-Windows-10-VisualStudio-16: OK (2247 of 2247 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.