Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Feb 28, 2024
1 parent 35ab973 commit 0643f1d
Show file tree
Hide file tree
Showing 18 changed files with 538 additions and 619 deletions.
4 changes: 2 additions & 2 deletions src/EnergyPlus/BaseboardElectric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ namespace BaseboardElectric {
thisBaseboard.EquipName,
Constant::eResource::EnergyTransfer,
OutputProcessor::Group::HVAC,
OutputProcessor::EndUseCat::Baseboard);
OutputProcessor::EndUseCat::Baseboard);

SetupOutputVariable(state,
"Baseboard Total Heating Rate",
Expand All @@ -371,7 +371,7 @@ namespace BaseboardElectric {
OutputProcessor::StoreType::Sum,
thisBaseboard.EquipName,
Constant::eResource::Electricity,
OutputProcessor::Group::HVAC,
OutputProcessor::Group::HVAC,
OutputProcessor::EndUseCat::Heating);

SetupOutputVariable(state,
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ namespace BaseboardRadiator {
OutputProcessor::StoreType::Sum,
thisBaseboard.EquipID,
Constant::eResource::EnergyTransfer,
OutputProcessor::Group::HVAC,
OutputProcessor::Group::HVAC,
OutputProcessor::EndUseCat::Baseboard);

SetupOutputVariable(state,
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ExternalInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,7 @@ void GetReportVariableKey(
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
OutputProcessor::VariableType varType(OutputProcessor::VariableType::Invalid); // 0=not found, 1=integer, 2=real, 3=meter
int numKeys(0); // Number of keys found
OutputProcessor::StoreType varAvgSum(OutputProcessor::StoreType::Average); // Variable is Averaged=1 or Summed=2
OutputProcessor::StoreType varAvgSum(OutputProcessor::StoreType::Average); // Variable is Averaged=1 or Summed=2
OutputProcessor::TimeStepType varStepType(OutputProcessor::TimeStepType::Zone); // Variable time step is Zone=1 or HVAC=2
Constant::Units varUnits(Constant::Units::None); // Units sting, may be blank
Array1D_string keyNames;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACFan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ namespace HVACFan {
Constant::eResource::Electricity,
OutputProcessor::Group::HVAC,
OutputProcessor::EndUseCat::Fans,
m_endUseSubcategoryName);
m_endUseSubcategoryName);
SetupOutputVariable(state,
"Fan Air Mass Flow Rate",
Constant::Units::kg_s,
Expand Down
136 changes: 64 additions & 72 deletions src/EnergyPlus/OutputProcessor.cc

Large diffs are not rendered by default.

298 changes: 151 additions & 147 deletions src/EnergyPlus/OutputProcessor.hh

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/EnergyPlus/OutputReportTabular.hh
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ namespace OutputReportTabular {
int resIndex = 0; // result index - pointer to BinResults array
int numTables = 0;
OutputProcessor::VariableType typeOfVar = OutputProcessor::VariableType::Invalid; // Was NotFound
OutputProcessor::StoreType avgSum = OutputProcessor::StoreType::Average; // Variable is Averaged=1 or Summed=2
OutputProcessor::TimeStepType stepType = OutputProcessor::TimeStepType::Zone; // Variable time step is Zone=1 or HVAC=2
Constant::Units units = Constant::Units::Invalid; // the units enumeration
std::string ScheduleName; // the name of the schedule
int scheduleIndex = 0; // index to the schedule specified - if no schedule use zero
OutputProcessor::StoreType avgSum = OutputProcessor::StoreType::Average; // Variable is Averaged=1 or Summed=2
OutputProcessor::TimeStepType stepType = OutputProcessor::TimeStepType::Zone; // Variable time step is Zone=1 or HVAC=2
Constant::Units units = Constant::Units::Invalid; // the units enumeration
std::string ScheduleName; // the name of the schedule
int scheduleIndex = 0; // index to the schedule specified - if no schedule use zero
};

struct BinResultsType
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/OutputReportTabularAnnual.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ void AnnualTable::gatherForTimestep(EnergyPlusData &state, OutputProcessor::Time
case AnnualFieldSet::AggregationKind::hoursInTenBinsPlusMinusTwoStdDev:
case AnnualFieldSet::AggregationKind::hoursInTenBinsPlusMinusThreeStdDev:
// for all of the binning options add the value to the deferred
if (fldStIt->m_varAvgSum == OutputProcessor::StoreType::Sum) { // if it is a summed variable
if (fldStIt->m_varAvgSum == OutputProcessor::StoreType::Sum) { // if it is a summed variable
fldStIt->m_cell[row].deferredResults.push_back(curValue /= secondsInTimeStep); // divide by time just like max and min
} else {
fldStIt->m_cell[row].deferredResults.push_back(curValue);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/PlantLoadProfile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ void GetPlantProfileInput(EnergyPlusData &state)
OutputProcessor::StoreType::Sum,
state.dataPlantLoadProfile->PlantProfile(ProfileNum).Name,
Constant::eResource::EnergyTransfer,
OutputProcessor::Group::Plant,
OutputProcessor::Group::Plant,
OutputProcessor::EndUseCat::Heating); // is EndUseKey right?

SetupOutputVariable(state,
Expand Down
6 changes: 2 additions & 4 deletions src/EnergyPlus/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state)
EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination");
}
std::string const groupType = EnergyPlus::Util::makeUPPER(fields.at("group_type").get<std::string>());
OutputProcessor::Group group =
static_cast<OutputProcessor::Group>(getEnumValue(OutputProcessor::groupNamesUC, groupType));
OutputProcessor::Group group = static_cast<OutputProcessor::Group>(getEnumValue(OutputProcessor::groupNamesUC, groupType));
if (group == OutputProcessor::Group::Invalid) {
ShowSevereError(state, format("Invalid input for PythonPlugin:OutputVariable, unexpected Group Type = {}", groupType));
ShowFatalError(state, "Python plugin output variable input problem causes program termination");
Expand All @@ -327,8 +326,7 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state)
if ((resource != Constant::eResource::EnergyTransfer) &&
(endUseCat == OutputProcessor::EndUseCat::HeatingCoils || endUseCat == OutputProcessor::EndUseCat::CoolingCoils ||
endUseCat == OutputProcessor::EndUseCat::Chillers || endUseCat == OutputProcessor::EndUseCat::Boilers ||
endUseCat == OutputProcessor::EndUseCat::Baseboard ||
endUseCat == OutputProcessor::EndUseCat::HeatRecoveryForCooling ||
endUseCat == OutputProcessor::EndUseCat::Baseboard || endUseCat == OutputProcessor::EndUseCat::HeatRecoveryForCooling ||
endUseCat == OutputProcessor::EndUseCat::HeatRecoveryForHeating)) {
ShowWarningError(state, format("Inconsistent resource type input for PythonPlugin:OutputVariable = {}", thisObjectName));
ShowContinueError(state, format("For end use subcategory = {}, resource type must be EnergyTransfer", endUse));
Expand Down
7 changes: 3 additions & 4 deletions src/EnergyPlus/ResultsFramework.hh
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,9 @@ namespace ResultsFramework {

void initializeMeters(const std::vector<OutputProcessor::Meter *> &EnergyMeters, const ReportFreq reportFrequency);

std::array<DataFrame, (int)TimeStepType::Num> detailedTSData = {
// DataFrame("Dummy"),
DataFrame("Detailed-Zone"),
DataFrame("Detailed-HVAC")};
std::array<DataFrame, (int)TimeStepType::Num> detailedTSData = {// DataFrame("Dummy"),
DataFrame("Detailed-Zone"),
DataFrame("Detailed-HVAC")};

std::array<DataFrame, (int)ReportFreq::Num> freqTSData = {DataFrame("Each Call"),
DataFrame("TimeStep"),
Expand Down
13 changes: 6 additions & 7 deletions src/EnergyPlus/RuntimeLanguageProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3390,11 +3390,11 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state)
Constant::eResource::Invalid,
OutputProcessor::Group::Invalid,
OutputProcessor::EndUseCat::Invalid,
"", // EndUseSubCat
"", // ZoneName
1, // ZoneMult
1, // ZoneListMult
"", // SpaceType
"", // EndUseSubCat
"", // ZoneName
1, // ZoneMult
1, // ZoneListMult
"", // SpaceType
-999, // indexGroupKey
UnitsB);
}
Expand Down Expand Up @@ -3616,8 +3616,7 @@ void GetRuntimeLanguageUserInput(EnergyPlusData &state)
if ((resource != Constant::eResource::EnergyTransfer) &&
(sovEndUseCat == OutputProcessor::EndUseCat::HeatingCoils || sovEndUseCat == OutputProcessor::EndUseCat::CoolingCoils ||
sovEndUseCat == OutputProcessor::EndUseCat::Chillers || sovEndUseCat == OutputProcessor::EndUseCat::Boilers ||
sovEndUseCat == OutputProcessor::EndUseCat::Baseboard ||
sovEndUseCat == OutputProcessor::EndUseCat::HeatRecoveryForCooling ||
sovEndUseCat == OutputProcessor::EndUseCat::Baseboard || sovEndUseCat == OutputProcessor::EndUseCat::HeatRecoveryForCooling ||
sovEndUseCat == OutputProcessor::EndUseCat::HeatRecoveryForHeating)) {
ShowWarningError(state, format("{}{}=\"{} invalid field.", RoutineName, cCurrentModuleObject, cAlphaArgs(1)));
ShowContinueError(state,
Expand Down
6 changes: 4 additions & 2 deletions src/EnergyPlus/SQLiteProcedures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1399,10 +1399,12 @@ void SQLite::createSQLiteReportDictionaryRecord(int const reportVariableReportID
"HVAC System Timestep", "Zone Timestep", "Hourly", "Daily", "Monthly", "Run Period", "Annual"};

static constexpr std::array<std::string_view, (int)OutputProcessor::StoreType::Num> storeTypeStrings = {// "Dummy",
"Avg", "Sum"};
"Avg",
"Sum"};

static constexpr std::array<std::string_view, (int)OutputProcessor::TimeStepType::Num> timeStepTypeStrings = {// "Dummy",
"Zone", "HVAC System"};
"Zone",
"HVAC System"};

if (m_writeOutputToSQLite) {
sqliteBindInteger(m_reportDictionaryInsertStmt, 1, reportVariableReportID);
Expand Down
12 changes: 6 additions & 6 deletions src/EnergyPlus/SystemAvailabilityManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -885,13 +885,13 @@ namespace SystemAvailabilityManager {
Constant::eResource::Invalid,
OutputProcessor::Group::Invalid,
OutputProcessor::EndUseCat::Invalid,
"", // End-use SubCat
"", // Zone
1, // ZoneMult
1, // ZoneListMult
"", // space type
"", // End-use SubCat
"", // Zone
1, // ZoneMult
1, // ZoneListMult
"", // space type
-999, // indexGroupKey
"", // custom units
"", // custom units
OutputProcessor::ReportFreq::Day);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/WaterThermalTanks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5495,7 +5495,7 @@ void WaterThermalTankData::setupWaterHeaterOutputVars(EnergyPlusData &state)
OutputProcessor::Group::Plant,
OutputProcessor::EndUseCat::WaterSystem, // DHW
this->EndUseSubcategoryName);

SetupOutputVariable(state,
"Water Heater Water Volume Flow Rate",
Constant::Units::m3_s,
Expand Down
3 changes: 1 addition & 2 deletions tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture
state->dataLoopNodes->Node.allocate(1);
// OutputProcessor::TimeValue.allocate(2);
// set up time related
SetupTimePointers(
*state, OutputProcessor::TimeStepType::Zone, state->dataGlobal->TimeStepZone); // Set up Time pointer for HB/Zone Simulation
SetupTimePointers(*state, OutputProcessor::TimeStepType::Zone, state->dataGlobal->TimeStepZone); // Set up Time pointer for HB/Zone Simulation
SetupTimePointers(*state, OutputProcessor::TimeStepType::System, state->dataHVACGlobal->TimeStepSys);

state->dataGlobal->NumOfTimeStepInHour = 4;
Expand Down
Loading

5 comments on commit 0643f1d

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

OutputProcessor2 (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2763 of 2764 tests passed, 0 test warnings)

Failures:\n

SQLiteFixture Test Summary

  • Passed: 99
  • Failed: 1

Build Badge Test Badge

@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.

OutputProcessor2 (Myoldmopar) - x86_64-MacOS-10.18-clang-15.0.0: OK (3550 of 3552 tests passed, 0 test warnings)

Failures:\n

SQLiteFixture Test Summary

  • Passed: 99
  • Failed: 1

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.

OutputProcessor2 (Myoldmopar) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3593 of 3593 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.

OutputProcessor2 (Myoldmopar) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1976 of 1976 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

OutputProcessor2 (Myoldmopar) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (791 of 791 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.