diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index fc98b125516..edd91470a2e 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -109,9 +109,6 @@ namespace DataGlobals { int const ksHVACSizeRunPeriodDesign(5); // a weather period design day run during HVAC Sizing Simulation int const ksReadAllWeatherData(6); // a weather period for reading all weather data prior to the simulation - int const ZoneTSReporting(1); // value for Zone Time Step Reporting (UpdateDataAndReport) - int const HVACTSReporting(2); // value for HVAC Time Step Reporting (UpdateDataAndReport) - Real64 const MaxEXPArg(709.78); // maximum exponent in EXP() function Real64 const Pi(3.14159265358979324); // Pi 3.1415926535897932384626435 Real64 const PiOvr2(Pi / 2.0); // Pi/2 diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index bec600a8ead..8fea0c84503 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -87,9 +87,6 @@ namespace DataGlobals { extern int const ksHVACSizeRunPeriodDesign; // a weather period design day run during HVAC Sizing Simulation extern int const ksReadAllWeatherData; // a weather period for reading all weather data prior to the simulation - extern int const ZoneTSReporting; // value for Zone Time Step Reporting (UpdateDataAndReport) - extern int const HVACTSReporting; // value for HVAC Time Step Reporting (UpdateDataAndReport) - extern Real64 const MaxEXPArg; // maximum exponent in EXP() function extern Real64 const Pi; // Pi 3.1415926535897932384626435 extern Real64 const PiOvr2; // Pi/2 diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index f080e9aa662..00242c82921 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -164,14 +164,14 @@ namespace DataZoneEquipment { int EndUse_CompMode; std::string Group; int ReportVarIndex; - int ReportVarIndexType; + OutputProcessor::TimeStepType ReportVarIndexType; int ReportVarType; Real64 CurMeterReading; // Default Constructor EquipMeterData() - : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(0), EndUse_CompMode(0), ReportVarIndex(0), ReportVarIndexType(0), - ReportVarType(0), CurMeterReading(0.0) + : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(0), EndUse_CompMode(0), ReportVarIndex(0), + ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0) { } }; diff --git a/src/EnergyPlus/DemandManager.cc b/src/EnergyPlus/DemandManager.cc index a1c0ff6ffd2..84b6a294750 100644 --- a/src/EnergyPlus/DemandManager.cc +++ b/src/EnergyPlus/DemandManager.cc @@ -306,8 +306,8 @@ namespace DemandManager { DemandManagerList(ListNum).ScheduledLimit = GetCurrentScheduleValue(DemandManagerList(ListNum).LimitSchedule); DemandManagerList(ListNum).DemandLimit = DemandManagerList(ListNum).ScheduledLimit * DemandManagerList(ListNum).SafetyFraction; - DemandManagerList(ListNum).MeterDemand = GetInstantMeterValue(DemandManagerList(ListNum).Meter, 1) / TimeStepZoneSec + - GetInstantMeterValue(DemandManagerList(ListNum).Meter, 2) / (TimeStepSys * SecInHour); + DemandManagerList(ListNum).MeterDemand = GetInstantMeterValue(DemandManagerList(ListNum).Meter, OutputProcessor::TimeStepType::TimeStepZone) / TimeStepZoneSec + + GetInstantMeterValue(DemandManagerList(ListNum).Meter, OutputProcessor::TimeStepType::TimeStepSystem) / (TimeStepSys * SecInHour); // Calculate average demand over the averaging window including the current timestep meter demand AverageDemand = DemandManagerList(ListNum).AverageDemand + diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 544d8744800..656c8ef2623 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -1307,7 +1307,7 @@ namespace EMSManager { int NumKeys; int KeyNum; OutputProcessor::StoreType AvgOrSum; - int StepType; + OutputProcessor::TimeStepType StepType; OutputProcessor::Unit Units(OutputProcessor::Unit::None); Array1D_string KeyName; Array1D_int KeyIndex; diff --git a/src/EnergyPlus/EconomicTariff.cc b/src/EnergyPlus/EconomicTariff.cc index d63a9ea91b0..1be8c52434f 100644 --- a/src/EnergyPlus/EconomicTariff.cc +++ b/src/EnergyPlus/EconomicTariff.cc @@ -402,7 +402,7 @@ namespace EconomicTariff { int KeyCount; int TypeVar; OutputProcessor::StoreType AvgSumVar; - int StepTypeVar; + OutputProcessor::TimeStepType StepTypeVar; OutputProcessor::Unit UnitsVar(OutputProcessor::Unit::None); // Units sting, may be blank Array1D_string NamesOfKeys; // Specific key name Array1D_int IndexesForKeyVar; // Array index diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 577f675efab..c9be8a79e81 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -130,15 +130,15 @@ void ElectricPowerServiceManager::manageElectricPowerService( if (!DataGlobals::BeginEnvrnFlag) newEnvironmentFlag_ = true; // retrieve data from meters for demand and production - totalBldgElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, 1) / DataGlobals::TimeStepZoneSec; - totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + totalBldgElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec; + totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); totalElectricDemand_ = totalBldgElecDemand_ + totalHVACElecDemand_; - elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); elecProducedPowerConversionRate_ = - GetInstantMeterValue(elecProducedPowerConversionIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(elecProducedPowerConversionIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); wholeBldgRemainingLoad_ = totalElectricDemand_; @@ -424,15 +424,15 @@ void ElectricPowerServiceManager::updateWholeBuildingRecords() { // main panel balancing. - totalBldgElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, 1) / DataGlobals::TimeStepZoneSec; - totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + totalBldgElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec; + totalHVACElecDemand_ = GetInstantMeterValue(elecFacilityIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); totalElectricDemand_ = totalBldgElecDemand_ + totalHVACElecDemand_; - elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); - elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedPVRate_ = GetInstantMeterValue(elecProducedPVIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedWTRate_ = GetInstantMeterValue(elecProducedWTIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedStorageRate_ = GetInstantMeterValue(elecProducedStorageIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecProducedCoGenRate_ = GetInstantMeterValue(elecProducedCoGenIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); elecProducedPowerConversionRate_ = - GetInstantMeterValue(elecProducedPowerConversionIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + GetInstantMeterValue(elecProducedPowerConversionIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); electProdRate_ = elecProducedCoGenRate_ + elecProducedPVRate_ + elecProducedWTRate_ + elecProducedStorageRate_ + elecProducedPowerConversionRate_; electricityProd_ = electProdRate_ * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; // whole building @@ -1268,8 +1268,8 @@ void ElectPowerLoadCenter::dispatchGenerators(bool const firstHVACIteration, // The TRACK CUSTOM METER scheme tries to have the generators meet all of the // electrical demand from a meter, it can also be a user-defined Custom Meter // and PV is ignored. - customMeterDemand = GetInstantMeterValue(demandMeterPtr_, 1) / DataGlobals::TimeStepZoneSec + - GetInstantMeterValue(demandMeterPtr_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + customMeterDemand = GetInstantMeterValue(demandMeterPtr_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec + + GetInstantMeterValue(demandMeterPtr_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); remainingLoad = customMeterDemand; loadCenterElectricLoad = remainingLoad; @@ -1505,8 +1505,8 @@ void ElectPowerLoadCenter::dispatchStorage(Real64 const originalFeedInRequest // } case StorageOpScheme::meterDemandStoreExcessOnSite: { // Get meter rate - subpanelFeedInRequest = GetInstantMeterValue(trackStorageOpMeterIndex_, 1) / DataGlobals::TimeStepZoneSec + - GetInstantMeterValue(trackStorageOpMeterIndex_, 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + subpanelFeedInRequest = GetInstantMeterValue(trackStorageOpMeterIndex_, OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec + + GetInstantMeterValue(trackStorageOpMeterIndex_, OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); subpanelDrawRequest = 0.0; break; } @@ -4100,8 +4100,8 @@ void ElectricTransformer::manageTransformers(Real64 const surplusPowerOutFromLoa if (DataGlobals::MetersHaveBeenInitialized) { - elecLoad += GetInstantMeterValue(wiredMeterPtrs_[meterNum], 1) / DataGlobals::TimeStepZoneSec + - GetInstantMeterValue(wiredMeterPtrs_[meterNum], 2) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); + elecLoad += GetInstantMeterValue(wiredMeterPtrs_[meterNum], OutputProcessor::TimeStepType::TimeStepZone) / DataGlobals::TimeStepZoneSec + + GetInstantMeterValue(wiredMeterPtrs_[meterNum], OutputProcessor::TimeStepType::TimeStepSystem) / (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); // PastElecLoad store the metered value in the previous time step. This value will be used to check whether // a transformer is overloaded or not. pastElecLoad += GetCurrentMeterValue(wiredMeterPtrs_[meterNum]) / DataGlobals::TimeStepZoneSec; diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index bc10c220203..affa26a11b3 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -2411,7 +2411,7 @@ namespace ExternalInterface { int varType(0); // 0=not found, 1=integer, 2=real, 3=meter int numKeys(0); // Number of keys found OutputProcessor::StoreType varAvgSum(OutputProcessor::StoreType::Averaged); // Variable is Averaged=1 or Summed=2 - int varStepType(0); // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType varStepType(OutputProcessor::TimeStepType::TimeStepZone); // Variable time step is Zone=1 or HVAC=2 OutputProcessor::Unit varUnits(OutputProcessor::Unit::None); // Units sting, may be blank Array1D_int keyIndexes; // Array index for Array1D_string NamesOfKeys; // Specific key name diff --git a/src/EnergyPlus/General.cc b/src/EnergyPlus/General.cc index 924d29fd84c..fcea1e17a19 100644 --- a/src/EnergyPlus/General.cc +++ b/src/EnergyPlus/General.cc @@ -67,6 +67,8 @@ #include #include #include +// TODO: move DetermineMinuteForReporting to avoid bringing this one in +#include #if defined(_WIN32) && _MSC_VER < 1900 #define snprintf _snprintf @@ -2968,7 +2970,7 @@ namespace General { Minute = mod(TmpItem, DecHr); } - int DetermineMinuteForReporting(int const IndexTypeKey) // kind of reporting, Zone Timestep or System + int DetermineMinuteForReporting(OutputProcessor::TimeStepType t_timeStepType) // kind of reporting, Zone Timestep or System { // FUNCTION INFORMATION: @@ -2990,7 +2992,6 @@ namespace General { // Using/Aliasing using namespace DataPrecisionGlobals; using DataGlobals::CurrentTime; - using DataGlobals::HVACTSReporting; using DataGlobals::TimeStepZone; using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; @@ -3015,7 +3016,7 @@ namespace General { Real64 ActualTimeE; // End of current interval (HVAC time step) int ActualTimeHrS; - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { ActualTimeS = CurrentTime - TimeStepZone + SysTimeElapsed; ActualTimeE = ActualTimeS + TimeStepSys; ActualTimeHrS = int(ActualTimeS); diff --git a/src/EnergyPlus/General.hh b/src/EnergyPlus/General.hh index 57220ce5cd6..05d19f356c6 100644 --- a/src/EnergyPlus/General.hh +++ b/src/EnergyPlus/General.hh @@ -64,6 +64,11 @@ namespace EnergyPlus { +// Forward declaration +namespace OutputProcessor { + enum class TimeStepType; +} + namespace General { // Data @@ -312,7 +317,8 @@ namespace General { int &Minute // minute in integer format (0:59) ); - int DetermineMinuteForReporting(int const IndexTypeKey); // kind of reporting, Zone Timestep or System + // TODO: this probably shouldn't be here + int DetermineMinuteForReporting(OutputProcessor::TimeStepType t_timeStepType); // kind of reporting, Zone Timestep or System void EncodeMonDayHrMin(int &Item, // word containing encoded month, day, hour, minute int const Month, // month in integer format (1:12) diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 21a840ecc66..45a4de35509 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -150,7 +150,6 @@ namespace HVACManager { using DataGlobals::emsCallFromHVACIterationLoop; using DataGlobals::EndHourFlag; using DataGlobals::HourOfDay; - using DataGlobals::HVACTSReporting; using DataGlobals::isPulseZoneSizing; using DataGlobals::KickOffSimulation; using DataGlobals::MetersHaveBeenInitialized; @@ -509,7 +508,7 @@ namespace HVACManager { } DetectOscillatingZoneTemp(); - UpdateZoneListAndGroupLoads(); // Must be called before UpdateDataandReport(HVACTSReporting) + UpdateZoneListAndGroupLoads(); // Must be called before UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem) UpdateIceFractions(); // Update fraction of ice stored in TES ManageWater(); // update electricity data for net, purchased, sold etc. @@ -535,11 +534,11 @@ namespace HVACManager { } if (DoOutputReporting) { ReportMaxVentilationLoads(); - UpdateDataandReport(HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsSystemStep(); } - UpdateTabularReports(HVACTSReporting); + UpdateTabularReports(OutputProcessor::TimeStepType::TimeStepSystem); } if (ZoneSizingCalc) { UpdateZoneSizing(DuringDay); @@ -570,7 +569,7 @@ namespace HVACManager { PrintedWarmup = true; } CalcMoreNodeInfo(); - UpdateDataandReport(HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsSystemStep(); } @@ -597,7 +596,7 @@ namespace HVACManager { } PrintedWarmup = true; } - UpdateDataandReport(HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); } ManageEMS(emsCallFromEndSystemTimestepAfterHVACReporting, anyEMSRan); // EMS calling point // UPDATE SYSTEM CLOCKS diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index f41711712fe..6425fd2cc06 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5974,12 +5974,12 @@ namespace HeatBalanceManager { if (!WarmupFlag && DoOutputReporting) { CalcMoreNodeInfo(); - UpdateDataandReport(ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsZoneStep(); } - UpdateTabularReports(ZoneTSReporting); + UpdateTabularReports(OutputProcessor::TimeStepType::TimeStepZone); UpdateUtilityBills(); } else if (!KickOffSimulation && DoOutputReporting && ReportDuringWarmup) { if (BeginDayFlag && !PrintEnvrnStampWarmupPrinted) { @@ -6004,13 +6004,13 @@ namespace HeatBalanceManager { } } CalcMoreNodeInfo(); - UpdateDataandReport(ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsZoneStep(); } } else if (UpdateDataDuringWarmupExternalInterface) { // added for FMI - UpdateDataandReport(ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); if (KindOfSim == ksHVACSizeDesignDay || KindOfSim == ksHVACSizeRunPeriodDesign) { if (hvacSizingSimulationManager) hvacSizingSimulationManager->UpdateSizingLogsZoneStep(); } diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index da88f7c97d9..9c230d4b0cc 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -121,13 +121,11 @@ namespace OutputProcessor { using DataGlobals::DayOfSim; using DataGlobals::DayOfSimChr; using DataGlobals::HourOfDay; - using DataGlobals::HVACTSReporting; using DataGlobals::MaxNameLength; using DataGlobals::MinutesPerTimeStep; using DataGlobals::OutputFileMeters; using DataGlobals::OutputFileStandard; using DataGlobals::StdOutputRecordCount; - using DataGlobals::ZoneTSReporting; using namespace DataGlobalConstants; // Data @@ -143,9 +141,6 @@ namespace OutputProcessor { int const IMinSetValue(999999); int const IMaxSetValue(-999999); - int const ZoneVar(1); // Type value for those variables reported on the Zone Time Step - int const HVACVar(2); // Type value for those variables reported on the System Time Step - int const VarType_NotFound(0); // ref: GetVariableKeyCountandType, 0 = not found int const VarType_Integer(1); // ref: GetVariableKeyCountandType, 1 = integer int const VarType_Real(2); // ref: GetVariableKeyCountandType, 2 = real @@ -282,7 +277,9 @@ namespace OutputProcessor { // PUBLIC SetReportNow // Object Data - Array1D TimeValue(2); // Pointers to the actual TimeStep variables + + // Pointers to the actual TimeStep variables + std::map TimeValue; Array1D RVariableTypes; // Variable Types structure (use NumOfRVariables to traverse) Array1D IVariableTypes; // Variable Types structure (use NumOfIVariables to traverse) Array1D DDVariableTypes; // Variable Types structure (use NumVariablesForOutput to traverse) @@ -379,7 +376,7 @@ namespace OutputProcessor { LEndMin = -1.0; GetMeterIndexFirstCall = true; InitFlag = true; - TimeValue.deallocate(); + TimeValue.clear(); RVariableTypes.deallocate(); IVariableTypes.deallocate(); DDVariableTypes.deallocate(); @@ -494,7 +491,7 @@ namespace OutputProcessor { InitializeMeters(); } - void SetupTimePointers(std::string const &IndexKey, // Which timestep is being set up, 'Zone'=1, 'HVAC'=2 + void SetupTimePointers(std::string const &TimeStepTypeKey, // Which timestep is being set up, 'Zone'=1, 'HVAC'=2 Real64 &TimeStep // The timestep variable. Used to get the address ) { @@ -515,22 +512,16 @@ namespace OutputProcessor { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string cValue; - int Index; - - Index = ValidateIndexType(IndexKey, "SetupTimePointers"); - - if (Index == 1) { - TimeValue(Index).TimeStep >>= TimeStep; - TimeValue(Index).CurMinute = 0.0; - - } else if (Index == 2) { - TimeValue(Index).TimeStep >>= TimeStep; - TimeValue(Index).CurMinute = 0.0; + // ValidateTimeStepType will throw a Fatal if not valid + TimeStepType timeStepType = ValidateTimeStepType(TimeStepTypeKey, "SetupTimePointers"); - } else { - ObjexxFCL::gio::write(cValue, fmtLD) << Index; - ShowSevereError("Illegal value passed to SetupTimePointers, must be 1 or 2 == " + cValue, OutputFileStandard); + TimeSteps tPtr; + tPtr.TimeStep >>= TimeStep; + if ( !TimeValue.insert( std::make_pair( timeStepType, tPtr ) ).second ) { + // The element was already present... shouldn't happen + ShowFatalError("SetupTimePointers was already called for " + TimeStepTypeKey); } + } void CheckReportVariable(std::string const &KeyedValue, // Associated Key for this variable @@ -1105,8 +1096,8 @@ namespace OutputProcessor { String = StrOut; } - int ValidateIndexType(std::string const &IndexTypeKey, // Index type (Zone, HVAC) for variables - std::string const &CalledFrom // Routine called from (for error messages) + TimeStepType ValidateTimeStepType(std::string const &TimeStepTypeKey, // Index type (Zone, HVAC) for variables + std::string const &CalledFrom // Routine called from (for error messages) ) { @@ -1123,43 +1114,30 @@ namespace OutputProcessor { // METHODOLOGY EMPLOYED: // Look it up in a list of valid index types. - // Return value - int ValidateIndexType; - // FUNCTION LOCAL VARIABLE DECLARATIONS: - static Array1D_string ZoneIndexTypes(3); - static Array1D_string SystemIndexTypes(3); - static bool Initialized(false); - int Item; - if (!Initialized) { - ZoneIndexTypes(1) = "ZONE"; - ZoneIndexTypes(2) = "HEATBALANCE"; - ZoneIndexTypes(3) = "HEAT BALANCE"; - SystemIndexTypes(1) = "HVAC"; - SystemIndexTypes(2) = "SYSTEM"; - SystemIndexTypes(3) = "PLANT"; - Initialized = true; - } + // TODO: , "HEATBALANCE", "HEAT BALANCE" are used nowhere aside from tests. Should we remove them? + static std::vector zoneIndexes({"ZONE", "HEATBALANCE", "HEAT BALANCE"}); + static std::vector systemIndexes({"HVAC", "SYSTEM", "PLANT"}); + std::string uppercase(UtilityRoutines::MakeUPPERCase(TimeStepTypeKey)); - ValidateIndexType = 1; - Item = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase(IndexTypeKey), ZoneIndexTypes, 3); - if (Item != 0) return ValidateIndexType; + if (std::find(zoneIndexes.begin(), zoneIndexes.end(), uppercase) != zoneIndexes.end()) { + return TimeStepType::TimeStepZone; + } - ValidateIndexType = 2; - Item = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase(IndexTypeKey), SystemIndexTypes, 3); - if (Item != 0) return ValidateIndexType; + if (std::find(systemIndexes.begin(), systemIndexes.end(), uppercase) != systemIndexes.end()) { + return TimeStepType::TimeStepSystem; + } - ValidateIndexType = 0; // The following should never happen to a user!!!! - ShowSevereError("OutputProcessor/ValidateIndexType: Invalid Index Key passed to ValidateIndexType=" + IndexTypeKey); - ShowContinueError("..Should be \"ZONE\", \"SYSTEM\", \"HVAC\"... was called from:" + CalledFrom); + ShowSevereError("OutputProcessor/ValidateTimeStepType: Invalid Index Key passed to ValidateTimeStepType=" + TimeStepTypeKey); + ShowContinueError("..Should be \"ZONE\", \"SYSTEM\", \"HVAC\", or \"PLANT\"... was called from:" + CalledFrom); ShowFatalError("Preceding condition causes termination."); - return ValidateIndexType; + return TimeStepType::TimeStepZone; } - std::string StandardIndexTypeKey(int const IndexType) + std::string StandardTimeStepTypeKey(TimeStepType const timeStepType) { // FUNCTION INFORMATION: @@ -1182,7 +1160,7 @@ namespace OutputProcessor { // na // Return value - std::string StandardIndexTypeKey; + std::string StandardTimeStepTypeKey; // Locals // FUNCTION ARGUMENT DEFINITIONS: @@ -1199,15 +1177,15 @@ namespace OutputProcessor { // FUNCTION LOCAL VARIABLE DECLARATIONS: // na - if (IndexType == 1) { - StandardIndexTypeKey = "Zone"; - } else if (IndexType == 2) { - StandardIndexTypeKey = "HVAC"; + if (timeStepType == TimeStepType::TimeStepZone) { + StandardTimeStepTypeKey = "Zone"; + } else if (timeStepType == TimeStepType::TimeStepSystem) { + StandardTimeStepTypeKey = "HVAC"; } else { - StandardIndexTypeKey = "UNKW"; + StandardTimeStepTypeKey = "UNKW"; } - return StandardIndexTypeKey; + return StandardTimeStepTypeKey; } StoreType validateVariableType(std::string const &VariableTypeKey) @@ -1465,7 +1443,7 @@ namespace OutputProcessor { int KeyCount; int TypeVar; OutputProcessor::StoreType AvgSumVar; - int StepTypeVar; + OutputProcessor::TimeStepType StepTypeVar; int iKey; int iKey1; bool MeterCreated; @@ -4222,7 +4200,7 @@ namespace OutputProcessor { std::string const &reportIDChr, // The reporting ID for the data std::string const &keyedValue, // The key name for the data std::string const &variableName, // The variable's actual name - int const indexType, + TimeStepType const timeStepType, OutputProcessor::Unit const &unitsForVar, // The variables units Optional_string_const customUnitName, Optional_string_const ScheduleName) @@ -4320,7 +4298,7 @@ namespace OutputProcessor { indexGroup, keyedValue, variableName, - indexType, + static_cast(timeStepType), UnitsString, static_cast(reportingInterval), false, @@ -5567,7 +5545,7 @@ namespace OutputProcessor { void SetupOutputVariable(std::string const &VariableName, // String Name of variable (with units) OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable Real64 &ActualVariable, // Actual Variable, used to set up pointer - std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + std::string const &TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string const &KeyedValue, // Associated Key for this variable Optional_string_const ReportFreq, // Internal use -- causes reporting at this freqency @@ -5605,7 +5583,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CV; std::string IDOut; - int IndexType; // 1=TimeStepZone, 2=TimeStepSys + TimeStepType TimeStepType; // 1=TimeStepZone, 2=TimeStepSys StoreType VariableType; // 1=Average, 2=Sum, 3=Min/Max int Loop; ReportingFrequency RepFreq(ReportingFrequency::Hourly); @@ -5681,13 +5659,13 @@ void SetupOutputVariable(std::string const &VariableName, // String Na } } - IndexType = ValidateIndexType(IndexTypeKey, "SetupOutputVariable"); + TimeStepType = ValidateTimeStepType(TimeStepTypeKey, "SetupOutputVariable"); VariableType = validateVariableType(VariableTypeKey); if (present(customUnitName)) { - AddToOutputVariableList(VarName, IndexType, VariableType, VarType_Real, VariableUnit, customUnitName); + AddToOutputVariableList(VarName, TimeStepType, VariableType, VarType_Real, VariableUnit, customUnitName); } else { - AddToOutputVariableList(VarName, IndexType, VariableType, VarType_Real, VariableUnit); + AddToOutputVariableList(VarName, TimeStepType, VariableType, VarType_Real, VariableUnit); } ++NumTotalRVariable; @@ -5704,7 +5682,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na ReallocateRVar(); } CV = NumOfRVariable; - RVariableTypes(CV).IndexType = IndexType; + RVariableTypes(CV).timeStepType = TimeStepType; RVariableTypes(CV).storeType = VariableType; RVariableTypes(CV).VarName = KeyedValue + ':' + VarName; RVariableTypes(CV).VarNameOnly = VarName; @@ -5788,11 +5766,11 @@ void SetupOutputVariable(std::string const &VariableName, // String Na RVariable().storeType, RVariable().ReportID, localIndexGroupKey, - IndexTypeKey, + TimeStepTypeKey, RVariable().ReportIDChr, KeyedValue, VarName, - RVariableTypes(CV).IndexType, + RVariableTypes(CV).timeStepType, RVariableTypes(CV).units, RVariableTypes(CV).unitNameCustomEMS, ReqRepVars(ReportList(Loop)).SchedName); @@ -5801,11 +5779,11 @@ void SetupOutputVariable(std::string const &VariableName, // String Na RVariable().storeType, RVariable().ReportID, localIndexGroupKey, - IndexTypeKey, + TimeStepTypeKey, RVariable().ReportIDChr, KeyedValue, VarName, - RVariableTypes(CV).IndexType, + RVariableTypes(CV).timeStepType, RVariableTypes(CV).units, RVariableTypes(CV).unitNameCustomEMS); } @@ -5816,7 +5794,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na void SetupOutputVariable(std::string const &VariableName, // String Name of variable OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable int &ActualVariable, // Actual Variable, used to set up pointer - std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + std::string const &TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string const &KeyedValue, // Associated Key for this variable Optional_string_const ReportFreq, // Internal use -- causes reporting at this freqency @@ -5846,7 +5824,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na int CV; std::string IDOut; // CHARACTER(len=MaxNameLength) :: VariableNamewithUnits ! Variable name with units std format - int IndexType; // 1=TimeStepZone, 2=TimeStepSys + TimeStepType TimeStepType; // 1=TimeStepZone, 2=TimeStepSys StoreType VariableType; // 1=Average, 2=Sum, 3=Min/Max int localIndexGroupKey; bool ThisOneOnTheList; @@ -5880,10 +5858,10 @@ void SetupOutputVariable(std::string const &VariableName, // String Na if (Loop == 1) ++NumOfIVariable_Setup; - IndexType = ValidateIndexType(IndexTypeKey, "SetupOutputVariable"); + TimeStepType = ValidateTimeStepType(TimeStepTypeKey, "SetupOutputVariable"); VariableType = validateVariableType(VariableTypeKey); - AddToOutputVariableList(VarName, IndexType, VariableType, VarType_Integer, VariableUnit); + AddToOutputVariableList(VarName, TimeStepType, VariableType, VarType_Integer, VariableUnit); ++NumTotalIVariable; if (!ThisOneOnTheList) continue; @@ -5897,7 +5875,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na } CV = NumOfIVariable; - IVariableTypes(CV).IndexType = IndexType; + IVariableTypes(CV).timeStepType = TimeStepType; IVariableTypes(CV).storeType = VariableType; IVariableTypes(CV).VarName = KeyedValue + ':' + VarName; IVariableTypes(CV).VarNameOnly = VarName; @@ -5953,11 +5931,11 @@ void SetupOutputVariable(std::string const &VariableName, // String Na IVariable().storeType, IVariable().ReportID, localIndexGroupKey, - IndexTypeKey, + TimeStepTypeKey, IVariable().ReportIDChr, KeyedValue, VarName, - IVariableTypes(CV).IndexType, + IVariableTypes(CV).timeStepType, IVariableTypes(CV).units, ReqRepVars(ReportList(Loop)).SchedName); } else { @@ -5965,11 +5943,11 @@ void SetupOutputVariable(std::string const &VariableName, // String Na IVariable().storeType, IVariable().ReportID, localIndexGroupKey, - IndexTypeKey, + TimeStepTypeKey, IVariable().ReportIDChr, KeyedValue, VarName, - IVariableTypes(CV).IndexType, + IVariableTypes(CV).timeStepType, IVariableTypes(CV).units); } } @@ -5979,7 +5957,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na void SetupOutputVariable(std::string const &VariableName, // String Name of variable OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable Real64 &ActualVariable, // Actual Variable, used to set up pointer - std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + std::string const &TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2 int const KeyedValue, // Associated Key for this variable Optional_string_const ReportFreq, // Internal use -- causes reporting at this freqency @@ -6036,7 +6014,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na SetupOutputVariable(VariableName, VariableUnit, ActualVariable, - IndexTypeKey, + TimeStepTypeKey, VariableTypeKey, IDOut, ReportFreq, @@ -6050,7 +6028,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na indexGroupKey); } -void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) +void UpdateDataandReport(OutputProcessor::TimeStepType const t_TimeStepTypeKey) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: @@ -6098,7 +6076,6 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Loop; // Loop Variable - int IndexType; // Translate Zone=>1, HVAC=>2 Real64 CurVal; // Current value for real variables Real64 ICurVal; // Current value for integer variables int MDHM; // Month,Day,Hour,Minute @@ -6115,235 +6092,229 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update static bool EndTimeStepFlag(false); // True when it's the end of the Zone Time Step Real64 rxTime; // (MinuteNow-StartMinute)/REAL(MinutesPerTimeStep,r64) - for execution time - IndexType = IndexTypeKey; - if (IndexType != ZoneTSReporting && IndexType != HVACTSReporting) { + if (t_TimeStepTypeKey != TimeStepType::TimeStepZone && t_TimeStepTypeKey != TimeStepType::TimeStepSystem) { ShowFatalError("Invalid reporting requested -- UpdateDataAndReport"); } - if ((IndexType >= ZoneVar) && (IndexType <= HVACVar)) { - - // Basic record keeping and report out if "detailed" - - StartMinute = TimeValue(IndexType).CurMinute; - TimeValue(IndexType).CurMinute += TimeValue(IndexType).TimeStep * 60.0; - if (IndexType == HVACVar && TimeValue(HVACVar).CurMinute == TimeValue(ZoneVar).CurMinute) { - EndTimeStepFlag = true; - } else if (IndexType == ZoneVar) { - EndTimeStepFlag = true; - } else { - EndTimeStepFlag = false; - } - MinuteNow = TimeValue(IndexType).CurMinute; + // Basic record keeping and report out if "detailed" + StartMinute = TimeValue.at(t_TimeStepTypeKey).CurMinute; + TimeValue.at(t_TimeStepTypeKey).CurMinute += TimeValue.at(t_TimeStepTypeKey).TimeStep * 60.0; + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem && + (TimeValue.at(TimeStepType::TimeStepSystem).CurMinute == TimeValue.at(TimeStepType::TimeStepZone).CurMinute)) { + EndTimeStepFlag = true; + } else if (t_TimeStepTypeKey == TimeStepType::TimeStepZone) { + EndTimeStepFlag = true; + } else { + EndTimeStepFlag = false; + } + MinuteNow = TimeValue.at(t_TimeStepTypeKey).CurMinute; - EncodeMonDayHrMin(MDHM, Month, DayOfMonth, HourOfDay, int(MinuteNow)); - TimePrint = true; + EncodeMonDayHrMin(MDHM, Month, DayOfMonth, HourOfDay, int(MinuteNow)); + TimePrint = true; - rxTime = (MinuteNow - StartMinute) / double(MinutesPerTimeStep); + rxTime = (MinuteNow - StartMinute) / double(MinutesPerTimeStep); - if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { - // R and I data frames for ZoneVar - if (IndexType == ZoneVar && !ResultsFramework::OutputSchema->RIDetailedZoneTSData.rVariablesScanned()) { - ResultsFramework::OutputSchema->initializeRTSDataFrame(ReportingFrequency::EachCall, RVariableTypes, NumOfRVariable, ZoneVar); - } - if (IndexType == ZoneVar && !ResultsFramework::OutputSchema->RIDetailedZoneTSData.iVariablesScanned()) { - ResultsFramework::OutputSchema->initializeITSDataFrame(ReportingFrequency::EachCall, IVariableTypes, NumOfIVariable, ZoneVar); - } + if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { + // R and I data frames for TimeStepType::TimeStepZone + if (t_TimeStepTypeKey == TimeStepType::TimeStepZone && !ResultsFramework::OutputSchema->RIDetailedZoneTSData.rVariablesScanned()) { + ResultsFramework::OutputSchema->initializeRTSDataFrame(ReportingFrequency::EachCall, RVariableTypes, NumOfRVariable, TimeStepType::TimeStepZone); + } + if (t_TimeStepTypeKey == TimeStepType::TimeStepZone && !ResultsFramework::OutputSchema->RIDetailedZoneTSData.iVariablesScanned()) { + ResultsFramework::OutputSchema->initializeITSDataFrame(ReportingFrequency::EachCall, IVariableTypes, NumOfIVariable, TimeStepType::TimeStepZone); + } - // R and I data frames for HVACVar - if (IndexType == HVACVar && !ResultsFramework::OutputSchema->RIDetailedHVACTSData.rVariablesScanned()) { - ResultsFramework::OutputSchema->initializeRTSDataFrame(ReportingFrequency::EachCall, RVariableTypes, NumOfRVariable, HVACVar); - } - if (IndexType == HVACVar && !ResultsFramework::OutputSchema->RIDetailedHVACTSData.iVariablesScanned()) { - ResultsFramework::OutputSchema->initializeITSDataFrame(ReportingFrequency::EachCall, IVariableTypes, NumOfIVariable, HVACVar); - } + // R and I data frames for TimeStepType::TimeStepSystem + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem && !ResultsFramework::OutputSchema->RIDetailedHVACTSData.rVariablesScanned()) { + ResultsFramework::OutputSchema->initializeRTSDataFrame(ReportingFrequency::EachCall, RVariableTypes, NumOfRVariable, TimeStepType::TimeStepSystem); + } + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem && !ResultsFramework::OutputSchema->RIDetailedHVACTSData.iVariablesScanned()) { + ResultsFramework::OutputSchema->initializeITSDataFrame(ReportingFrequency::EachCall, IVariableTypes, NumOfIVariable, TimeStepType::TimeStepSystem); } + } - if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { - if (IndexType == ZoneVar) { - ResultsFramework::OutputSchema->RIDetailedZoneTSData.newRow(Month, DayOfMonth, HourOfDay, TimeValue(1).CurMinute); - } - if (IndexType == HVACVar) { - ResultsFramework::OutputSchema->RIDetailedHVACTSData.newRow(Month, DayOfMonth, HourOfDay, TimeValue(1).CurMinute); - } + if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { + if (t_TimeStepTypeKey == TimeStepType::TimeStepZone) { + ResultsFramework::OutputSchema->RIDetailedZoneTSData.newRow(Month, DayOfMonth, HourOfDay, TimeValue.at(TimeStepType::TimeStepZone).CurMinute); } + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem) { + // TODO this was an error probably, was using TimeValue(1) + ResultsFramework::OutputSchema->RIDetailedHVACTSData.newRow(Month, DayOfMonth, HourOfDay, TimeValue.at(TimeStepType::TimeStepSystem).CurMinute); + } + } - // Main "Record Keeping" Loops for R and I variables - for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType != IndexType) continue; + // Main "Record Keeping" Loops for R and I variables + for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { + if (RVariableTypes(Loop).timeStepType != t_TimeStepTypeKey) continue; - // Act on the RVariables variable - auto &rVar(RVariableTypes(Loop).VarPtr()); - rVar.Stored = true; - if (rVar.storeType == StoreType::Averaged) { - CurVal = rVar.Which * rxTime; - // CALL SetMinMax(RVar%Which,MDHM,RVar%MaxValue,RVar%maxValueDate,RVar%MinValue,RVar%minValueDate) - if (rVar.Which > rVar.MaxValue) { - rVar.MaxValue = rVar.Which; - rVar.maxValueDate = MDHM; - } - if (rVar.Which < rVar.MinValue) { - rVar.MinValue = rVar.Which; - rVar.minValueDate = MDHM; - } - rVar.TSValue += CurVal; - rVar.EITSValue = rVar.TSValue; // CR - 8481 fix - 09/06/2011 - } else { - // CurVal=RVar%Which - if (rVar.Which > rVar.MaxValue) { - rVar.MaxValue = rVar.Which; - rVar.maxValueDate = MDHM; - } - if (rVar.Which < rVar.MinValue) { - rVar.MinValue = rVar.Which; - rVar.minValueDate = MDHM; - } - rVar.TSValue += rVar.Which; - rVar.EITSValue = rVar.TSValue; // CR - 8481 fix - 09/06/2011 - } - - // End of "record keeping" Report if applicable - if (!rVar.Report) continue; - ReportNow = true; - if (rVar.SchedPtr > 0) ReportNow = (GetCurrentScheduleValue(rVar.SchedPtr) != 0.0); // SetReportNow(RVar%SchedPtr) - if (!ReportNow) continue; - rVar.tsStored = true; - if (!rVar.thisTSStored) { - ++rVar.thisTSCount; - rVar.thisTSStored = true; - } - - if (rVar.frequency == ReportingFrequency::EachCall) { - if (TimePrint) { - if (LHourP != HourOfDay || std::abs(LStartMin - StartMinute) > 0.001 || - std::abs(LEndMin - TimeValue(IndexType).CurMinute) > 0.001) { - CurDayType = DayOfWeek; - if (HolidayIndex > 0) { - CurDayType = 7 + HolidayIndex; - } - WriteTimeStampFormatData(eso_stream, - ReportingFrequency::EachCall, - TimeStepStampReportNbr, - TimeStepStampReportChr, - DayOfSim, - DayOfSimChr, - true, - Month, - DayOfMonth, - HourOfDay, - TimeValue(IndexType).CurMinute, - StartMinute, - DSTIndicator, - DayTypes(CurDayType)); - LHourP = HourOfDay; - LStartMin = StartMinute; - LEndMin = TimeValue(IndexType).CurMinute; + // Act on the RVariables variable + auto &rVar(RVariableTypes(Loop).VarPtr()); + rVar.Stored = true; + if (rVar.storeType == StoreType::Averaged) { + CurVal = rVar.Which * rxTime; + // CALL SetMinMax(RVar%Which,MDHM,RVar%MaxValue,RVar%maxValueDate,RVar%MinValue,RVar%minValueDate) + if (rVar.Which > rVar.MaxValue) { + rVar.MaxValue = rVar.Which; + rVar.maxValueDate = MDHM; + } + if (rVar.Which < rVar.MinValue) { + rVar.MinValue = rVar.Which; + rVar.minValueDate = MDHM; + } + rVar.TSValue += CurVal; + rVar.EITSValue = rVar.TSValue; // CR - 8481 fix - 09/06/2011 + } else { + // CurVal=RVar%Which + if (rVar.Which > rVar.MaxValue) { + rVar.MaxValue = rVar.Which; + rVar.maxValueDate = MDHM; + } + if (rVar.Which < rVar.MinValue) { + rVar.MinValue = rVar.Which; + rVar.minValueDate = MDHM; + } + rVar.TSValue += rVar.Which; + rVar.EITSValue = rVar.TSValue; // CR - 8481 fix - 09/06/2011 + } + + // End of "record keeping" Report if applicable + if (!rVar.Report) continue; + ReportNow = true; + if (rVar.SchedPtr > 0) ReportNow = (GetCurrentScheduleValue(rVar.SchedPtr) != 0.0); // SetReportNow(RVar%SchedPtr) + if (!ReportNow) continue; + rVar.tsStored = true; + if (!rVar.thisTSStored) { + ++rVar.thisTSCount; + rVar.thisTSStored = true; + } + + if (rVar.frequency == ReportingFrequency::EachCall) { + if (TimePrint) { + if (LHourP != HourOfDay || std::abs(LStartMin - StartMinute) > 0.001 || + std::abs(LEndMin - TimeValue.at(t_TimeStepTypeKey).CurMinute) > 0.001) { + CurDayType = DayOfWeek; + if (HolidayIndex > 0) { + CurDayType = 7 + HolidayIndex; } - TimePrint = false; + WriteTimeStampFormatData(eso_stream, + ReportingFrequency::EachCall, + TimeStepStampReportNbr, + TimeStepStampReportChr, + DayOfSim, + DayOfSimChr, + true, + Month, + DayOfMonth, + HourOfDay, + TimeValue.at(t_TimeStepTypeKey).CurMinute, + StartMinute, + DSTIndicator, + DayTypes(CurDayType)); + LHourP = HourOfDay; + LStartMin = StartMinute; + LEndMin = TimeValue.at(t_TimeStepTypeKey).CurMinute; } - WriteNumericData(rVar.ReportID, rVar.ReportIDChr, rVar.Which); - ++StdOutputRecordCount; + TimePrint = false; + } + WriteNumericData(rVar.ReportID, rVar.ReportIDChr, rVar.Which); + ++StdOutputRecordCount; - if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { - if (IndexType == ZoneVar) { - ResultsFramework::OutputSchema->RIDetailedZoneTSData.pushVariableValue(rVar.ReportID, rVar.Which); - } - if (IndexType == HVACVar) { - ResultsFramework::OutputSchema->RIDetailedHVACTSData.pushVariableValue(rVar.ReportID, rVar.Which); - } + if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { + if (t_TimeStepTypeKey == TimeStepType::TimeStepZone) { + ResultsFramework::OutputSchema->RIDetailedZoneTSData.pushVariableValue(rVar.ReportID, rVar.Which); + } + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem) { + ResultsFramework::OutputSchema->RIDetailedHVACTSData.pushVariableValue(rVar.ReportID, rVar.Which); } } } + } - for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType != IndexType) continue; - - // Act on the IVariables variable - auto &iVar(IVariableTypes(Loop).VarPtr()); - iVar.Stored = true; - // ICurVal=IVar%Which - if (iVar.storeType == StoreType::Averaged) { - ICurVal = iVar.Which * rxTime; - iVar.TSValue += ICurVal; - iVar.EITSValue = iVar.TSValue; // CR - 8481 fix - 09/06/2011 - if (nint(ICurVal) > iVar.MaxValue) { - iVar.MaxValue = nint(ICurVal); // Record keeping for date and time go here too - iVar.maxValueDate = MDHM; //+ TimeValue(IndexType)%TimeStep - } - if (nint(ICurVal) < iVar.MinValue) { - iVar.MinValue = nint(ICurVal); - iVar.minValueDate = MDHM; //+ TimeValue(IndexType)%TimeStep - } - } else { - if (iVar.Which > iVar.MaxValue) { - iVar.MaxValue = iVar.Which; // Record keeping for date and time go here too - iVar.maxValueDate = MDHM; //+ TimeValue(IndexType)%TimeStep - } - if (iVar.Which < iVar.MinValue) { - iVar.MinValue = iVar.Which; - iVar.minValueDate = MDHM; //+ TimeValue(IndexType)%TimeStep - } - iVar.TSValue += iVar.Which; - iVar.EITSValue = iVar.TSValue; // CR - 8481 fix - 09/06/2011 - } - - if (!iVar.Report) continue; - ReportNow = true; - if (iVar.SchedPtr > 0) ReportNow = (GetCurrentScheduleValue(iVar.SchedPtr) != 0.0); // SetReportNow(IVar%SchedPtr) - if (!ReportNow) continue; - iVar.tsStored = true; - if (!iVar.thisTSStored) { - ++iVar.thisTSCount; - iVar.thisTSStored = true; - } - - if (iVar.frequency == ReportingFrequency::EachCall) { - if (TimePrint) { - if (LHourP != HourOfDay || std::abs(LStartMin - StartMinute) > 0.001 || - std::abs(LEndMin - TimeValue(IndexType).CurMinute) > 0.001) { - CurDayType = DayOfWeek; - if (HolidayIndex > 0) { - CurDayType = 7 + HolidayIndex; - } - WriteTimeStampFormatData(eso_stream, - ReportingFrequency::EachCall, - TimeStepStampReportNbr, - TimeStepStampReportChr, - DayOfSim, - DayOfSimChr, - true, - Month, - DayOfMonth, - HourOfDay, - TimeValue(IndexType).CurMinute, - StartMinute, - DSTIndicator, - DayTypes(CurDayType)); - LHourP = HourOfDay; - LStartMin = StartMinute; - LEndMin = TimeValue(IndexType).CurMinute; + for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { + if (IVariableTypes(Loop).timeStepType != t_TimeStepTypeKey) continue; + + // Act on the IVariables variable + auto &iVar(IVariableTypes(Loop).VarPtr()); + iVar.Stored = true; + // ICurVal=IVar%Which + if (iVar.storeType == StoreType::Averaged) { + ICurVal = iVar.Which * rxTime; + iVar.TSValue += ICurVal; + iVar.EITSValue = iVar.TSValue; // CR - 8481 fix - 09/06/2011 + if (nint(ICurVal) > iVar.MaxValue) { + iVar.MaxValue = nint(ICurVal); // Record keeping for date and time go here too + iVar.maxValueDate = MDHM; //+ TimeValue.at(t_TimeStepTypeKey)%TimeStep + } + if (nint(ICurVal) < iVar.MinValue) { + iVar.MinValue = nint(ICurVal); + iVar.minValueDate = MDHM; //+ TimeValue.at(t_TimeStepTypeKey)%TimeStep + } + } else { + if (iVar.Which > iVar.MaxValue) { + iVar.MaxValue = iVar.Which; // Record keeping for date and time go here too + iVar.maxValueDate = MDHM; //+ TimeValue(TimeStepType)%TimeStep + } + if (iVar.Which < iVar.MinValue) { + iVar.MinValue = iVar.Which; + iVar.minValueDate = MDHM; //+ TimeValue(TimeStepType)%TimeStep + } + iVar.TSValue += iVar.Which; + iVar.EITSValue = iVar.TSValue; // CR - 8481 fix - 09/06/2011 + } + + if (!iVar.Report) continue; + ReportNow = true; + if (iVar.SchedPtr > 0) ReportNow = (GetCurrentScheduleValue(iVar.SchedPtr) != 0.0); // SetReportNow(IVar%SchedPtr) + if (!ReportNow) continue; + iVar.tsStored = true; + if (!iVar.thisTSStored) { + ++iVar.thisTSCount; + iVar.thisTSStored = true; + } + + if (iVar.frequency == ReportingFrequency::EachCall) { + if (TimePrint) { + if (LHourP != HourOfDay || std::abs(LStartMin - StartMinute) > 0.001 || + std::abs(LEndMin - TimeValue.at(t_TimeStepTypeKey).CurMinute) > 0.001) { + CurDayType = DayOfWeek; + if (HolidayIndex > 0) { + CurDayType = 7 + HolidayIndex; } - TimePrint = false; + WriteTimeStampFormatData(eso_stream, + ReportingFrequency::EachCall, + TimeStepStampReportNbr, + TimeStepStampReportChr, + DayOfSim, + DayOfSimChr, + true, + Month, + DayOfMonth, + HourOfDay, + TimeValue.at(t_TimeStepTypeKey).CurMinute, + StartMinute, + DSTIndicator, + DayTypes(CurDayType)); + LHourP = HourOfDay; + LStartMin = StartMinute; + LEndMin = TimeValue.at(t_TimeStepTypeKey).CurMinute; } - // only time integer vars actual report as integer only is "detailed" - WriteNumericData(iVar.ReportID, iVar.ReportIDChr, iVar.Which); - ++StdOutputRecordCount; + TimePrint = false; + } + // only time integer vars actual report as integer only is "detailed" + WriteNumericData(iVar.ReportID, iVar.ReportIDChr, iVar.Which); + ++StdOutputRecordCount; - if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { - if (IndexType == ZoneVar) { - ResultsFramework::OutputSchema->RIDetailedZoneTSData.pushVariableValue(iVar.ReportID, iVar.Which); - } - if (IndexType == HVACVar) { - ResultsFramework::OutputSchema->RIDetailedHVACTSData.pushVariableValue(iVar.ReportID, iVar.Which); - } + if (ResultsFramework::OutputSchema->timeSeriesEnabled()) { + if (t_TimeStepTypeKey == TimeStepType::TimeStepZone) { + ResultsFramework::OutputSchema->RIDetailedZoneTSData.pushVariableValue(iVar.ReportID, iVar.Which); + } + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem) { + ResultsFramework::OutputSchema->RIDetailedHVACTSData.pushVariableValue(iVar.ReportID, iVar.Which); } } } - - } else { - ShowSevereError("Illegal Index passed to Report Variables"); } - if (IndexType == HVACVar) return; // All other stuff happens at the "zone" time step call to this routine. + if (t_TimeStepTypeKey == TimeStepType::TimeStepSystem) return; // All other stuff happens at the "zone" time step call to this routine. // TimeStep Block (Report on Zone TimeStep) @@ -6355,12 +6326,12 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update if (!ResultsFramework::OutputSchema->RITimestepTSData.iVariablesScanned()) { ResultsFramework::OutputSchema->initializeITSDataFrame(ReportingFrequency::TimeStep, IVariableTypes, NumOfIVariable); } - ResultsFramework::OutputSchema->RITimestepTSData.newRow(Month, DayOfMonth, HourOfDay, TimeValue(1).CurMinute); + ResultsFramework::OutputSchema->RITimestepTSData.newRow(Month, DayOfMonth, HourOfDay, TimeValue.at(TimeStepType::TimeStepZone).CurMinute); } - for (IndexType = 1; IndexType <= 2; ++IndexType) { + for (auto& thisTimeStepType: {TimeStepType::TimeStepZone, TimeStepType::TimeStepSystem}) { // Zone, HVAC for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType != IndexType) continue; + if (RVariableTypes(Loop).timeStepType != thisTimeStepType) continue; auto &rVar(RVariableTypes(Loop).VarPtr()); // Update meters on the TimeStep (Zone) if (rVar.MeterArrayPtr != 0) { @@ -6392,7 +6363,7 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update if (rVar.frequency == ReportingFrequency::TimeStep) { if (TimePrint) { if (LHourP != HourOfDay || std::abs(LStartMin - StartMinute) > 0.001 || - std::abs(LEndMin - TimeValue(IndexType).CurMinute) > 0.001) { + std::abs(LEndMin - TimeValue.at(thisTimeStepType).CurMinute) > 0.001) { CurDayType = DayOfWeek; if (HolidayIndex > 0) { CurDayType = 7 + HolidayIndex; @@ -6407,13 +6378,13 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update Month, DayOfMonth, HourOfDay, - TimeValue(IndexType).CurMinute, + TimeValue.at(thisTimeStepType).CurMinute, StartMinute, DSTIndicator, DayTypes(CurDayType)); LHourP = HourOfDay; LStartMin = StartMinute; - LEndMin = TimeValue(IndexType).CurMinute; + LEndMin = TimeValue.at(thisTimeStepType).CurMinute; } TimePrint = false; } @@ -6430,7 +6401,7 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update } // Number of R Variables for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType != IndexType) continue; + if (IVariableTypes(Loop).timeStepType != thisTimeStepType) continue; auto &iVar(IVariableTypes(Loop).VarPtr()); ReportNow = true; if (iVar.SchedPtr > 0) ReportNow = (GetCurrentScheduleValue(iVar.SchedPtr) != 0.0); // SetReportNow(IVar%SchedPtr) @@ -6448,7 +6419,7 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update if (iVar.frequency == ReportingFrequency::TimeStep) { if (TimePrint) { if (LHourP != HourOfDay || std::abs(LStartMin - StartMinute) > 0.001 || - std::abs(LEndMin - TimeValue(IndexType).CurMinute) > 0.001) { + std::abs(LEndMin - TimeValue.at(thisTimeStepType).CurMinute) > 0.001) { CurDayType = DayOfWeek; if (HolidayIndex > 0) { CurDayType = 7 + HolidayIndex; @@ -6463,13 +6434,13 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update Month, DayOfMonth, HourOfDay, - TimeValue(IndexType).CurMinute, + TimeValue.at(thisTimeStepType).CurMinute, StartMinute, DSTIndicator, DayTypes(CurDayType)); LHourP = HourOfDay; LStartMin = StartMinute; - LEndMin = TimeValue(IndexType).CurMinute; + LEndMin = TimeValue.at(thisTimeStepType).CurMinute; } TimePrint = false; } @@ -6488,7 +6459,7 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update UpdateMeters(MDHM); - ReportTSMeters(StartMinute, TimeValue(1).CurMinute, TimePrint, TimePrint); + ReportTSMeters(StartMinute, TimeValue.at(TimeStepType::TimeStepZone).CurMinute, TimePrint, TimePrint); } // TimeStep Block @@ -6526,10 +6497,10 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update ResultsFramework::OutputSchema->RIHourlyTSData.newRow(Month, DayOfMonth, HourOfDay, 0); } - for (IndexType = 1; IndexType <= 2; ++IndexType) { // Zone, HVAC - TimeValue(IndexType).CurMinute = 0.0; + for (auto& thisTimeStepType: {TimeStepType::TimeStepZone, TimeStepType::TimeStepSystem}) { // Zone, HVAC + TimeValue.at(thisTimeStepType).CurMinute = 0.0; for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType != IndexType) continue; + if (RVariableTypes(Loop).timeStepType != thisTimeStepType) continue; auto &rVar(RVariableTypes(Loop).VarPtr()); // ReportNow=.TRUE. // IF (RVar%SchedPtr > 0) & @@ -6559,7 +6530,7 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update } // Number of R Variables for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType != IndexType) continue; + if (IVariableTypes(Loop).timeStepType != thisTimeStepType) continue; auto &iVar(IVariableTypes(Loop).VarPtr()); // ReportNow=.TRUE. // IF (IVar%SchedPtr > 0) & @@ -6585,7 +6556,7 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update iVar.thisTSCount = 0; iVar.Value = 0.0; } // Number of I Variables - } // IndexType (Zone or HVAC) + } // thisTimeStepType (Zone or HVAC) ReportHRMeters(TimePrint); @@ -6627,19 +6598,19 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update } NumHoursInMonth += 24; - for (IndexType = 1; IndexType <= 2; ++IndexType) { + for (auto& thisTimeStepType: {TimeStepType::TimeStepZone, TimeStepType::TimeStepSystem}) { // Zone, HVAC for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType == IndexType) { + if (RVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteRealVariableOutput(RVariableTypes(Loop).VarPtr, ReportingFrequency::Daily); } } // Number of R Variables for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType == IndexType) { + if (IVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteIntegerVariableOutput(IVariableTypes(Loop).VarPtr, ReportingFrequency::Daily); } } // Number of I Variables - } // Index type (Zone or HVAC) + } // thisTimeStepType (Zone or HVAC) ReportDYMeters(TimePrint); @@ -6668,19 +6639,19 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update NumHoursInSim += NumHoursInMonth; EndMonthFlag = false; - for (IndexType = 1; IndexType <= 2; ++IndexType) { // Zone, HVAC - for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType == IndexType) { + for (auto& thisTimeStepType: {TimeStepType::TimeStepZone, TimeStepType::TimeStepSystem}) { // Zone, HVAC + for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { + if (RVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteRealVariableOutput(RVariableTypes(Loop).VarPtr, ReportingFrequency::Monthly); } } // Number of R Variables for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType == IndexType) { + if (IVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteIntegerVariableOutput(IVariableTypes(Loop).VarPtr, ReportingFrequency::Monthly); } } // Number of I Variables - } // IndexType (Zone, HVAC) + } // thisTimeStepType (Zone, HVAC) ReportMNMeters(TimePrint); @@ -6704,19 +6675,19 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update } ResultsFramework::OutputSchema->RIRunPeriodTSData.newRow(Month, DayOfMonth, HourOfDay, 0); } - for (IndexType = 1; IndexType <= 2; ++IndexType) { // Zone, HVAC + for (auto& thisTimeStepType: {TimeStepType::TimeStepZone, TimeStepType::TimeStepSystem}) { // Zone, HVAC for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType == IndexType) { + if (RVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteRealVariableOutput(RVariableTypes(Loop).VarPtr, ReportingFrequency::Simulation); } } // Number of R Variables for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType == IndexType) { + if (IVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteIntegerVariableOutput(IVariableTypes(Loop).VarPtr, ReportingFrequency::Simulation); } } // Number of I Variables - } // Index Type (Zone, HVAC) + } // thisTimeStepType (Zone, HVAC) ReportSMMeters(TimePrint); @@ -6729,19 +6700,19 @@ void UpdateDataandReport(int const IndexTypeKey) // What kind of data to update WriteYearlyTimeStamp(eso_stream, YearlyStampReportChr, DataGlobals::CalendarYearChr, true); TimePrint = false; } - for (IndexType = 1; IndexType <= 2; ++IndexType) { // Zone, HVAC + for (auto& thisTimeStepType: {TimeStepType::TimeStepZone, TimeStepType::TimeStepSystem}) { // Zone, HVAC for (Loop = 1; Loop <= NumOfRVariable; ++Loop) { - if (RVariableTypes(Loop).IndexType == IndexType) { + if (RVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteRealVariableOutput(RVariableTypes(Loop).VarPtr, ReportingFrequency::Yearly); } } // Number of R Variables for (Loop = 1; Loop <= NumOfIVariable; ++Loop) { - if (IVariableTypes(Loop).IndexType == IndexType) { + if (IVariableTypes(Loop).timeStepType == thisTimeStepType) { WriteIntegerVariableOutput(IVariableTypes(Loop).VarPtr, ReportingFrequency::Yearly); } } // Number of I Variables - } // Index Type (Zone, HVAC) + } // thisTimeStepType (Zone, HVAC) ReportYRMeters(TimePrint); @@ -7656,7 +7627,7 @@ Real64 GetCurrentMeterValue(int const MeterNumber) // Which Meter Number (from G } Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from GetMeterIndex) - int const IndexType // Whether this is zone of HVAC + OutputProcessor::TimeStepType const t_timeStepType // Whether this is zone of HVAC ) { @@ -7668,7 +7639,7 @@ Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from G // PURPOSE OF THIS FUNCTION: // This function returns the Instantaneous meter value (timestep) for the meter number indicated - // using IndexType to differentiate between Zone and HVAC values. + // using TimeStepType to differentiate between Zone and HVAC values. // METHODOLOGY EMPLOYED: // Uses internal EnergyMeters structure to get value. @@ -7735,8 +7706,8 @@ Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from G } for (int Loop = cache_beg; Loop <= cache_end; ++Loop) { auto &r_var_loop(RVariableTypes(InstMeterCache(Loop))); - // Separate the Zone variables from the HVAC variables using IndexType - if (r_var_loop.IndexType == IndexType) { + // Separate the Zone variables from the HVAC variables using TimeStepType + if (r_var_loop.timeStepType == t_timeStepType) { auto &rVar(r_var_loop.VarPtr()); // Add to the total all of the appropriate variables InstantMeterValue += rVar.Which * rVar.ZoneMult * rVar.ZoneListMult; @@ -7751,8 +7722,8 @@ Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from G auto const &var_meter_on(VarMeterArrays(Loop).OnMeters); for (int Meter = 1, Meter_end = VarMeterArrays(Loop).NumOnMeters; Meter <= Meter_end; ++Meter) { if (var_meter_on(Meter) == energy_meter.SourceMeter) { - // Separate the Zone variables from the HVAC variables using IndexType - if (r_var_loop.IndexType == IndexType) { + // Separate the Zone variables from the HVAC variables using TimeStepType + if (r_var_loop.timeStepType == t_timeStepType) { auto &rVar(r_var_loop.VarPtr()); // Add to the total all of the appropriate variables InstantMeterValue += rVar.Which * rVar.ZoneMult * rVar.ZoneListMult; @@ -7764,8 +7735,8 @@ Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from G auto const &var_meter_on_custom(VarMeterArrays(Loop).OnCustomMeters); for (int Meter = 1, Meter_end = VarMeterArrays(Loop).NumOnCustomMeters; Meter <= Meter_end; ++Meter) { if (var_meter_on_custom(Meter) == energy_meter.SourceMeter) { - // Separate the Zone variables from the HVAC variables using IndexType - if (r_var_loop.IndexType == IndexType) { + // Separate the Zone variables from the HVAC variables using TimeStepType + if (r_var_loop.timeStepType == t_timeStepType) { auto &rVar(r_var_loop.VarPtr()); // Add to the total all of the appropriate variables InstantMeterValue += rVar.Which * rVar.ZoneMult * rVar.ZoneListMult; @@ -7781,8 +7752,8 @@ Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from G auto const &var_meter_on(VarMeterArrays(Loop).OnMeters); for (int Meter = 1, Meter_end = VarMeterArrays(Loop).NumOnMeters; Meter <= Meter_end; ++Meter) { if (var_meter_on(Meter) == MeterNumber) { - // Separate the Zone variables from the HVAC variables using IndexType - if (r_var_loop.IndexType == IndexType) { + // Separate the Zone variables from the HVAC variables using TimeStepType + if (r_var_loop.timeStepType == t_timeStepType) { auto &rVar(r_var_loop.VarPtr()); // Add to the total all of the appropriate variables InstantMeterValue -= rVar.Which * rVar.ZoneMult * rVar.ZoneListMult; @@ -7794,8 +7765,8 @@ Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from G auto const &var_meter_on_custom(VarMeterArrays(Loop).OnCustomMeters); for (int Meter = 1, Meter_end = VarMeterArrays(Loop).NumOnCustomMeters; Meter <= Meter_end; ++Meter) { if (var_meter_on_custom(Meter) == MeterNumber) { - // Separate the Zone variables from the HVAC variables using IndexType - if (r_var_loop.IndexType == IndexType) { + // Separate the Zone variables from the HVAC variables using TimeStepType + if (r_var_loop.timeStepType == t_timeStepType) { auto &rVar(r_var_loop.VarPtr()); // Add to the total all of the appropriate variables InstantMeterValue -= rVar.Which * rVar.ZoneMult * rVar.ZoneListMult; @@ -8071,7 +8042,7 @@ void GetMeteredVariables(std::string const &ComponentType, // Given Co std::string const &ComponentName, // Given Component Name (user defined) Array1S_int VarIndexes, // Variable Numbers Array1S_int VarTypes, // Variable Types (1=integer, 2=real, 3=meter) - Array1S_int IndexTypes, // Variable Index Types (1=Zone,2=HVAC) + Array1A TimeStepTypes, // Variable Index Types (1=Zone,2=HVAC) Array1A unitsForVar, // units from enum for each variable Array1S_int ResourceTypes, // ResourceTypes for each variable Optional EndUses, // EndUses for each variable @@ -8118,7 +8089,7 @@ void GetMeteredVariables(std::string const &ComponentType, // Given Co ++NumVariables; VarIndexes(NumVariables) = Loop; VarTypes(NumVariables) = 2; - IndexTypes(NumVariables) = RVariableTypes(Loop).IndexType; + TimeStepTypes(NumVariables) = RVariableTypes(Loop).timeStepType; unitsForVar(NumVariables) = RVariableTypes(Loop).units; ResourceTypes(NumVariables) = AssignResourceTypeNum(UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).ResourceType)); @@ -8128,7 +8099,7 @@ void GetMeteredVariables(std::string const &ComponentType, // Given Co if (present(EndUses)) { for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); - if (EnergyMeters(MeterPtr).EndUse != "") { + if (!EnergyMeters(MeterPtr).EndUse.empty()) { EndUses()(NumVariables) = UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).EndUse); break; } @@ -8137,7 +8108,7 @@ void GetMeteredVariables(std::string const &ComponentType, // Given Co if (present(Groups)) { for (MeterNum = 1; MeterNum <= NumOnMeterPtr; ++MeterNum) { MeterPtr = VarMeterArrays(rVar.MeterArrayPtr).OnMeters(MeterNum); - if (EnergyMeters(MeterPtr).Group != "") { + if (!EnergyMeters(MeterPtr).Group.empty()) { Groups()(NumVariables) = UtilityRoutines::MakeUPPERCase(EnergyMeters(MeterPtr).Group); break; } @@ -8160,7 +8131,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa int &numKeys, // Number of keys found int &varType, // 0=not found, 1=integer, 2=real, 3=meter OutputProcessor::StoreType &varAvgSum, // Variable is Averaged=1 or Summed=2 - int &varStepType, // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType &varStepType, // Variable time step is Zone=1 or HVAC=2 OutputProcessor::Unit &varUnits // Units enumeration ) { @@ -8255,7 +8226,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa varType = VarType_NotFound; numKeys = 0; varAvgSum = StoreType::Averaged; - varStepType = 0; + varStepType = TimeStepType::TimeStepZone; varUnits = OutputProcessor::Unit::None; Found = false; Duplicate = false; @@ -8290,7 +8261,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa } keyVarIndexes(numKeys) = Loop; varAvgSum = DDVariableTypes(ivarNames(VFound)).storeType; - varStepType = DDVariableTypes(ivarNames(VFound)).IndexType; + varStepType = DDVariableTypes(ivarNames(VFound)).timeStepType; varUnits = DDVariableTypes(ivarNames(VFound)).units; } } @@ -8317,7 +8288,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa } keyVarIndexes(numKeys) = Loop; varAvgSum = DDVariableTypes(ivarNames(VFound)).storeType; - varStepType = DDVariableTypes(ivarNames(VFound)).IndexType; + varStepType = DDVariableTypes(ivarNames(VFound)).timeStepType; varUnits = DDVariableTypes(ivarNames(VFound)).units; } } @@ -8335,7 +8306,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa varType = VarType_Meter; varUnits = EnergyMeters(keyVarIndexes(1)).Units; varAvgSum = StoreType::Summed; - varStepType = ZoneVar; + varStepType = TimeStepType::TimeStepZone; } } @@ -8350,7 +8321,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa varType = VarType_Schedule; varUnits = unitStringToEnum(GetScheduleType(keyVarIndexes(1))); varAvgSum = StoreType::Averaged; - varStepType = ZoneVar; + varStepType = TimeStepType::TimeStepZone; } } } @@ -8784,12 +8755,12 @@ void ProduceRDDMDD() // Members int RealIntegerType; // Real= 1, Integer=2 int VarPtr; // pointer to real/integer VariableTypes structures - int IndexType; + int TimeStepType; int StoreType; std::string UnitsString; // Default Constructor - VariableTypes() : RealIntegerType(0), VarPtr(0), IndexType(0), StoreType(0) + VariableTypes() : RealIntegerType(0), VarPtr(0), TimeStepType(0), StoreType(0) { } }; @@ -8802,10 +8773,10 @@ void ProduceRDDMDD() if (DoReport) { ProduceReportVDD = ReportVDD_Yes; - if (VarOption1 == "IDF") { + if (VarOption1 == std::string("IDF")) { ProduceReportVDD = ReportVDD_IDF; } - if (VarOption2 != "") { + if (!VarOption2.empty()) { if (UtilityRoutines::SameString(VarOption2, "Name") || UtilityRoutines::SameString(VarOption2, "AscendingName")) { SortByName = true; } @@ -8859,10 +8830,10 @@ void ProduceRDDMDD() if (ProduceReportVDD == ReportVDD_Yes) { ItemPtr = iVariableNames(Item); if (!DDVariableTypes(ItemPtr).ReportedOnDDFile) { - rdd_stream << StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) << ',' + rdd_stream << StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) << ',' << standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) << ',' << VariableNames(Item) << unitStringFromDDitem(ItemPtr) << '\n'; - ResultsFramework::OutputSchema->RDD.push_back(StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) + "," + + ResultsFramework::OutputSchema->RDD.push_back(StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) + "," + standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) + "," + VariableNames(Item) + unitStringFromDDitem(ItemPtr)); DDVariableTypes(ItemPtr).ReportedOnDDFile = true; @@ -8872,10 +8843,10 @@ void ProduceRDDMDD() } else { ItemPtr = DDVariableTypes(ItemPtr).Next; } - rdd_stream << StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) << ',' + rdd_stream << StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) << ',' << standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) << ',' << VariableNames(Item) << unitStringFromDDitem(ItemPtr) << '\n'; - ResultsFramework::OutputSchema->RDD.push_back(StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) + "," + + ResultsFramework::OutputSchema->RDD.push_back(StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) + "," + standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) + "," + VariableNames(Item) + unitStringFromDDitem(ItemPtr)); DDVariableTypes(ItemPtr).ReportedOnDDFile = true; @@ -8885,9 +8856,9 @@ void ProduceRDDMDD() ItemPtr = iVariableNames(Item); if (!DDVariableTypes(ItemPtr).ReportedOnDDFile) { rdd_stream << "Output:Variable,*," << VariableNames(Item) << ",hourly; !- " - << StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) << ' ' + << StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) << ' ' << standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) << unitStringFromDDitem(ItemPtr) << '\n'; - ResultsFramework::OutputSchema->RDD.push_back(StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) + "," + + ResultsFramework::OutputSchema->RDD.push_back(StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) + "," + standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) + "," + VariableNames(Item) + unitStringFromDDitem(ItemPtr)); DDVariableTypes(ItemPtr).ReportedOnDDFile = true; @@ -8898,9 +8869,9 @@ void ProduceRDDMDD() ItemPtr = DDVariableTypes(ItemPtr).Next; } rdd_stream << "Output:Variable,*," << VariableNames(Item) << ",hourly; !- " - << StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) << ' ' + << StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) << ' ' << standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) << unitStringFromDDitem(ItemPtr) << '\n'; - ResultsFramework::OutputSchema->RDD.push_back(StandardIndexTypeKey(DDVariableTypes(ItemPtr).IndexType) + "," + + ResultsFramework::OutputSchema->RDD.push_back(StandardTimeStepTypeKey(DDVariableTypes(ItemPtr).timeStepType) + "," + standardVariableTypeKey(DDVariableTypes(ItemPtr).storeType) + "," + VariableNames(Item) + unitStringFromDDitem(ItemPtr)); DDVariableTypes(ItemPtr).ReportedOnDDFile = true; @@ -8946,7 +8917,7 @@ void ProduceRDDMDD() } void AddToOutputVariableList(std::string const &VarName, // Variable Name - int const IndexType, + OutputProcessor::TimeStepType const TimeStepType, OutputProcessor::StoreType const StateType, int const VariableType, OutputProcessor::Unit const unitsForVar, @@ -8999,7 +8970,7 @@ void AddToOutputVariableList(std::string const &VarName, // Variable Name if (NumVariablesForOutput > MaxVariablesForOutput) { DDVariableTypes.redimension(MaxVariablesForOutput += LVarAllocInc); } - DDVariableTypes(NumVariablesForOutput).IndexType = IndexType; + DDVariableTypes(NumVariablesForOutput).timeStepType = TimeStepType; DDVariableTypes(NumVariablesForOutput).storeType = StateType; DDVariableTypes(NumVariablesForOutput).VariableType = VariableType; DDVariableTypes(NumVariablesForOutput).VarNameOnly = VarName; @@ -9022,7 +8993,7 @@ void AddToOutputVariableList(std::string const &VarName, // Variable Name if (NumVariablesForOutput > MaxVariablesForOutput) { DDVariableTypes.redimension(MaxVariablesForOutput += LVarAllocInc); } - DDVariableTypes(NumVariablesForOutput).IndexType = IndexType; + DDVariableTypes(NumVariablesForOutput).timeStepType = TimeStepType; DDVariableTypes(NumVariablesForOutput).storeType = StateType; DDVariableTypes(NumVariablesForOutput).VariableType = VariableType; DDVariableTypes(NumVariablesForOutput).VarNameOnly = VarName; diff --git a/src/EnergyPlus/OutputProcessor.hh b/src/EnergyPlus/OutputProcessor.hh index 515d1c05eda..01c26c3a2fe 100644 --- a/src/EnergyPlus/OutputProcessor.hh +++ b/src/EnergyPlus/OutputProcessor.hh @@ -50,6 +50,7 @@ // C++ Headers #include +#include // ObjexxFCL Headers #include @@ -81,9 +82,6 @@ namespace OutputProcessor { extern int const IMinSetValue; extern int const IMaxSetValue; - extern int const ZoneVar; // Type value for those variables reported on the Zone Time Step - extern int const HVACVar; // Type value for those variables reported on the System Time Step - extern int const VarType_NotFound; // ref: GetVariableKeyCountandType, 0 = not found extern int const VarType_Integer; // ref: GetVariableKeyCountandType, 1 = integer extern int const VarType_Real; // ref: GetVariableKeyCountandType, 2 = real @@ -257,14 +255,21 @@ namespace OutputProcessor { Summed // Type value for "summed" variables }; + enum class TimeStepType + { + TimeStepZone = 1, // Type value for "zone" timestep variables + TimeStepSystem = 2, // Type value for "system" timestep variables + }; + struct TimeSteps { // Members - Reference TimeStep; // Pointer to the Actual Time Step Variable (Zone or HVAC) + Reference TimeStep; // fortran POINTER Pointer to the Actual Time Step Variable (Zone or HVAC) Real64 CurMinute; // Current minute (decoded from real Time Step Value) // Default Constructor TimeSteps() + : CurMinute(0.0) { } }; @@ -341,7 +346,7 @@ namespace OutputProcessor { struct VariableTypeForDDOutput { // Members - int IndexType; // Type whether Zone or HVAC + TimeStepType timeStepType; // Type whether Zone or HVAC StoreType storeType; // Variable Type (Summed/Non-Static or Average/Static) int VariableType; // Integer, Real. int Next; // Next variable of same name (different units) @@ -352,7 +357,7 @@ namespace OutputProcessor { // Default Constructor VariableTypeForDDOutput() - : IndexType(0), storeType(StoreType::Averaged), VariableType(VarType_NotFound), Next(0), ReportedOnDDFile(false), + : timeStepType(TimeStepType::TimeStepZone), storeType(StoreType::Averaged), VariableType(VarType_NotFound), Next(0), ReportedOnDDFile(false), units(OutputProcessor::Unit::None) { } @@ -361,7 +366,7 @@ namespace OutputProcessor { struct RealVariableType { // Members - int IndexType; // Type whether Zone or HVAC + TimeStepType timeStepType; // Type whether Zone or HVAC StoreType storeType; // Variable Type (Summed/Non-Static or Average/Static) int ReportID; // Report variable ID number std::string VarName; // Name of Variable key:variable @@ -374,7 +379,7 @@ namespace OutputProcessor { Reference VarPtr; // Pointer used to real Variables structure // Default Constructor - RealVariableType() : IndexType(0), storeType(StoreType::Averaged), ReportID(0), units(OutputProcessor::Unit::None) + RealVariableType() : timeStepType(TimeStepType::TimeStepZone), storeType(StoreType::Averaged), ReportID(0), units(OutputProcessor::Unit::None) { } }; @@ -382,7 +387,7 @@ namespace OutputProcessor { struct IntegerVariableType { // Members - int IndexType; // Type whether Zone or HVAC + TimeStepType timeStepType; // Type whether Zone or HVAC StoreType storeType; // Variable Type (Summed/Non-Static or Average/Static) int ReportID; // Report variable ID number std::string VarName; // Name of Variable @@ -392,7 +397,7 @@ namespace OutputProcessor { Reference VarPtr; // Pointer used to integer Variables structure // Default Constructor - IntegerVariableType() : IndexType(0), storeType(StoreType::Averaged), ReportID(0), units(OutputProcessor::Unit::None) + IntegerVariableType() : timeStepType(TimeStepType::TimeStepZone), storeType(StoreType::Averaged), ReportID(0), units(OutputProcessor::Unit::None) { } }; @@ -561,7 +566,7 @@ namespace OutputProcessor { }; // Object Data - extern Array1D TimeValue; // Pointers to the actual TimeStep variables + extern std::map TimeValue; // Pointers to the actual TimeStep variables extern Array1D RVariableTypes; // Variable Types structure (use NumOfRVariables to traverse) extern Array1D IVariableTypes; // Variable Types structure (use NumOfIVariables to traverse) extern Array1D DDVariableTypes; // Variable Types structure (use NumVariablesForOutput to traverse) @@ -631,11 +636,11 @@ namespace OutputProcessor { IVariableTypes.redimension(MaxIVariable += IVarAllocInc); } - int ValidateIndexType(std::string const &IndexTypeKey, // Index type (Zone, HVAC) for variables - std::string const &CalledFrom // Routine called from (for error messages) + TimeStepType ValidateTimeStepType(std::string const &TimeStepTypeKey, // Index type (Zone, HVAC) for variables + std::string const &CalledFrom // Routine called from (for error messages) ); - std::string StandardIndexTypeKey(int const IndexType); + std::string StandardTimeStepTypeKey(TimeStepType const timeStepType); StoreType validateVariableType(std::string const &VariableTypeKey); @@ -771,7 +776,7 @@ namespace OutputProcessor { std::string const &reportIDChr, // The reporting ID for the data std::string const &keyedValue, // The key name for the data std::string const &variableName, // The variable's actual name - int const indexType, + TimeStepType const timeStepType, OutputProcessor::Unit const &unitsForVar, // The variables units Optional_string_const customUnitName = _, Optional_string_const ScheduleName = _); @@ -871,6 +876,8 @@ namespace OutputProcessor { std::string unitStringFromDDitem(int const ddItemPtr // index provided for DDVariableTypes ); + std::string timeStepTypeEnumToString(OutputProcessor::TimeStepType const &t_timeStepType); + } // namespace OutputProcessor //============================================================================================== @@ -884,7 +891,7 @@ namespace OutputProcessor { void SetupOutputVariable(std::string const &VariableName, // String Name of variable (with units) OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable Real64 &ActualVariable, // Actual Variable, used to set up pointer - std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + std::string const &TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string const &KeyedValue, // Associated Key for this variable Optional_string_const ReportFreq = _, // Internal use -- causes reporting at this freqency @@ -902,7 +909,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na void SetupOutputVariable(std::string const &VariableName, // String Name of variable OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable int &ActualVariable, // Actual Variable, used to set up pointer - std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + std::string const &TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2 std::string const &KeyedValue, // Associated Key for this variable Optional_string_const ReportFreq = _, // Internal use -- causes reporting at this freqency @@ -912,7 +919,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na void SetupOutputVariable(std::string const &VariableName, // String Name of variable OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable Real64 &ActualVariable, // Actual Variable, used to set up pointer - std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 + std::string const &TimeStepTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2 std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2 int const KeyedValue, // Associated Key for this variable Optional_string_const ReportFreq = _, // Internal use -- causes reporting at this freqency @@ -926,7 +933,7 @@ void SetupOutputVariable(std::string const &VariableName, // String Na Optional_int_const indexGroupKey = _ // Group identifier for SQL output ); -void UpdateDataandReport(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) +void UpdateDataandReport(OutputProcessor::TimeStepType const TimeStepTypeKey); // What kind of data to update (Zone, HVAC) void AssignReportNumber(int &ReportNumber); @@ -947,7 +954,7 @@ std::string GetMeterResourceType(int const MeterNumber); // Which Meter Number ( Real64 GetCurrentMeterValue(int const MeterNumber); // Which Meter Number (from GetMeterIndex) Real64 GetInstantMeterValue(int const MeterNumber, // Which Meter Number (from GetMeterIndex) - int const IndexType // Whether this is zone of HVAC + OutputProcessor::TimeStepType const TimeStepType // Whether this is zone of HVAC ); void IncrementInstMeterCache(); @@ -968,7 +975,7 @@ void GetMeteredVariables(std::string const &ComponentType, // Given Co std::string const &ComponentName, // Given Component Name (user defined) Array1S_int VarIndexes, // Variable Numbers Array1S_int VarTypes, // Variable Types (1=integer, 2=real, 3=meter) - Array1S_int IndexTypes, // Variable Index Types (1=Zone,2=HVAC) + Array1A TimeStepTypes, // Variable Index Types (1=Zone,2=HVAC), Array1A unitsForVar, // units from enum for each variable Array1S_int ResourceTypes, // ResourceTypes for each variable Optional EndUses = _, // EndUses for each variable @@ -982,7 +989,7 @@ void GetVariableKeyCountandType(std::string const &varName, // Standa int &numKeys, // Number of keys found int &varType, // 0=not found, 1=integer, 2=real, 3=meter OutputProcessor::StoreType &varAvgSum, // Variable is Averaged=1 or Summed=2 - int &varStepType, // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType &varStepType, // Variable time step is Zone=1 or HVAC=2 OutputProcessor::Unit &varUnits // Units enumeration ); @@ -999,7 +1006,7 @@ void InitPollutionMeterReporting(std::string const &ReportFreqName); void ProduceRDDMDD(); void AddToOutputVariableList(std::string const &VarName, // Variable Name - int const IndexType, + OutputProcessor::TimeStepType const TimeStepType, OutputProcessor::StoreType const StateType, int const VariableType, OutputProcessor::Unit const unitsForVar, diff --git a/src/EnergyPlus/OutputReportData.cc b/src/EnergyPlus/OutputReportData.cc index fe5ca1be51d..2f484fe18cd 100644 --- a/src/EnergyPlus/OutputReportData.cc +++ b/src/EnergyPlus/OutputReportData.cc @@ -73,7 +73,7 @@ AnnualFieldSet::AnnualFieldSet(std::string varName, AnnualFieldSet::AggregationK int AnnualFieldSet::getVariableKeyCountandTypeFromFldSt(int &typeVar, OutputProcessor::StoreType &avgSumVar, - int &stepTypeVar, + OutputProcessor::TimeStepType &stepTypeVar, OutputProcessor::Unit &unitsVar) { int numkeys; diff --git a/src/EnergyPlus/OutputReportData.hh b/src/EnergyPlus/OutputReportData.hh index d3f28574f8f..2dc92463ead 100644 --- a/src/EnergyPlus/OutputReportData.hh +++ b/src/EnergyPlus/OutputReportData.hh @@ -116,7 +116,8 @@ public: std::vector m_timeInBin; // amount of time in each bin (usually 10 bins) }; - int getVariableKeyCountandTypeFromFldSt(int &typeVar, OutputProcessor::StoreType &avgSumVar, int &stepTypeVar, OutputProcessor::Unit &unitsVar); + int getVariableKeyCountandTypeFromFldSt(int &typeVar, OutputProcessor::StoreType &avgSumVar, + OutputProcessor::TimeStepType &stepTypeVar, OutputProcessor::Unit &unitsVar); void getVariableKeysFromFldSt(int &typeVar, int keyCount, std::vector &namesOfKeys, std::vector &indexesForKeyVar); @@ -128,7 +129,7 @@ public: int m_typeOfVar; // 0=not found, 1=integer, 2=real, 3=meter int m_keyCount; OutputProcessor::StoreType m_varAvgSum; // Variable is Averaged=1 or Summed=2 - int m_varStepType; // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType m_varStepType; // Variable time step is Zone=1 or HVAC=2 std::vector m_namesOfKeys; // stored version of name of keys from getVariableKeys std::vector m_indexesForKeyVar; // stored version of name of keys from getVariableKeys std::vector m_cell; // for each row contains the results and details for one cell of the table diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index c088fd0de05..8849979a83e 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -175,7 +175,6 @@ namespace OutputReportTabular { using DataGlobals::DoOutputReporting; using DataGlobals::DoWeathSim; using DataGlobals::HourOfDay; - using DataGlobals::HVACTSReporting; using DataGlobals::KindOfSim; using DataGlobals::ksDesignDay; using DataGlobals::ksRunPeriodDesign; @@ -187,7 +186,6 @@ namespace OutputReportTabular { using DataGlobals::TimeStep; using DataGlobals::TimeStepZone; using DataGlobals::TimeStepZoneSec; - using DataGlobals::ZoneTSReporting; using namespace DataGlobalConstants; using namespace OutputReportPredefined; using namespace DataHeatBalance; @@ -226,9 +224,6 @@ namespace OutputReportTabular { int const unitsStyleInchPound(4); int const unitsStyleNotFound(5); - int const stepTypeZone(ZoneTSReporting); - int const stepTypeHVAC(HVACTSReporting); - // BEPS Report Related Variables // From Report:Table:Predefined - BEPS int const numResourceTypes(14); @@ -729,7 +724,7 @@ namespace OutputReportTabular { OutputReportTabular::ResetTabularReports(); } - void UpdateTabularReports(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void UpdateTabularReports(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -764,7 +759,7 @@ namespace OutputReportTabular { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - if (IndexTypeKey != ZoneTSReporting && IndexTypeKey != HVACTSReporting) { + if (t_timeStepType != OutputProcessor::TimeStepType::TimeStepZone && t_timeStepType != OutputProcessor::TimeStepType::TimeStepSystem) { ShowFatalError("Invalid reporting requested -- UpdateTabularReports"); } @@ -787,18 +782,18 @@ namespace OutputReportTabular { date_and_time(_, _, _, td); } if (DoOutputReporting && WriteTabularFiles && (KindOfSim == ksRunPeriodWeather)) { - if (IndexTypeKey == stepTypeZone) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { gatherElapsedTimeBEPS += TimeStepZone; } if (DoWeathSim) { - GatherMonthlyResultsForTimestep(IndexTypeKey); - OutputReportTabularAnnual::GatherAnnualResultsForTimeStep(IndexTypeKey); - GatherBinResultsForTimestep(IndexTypeKey); - GatherBEPSResultsForTimestep(IndexTypeKey); - GatherSourceEnergyEndUseResultsForTimestep(IndexTypeKey); - GatherPeakDemandForTimestep(IndexTypeKey); - GatherHeatGainReport(IndexTypeKey); - GatherHeatEmissionReport(IndexTypeKey); + GatherMonthlyResultsForTimestep(t_timeStepType); + OutputReportTabularAnnual::GatherAnnualResultsForTimeStep(t_timeStepType); + GatherBinResultsForTimestep(t_timeStepType); + GatherBEPSResultsForTimestep(t_timeStepType); + GatherSourceEnergyEndUseResultsForTimestep(t_timeStepType); + GatherPeakDemandForTimestep(t_timeStepType); + GatherHeatGainReport(t_timeStepType); + GatherHeatEmissionReport(t_timeStepType); } } } @@ -1097,7 +1092,7 @@ namespace OutputReportTabular { int KeyCount; int TypeVar; OutputProcessor::StoreType AvgSumVar; - int StepTypeVar; + OutputProcessor::TimeStepType StepTypeVar; OutputProcessor::Unit UnitsVar(OutputProcessor::Unit::None); // Units enum // CHARACTER(len=MaxNameLength), DIMENSION(:), ALLOCATABLE :: NamesOfKeys ! Specific key name // INTEGER, DIMENSION(:) , ALLOCATABLE :: IndexesForKeyVar ! Array index @@ -1242,7 +1237,7 @@ namespace OutputReportTabular { e.varNum = 0; e.typeOfVar = 0; e.avgSum = OutputProcessor::StoreType::Averaged; - e.stepType = 0; + e.stepType = OutputProcessor::TimeStepType::TimeStepZone; e.units = OutputProcessor::Unit::None; e.aggType = 0; } @@ -1457,7 +1452,7 @@ namespace OutputReportTabular { MonthlyColumns(mColumn).varNum = 0; MonthlyColumns(mColumn).typeOfVar = 0; MonthlyColumns(mColumn).avgSum = OutputProcessor::StoreType::Averaged; - MonthlyColumns(mColumn).stepType = 0; + MonthlyColumns(mColumn).stepType = OutputProcessor::TimeStepType::TimeStepZone; MonthlyColumns(mColumn).units = OutputProcessor::Unit::None; MonthlyColumns(mColumn).aggType = aggTypeSumOrAvg; } @@ -3915,7 +3910,7 @@ namespace OutputReportTabular { //====================================================================================================================== //====================================================================================================================== - void GatherBinResultsForTimestep(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void GatherBinResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -3961,7 +3956,7 @@ namespace OutputReportTabular { Real64 topValue; int binNum; int repIndex; - int curStepType; + OutputProcessor::TimeStepType curStepType; // REAL(r64), external :: GetInternalVariableValue @@ -3992,12 +3987,12 @@ namespace OutputReportTabular { if (gatherThisTime) { for (jTable = 1; jTable <= curNumTables; ++jTable) { repIndex = curResIndex + (jTable - 1); - if (((curStepType == stepTypeZone) && (IndexTypeKey == ZoneTSReporting)) || - ((curStepType == stepTypeHVAC) && (IndexTypeKey == HVACTSReporting))) { + if (((curStepType == OutputProcessor::TimeStepType::TimeStepZone) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) || + ((curStepType == OutputProcessor::TimeStepType::TimeStepSystem) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem))) { // put actual value from OutputProcesser arrays curValue = GetInternalVariableValue(curTypeOfVar, BinObjVarID(repIndex).varMeterNum); // per MJW when a summed variable is used divide it by the length of the time step - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { elapsedTime = TimeStepSys; } else { elapsedTime = TimeStepZone; @@ -4043,7 +4038,7 @@ namespace OutputReportTabular { } } - void GatherMonthlyResultsForTimestep(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void GatherMonthlyResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -4093,7 +4088,7 @@ namespace OutputReportTabular { // LOGICAL,SAVE :: activeHoursShown=.FALSE. !fix by LKL addressing CR6482 bool activeHoursShown; bool activeNewValue; - int curStepType; + OutputProcessor::TimeStepType curStepType; int minuteCalculated; int kOtherColumn; // variable used in loop to scan through additional columns int scanColumn; @@ -4105,7 +4100,7 @@ namespace OutputReportTabular { // profiling showed that they were slow. static Array1D_int MonthlyColumnsTypeOfVar; - static Array1D_int MonthlyColumnsStepType; + static Array1D MonthlyColumnsStepType; static Array1D_int MonthlyColumnsAggType; static Array1D_int MonthlyColumnsVarNum; static Array1D_int MonthlyTablesNumColumns; @@ -4139,7 +4134,7 @@ namespace OutputReportTabular { } elapsedTime = TimeStepSys; - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { elapsedTime = TimeStepSys; } else { elapsedTime = TimeStepZone; @@ -4153,8 +4148,8 @@ namespace OutputReportTabular { curCol = jColumn + curFirstColumn - 1; curTypeOfVar = MonthlyColumnsTypeOfVar(curCol); curStepType = MonthlyColumnsStepType(curCol); - if (((curStepType == stepTypeZone) && (IndexTypeKey == ZoneTSReporting)) || - ((curStepType == stepTypeHVAC) && (IndexTypeKey == HVACTSReporting))) { + if (((curStepType == OutputProcessor::TimeStepType::TimeStepZone) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) || + ((curStepType == OutputProcessor::TimeStepType::TimeStepSystem) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem))) { // the above condition used to include the following prior to new scan method // (MonthlyColumns(curCol)%aggType .EQ. aggTypeValueWhenMaxMin) curVarNum = MonthlyColumnsVarNum(curCol); @@ -4169,9 +4164,9 @@ namespace OutputReportTabular { newDuration = 0.0; activeNewValue = false; // the current timestamp - minuteCalculated = DetermineMinuteForReporting(IndexTypeKey); + minuteCalculated = DetermineMinuteForReporting(t_timeStepType); // minuteCalculated = (CurrentTime - INT(CurrentTime))*60 - // IF (IndexTypeKey .EQ. stepTypeHVAC) minuteCalculated = minuteCalculated + SysTimeElapsed * 60 + // IF (t_timeStepType .EQ. OutputProcessor::TimeStepType::TimeStepSystem) minuteCalculated = minuteCalculated + SysTimeElapsed * 60 // minuteCalculated = INT((TimeStep-1) * TimeStepZone * 60) + INT((SysTimeElapsed + TimeStepSys) * 60) EncodeMonDayHrMin(timestepTimeStamp, Month, DayOfMonth, HourOfDay, minuteCalculated); // perform the selected aggregation type @@ -4189,7 +4184,7 @@ namespace OutputReportTabular { } else if (SELECT_CASE_var == aggTypeMaximum) { // per MJW when a summed variable is used divide it by the length of the time step if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { curValue /= (TimeStepSys * SecInHour); } else { curValue /= TimeStepZoneSec; @@ -4206,7 +4201,7 @@ namespace OutputReportTabular { } else if (SELECT_CASE_var == aggTypeMinimum) { // per MJW when a summed variable is used divide it by the length of the time step if (MonthlyColumns(curCol).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { curValue /= (TimeStepSys * SecInHour); } else { curValue /= TimeStepZoneSec; @@ -4303,7 +4298,7 @@ namespace OutputReportTabular { scanValue = GetInternalVariableValue(scanTypeOfVar, scanVarNum); // When a summed variable is used divide it by the length of the time step if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * SecInHour); } else { scanValue /= TimeStepZoneSec; @@ -4347,7 +4342,7 @@ namespace OutputReportTabular { MonthlyColumns(scanColumn).duration(Month) += elapsedTime; } else if (SELECT_CASE_var == aggTypeMaximumDuringHoursShown) { if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * SecInHour); } else { scanValue /= TimeStepZoneSec; @@ -4359,7 +4354,7 @@ namespace OutputReportTabular { } } else if (SELECT_CASE_var == aggTypeMinimumDuringHoursShown) { if (MonthlyColumns(scanColumn).avgSum == OutputProcessor::StoreType::Summed) { // if it is a summed variable - if (IndexTypeKey == HVACTSReporting) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { scanValue /= (TimeStepSys * SecInHour); } else { scanValue /= TimeStepZoneSec; @@ -4381,7 +4376,7 @@ namespace OutputReportTabular { } } - void GatherBEPSResultsForTimestep(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -4461,7 +4456,7 @@ namespace OutputReportTabular { // if no beps report is called then skip - if ((displayTabularBEPS || displayLEEDSummary) && (IndexTypeKey == stepTypeZone)) { + if ((displayTabularBEPS || displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // add the current time to the total elapsed time // FOLLOWING LINE MOVED TO UPDATETABULARREPORTS because used even when beps is not called // gatherElapsedTimeBEPS = gatherElapsedTimeBEPS + TimeStepZone @@ -4533,7 +4528,7 @@ namespace OutputReportTabular { } } - void GatherSourceEnergyEndUseResultsForTimestep(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void GatherSourceEnergyEndUseResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Mangesh Basarkar @@ -4622,7 +4617,7 @@ namespace OutputReportTabular { // if no beps by source report is called then skip - if ((displaySourceEnergyEndUseSummary) && (IndexTypeKey == stepTypeZone)) { + if ((displaySourceEnergyEndUseSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { @@ -4661,7 +4656,7 @@ namespace OutputReportTabular { } } - void GatherPeakDemandForTimestep(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void GatherPeakDemandForTimestep(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -4746,7 +4741,7 @@ namespace OutputReportTabular { int minuteCalculated; int timestepTimeStamp; - if ((displayDemandEndUse) && (IndexTypeKey == stepTypeZone)) { + if ((displayDemandEndUse) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { curMeterNumber = meterNumTotalsBEPS(iResource); @@ -4757,7 +4752,7 @@ namespace OutputReportTabular { gatherDemandTotal(iResource) = curDemandValue; // save the time that the peak demand occurred // minuteCalculated = (CurrentTime - INT(CurrentTime))*60 - minuteCalculated = DetermineMinuteForReporting(IndexTypeKey); + minuteCalculated = DetermineMinuteForReporting(t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, Month, DayOfMonth, HourOfDay, minuteCalculated); gatherDemandTimeStamp(iResource) = timestepTimeStamp; // if new peak demand is set, then gather all of the end use values at this particular @@ -4782,7 +4777,7 @@ namespace OutputReportTabular { } // gather the peak demands of each individual enduse subcategory for the LEED report - if ((displayLEEDSummary) && (IndexTypeKey == stepTypeZone)) { + if ((displayLEEDSummary) && (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) { // loop through all of the resources and end uses for the entire facility for (iResource = 1; iResource <= numResourceTypes; ++iResource) { for (jEndUse = 1; jEndUse <= NumEndUses; ++jEndUse) { @@ -4808,7 +4803,7 @@ namespace OutputReportTabular { } } - void GatherHeatEmissionReport(int const IndexTypeKey) + void GatherHeatEmissionReport(OutputProcessor::TimeStepType t_timeStepType) { // PURPOSE OF THIS SUBROUTINE: // Gathers the data each zone timestep for the heat gain report. @@ -4892,7 +4887,7 @@ namespace OutputReportTabular { if (!displayHeatEmissionsSummary) return; // don't gather data if report isn't requested // Only gather zone report at zone time steps - if (IndexTypeKey == stepTypeZone) { + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { BuildingPreDefRep.emiEnvelopConv += SumSurfaceHeatEmission * convertJtoGJ; return; } @@ -5065,7 +5060,7 @@ namespace OutputReportTabular { BuildingPreDefRep.emiHVACRelief + BuildingPreDefRep.emiHVACReject; } - void GatherHeatGainReport(int const IndexTypeKey) // What kind of data to update (Zone, HVAC) + void GatherHeatGainReport(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC) { // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer @@ -5193,7 +5188,7 @@ namespace OutputReportTabular { if (!reportName(pdrSensibleGain).show) return; // don't gather data if report isn't requested - if (IndexTypeKey == stepTypeZone) return; // only add values over the HVAC timestep basis + if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) return; // only add values over the HVAC timestep basis if (GatherHeatGainReportfirstTime) { radiantHeat.allocate(NumOfZones); @@ -5353,7 +5348,7 @@ namespace OutputReportTabular { // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) - ActualTimeMin = DetermineMinuteForReporting(IndexTypeKey); + ActualTimeMin = DetermineMinuteForReporting(t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, Month, DayOfMonth, HourOfDay, ActualTimeMin); ZonePreDefRep(iZone).htPtTimeStamp = timestepTimeStamp; // HVAC Input Sensible Air Heating @@ -5432,7 +5427,7 @@ namespace OutputReportTabular { // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) - ActualTimeMin = DetermineMinuteForReporting(IndexTypeKey); + ActualTimeMin = DetermineMinuteForReporting(t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, Month, DayOfMonth, HourOfDay, ActualTimeMin); ZonePreDefRep(iZone).clPtTimeStamp = timestepTimeStamp; // HVAC Input Sensible Air Heating @@ -5523,7 +5518,7 @@ namespace OutputReportTabular { // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) - ActualTimeMin = DetermineMinuteForReporting(IndexTypeKey); + ActualTimeMin = DetermineMinuteForReporting(t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, Month, DayOfMonth, HourOfDay, ActualTimeMin); BuildingPreDefRep.htPtTimeStamp = timestepTimeStamp; // reset building level results to zero prior to accumulating across zones @@ -5611,7 +5606,7 @@ namespace OutputReportTabular { // ActualtimeE = ActualTimeS+TimeStepSys // ActualTimeHrS=INT(ActualTimeS) // ActualTimeMin=NINT((ActualtimeE - ActualTimeHrS)*FracToMin) - ActualTimeMin = DetermineMinuteForReporting(IndexTypeKey); + ActualTimeMin = DetermineMinuteForReporting(t_timeStepType); EncodeMonDayHrMin(timestepTimeStamp, Month, DayOfMonth, HourOfDay, ActualTimeMin); BuildingPreDefRep.clPtTimeStamp = timestepTimeStamp; // reset building level results to zero prior to accumulating across zones diff --git a/src/EnergyPlus/OutputReportTabular.hh b/src/EnergyPlus/OutputReportTabular.hh index aba90c8d107..6dfe85d0044 100644 --- a/src/EnergyPlus/OutputReportTabular.hh +++ b/src/EnergyPlus/OutputReportTabular.hh @@ -409,7 +409,7 @@ namespace OutputReportTabular { int numTables; int typeOfVar; // 0=not found, 1=integer, 2=real, 3=meter OutputProcessor::StoreType avgSum; // Variable is Averaged=1 or Summed=2 - int stepType; // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType stepType; // Variable time step is Zone=1 or HVAC=2 OutputProcessor::Unit units; // the units enumeration std::string ScheduleName; // the name of the schedule int scheduleIndex; // index to the schedule specified - if no schedule use zero @@ -417,7 +417,7 @@ namespace OutputReportTabular { // Default Constructor OutputTableBinnedType() : intervalStart(0.0), intervalSize(0.0), intervalCount(0), resIndex(0), numTables(0), typeOfVar(0), - avgSum(OutputProcessor::StoreType::Averaged), stepType(0), scheduleIndex(0) + avgSum(OutputProcessor::StoreType::Averaged), stepType(OutputProcessor::TimeStepType::TimeStepZone), scheduleIndex(0) { } }; @@ -500,14 +500,14 @@ namespace OutputReportTabular { int typeOfVar; // 0=not found, 1=integer, 2=real, 3=meter int keyCount; // noel OutputProcessor::StoreType varAvgSum; // Variable is Averaged=1 or Summed=2 - int varStepType; // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType varStepType; // Variable time step is Zone=1 or HVAC=2 Array1D_string NamesOfKeys; // keyNames !noel Array1D_int IndexesForKeyVar; // keyVarIndexes !noel // Default Constructor MonthlyFieldSetInputType() : aggregate(0), varUnits(OutputProcessor::Unit::None), typeOfVar(0), keyCount(0), varAvgSum(OutputProcessor::StoreType::Averaged), - varStepType(1) + varStepType(OutputProcessor::TimeStepType::TimeStepZone) { } }; @@ -533,7 +533,7 @@ namespace OutputReportTabular { int varNum; // variable or meter number int typeOfVar; // 0=not found, 1=integer, 2=real, 3=meter OutputProcessor::StoreType avgSum; // Variable is Averaged=1 or Summed=2 - int stepType; // Variable time step is Zone=1 or HVAC=2 + OutputProcessor::TimeStepType stepType; // Variable time step is Zone=1 or HVAC=2 OutputProcessor::Unit units; // the units string, may be blank int aggType; // index to the type of aggregation (see list of parameters) Array1D reslt; // monthly results @@ -544,7 +544,7 @@ namespace OutputReportTabular { // Default Constructor MonthlyColumnsType() - : varNum(0), typeOfVar(0), avgSum(OutputProcessor::StoreType::Averaged), stepType(0), units(OutputProcessor::Unit::None), aggType(0), + : varNum(0), typeOfVar(0), avgSum(OutputProcessor::StoreType::Averaged), stepType(OutputProcessor::TimeStepType::TimeStepZone), units(OutputProcessor::Unit::None), aggType(0), reslt(12, 0.0), duration(12, 0.0), timeStamp(12, 0), aggForStep(0.0) { } @@ -669,7 +669,7 @@ namespace OutputReportTabular { // Functions void clear_state(); - void UpdateTabularReports(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void UpdateTabularReports(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) //====================================================================================================================== //====================================================================================================================== @@ -731,19 +731,19 @@ namespace OutputReportTabular { //====================================================================================================================== //====================================================================================================================== - void GatherBinResultsForTimestep(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void GatherBinResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherMonthlyResultsForTimestep(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void GatherMonthlyResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherBEPSResultsForTimestep(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherSourceEnergyEndUseResultsForTimestep(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void GatherSourceEnergyEndUseResultsForTimestep(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherPeakDemandForTimestep(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void GatherPeakDemandForTimestep(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherHeatGainReport(int const IndexTypeKey); // What kind of data to update (Zone, HVAC) + void GatherHeatGainReport(OutputProcessor::TimeStepType t_timeStepType); // What kind of data to update (Zone, HVAC) - void GatherHeatEmissionReport(int const IndexTypeKey); + void GatherHeatEmissionReport(OutputProcessor::TimeStepType t_timeStepType); //====================================================================================================================== //====================================================================================================================== diff --git a/src/EnergyPlus/OutputReportTabularAnnual.cc b/src/EnergyPlus/OutputReportTabularAnnual.cc index b630ac43688..4cbeadcdcba 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.cc +++ b/src/EnergyPlus/OutputReportTabularAnnual.cc @@ -176,7 +176,7 @@ namespace OutputReportTabularAnnual { int keyCount = 0; int typeVar = 0; OutputProcessor::StoreType avgSumVar; - int stepTypeVar = 0; + OutputProcessor::TimeStepType stepTypeVar; OutputProcessor::Unit unitsVar = OutputProcessor::Unit::None; Array1D_string namesOfKeys; // keyNames Array1D_int indexesForKeyVar; // keyVarIndexes @@ -304,7 +304,7 @@ namespace OutputReportTabularAnnual { return (missingHourAggError || missingMaxOrMinError); } - void GatherAnnualResultsForTimeStep(int kindOfTimeStep) + void GatherAnnualResultsForTimeStep(OutputProcessor::TimeStepType kindOfTimeStep) { // Jason Glazer, August 2015 // This function is not part of the class but acts as an interface between procedural code and the class by @@ -315,7 +315,7 @@ namespace OutputReportTabularAnnual { } } - void AnnualTable::gatherForTimestep(int kindOfTimeStep) + void AnnualTable::gatherForTimestep(OutputProcessor::TimeStepType kindOfTimeStep) { // Jason Glazer, August 2015 // For each cell of the table, gather the value as indicated by the type of aggregation @@ -337,7 +337,7 @@ namespace OutputReportTabularAnnual { for (unsigned int row = 0; row != m_objectNames.size(); row++) { // loop through by row. for (fldStIt = m_annualFields.begin(); fldStIt != m_annualFields.end(); ++fldStIt) { int curTypeOfVar = fldStIt->m_typeOfVar; - int curStepType = fldStIt->m_varStepType; + OutputProcessor::TimeStepType curStepType = fldStIt->m_varStepType; if (curStepType == kindOfTimeStep) // this is a much simpler conditional than the code in monthly gathering { int curVarNum = fldStIt->m_cell[row].indexesForKeyVar; @@ -601,10 +601,10 @@ namespace OutputReportTabularAnnual { } } - Real64 AnnualTable::getElapsedTime(int kindOfTimeStep) + Real64 AnnualTable::getElapsedTime(OutputProcessor::TimeStepType kindOfTimeStep) { Real64 elapsedTime; - if (kindOfTimeStep == DataGlobals::HVACTSReporting) { + if (kindOfTimeStep == OutputProcessor::TimeStepType::TimeStepZone) { elapsedTime = DataHVACGlobals::TimeStepSys; } else { elapsedTime = DataGlobals::TimeStepZone; @@ -612,10 +612,10 @@ namespace OutputReportTabularAnnual { return elapsedTime; } - Real64 AnnualTable::getSecondsInTimeStep(int kindOfTimeStep) + Real64 AnnualTable::getSecondsInTimeStep(OutputProcessor::TimeStepType kindOfTimeStep) { Real64 secondsInTimeStep; - if (kindOfTimeStep == DataGlobals::HVACTSReporting) { + if (kindOfTimeStep == OutputProcessor::TimeStepType::TimeStepZone) { secondsInTimeStep = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; } else { secondsInTimeStep = DataGlobals::TimeStepZoneSec; @@ -1399,7 +1399,7 @@ namespace OutputReportTabularAnnual { ret.push_back(outStr); outStr = std::to_string(static_cast(fldSt.m_varAvgSum)); ret.push_back(outStr); - outStr = std::to_string(fldSt.m_varStepType); + outStr = std::to_string(static_cast(fldSt.m_varStepType)); ret.push_back(outStr); outStr = std::to_string(fldSt.m_aggregate); ret.push_back(outStr); diff --git a/src/EnergyPlus/OutputReportTabularAnnual.hh b/src/EnergyPlus/OutputReportTabularAnnual.hh index 9b33ab80757..11934b8bd3a 100644 --- a/src/EnergyPlus/OutputReportTabularAnnual.hh +++ b/src/EnergyPlus/OutputReportTabularAnnual.hh @@ -76,7 +76,7 @@ namespace OutputReportTabularAnnual { void checkAggregationOrderForAnnual(); - void GatherAnnualResultsForTimeStep(int kindOfTypeStep); + void GatherAnnualResultsForTimeStep(OutputProcessor::TimeStepType kindOfTypeStep); void ResetAnnualGathering(); @@ -115,7 +115,7 @@ namespace OutputReportTabularAnnual { bool invalidAggregationOrder(); - void gatherForTimestep(int kindOfTypeStep); + void gatherForTimestep(OutputProcessor::TimeStepType kindOfTypeStep); void resetGathering(); @@ -142,9 +142,9 @@ namespace OutputReportTabularAnnual { std::vector m_objectNames; // for each row of annual table std::vector m_annualFields; // for each column - Real64 getElapsedTime(int); + Real64 getElapsedTime(OutputProcessor::TimeStepType kindOfTimeStep); - Real64 getSecondsInTimeStep(int); + Real64 getSecondsInTimeStep(OutputProcessor::TimeStepType kindOfTimeStep); void computeBinColumns(); diff --git a/src/EnergyPlus/Plant/MeterData.hh b/src/EnergyPlus/Plant/MeterData.hh index 6a502a8e775..fb1ee5bb223 100644 --- a/src/EnergyPlus/Plant/MeterData.hh +++ b/src/EnergyPlus/Plant/MeterData.hh @@ -63,14 +63,14 @@ namespace DataPlant { int EndUse_CompMode; std::string Group; int ReportVarIndex; - int ReportVarIndexType; + OutputProcessor::TimeStepType ReportVarIndexType; int ReportVarType; Real64 CurMeterReading; // Default Constructor MeterData() - : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(0), EndUse_CompMode(0), ReportVarIndex(0), ReportVarIndexType(0), - ReportVarType(0), CurMeterReading(0.0) + : ReportVarUnits(OutputProcessor::Unit::None), ResourceType(0), EndUse_CompMode(0), ReportVarIndex(0), + ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0) { } }; diff --git a/src/EnergyPlus/PollutionModule.cc b/src/EnergyPlus/PollutionModule.cc index 61da93df0a1..0490819c28a 100644 --- a/src/EnergyPlus/PollutionModule.cc +++ b/src/EnergyPlus/PollutionModule.cc @@ -5718,37 +5718,50 @@ namespace PollutionModule { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: FuelType.ElecFacility = - GetInstantMeterValue(FuelType.ElecFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.ElecFacilityIndex, 2); + GetInstantMeterValue(FuelType.ElecFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.ElecFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.DieselFacility = - GetInstantMeterValue(FuelType.DieselFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.DieselFacilityIndex, 2); + GetInstantMeterValue(FuelType.DieselFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.DieselFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.PurchCoolFacility = - GetInstantMeterValue(FuelType.PurchCoolFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.PurchCoolFacilityIndex, 2); + GetInstantMeterValue(FuelType.PurchCoolFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.PurchCoolFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.PurchHeatFacility = - GetInstantMeterValue(FuelType.PurchHeatFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.PurchHeatFacilityIndex, 2); + GetInstantMeterValue(FuelType.PurchHeatFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.PurchHeatFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.NatGasFacility = - GetInstantMeterValue(FuelType.NatGasFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.NatGasFacilityIndex, 2); + GetInstantMeterValue(FuelType.NatGasFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.NatGasFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.GasolineFacility = - GetInstantMeterValue(FuelType.GasolineFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.GasolineFacilityIndex, 2); + GetInstantMeterValue(FuelType.GasolineFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.GasolineFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.CoalFacility = - GetInstantMeterValue(FuelType.CoalFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.CoalFacilityIndex, 2); + GetInstantMeterValue(FuelType.CoalFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.CoalFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.FuelOil1Facility = - GetInstantMeterValue(FuelType.FuelOil1FacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.FuelOil1FacilityIndex, 2); + GetInstantMeterValue(FuelType.FuelOil1FacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.FuelOil1FacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.FuelOil2Facility = - GetInstantMeterValue(FuelType.FuelOil2FacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.FuelOil2FacilityIndex, 2); + GetInstantMeterValue(FuelType.FuelOil2FacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.FuelOil2FacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.PropaneFacility = - GetInstantMeterValue(FuelType.PropaneFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.PropaneFacilityIndex, 2); + GetInstantMeterValue(FuelType.PropaneFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.PropaneFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.OtherFuel1Facility = - GetInstantMeterValue(FuelType.OtherFuel1FacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.OtherFuel1FacilityIndex, 2); + GetInstantMeterValue(FuelType.OtherFuel1FacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.OtherFuel1FacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.OtherFuel2Facility = - GetInstantMeterValue(FuelType.OtherFuel2FacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.OtherFuel2FacilityIndex, 2); - FuelType.ElecProducedFacility = GetInstantMeterValue(FuelType.ElecProducedFacilityIndex, 1) * FracTimeStepZone + - GetInstantMeterValue(FuelType.ElecProducedFacilityIndex, 2); + GetInstantMeterValue(FuelType.OtherFuel2FacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.OtherFuel2FacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); + FuelType.ElecProducedFacility = GetInstantMeterValue(FuelType.ElecProducedFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.ElecProducedFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); FuelType.SteamFacility = - GetInstantMeterValue(FuelType.SteamFacilityIndex, 1) * FracTimeStepZone + GetInstantMeterValue(FuelType.SteamFacilityIndex, 2); - FuelType.ElecPurchasedFacility = GetInstantMeterValue(FuelType.ElecPurchasedFacilityIndex, 1) * FracTimeStepZone + - GetInstantMeterValue(FuelType.ElecPurchasedFacilityIndex, 2); - FuelType.ElecSurplusSoldFacility = GetInstantMeterValue(FuelType.ElecSurplusSoldFacilityIndex, 1) * FracTimeStepZone + - GetInstantMeterValue(FuelType.ElecSurplusSoldFacilityIndex, 2); + GetInstantMeterValue(FuelType.SteamFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.SteamFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); + FuelType.ElecPurchasedFacility = GetInstantMeterValue(FuelType.ElecPurchasedFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.ElecPurchasedFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); + FuelType.ElecSurplusSoldFacility = GetInstantMeterValue(FuelType.ElecSurplusSoldFacilityIndex, OutputProcessor::TimeStepType::TimeStepZone) * FracTimeStepZone + + GetInstantMeterValue(FuelType.ElecSurplusSoldFacilityIndex, OutputProcessor::TimeStepType::TimeStepSystem); // Now these fuel types have to be sorted and summed into categories that we have pollution factors for. // The Off-Site Electricity is the total needed by the facility minus the amount generated on-site. diff --git a/src/EnergyPlus/ResultsSchema.cc b/src/EnergyPlus/ResultsSchema.cc index 80ce1e90e6a..ad17bc7d91b 100644 --- a/src/EnergyPlus/ResultsSchema.cc +++ b/src/EnergyPlus/ResultsSchema.cc @@ -167,15 +167,12 @@ namespace ResultsFramework { // Class Variable Variable::Variable(const std::string &VarName, const OutputProcessor::ReportingFrequency reportFrequency, - const int IndexType, + const OutputProcessor::TimeStepType timeStepType, const int ReportID, const OutputProcessor::Unit &units) + : varName(VarName), m_timeStepType(timeStepType), rptID(ReportID), Units(units) { - varName = VarName; setReportFrequency(reportFrequency); - idxType = IndexType; - rptID = ReportID; - Units = units; } std::string Variable::variableName() const @@ -203,8 +200,8 @@ namespace ResultsFramework { iReportFreq = reportFrequency; switch (iReportFreq) { case OutputProcessor::ReportingFrequency::EachCall: // each time UpdatedataandReport is called - if (idxType == ZoneVar) sReportFreq = "Detailed - Zone"; - if (idxType == HVACVar) sReportFreq = "Detailed - HVAC"; + if (m_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) sReportFreq = "Detailed - Zone"; + if (m_timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) sReportFreq = "Detailed - HVAC"; break; case OutputProcessor::ReportingFrequency::TimeStep: // at 'EndTimeStepFlag' sReportFreq = "Timestep"; @@ -227,14 +224,14 @@ namespace ResultsFramework { } } - int Variable::indexType() const + OutputProcessor::TimeStepType Variable::timeStepType() const { - return idxType; + return m_timeStepType; } - void Variable::setIndexType(int IndexType) + void Variable::setTimeStepType(const OutputProcessor::TimeStepType timeStepType) { - idxType = IndexType; + m_timeStepType = timeStepType; } int Variable::reportID() const @@ -281,10 +278,10 @@ namespace ResultsFramework { // Class OutputVariable OutputVariable::OutputVariable(const std::string &VarName, const OutputProcessor::ReportingFrequency reportFrequency, - const int IndexType, + const OutputProcessor::TimeStepType timeStepType, const int ReportID, const OutputProcessor::Unit &units) - : Variable(VarName, reportFrequency, IndexType, ReportID, units) + : Variable(VarName, reportFrequency, timeStepType, ReportID, units) { } @@ -294,7 +291,7 @@ namespace ResultsFramework { const int ReportID, const OutputProcessor::Unit &units, const bool Accumulative) - : Variable(VarName, reportFrequency, ZoneVar, ReportID, units) + : Variable(VarName, reportFrequency, OutputProcessor::TimeStepType::TimeStepZone, ReportID, units) { acc = Accumulative; } @@ -737,7 +734,7 @@ namespace ResultsFramework { void ResultsSchema::initializeRTSDataFrame(const OutputProcessor::ReportingFrequency reportFrequency, const Array1D &RVariableTypes, const int NumOfRVariable, - const int IndexType) + const OutputProcessor::TimeStepType timeStepType) { Reference RVar; @@ -749,14 +746,17 @@ namespace ResultsFramework { // reportFrequency, RVariableTypes( Loop ).IndexType, // RVariableTypes( Loop ).ReportID, // RVariableTypes( Loop ).units); - Variable var(RVariableTypes(Loop).VarName, reportFrequency, RVariableTypes(Loop).IndexType, RVariableTypes(Loop).ReportID, + Variable var(RVariableTypes(Loop).VarName, reportFrequency, RVariableTypes(Loop).timeStepType, RVariableTypes(Loop).ReportID, RVariableTypes(Loop).units); switch (reportFrequency) { case OutputProcessor::ReportingFrequency::EachCall: // each time UpdatedataandReport is called - if (IndexType == ZoneVar && RVariableTypes(Loop).IndexType == ZoneVar) { + if ((timeStepType == OutputProcessor::TimeStepType::TimeStepZone) && + (RVariableTypes(Loop).timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) + { RIDetailedZoneTSData.setRDataFrameEnabled(true); RIDetailedZoneTSData.addVariable(var); - } else if (IndexType == HVACVar && RVariableTypes(Loop).IndexType == HVACVar) { + } else if ((timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) && + (RVariableTypes(Loop).timeStepType == OutputProcessor::TimeStepType::TimeStepSystem)) { RIDetailedHVACTSData.setRDataFrameEnabled(true); RIDetailedHVACTSData.addVariable(var); } @@ -791,8 +791,11 @@ namespace ResultsFramework { // set the scanned variables to true or false switch (reportFrequency) { case OutputProcessor::ReportingFrequency::EachCall: - if (IndexType == ZoneVar) RIDetailedZoneTSData.setRVariablesScanned(true); - if (IndexType == HVACVar) RIDetailedHVACTSData.setRVariablesScanned(true); + if (timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { + RIDetailedZoneTSData.setRVariablesScanned(true); + } else if (timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { + RIDetailedHVACTSData.setRVariablesScanned(true); + } break; case OutputProcessor::ReportingFrequency::TimeStep: // at 'EndTimeStepFlag' RITimestepTSData.setRVariablesScanned(true); @@ -818,7 +821,7 @@ namespace ResultsFramework { void ResultsSchema::initializeITSDataFrame(const OutputProcessor::ReportingFrequency reportFrequency, const Array1D &IVariableTypes, const int NumOfIVariable, - const int IndexType) + const OutputProcessor::TimeStepType timeStepType) { Reference IVar; @@ -831,14 +834,17 @@ namespace ResultsFramework { // IVariableTypes( Loop ).IndexType, // IVariableTypes( Loop ).ReportID, // IVariableTypes( Loop ).units); - OutputVariable var(IVariableTypes(Loop).VarName, reportFrequency, IVariableTypes(Loop).IndexType, IVariableTypes(Loop).ReportID, + OutputVariable var(IVariableTypes(Loop).VarName, reportFrequency, IVariableTypes(Loop).timeStepType, IVariableTypes(Loop).ReportID, IVariableTypes(Loop).units); switch (reportFrequency) { case OutputProcessor::ReportingFrequency::EachCall: // each time UpdatedataandReport is called - if (IndexType == ZoneVar && IVariableTypes(Loop).IndexType == ZoneVar) { + if ((timeStepType == OutputProcessor::TimeStepType::TimeStepZone) && + (IVariableTypes(Loop).timeStepType == OutputProcessor::TimeStepType::TimeStepZone)) + { RIDetailedZoneTSData.setIDataFrameEnabled(true); RIDetailedZoneTSData.addVariable(var); - } else if (IndexType == HVACVar && IVariableTypes(Loop).IndexType == HVACVar) { + } else if ((timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) && + (IVariableTypes(Loop).timeStepType == OutputProcessor::TimeStepType::TimeStepSystem)) { RIDetailedHVACTSData.setIDataFrameEnabled(true); RIDetailedHVACTSData.addVariable(var); } @@ -874,8 +880,11 @@ namespace ResultsFramework { // set the scanned variables to true or false switch (reportFrequency) { case OutputProcessor::ReportingFrequency::EachCall: - if (IndexType == ZoneVar) RIDetailedZoneTSData.setIVariablesScanned(true); - if (IndexType == HVACVar) RIDetailedHVACTSData.setIVariablesScanned(true); + if (timeStepType == OutputProcessor::TimeStepType::TimeStepZone) { + RIDetailedZoneTSData.setIVariablesScanned(true); + } else if (timeStepType == OutputProcessor::TimeStepType::TimeStepSystem) { + RIDetailedHVACTSData.setIVariablesScanned(true); + } break; case OutputProcessor::ReportingFrequency::TimeStep: // at 'EndTimeStepFlag' RITimestepTSData.setIVariablesScanned(true); diff --git a/src/EnergyPlus/ResultsSchema.hh b/src/EnergyPlus/ResultsSchema.hh index 45b12c13b35..9ab971de4cb 100644 --- a/src/EnergyPlus/ResultsSchema.hh +++ b/src/EnergyPlus/ResultsSchema.hh @@ -108,7 +108,7 @@ namespace ResultsFramework { Variable() = default; Variable(const std::string &VarName, const OutputProcessor::ReportingFrequency reportFrequency, - const int IndexType, + const OutputProcessor::TimeStepType timeStepType, const int ReportID, const OutputProcessor::Unit &units); @@ -119,8 +119,8 @@ namespace ResultsFramework { OutputProcessor::ReportingFrequency iReportFrequency(); void setReportFrequency(const OutputProcessor::ReportingFrequency reportFrequency); - int indexType() const; - void setIndexType(const int IndexType); + OutputProcessor::TimeStepType timeStepType() const; + void setTimeStepType(const OutputProcessor::TimeStepType timeStepType); int reportID() const; void setReportID(const int Id); @@ -137,10 +137,10 @@ namespace ResultsFramework { protected: std::string varName; std::string sReportFreq; - OutputProcessor::Unit Units; OutputProcessor::ReportingFrequency iReportFreq = OutputProcessor::ReportingFrequency::EachCall; - int idxType = -1; + OutputProcessor::TimeStepType m_timeStepType = OutputProcessor::TimeStepType::TimeStepZone; int rptID = -1; + OutputProcessor::Unit Units; std::vector Values; }; @@ -149,7 +149,7 @@ namespace ResultsFramework { public: OutputVariable(const std::string &VarName, const OutputProcessor::ReportingFrequency reportFrequency, - const int IndexType, + const OutputProcessor::TimeStepType timeStepType, const int ReportID, const OutputProcessor::Unit &units); }; @@ -290,11 +290,11 @@ namespace ResultsFramework { void initializeRTSDataFrame(const OutputProcessor::ReportingFrequency reportFrequency, const Array1D &RVariableTypes, const int NumOfRVariable, - const int IndexType = OutputProcessor::ZoneVar); + const OutputProcessor::TimeStepType timeStepType = OutputProcessor::TimeStepType::TimeStepZone); void initializeITSDataFrame(const OutputProcessor::ReportingFrequency reportFrequency, const Array1D &IVariableTypes, const int NumOfIVariable, - const int IndexType = OutputProcessor::ZoneVar); + const OutputProcessor::TimeStepType timeStepType = OutputProcessor::TimeStepType::TimeStepZone); void initializeMeters(const Array1D &EnergyMeters, const OutputProcessor::ReportingFrequency reportFrequency); DataFrame RIDetailedZoneTSData = DataFrame("Detailed-Zone"); diff --git a/src/EnergyPlus/SQLiteProcedures.cc b/src/EnergyPlus/SQLiteProcedures.cc index 45a05e83e0e..b07827aaa37 100644 --- a/src/EnergyPlus/SQLiteProcedures.cc +++ b/src/EnergyPlus/SQLiteProcedures.cc @@ -1258,10 +1258,10 @@ std::string SQLite::storageType(const int storageTypeIndex) std::string result; switch (storageTypeIndex) { - case 1: + case 1: // static_cast(OutputProcessor::StoreType::Averaged) result = "Avg"; break; - case 2: + case 2: // static_cast(OutputProcessor::StoreType::Summed) result = "Sum"; break; default: @@ -1276,12 +1276,12 @@ std::string SQLite::timestepTypeName(const int timestepType) std::string result; switch (timestepType) { - case 1: - result = "HVAC System"; - break; - case 2: + case 1: // static_cast(OutputProcessor::TimeStepType::TimeStepZone) result = "Zone"; break; + case 2: // static_cast(OutputProcessor::TimeStepType::TimeStepSystem) + result = "HVAC System"; + break; default: result = "Unknown!!!"; } diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 7055f2f78e4..ab6e65e26db 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -7760,7 +7760,7 @@ namespace SetPointManager { Array1D_int VarIndexes; // Variable Numbers Array1D_int VarTypes; // Variable Types (1=integer, 2=real, 3=meter) - Array1D_int IndexTypes; // Variable Index Types (1=Zone,2=HVAC) + Array1D IndexTypes; // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar; // units from enum for each variable Array1D_int ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses; // EndUses for each variable diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index dc69922a9ba..fb1d5ce8977 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2812,7 +2812,7 @@ namespace SimulationManager { int NumVariables; Array1D_int VarIndexes; Array1D_int VarIDs; - Array1D_int IndexTypes; + Array1D IndexTypes; Array1D_int VarTypes; Array1D unitsForVar; // units from enum for each variable Array1D_string VarNames; @@ -2851,7 +2851,9 @@ namespace SimulationManager { for (Loop1 = 1; Loop1 <= NumVariables; ++Loop1) { ObjexxFCL::gio::write(OutputFileDebug, "(1X,'RepVar,',I5,',',I5,',',A,',[',A,'],',A,',',A,',',A,',',I5)") << VarIndexes(Loop1) << VarIDs(Loop1) << VarNames(Loop1) << unitEnumToString(unitsForVar(Loop1)) - << GetResourceTypeChar(ResourceTypes(Loop1)) << EndUses(Loop1) << Groups(Loop1) << IndexTypes(Loop1); + << GetResourceTypeChar(ResourceTypes(Loop1)) << EndUses(Loop1) << Groups(Loop1) + // TODO: Should call OutputProcessor::StandardTimeStepTypeKey(IndexTypes(Loop1)) to return "Zone" or "HVAC" + << static_cast(IndexTypes(Loop1)); } VarIndexes.deallocate(); IndexTypes.deallocate(); diff --git a/src/EnergyPlus/SizingAnalysisObjects.cc b/src/EnergyPlus/SizingAnalysisObjects.cc index 9a2c59735cc..030b8a79a25 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -370,8 +370,6 @@ ZoneTimestepObject SizingLoggerFramework::PrepareZoneTimestepStamp() // prepare current timing data once and then pass into fill routines // function used by both zone and system frequency log updates - int const ZoneIndex(1); - int locDayOfSim(1); if (DataGlobals::WarmupFlag) { // DayOfSim not okay during warmup, keeps incrementing up during warmup days @@ -386,7 +384,7 @@ ZoneTimestepObject SizingLoggerFramework::PrepareZoneTimestepStamp() locDayOfSim, DataGlobals::HourOfDay, DataGlobals::TimeStep, - OutputProcessor::TimeValue(ZoneIndex).TimeStep, + OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep, DataGlobals::NumOfTimeStepInHour); return tmpztStepStamp; @@ -405,7 +403,6 @@ void SizingLoggerFramework::UpdateSizingLogValuesZoneStep() void SizingLoggerFramework::UpdateSizingLogValuesSystemStep() { - int const SysIndex(2); Real64 const MinutesPerHour(60.0); ZoneTimestepObject tmpztStepStamp; SystemTimestepObject tmpSysStepStamp; @@ -413,12 +410,12 @@ void SizingLoggerFramework::UpdateSizingLogValuesSystemStep() tmpztStepStamp = PrepareZoneTimestepStamp(); // pepare system timestep stamp - tmpSysStepStamp.CurMinuteEnd = OutputProcessor::TimeValue(SysIndex).CurMinute; + tmpSysStepStamp.CurMinuteEnd = OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute; if (tmpSysStepStamp.CurMinuteEnd == 0.0) { tmpSysStepStamp.CurMinuteEnd = MinutesPerHour; } - tmpSysStepStamp.CurMinuteStart = tmpSysStepStamp.CurMinuteEnd - OutputProcessor::TimeValue(SysIndex).TimeStep * MinutesPerHour; - tmpSysStepStamp.TimeStepDuration = OutputProcessor::TimeValue(SysIndex).TimeStep; + tmpSysStepStamp.CurMinuteStart = tmpSysStepStamp.CurMinuteEnd - OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * MinutesPerHour; + tmpSysStepStamp.TimeStepDuration = OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep; for (auto &l : logObjs) { l.FillSysStep(tmpztStepStamp, tmpSysStepStamp); diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index c911859cdc7..88d50bf4b78 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -2481,8 +2481,8 @@ namespace SystemReports { // Dimension GetMeteredVariables arrays Array1D_int VarIndexes; // Variable Numbers Array1D_int VarTypes; // Variable Types (1=integer, 2=real, 3=meter) - Array1D_int IndexTypes; // Variable Idx Types (1=Zone,2=HVAC) Array1D_string UnitsStrings; // UnitsStrings for each variable + Array1D IndexTypes; // Variable Idx Types (1=Zone,2=HVAC) Array1D unitsForVar; // units from enum for each variable Array1D_int ResourceTypes; // ResourceTypes for each variable Array1D_string EndUses; // EndUses for each variable diff --git a/src/EnergyPlus/Untitled.ipynb b/src/EnergyPlus/Untitled.ipynb new file mode 100644 index 00000000000..b1347546014 --- /dev/null +++ b/src/EnergyPlus/Untitled.ipynb @@ -0,0 +1,463 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import re\n", + "import glob as gb\n", + "files = gb.glob(\"*.cc\")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "re_setup = re.compile(r'SetupOutputVariable\\(.*?,.*?,.*?,(.*?),.*?\\);', re.DOTALL)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CondenserLoopTowers.cc \n", + "SetupOutputVariable('Tower Makeup Water Consumption [m3]', &\n", + " // SimpleTowerReport(TowerNum)%WaterAmountUsed,'System','Sum',SimpleTower(TowerNum)%Name, &\n", + " // ResourceTypeKey='Water',EndUseKey='HeatRejection',GroupKey='Plant')\n", + " }\n", + "\n", + " // CurrentModuleObject='CoolingTower:VariableSpeed:Merkel'\n", + " for (TowerNum = NumSingleSpeedTowers + NumTwoSpeedTowers + NumVariableSpeedTowers + 1;\n", + " TowerNum <= NumSingleSpeedTowers + NumTwoSpeedTowers + NumVariableSpeedTowers + NumVSMerkelTowers;\n", + " ++TowerNum) {\n", + " SetupOutputVariable(\"Cooling Tower Inlet Temperature\",\n", + " OutputProcessor::Unit::C,\n", + " SimpleTowerReport(TowerNum).InletWaterTemp,\n", + " \"System\",\n", + " \"Average\",\n", + " SimpleTower(TowerNum).Name);\n", + "OutputProcessor.cc \n", + "SetupOutputVariable(std::string const &VariableName, // String Name of variable\n", + " OutputProcessor::Unit const &VariableUnit, // Actual units corresponding to the actual variable\n", + " int &ActualVariable, // Actual Variable, used to set up pointer\n", + " std::string const &IndexTypeKey, // Zone, HeatBalance=1, HVAC, System, Plant=2\n", + " std::string const &VariableTypeKey, // State, Average=1, NonState, Sum=2\n", + " std::string const &KeyedValue, // Associated Key for this variable\n", + " Optional_string_const ReportFreq, // Internal use -- causes reporting at this freqency\n", + " Optional_int_const indexGroupKey // Group identifier for SQL output\n", + ")\n", + "{\n", + "\n", + " // SUBROUTINE INFORMATION:\n", + " // AUTHOR Linda K. Lawrie\n", + " // DATE WRITTEN December 1998\n", + " // MODIFIED August 2008; Added SQL output capability\n", + " // RE-ENGINEERED na\n", + "\n", + " // PURPOSE OF THIS SUBROUTINE:\n", + " // This subroutine sets up the variable data structure that will be used\n", + " // to track values of the output variables of EnergyPlus.\n", + "\n", + " // METHODOLOGY EMPLOYED:\n", + " // Pointers (as pointers), pointers (as indices), and lots of other KEWL data stuff.\n", + "\n", + " // Using/Aliasing\n", + " using namespace DataPrecisionGlobals;\n", + " using namespace OutputProcessor;\n", + " using General::TrimSigDigits;\n", + "\n", + " // SUBROUTINE LOCAL VARIABLE DECLARATIONS:\n", + " int CV;\n", + " std::string IDOut;\n", + " // CHARACTER(len=MaxNameLength) :: VariableNamewithUnits ! Variable name with units std format\n", + " int IndexType; // 1=TimeStepZone, 2=TimeStepSys\n", + " StoreType VariableType; // 1=Average, 2=Sum, 3=Min/Max\n", + " int localIndexGroupKey;\n", + " bool ThisOneOnTheList;\n", + " int Loop;\n", + " ReportingFrequency RepFreq(ReportingFrequency::Hourly);\n", + "OutputProcessor.cc \n", + "SetupOutputVariable(VariableName,\n", + " VariableUnit,\n", + " ActualVariable,\n", + " IndexTypeKey,\n", + " VariableTypeKey,\n", + " IDOut,\n", + " ReportFreq,\n", + " ResourceTypeKey,\n", + " EndUseKey,\n", + " EndUseSubKey,\n", + " GroupKey,\n", + " ZoneKey,\n", + " ZoneMult,\n", + " ZoneListMult,\n", + " indexGroupKey);\n", + "SolarShading.cc \n", + "SetupOutputVariable(\"Surface Window Front Face Temperature Layer \" + RoundSigDigits(I) + \"\",\n", + " OutputProcessor::Unit::C,\n", + " FenLaySurfTempFront(I, SurfLoop),\n", + " \"Zone\",\n", + " \"Average\",\n", + " Surface(SurfLoop).Name);\n", + "SolarShading.cc \n", + "SetupOutputVariable(cAlphaArgs(1), curUnit, RuntimeReportVar(RuntimeReportVarNum).Value, FreqString, VarTypeString, \"EMS\");\n", + "RuntimeLanguageProcessor.cc \n", + "SetupOutputVariable(cAlphaArgs(1),\n", + " curUnit,\n", + " RuntimeReportVar(RuntimeReportVarNum).Value,\n", + " FreqString,\n", + " VarTypeString,\n", + " \"EMS\",\n", + " _,\n", + " ResourceTypeString,\n", + " EndUseTypeString,\n", + " EndUseSubCatString,\n", + " GroupTypeString);\n", + "RuntimeLanguageProcessor.cc \n", + "SetupOutputVariable(\"Room Air Window Jet Region Average Air Velocity\",\n", + " OutputProcessor::Unit::m_s,\n", + " CVJetRecFlows(i, Loop).Ujet,\n", + " \"Zone\",\n", + " \"Average\",\n", + " AirflowNetwork::MultizoneSurfaceData(i).SurfName);\n", + "SingleDuct.cc \n", + "SetupOutputVariable('Damper Position', Sys(SysNum)%DamperPosition, &\n", + " // 'System','Average',Sys(SysNum)%SysName)\n", + "\n", + " } // End Number of Sys Loop\n", + "\n", + " CurrentModuleObject = \"AirTerminal:SingleDuct:ConstantVolume:NoReheat\";\n", + "\n", + " for (SysIndex = 1; SysIndex <= NumCVNoReheatSys; ++SysIndex) {\n", + "\n", + " inputProcessor->getObjectItem(CurrentModuleObject,\n", + " SysIndex,\n", + " Alphas,\n", + " NumAlphas,\n", + " Numbers,\n", + " NumNums,\n", + " IOStat,\n", + " lNumericBlanks,\n", + " lAlphaBlanks,\n", + " cAlphaFields,\n", + " cNumericFields);\n", + "DaylightingDevices.cc \n", + "SetupOutputVariable('View Factor To Outside Shelf []', &\n", + " // Shelf(ShelfNum)%ViewFactor,'Zone','Average',Shelf(ShelfNum)%Name)\n", + " }\n", + " }\n", + "\n", + " // Warning that if Calculate Solar Reflection From Exterior Surfaces = Yes in Building input, then\n", + " // solar reflection calculated from obstructions will not be used in daylighting shelf or tubular device\n", + " // calculation\n", + "\n", + " if (CalcSolRefl && (NumOfTDDPipes > 0 || NumOfShelf > 0)) {\n", + " ShowWarningError(\"InitDaylightingDevices: Solar Distribution Model includes Solar Reflection calculations;\");\n", + "MundtSimMgr.cc \n", + "SetupOutputVariable('DX Cooling Coil Crankcase Heater Power [W]',Coil%CrankcaseHeaterPower,'System',&\n", + " // 'Average',Coil%Name)\n", + " // CALL SetupOutputVariable('Cooling Coil Crankcase Heater Electric Energy [J]',Coil%CrankcaseHeaterConsumption,&\n", + " // 'System','Sum',Coil%Name, &\n", + " // ResourceTypeKey='Electric',EndUseKey='COOLING',GroupKey='System')\n", + " // END IF\n", + "\n", + " if (Coil.ReportEvapCondVars) {\n", + " SetupOutputVariable(\n", + " \"Cooling Coil Condenser Inlet Temperature\", OutputProcessor::Unit::C, Coil.CondInletTemp, \"System\", \"Average\", Coil.Name);\n", + "VentilatedSlab.cc \n", + "SetupOutputVariable('Ventilated Slab Direct Heat Loss Rate [W]', &\n", + " // VentSlab(Item)%DirectHeatLossRate,'System', &\n", + " // 'Average', VentSlab(Item)%Name)\n", + " // CALL SetupOutputVariable('Ventilated Slab Direct Heat Loss [W]', &\n", + " // VentSlab(Item)%DirectHeatLoss,'System', &\n", + " // 'Sum', VentSlab(Item)%Name)\n", + " // CALL SetupOutputVariable('Ventilated Slab Direct Heat Gain Rate [W]', &\n", + " // VentSlab(Item)%DirectHeatGainRate,'System', &\n", + " // 'Average', VentSlab(Item)%Name)\n", + " // CALL SetupOutputVariable('Ventilated Slab Direct Heat Gain [J]', &\n", + " // VentSlab(Item)%DirectHeatGain,'System', &\n", + " // 'Sum', VentSlab(Item)%Name)\n", + " SetupOutputVariable(\"Zone Ventilated Slab Radiant Heating Rate\",\n", + " OutputProcessor::Unit::W,\n", + " VentSlab(Item).RadHeatingPower,\n", + " \"System\",\n", + " \"Average\",\n", + " VentSlab(Item).Name);\n" + ] + } + ], + "source": [ + "types = set()\n", + "\n", + "for fpath in files:\n", + " with open(fpath, 'r') as f:\n", + " content = f.read()\n", + " for m in re_setup.finditer(content):\n", + " t = m.groups()[0].strip().replace('\"', '').upper()\n", + " types.add(t)\n", + " if t not in [\"HVAC\", \"PLANT\", \"SYSTEM\", \"ZONE\"]:\n", + " print(fpath, m)\n", + " print(content[m.start():m.end()])" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CondenserLoopTowers.cc \n" + ] + } + ], + "source": [ + "fpath = 'CondenserLoopTowers.cc'\n", + "with open(fpath, 'r') as f:\n", + " content = f.read()\n", + "for m in re_setup.finditer(content):\n", + " t = m.groups()[0].strip().replace('\"', '').upper()\n", + " types.add(t)\n", + " if t not in [\"HVAC\", \"PLANT\", \"SYSTEM\", \"ZONE\"]:\n", + " print(fpath, m)\n", + " break" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'SetupOutputVariable(\\'Tower Makeup Water Consumption [m3]\\', &\\n // SimpleTowerReport(TowerNum)%WaterAmountUsed,\\'System\\',\\'Sum\\',SimpleTower(TowerNum)%Name, &\\n // ResourceTypeKey=\\'Water\\',EndUseKey=\\'HeatRejection\\',GroupKey=\\'Plant\\')\\n }\\n\\n // CurrentModuleObject=\\'CoolingTower:VariableSpeed:Merkel\\'\\n for (TowerNum = NumSingleSpeedTowers + NumTwoSpeedTowers + NumVariableSpeedTowers + 1;\\n TowerNum <= NumSingleSpeedTowers + NumTwoSpeedTowers + NumVariableSpeedTowers + NumVSMerkelTowers;\\n ++TowerNum) {\\n SetupOutputVariable(\"Cooling Tower Inlet Temperature\",\\n OutputProcessor::Unit::C,\\n SimpleTowerReport(TowerNum).InletWaterTemp,\\n \"System\",\\n \"Average\",\\n SimpleTower(TowerNum).Name);'" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "t = '\"HVAC\"'" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'HVAC'" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "t.replace('\"', '')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + }, + "toc": { + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "toc_cell": false, + "toc_position": {}, + "toc_section_display": "block", + "toc_window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc index 30440be13bb..0dda39d51e1 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc @@ -1470,7 +1470,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctSeriesPIU_SimTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; ManageSimulation(); // run the design day over the warmup period (24 hrs, 25 days) diff --git a/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc b/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc index e065ece29be..c619a62af09 100644 --- a/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc +++ b/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc @@ -1110,7 +1110,7 @@ TEST_F(EnergyPlusFixture, BranchNodeConnections_ReturnPlenumNodeCheckFailure) ASSERT_TRUE(process_idf(idf_objects)); compare_err_stream(""); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; GetProjectData(); @@ -2118,7 +2118,7 @@ TEST_F(EnergyPlusFixture, BranchNodeConnections_ReturnPlenumNodeCheck) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; GetProjectData(); diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 26b6644fcfb..0a170a309f5 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -1775,7 +1775,7 @@ TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); // run the design day // set conditions for test diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 46964bc588e..9c632be8564 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -491,7 +491,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelNoCooling) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -883,7 +883,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -1315,7 +1315,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -1730,7 +1730,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -2214,7 +2214,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -2641,7 +2641,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedTowerLowSpeedNomCapSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -3037,7 +3037,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_Sizing SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -3437,7 +3437,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_UserSp SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); diff --git a/tst/EnergyPlus/unit/DataHeatBalance.unit.cc b/tst/EnergyPlus/unit/DataHeatBalance.unit.cc index 635cc4ee0fa..30ed5e38af7 100644 --- a/tst/EnergyPlus/unit/DataHeatBalance.unit.cc +++ b/tst/EnergyPlus/unit/DataHeatBalance.unit.cc @@ -798,7 +798,7 @@ TEST_F(EnergyPlusFixture, DataHeatBalance_CheckConstructLayers) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); ScheduleManager::ProcessScheduleInput(); // read schedules diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index 963e5e2d7d1..6f60a748896 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -2810,7 +2810,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnOASystemTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; SimulationManager::GetProjectData(); @@ -3990,7 +3990,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnPrimaryAirSystemTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; SimulationManager::GetProjectData(); @@ -5408,7 +5408,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_RegenAirHeaterHWCoilSizingTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; SimulationManager::GetProjectData(); @@ -6653,7 +6653,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_VSCoolingCoilOnPrimaryAirSystemTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; SimulationManager::GetProjectData(); diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index 66db7d78b88..30c7d59920c 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -2266,7 +2266,7 @@ TEST_F(EnergyPlusFixture, Test_TightenWaterFlowLimits) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); GetZoneData(ErrorsFound); GetZoneEquipmentData1(); diff --git a/tst/EnergyPlus/unit/Furnaces.unit.cc b/tst/EnergyPlus/unit/Furnaces.unit.cc index 8d271d9114d..824361a3937 100644 --- a/tst/EnergyPlus/unit/Furnaces.unit.cc +++ b/tst/EnergyPlus/unit/Furnaces.unit.cc @@ -1071,7 +1071,7 @@ TEST_F(EnergyPlusFixture, UnitaryHeatPumpAirToAir_MaxSuppAirTempTest) int AirLoopNum(1); bool FirstHVACIteration(false); - OutputProcessor::TimeValue.allocate(2); // + // OutputProcessor::TimeValue.allocate(2); ManageSimulation(); // check the design max air outlet temperature EXPECT_DOUBLE_EQ(45.0, Furnace(1).DesignMaxOutletTemp); diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 0b0864504ed..2b094c901b9 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -1632,7 +1632,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); PlantManager::CheckIfAnyPlant(); @@ -3162,7 +3162,7 @@ TEST_F(EnergyPlusFixture, Beam_fatalWhenSysSizingOff) OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); PlantManager::CheckIfAnyPlant(); diff --git a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc index 64dffade458..613526a6fda 100644 --- a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc @@ -124,7 +124,7 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture // need a node to log mass flow rate from Node.allocate(1); - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); // set up time related SetupTimePointers("Zone", TimeStepZone); // Set up Time pointer for HB/Zone Simulation SetupTimePointers("HVAC", TimeStepSys); @@ -132,10 +132,10 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture NumOfTimeStepInHour = 4; TimeStepFraction = 1.0 / double(NumOfTimeStepInHour); - TimeValue(1).TimeStep >>= TimeStepZone; - TimeValue(1).CurMinute = 0; // init - TimeValue(2).TimeStep >>= TimeStepSys; - TimeValue(2).CurMinute = 0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep >>= TimeStepZone; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0; // init + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep >>= TimeStepSys; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0; } virtual void TearDown() @@ -194,18 +194,18 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; PlantReport(1).HeatingDemand = HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // ... End hour loop. @@ -218,11 +218,11 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) Environment(Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; @@ -230,7 +230,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // End hour loop. @@ -244,18 +244,18 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) while (DayOfSim < NumOfDayInEnvrn) { ++DayOfSim; for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; PlantReport(1).HeatingDemand = HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // ... End hour loop. @@ -270,18 +270,18 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) while (DayOfSim < NumOfDayInEnvrn) { ++DayOfSim; for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; PlantReport(1).HeatingDemand = HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // ... End hour loop. @@ -387,18 +387,18 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) Environment(Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; PlantReport(1).HeatingDemand = HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // ... End hour loop. @@ -410,11 +410,11 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) Environment(Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; @@ -422,7 +422,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // End hour loop. @@ -519,12 +519,12 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) Environment(Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; @@ -532,7 +532,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } // E+ doesn't really update zone step data until system steps are done - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // ... End hour loop. @@ -544,12 +544,12 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) Environment(Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; @@ -557,7 +557,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // End hour loop. @@ -603,15 +603,15 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) Environment(Envrn).DesignDayNum = 1; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { NumOfSysTimeSteps = TimeStep; TimeStepSys = TimeStepZone / NumOfSysTimeSteps; for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; @@ -619,7 +619,7 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } // E+ doesn't really update zone step data until system steps are done - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // ... End hour loop. @@ -631,14 +631,14 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) Environment(Envrn).DesignDayNum = 2; testSizeSimManagerObj.sizingLogger.SetupSizingLogsNewEnvironment(); for (HourOfDay = 1; HourOfDay <= 24; ++HourOfDay) { // Begin hour loop ... - TimeValue(1).CurMinute = 0.0; - TimeValue(2).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 0.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 0.0; for (TimeStep = 1; TimeStep <= NumOfTimeStepInHour; ++TimeStep) { NumOfSysTimeSteps = TimeStep; TimeStepSys = TimeStepZone / NumOfSysTimeSteps; for (int SysTimestepLoop = 1; SysTimestepLoop <= NumOfSysTimeSteps; ++SysTimestepLoop) { - TimeValue(2).CurMinute += TimeValue(2).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * 60.0; Node(1).MassFlowRate = HourOfDay * 0.1; Node(1).Temp = 10.0; @@ -646,7 +646,7 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(); } - TimeValue(1).CurMinute += TimeValue(1).TimeStep * 60.0; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep * 60.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesZoneStep(); } // TimeStep loop } // End hour loop. diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 801db419248..6148b523807 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1546,7 +1546,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_EMSConstructionTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); DataGlobals::DayOfSim = 2; // avoid array bounds problem in RecKeepHeatBalance WeatherManager::Envrn = 1; diff --git a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc index d583fff2751..648aa8857e5 100644 --- a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc +++ b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc @@ -712,7 +712,7 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); @@ -1462,7 +1462,7 @@ TEST_F(EnergyPlusFixture, WWHP_AutosizeTest1) OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); createFacilityElectricPowerServiceObject(); diff --git a/tst/EnergyPlus/unit/HeatRecovery.unit.cc b/tst/EnergyPlus/unit/HeatRecovery.unit.cc index d430a8fdb3e..158bc55040c 100644 --- a/tst/EnergyPlus/unit/HeatRecovery.unit.cc +++ b/tst/EnergyPlus/unit/HeatRecovery.unit.cc @@ -3811,7 +3811,7 @@ TEST_F(EnergyPlusFixture, HeatRecoveryHXOnMainBranch_SimHeatRecoveryTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); // + // OutputProcessor::TimeValue.allocate(2); // ManageSimulation(); // run the design day ASSERT_EQ("DOAS HEAT RECOVERY", ExchCond(1).Name); // Name of Heat Recovery Exchange On Main Air Loop diff --git a/tst/EnergyPlus/unit/JsonOutput.unit.cc b/tst/EnergyPlus/unit/JsonOutput.unit.cc index 2bff726d97a..a1f090d7731 100644 --- a/tst/EnergyPlus/unit/JsonOutput.unit.cc +++ b/tst/EnergyPlus/unit/JsonOutput.unit.cc @@ -169,7 +169,7 @@ TEST_F(EnergyPlusFixture, JsonOutput_VariableInfo) // EXPECT_EQ( "SALESFLOOR INLET NODE:System Node Mass Flow Rate", OutputProcessor::RVariableTypes( 2 ).VarName ); // EXPECT_EQ( 1, OutputProcessor::RVariableTypes( 1 ).ReportID ); // EXPECT_EQ( 2, OutputProcessor::RVariableTypes( 2 ).ReportID ); - int indexType = 1; + OutputProcessor::TimeStepType indexType = OutputProcessor::TimeStepType::TimeStepZone; int repordId = 1; Variable var("SALESFLOOR INLET NODE:System Node Temperature", ReportingFrequency::TimeStep, indexType, repordId, Unit::C); @@ -191,7 +191,7 @@ TEST_F(EnergyPlusFixture, JsonOutput_DataFrameInfo1) { json OutputVars; - int indexType = 1; + OutputProcessor::TimeStepType indexType = OutputProcessor::TimeStepType::TimeStepZone; int reportId = 1; Variable var0("SALESFLOOR INLET NODE:System Node Temperature", ReportingFrequency::TimeStep, indexType, reportId, Unit::C); @@ -225,7 +225,7 @@ TEST_F(EnergyPlusFixture, JsonOutput_DataFrameInfo2) { json OutputData; - int indexType = 1; + OutputProcessor::TimeStepType indexType = OutputProcessor::TimeStepType::TimeStepZone; int reportId = 1; Variable var0("SALESFLOOR INLET NODE:System Node Temperature", ReportingFrequency::TimeStep, indexType, reportId, Unit::C); diff --git a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc index 708c82118d7..1729e7a3aa9 100644 --- a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc +++ b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc @@ -1039,7 +1039,7 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOffSim) }); ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); EXPECT_EQ(1, NumOASystems); @@ -2017,7 +2017,7 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOnSim) }); ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); EXPECT_EQ(1, NumOASystems); diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index d68beed2652..b1d6213558c 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -75,7 +75,7 @@ namespace OutputProcessor { int const NumVariables = 2; Array1D_int VarIndexes(NumVariables); // Variable Numbers Array1D_int VarTypes(NumVariables); // Variable Types (1=integer, 2=real, 3=meter) - Array1D_int IndexTypes(NumVariables); // Variable Index Types (1=Zone,2=HVAC) + Array1D IndexTypes(NumVariables); // Variable Index Types (1=Zone,2=HVAC) Array1D unitsForVar(NumVariables); // units from enum for each variable Array1D_int ResourceTypes(NumVariables); // ResourceTypes for each variable Array1D_string EndUses(NumVariables); // EndUses for each variable @@ -1082,31 +1082,41 @@ namespace OutputProcessor { } } - TEST_F(SQLiteFixture, OutputProcessor_validateIndexType) + TEST_F(SQLiteFixture, OutputProcessor_validateTimeStepType) { - std::map const resource_map = {{"ZONE", 1}, {"HEATBALANCE", 1}, {"HEAT BALANCE", 1}, - {"HVAC", 2}, {"SYSTEM", 2}, {"PLANT", 2}}; + std::map const resource_map = { + // Zone + {"ZONE", OutputProcessor::TimeStepType::TimeStepZone}, + {"HEATBALANCE", OutputProcessor::TimeStepType::TimeStepZone}, + {"HEAT BALANCE", OutputProcessor::TimeStepType::TimeStepZone}, + // System + {"HVAC", OutputProcessor::TimeStepType::TimeStepSystem}, + {"SYSTEM", OutputProcessor::TimeStepType::TimeStepSystem}, + {"PLANT", OutputProcessor::TimeStepType::TimeStepSystem} + }; auto const calledFrom = "UnitTest"; for (auto const &indexGroup : resource_map) { - EXPECT_EQ(indexGroup.second, ValidateIndexType(indexGroup.first, calledFrom)) << "where indexTypeKey is " << indexGroup.first; + EXPECT_EQ(indexGroup.second, ValidateTimeStepType(indexGroup.first, calledFrom)) << "where indexTypeKey is " << indexGroup.first; } } - TEST_F(SQLiteFixture, OutputProcessor_DeathTest_validateIndexType) + TEST_F(SQLiteFixture, OutputProcessor_DeathTest_validateTimeStepType) { auto const calledFrom = "UnitTest"; - EXPECT_ANY_THROW(ValidateIndexType("BAD INPUT", calledFrom)); + EXPECT_ANY_THROW(ValidateTimeStepType("BAD INPUT", calledFrom)); } TEST_F(SQLiteFixture, OutputProcessor_standardIndexTypeKey) { - EXPECT_EQ("Zone", StandardIndexTypeKey(1)); - EXPECT_EQ("HVAC", StandardIndexTypeKey(2)); - EXPECT_EQ("UNKW", StandardIndexTypeKey(0)); - EXPECT_EQ("UNKW", StandardIndexTypeKey(-1)); - EXPECT_EQ("UNKW", StandardIndexTypeKey(3)); + EXPECT_EQ("Zone", StandardTimeStepTypeKey(OutputProcessor::TimeStepType::TimeStepZone)); + EXPECT_EQ("HVAC", StandardTimeStepTypeKey(OutputProcessor::TimeStepType::TimeStepSystem)); + + // It's no longer possible to pass something that isn't part of the enum, that's kind of the point of using an enum! + //EXPECT_EQ("UNKW", StandardTimeStepTypeKey(0)); + //EXPECT_EQ("UNKW", StandardTimeStepTypeKey(-1)); + //EXPECT_EQ("UNKW", StandardTimeStepTypeKey(3)); } TEST_F(SQLiteFixture, OutputProcessor_validateVariableType) @@ -1378,37 +1388,43 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); + // TODO: Double check my determination of correct behavior + // Before it was internally calling createSQLiteReportDictionaryRecord with indexType = 1 which in SQLiteProcedures means "HVAC System" + // but in OutputProcessor domain it means Zone... + // According to the I/O ref guide: Output:Meter is supposed to have the "Zone Timestep interval" for its resolution + std::string timeStepTypeString = "Zone"; + std::vector> reportDataDictionary( - {{"1", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Zone Timestep", "", "J"}, - {"2", "1", "Sum", "indexGroup", "HVAC System", "", "meterName", "Zone Timestep", "", "W"}, - {"3", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Zone Timestep", "", "J"}, - {"4", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Zone Timestep", "", "W"}, - {"5", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Zone Timestep", "", "W"}, - {"6", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "HVAC System Timestep", "", "J"}, - {"7", "1", "Sum", "indexGroup", "HVAC System", "", "meterName", "HVAC System Timestep", "", "J"}, - {"8", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "HVAC System Timestep", "", "J"}, - {"9", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "HVAC System Timestep", "", "J"}, - {"10", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "HVAC System Timestep", "", "J"}, - {"11", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Hourly", "", "J"}, - {"12", "1", "Sum", "indexGroup", "HVAC System", "", "meterName", "Hourly", "", ""}, - {"13", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Hourly", "", ""}, - {"14", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Hourly", "", ""}, - {"15", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Hourly", "", ""}, - {"16", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Daily", "", ""}, - {"17", "1", "Sum", "indexGroup", "HVAC System", "", "meterName", "Daily", "", ""}, - {"18", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Daily", "", "deltaC"}, - {"19", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Daily", "", "deltaC"}, - {"20", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Daily", "", "deltaC"}, - {"21", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Monthly", "", "deltaC"}, - {"22", "1", "Sum", "indexGroup", "HVAC System", "", "meterName", "Monthly", "", "deltaC"}, - {"23", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Monthly", "", "deltaC"}, - {"24", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Monthly", "", "deltaC"}, - {"25", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Monthly", "", "deltaC"}, - {"26", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Run Period", "", "deltaC"}, - {"27", "1", "Sum", "indexGroup", "HVAC System", "", "meterName", "Run Period", "", "deltaC"}, - {"28", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Run Period", "", "deltaC"}, - {"29", "1", "Avg", "indexGroup", "HVAC System", "", "meterName", "Run Period", "", "deltaC"}, - {"30", "1", "Avg", "indexGroup", "HVAC System", "Cumulative ", "meterName", "Run Period", "", "deltaC"}}); + {{"1", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Zone Timestep", "", "J"}, + {"2", "1", "Sum", "indexGroup", timeStepTypeString, "", "meterName", "Zone Timestep", "", "W"}, + {"3", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Zone Timestep", "", "J"}, + {"4", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Zone Timestep", "", "W"}, + {"5", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Zone Timestep", "", "W"}, + {"6", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "HVAC System Timestep", "", "J"}, + {"7", "1", "Sum", "indexGroup", timeStepTypeString, "", "meterName", "HVAC System Timestep", "", "J"}, + {"8", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "HVAC System Timestep", "", "J"}, + {"9", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "HVAC System Timestep", "", "J"}, + {"10", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "HVAC System Timestep", "", "J"}, + {"11", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Hourly", "", "J"}, + {"12", "1", "Sum", "indexGroup", timeStepTypeString, "", "meterName", "Hourly", "", ""}, + {"13", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Hourly", "", ""}, + {"14", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Hourly", "", ""}, + {"15", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Hourly", "", ""}, + {"16", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Daily", "", ""}, + {"17", "1", "Sum", "indexGroup", timeStepTypeString, "", "meterName", "Daily", "", ""}, + {"18", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Daily", "", "deltaC"}, + {"19", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Daily", "", "deltaC"}, + {"20", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Daily", "", "deltaC"}, + {"21", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Monthly", "", "deltaC"}, + {"22", "1", "Sum", "indexGroup", timeStepTypeString, "", "meterName", "Monthly", "", "deltaC"}, + {"23", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Monthly", "", "deltaC"}, + {"24", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Monthly", "", "deltaC"}, + {"25", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Monthly", "", "deltaC"}, + {"26", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Run Period", "", "deltaC"}, + {"27", "1", "Sum", "indexGroup", timeStepTypeString, "", "meterName", "Run Period", "", "deltaC"}, + {"28", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Run Period", "", "deltaC"}, + {"29", "1", "Avg", "indexGroup", timeStepTypeString, "", "meterName", "Run Period", "", "deltaC"}, + {"30", "1", "Avg", "indexGroup", timeStepTypeString, "Cumulative ", "meterName", "Run Period", "", "deltaC"}}); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); } @@ -1418,172 +1434,184 @@ namespace OutputProcessor { EnergyPlus::sqlite->createSQLiteTimeIndexRecord(4, 1, 1, 0, 2017); + // Store expected results + std::vector> expectedReportDataDictionary; + + std::string timeStepZoneString = "Zone"; + std::string timeStepSystemString = "HVAC System"; + + // For now I don't accept anything else than TimeStepZone or TimeStepSystem, but to make it easier if we need to change that later + // and to preserve the original test (passing int=3 before should have defaulted to Zone...) + OutputProcessor::TimeStepType aThirdTimeStepType = OutputProcessor::TimeStepType::TimeStepZone; + std::string aThirdTimeStepString = timeStepZoneString; + WriteReportVariableDictionaryItem(ReportingFrequency::TimeStep, StoreType::Averaged, 1, -999, "indexGroup", "1", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"1,1,keyedValue,variableName [m3/s] !TimeStep"}))); WriteReportVariableDictionaryItem(ReportingFrequency::TimeStep, StoreType::Summed, 2, -999, "indexGroup", "2", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"2,1,keyedValue,variableName [m3/s] !TimeStep"}))); WriteReportVariableDictionaryItem(ReportingFrequency::TimeStep, StoreType::Averaged, 3, -999, "indexGroup", "3", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, "scheduleName"); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, "scheduleName"); EXPECT_TRUE(compare_eso_stream(delimited_string({"3,1,keyedValue,variableName [m3/s] !TimeStep,scheduleName"}))); WriteReportVariableDictionaryItem(ReportingFrequency::TimeStep, StoreType::Averaged, 4, -999, "indexGroup", "4", "keyedValue", "variableName", - 2, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepSystem, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"4,1,keyedValue,variableName [m3/s] !TimeStep"}))); + // Hum, can no longer pass Something else than what's in the enum... WriteReportVariableDictionaryItem(ReportingFrequency::TimeStep, StoreType::Averaged, 5, -999, "indexGroup", "5", "keyedValue", "variableName", - 3, OutputProcessor::Unit::m3_s, _, _); + aThirdTimeStepType, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"5,1,keyedValue,variableName [m3/s] !TimeStep"}))); WriteReportVariableDictionaryItem(ReportingFrequency::EachCall, StoreType::Averaged, 6, -999, "indexGroup", "6", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"6,1,keyedValue,variableName [m3/s] !Each Call"}))); WriteReportVariableDictionaryItem(ReportingFrequency::EachCall, StoreType::Summed, 7, -999, "indexGroup", "7", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"7,1,keyedValue,variableName [m3/s] !Each Call"}))); WriteReportVariableDictionaryItem(ReportingFrequency::EachCall, StoreType::Averaged, 8, -999, "indexGroup", "8", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, "scheduleName"); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, "scheduleName"); EXPECT_TRUE(compare_eso_stream(delimited_string({"8,1,keyedValue,variableName [m3/s] !Each Call,scheduleName"}))); WriteReportVariableDictionaryItem(ReportingFrequency::EachCall, StoreType::Averaged, 9, -999, "indexGroup", "9", "keyedValue", "variableName", - 2, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepSystem, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"9,1,keyedValue,variableName [m3/s] !Each Call"}))); WriteReportVariableDictionaryItem(ReportingFrequency::EachCall, StoreType::Averaged, 10, -999, "indexGroup", "10", "keyedValue", - "variableName", 3, OutputProcessor::Unit::m3_s, _, _); + "variableName", aThirdTimeStepType, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(compare_eso_stream(delimited_string({"10,1,keyedValue,variableName [m3/s] !Each Call"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Hourly, StoreType::Averaged, 11, -999, "indexGroup", "11", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingHourlyVariables); TrackingHourlyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"11,1,keyedValue,variableName [m3/s] !Hourly"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Hourly, StoreType::Summed, 12, -999, "indexGroup", "12", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingHourlyVariables); TrackingHourlyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"12,1,keyedValue,variableName [m3/s] !Hourly"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Hourly, StoreType::Averaged, 13, -999, "indexGroup", "13", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, "scheduleName"); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, "scheduleName"); EXPECT_TRUE(TrackingHourlyVariables); TrackingHourlyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"13,1,keyedValue,variableName [m3/s] !Hourly,scheduleName"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Hourly, StoreType::Averaged, 14, -999, "indexGroup", "14", "keyedValue", "variableName", - 2, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepSystem, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingHourlyVariables); TrackingHourlyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"14,1,keyedValue,variableName [m3/s] !Hourly"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Hourly, StoreType::Averaged, 15, -999, "indexGroup", "15", "keyedValue", "variableName", - 3, OutputProcessor::Unit::m3_s, _, _); + aThirdTimeStepType, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingHourlyVariables); TrackingHourlyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"15,1,keyedValue,variableName [m3/s] !Hourly"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Daily, StoreType::Averaged, 16, -999, "indexGroup", "16", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingDailyVariables); TrackingDailyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"16,7,keyedValue,variableName [m3/s] !Daily [Value,Min,Hour,Minute,Max,Hour,Minute]"}))); - WriteReportVariableDictionaryItem(ReportingFrequency::Daily, StoreType::Summed, 17, -999, "indexGroup", "17", "keyedValue", "variableName", 1, - OutputProcessor::Unit::m3_s, _, _); + WriteReportVariableDictionaryItem(ReportingFrequency::Daily, StoreType::Summed, 17, -999, "indexGroup", "17", "keyedValue", "variableName", + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingDailyVariables); TrackingDailyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"17,7,keyedValue,variableName [m3/s] !Daily [Value,Min,Hour,Minute,Max,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Daily, StoreType::Averaged, 18, -999, "indexGroup", "18", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, "scheduleName"); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, "scheduleName"); EXPECT_TRUE(TrackingDailyVariables); TrackingDailyVariables = false; EXPECT_TRUE(compare_eso_stream( delimited_string({"18,7,keyedValue,variableName [m3/s] !Daily [Value,Min,Hour,Minute,Max,Hour,Minute],scheduleName"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Daily, StoreType::Averaged, 19, -999, "indexGroup", "19", "keyedValue", "variableName", - 2, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepSystem, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingDailyVariables); TrackingDailyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"19,7,keyedValue,variableName [m3/s] !Daily [Value,Min,Hour,Minute,Max,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Daily, StoreType::Averaged, 20, -999, "indexGroup", "20", "keyedValue", "variableName", - 3, OutputProcessor::Unit::m3_s, _, _); + aThirdTimeStepType, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingDailyVariables); TrackingDailyVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string({"20,7,keyedValue,variableName [m3/s] !Daily [Value,Min,Hour,Minute,Max,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Monthly, StoreType::Averaged, 21, -999, "indexGroup", "21", "keyedValue", - "variableName", 1, OutputProcessor::Unit::m3_s, _, _); + "variableName", OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingMonthlyVariables); TrackingMonthlyVariables = false; EXPECT_TRUE( compare_eso_stream(delimited_string({"21,9,keyedValue,variableName [m3/s] !Monthly [Value,Min,Day,Hour,Minute,Max,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Monthly, StoreType::Summed, 22, -999, "indexGroup", "22", "keyedValue", "variableName", - 1, OutputProcessor::Unit::m3_s, _, _); + OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingMonthlyVariables); TrackingMonthlyVariables = false; EXPECT_TRUE( compare_eso_stream(delimited_string({"22,9,keyedValue,variableName [m3/s] !Monthly [Value,Min,Day,Hour,Minute,Max,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Monthly, StoreType::Averaged, 23, -999, "indexGroup", "23", "keyedValue", - "variableName", 1, OutputProcessor::Unit::m3_s, _, "scheduleName"); + "variableName", OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, "scheduleName"); EXPECT_TRUE(TrackingMonthlyVariables); TrackingMonthlyVariables = false; EXPECT_TRUE(compare_eso_stream( delimited_string({"23,9,keyedValue,variableName [m3/s] !Monthly [Value,Min,Day,Hour,Minute,Max,Day,Hour,Minute],scheduleName"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Monthly, StoreType::Averaged, 24, -999, "indexGroup", "24", "keyedValue", - "variableName", 2, OutputProcessor::Unit::m3_s, _, _); + "variableName", OutputProcessor::TimeStepType::TimeStepSystem, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingMonthlyVariables); TrackingMonthlyVariables = false; EXPECT_TRUE( compare_eso_stream(delimited_string({"24,9,keyedValue,variableName [m3/s] !Monthly [Value,Min,Day,Hour,Minute,Max,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Monthly, StoreType::Averaged, 25, -999, "indexGroup", "25", "keyedValue", - "variableName", 3, OutputProcessor::Unit::m3_s, _, _); + "variableName", aThirdTimeStepType, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingMonthlyVariables); TrackingMonthlyVariables = false; EXPECT_TRUE( compare_eso_stream(delimited_string({"25,9,keyedValue,variableName [m3/s] !Monthly [Value,Min,Day,Hour,Minute,Max,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Simulation, StoreType::Averaged, 26, -999, "indexGroup", "26", "keyedValue", - "variableName", 1, OutputProcessor::Unit::m3_s, _, _); + "variableName", OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingRunPeriodVariables); TrackingRunPeriodVariables = false; EXPECT_TRUE(compare_eso_stream( delimited_string({"26,11,keyedValue,variableName [m3/s] !RunPeriod [Value,Min,Month,Day,Hour,Minute,Max,Month,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Simulation, StoreType::Summed, 27, -999, "indexGroup", "27", "keyedValue", - "variableName", 1, OutputProcessor::Unit::m3_s, _, _); + "variableName", OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingRunPeriodVariables); TrackingRunPeriodVariables = false; EXPECT_TRUE(compare_eso_stream( delimited_string({"27,11,keyedValue,variableName [m3/s] !RunPeriod [Value,Min,Month,Day,Hour,Minute,Max,Month,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Simulation, StoreType::Averaged, 28, -999, "indexGroup", "28", "keyedValue", - "variableName", 1, OutputProcessor::Unit::m3_s, _, "scheduleName"); + "variableName", OutputProcessor::TimeStepType::TimeStepZone, OutputProcessor::Unit::m3_s, _, "scheduleName"); EXPECT_TRUE(TrackingRunPeriodVariables); TrackingRunPeriodVariables = false; EXPECT_TRUE(compare_eso_stream(delimited_string( {"28,11,keyedValue,variableName [m3/s] !RunPeriod [Value,Min,Month,Day,Hour,Minute,Max,Month,Day,Hour,Minute],scheduleName"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Simulation, StoreType::Averaged, 29, -999, "indexGroup", "29", "keyedValue", - "variableName", 2, OutputProcessor::Unit::m3_s, _, _); + "variableName", OutputProcessor::TimeStepType::TimeStepSystem, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingRunPeriodVariables); TrackingRunPeriodVariables = false; EXPECT_TRUE(compare_eso_stream( delimited_string({"29,11,keyedValue,variableName [m3/s] !RunPeriod [Value,Min,Month,Day,Hour,Minute,Max,Month,Day,Hour,Minute]"}))); WriteReportVariableDictionaryItem(ReportingFrequency::Simulation, StoreType::Averaged, 30, -999, "indexGroup", "30", "keyedValue", - "variableName", 3, OutputProcessor::Unit::m3_s, _, _); + "variableName", aThirdTimeStepType, OutputProcessor::Unit::m3_s, _, _); EXPECT_TRUE(TrackingRunPeriodVariables); TrackingRunPeriodVariables = false; EXPECT_TRUE(compare_eso_stream( @@ -1591,37 +1619,38 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); - std::vector> reportDataDictionary( - {{"1", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, - {"2", "0", "Sum", "indexGroup", "HVAC System", "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, - {"3", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Zone Timestep", "scheduleName", "m3/s"}, - {"4", "0", "Avg", "indexGroup", "Zone", "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, - {"5", "0", "Avg", "indexGroup", "Unknown!!!", "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, - {"6", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, - {"7", "0", "Sum", "indexGroup", "HVAC System", "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, - {"8", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "HVAC System Timestep", "scheduleName", "m3/s"}, - {"9", "0", "Avg", "indexGroup", "Zone", "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, - {"10", "0", "Avg", "indexGroup", "Unknown!!!", "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, - {"11", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Hourly", "", "m3/s"}, - {"12", "0", "Sum", "indexGroup", "HVAC System", "keyedValue", "variableName", "Hourly", "", "m3/s"}, - {"13", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Hourly", "scheduleName", "m3/s"}, - {"14", "0", "Avg", "indexGroup", "Zone", "keyedValue", "variableName", "Hourly", "", "m3/s"}, - {"15", "0", "Avg", "indexGroup", "Unknown!!!", "keyedValue", "variableName", "Hourly", "", "m3/s"}, - {"16", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Daily", "", "m3/s"}, - {"17", "0", "Sum", "indexGroup", "HVAC System", "keyedValue", "variableName", "Daily", "", "m3/s"}, - {"18", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Daily", "scheduleName", "m3/s"}, - {"19", "0", "Avg", "indexGroup", "Zone", "keyedValue", "variableName", "Daily", "", "m3/s"}, - {"20", "0", "Avg", "indexGroup", "Unknown!!!", "keyedValue", "variableName", "Daily", "", "m3/s"}, - {"21", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Monthly", "", "m3/s"}, - {"22", "0", "Sum", "indexGroup", "HVAC System", "keyedValue", "variableName", "Monthly", "", "m3/s"}, - {"23", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Monthly", "scheduleName", "m3/s"}, - {"24", "0", "Avg", "indexGroup", "Zone", "keyedValue", "variableName", "Monthly", "", "m3/s"}, - {"25", "0", "Avg", "indexGroup", "Unknown!!!", "keyedValue", "variableName", "Monthly", "", "m3/s"}, - {"26", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Run Period", "", "m3/s"}, - {"27", "0", "Sum", "indexGroup", "HVAC System", "keyedValue", "variableName", "Run Period", "", "m3/s"}, - {"28", "0", "Avg", "indexGroup", "HVAC System", "keyedValue", "variableName", "Run Period", "scheduleName", "m3/s"}, - {"29", "0", "Avg", "indexGroup", "Zone", "keyedValue", "variableName", "Run Period", "", "m3/s"}, - {"30", "0", "Avg", "indexGroup", "Unknown!!!", "keyedValue", "variableName", "Run Period", "", "m3/s"}}); + std::vector> reportDataDictionary({ + {"1", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, + {"2", "0", "Sum", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, + {"3", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Zone Timestep", "scheduleName", "m3/s"}, + {"4", "0", "Avg", "indexGroup", timeStepSystemString, "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, + {"5", "0", "Avg", "indexGroup", aThirdTimeStepString, "keyedValue", "variableName", "Zone Timestep", "", "m3/s"}, + {"6", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, + {"7", "0", "Sum", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, + {"8", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "HVAC System Timestep", "scheduleName", "m3/s"}, + {"9", "0", "Avg", "indexGroup", timeStepSystemString, "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, + {"10", "0", "Avg", "indexGroup", aThirdTimeStepString, "keyedValue", "variableName", "HVAC System Timestep", "", "m3/s"}, + {"11", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Hourly", "", "m3/s"}, + {"12", "0", "Sum", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Hourly", "", "m3/s"}, + {"13", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Hourly", "scheduleName", "m3/s"}, + {"14", "0", "Avg", "indexGroup", timeStepSystemString, "keyedValue", "variableName", "Hourly", "", "m3/s"}, + {"15", "0", "Avg", "indexGroup", aThirdTimeStepString, "keyedValue", "variableName", "Hourly", "", "m3/s"}, + {"16", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Daily", "", "m3/s"}, + {"17", "0", "Sum", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Daily", "", "m3/s"}, + {"18", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Daily", "scheduleName", "m3/s"}, + {"19", "0", "Avg", "indexGroup", timeStepSystemString, "keyedValue", "variableName", "Daily", "", "m3/s"}, + {"20", "0", "Avg", "indexGroup", aThirdTimeStepString, "keyedValue", "variableName", "Daily", "", "m3/s"}, + {"21", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Monthly", "", "m3/s"}, + {"22", "0", "Sum", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Monthly", "", "m3/s"}, + {"23", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Monthly", "scheduleName", "m3/s"}, + {"24", "0", "Avg", "indexGroup", timeStepSystemString, "keyedValue", "variableName", "Monthly", "", "m3/s"}, + {"25", "0", "Avg", "indexGroup", aThirdTimeStepString, "keyedValue", "variableName", "Monthly", "", "m3/s"}, + {"26", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Run Period", "", "m3/s"}, + {"27", "0", "Sum", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Run Period", "", "m3/s"}, + {"28", "0", "Avg", "indexGroup", timeStepZoneString, "keyedValue", "variableName", "Run Period", "scheduleName", "m3/s"}, + {"29", "0", "Avg", "indexGroup", timeStepSystemString, "keyedValue", "variableName", "Run Period", "", "m3/s"}, + {"30", "0", "Avg", "indexGroup", aThirdTimeStepString, "keyedValue", "variableName", "Run Period", "", "m3/s"} + }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); } @@ -2243,21 +2272,21 @@ namespace OutputProcessor { TEST_F(SQLiteFixture, OutputProcessor_setupTimePointers) { - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0; SetupTimePointers("Zone", timeStep); - EXPECT_DOUBLE_EQ(timeStep, TimeValue(1).TimeStep); - EXPECT_DOUBLE_EQ(0.0, TimeValue(1).CurMinute); + EXPECT_DOUBLE_EQ(timeStep, TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep); + EXPECT_DOUBLE_EQ(0.0, TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute); timeStep = 2.0; SetupTimePointers("HVAC", timeStep); - EXPECT_DOUBLE_EQ(timeStep, TimeValue(2).TimeStep); - EXPECT_DOUBLE_EQ(0.0, TimeValue(2).CurMinute); + EXPECT_DOUBLE_EQ(timeStep, TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep); + EXPECT_DOUBLE_EQ(0.0, TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute); } TEST_F(SQLiteFixture, OutputProcessor_getReportVariableInput) @@ -2584,12 +2613,16 @@ namespace OutputProcessor { ASSERT_TRUE(process_idf(idf_objects)); - AddToOutputVariableList("Site Outdoor Air Drybulb Temperature", 1, StoreType::Averaged, 2, OutputProcessor::Unit::C); - AddToOutputVariableList("Site Outdoor Air Wetbulb Temperature", 1, StoreType::Averaged, 2, OutputProcessor::Unit::C); - AddToOutputVariableList("Site Outdoor Air Humidity Ratio", 1, StoreType::Averaged, 2, OutputProcessor::Unit::kgWater_kgDryAir); - AddToOutputVariableList("Site Outdoor Air Relative Humidity", 1, StoreType::Averaged, 2, OutputProcessor::Unit::Perc); + AddToOutputVariableList("Site Outdoor Air Drybulb Temperature", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 2, OutputProcessor::Unit::C); + AddToOutputVariableList("Site Outdoor Air Wetbulb Temperature", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 2, OutputProcessor::Unit::C); + AddToOutputVariableList("Site Outdoor Air Humidity Ratio", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 2, OutputProcessor::Unit::kgWater_kgDryAir); + AddToOutputVariableList("Site Outdoor Air Relative Humidity", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 2, OutputProcessor::Unit::Perc); - EXPECT_EQ(1, DDVariableTypes(1).IndexType); + EXPECT_EQ(OutputProcessor::TimeStepType::TimeStepZone, DDVariableTypes(1).timeStepType); EXPECT_EQ(StoreType::Averaged, DDVariableTypes(1).storeType); EXPECT_EQ(2, DDVariableTypes(1).VariableType); EXPECT_EQ(0, DDVariableTypes(1).Next); @@ -2597,7 +2630,7 @@ namespace OutputProcessor { EXPECT_EQ("Site Outdoor Air Drybulb Temperature", DDVariableTypes(1).VarNameOnly); EXPECT_EQ(OutputProcessor::Unit::C, DDVariableTypes(1).units); - EXPECT_EQ(1, DDVariableTypes(2).IndexType); + EXPECT_EQ(OutputProcessor::TimeStepType::TimeStepZone, DDVariableTypes(2).timeStepType); EXPECT_EQ(StoreType::Averaged, DDVariableTypes(2).storeType); EXPECT_EQ(2, DDVariableTypes(2).VariableType); EXPECT_EQ(0, DDVariableTypes(2).Next); @@ -2605,7 +2638,7 @@ namespace OutputProcessor { EXPECT_EQ("Site Outdoor Air Wetbulb Temperature", DDVariableTypes(2).VarNameOnly); EXPECT_EQ(OutputProcessor::Unit::C, DDVariableTypes(2).units); - EXPECT_EQ(1, DDVariableTypes(3).IndexType); + EXPECT_EQ(OutputProcessor::TimeStepType::TimeStepZone, DDVariableTypes(3).timeStepType); EXPECT_EQ(StoreType::Averaged, DDVariableTypes(3).storeType); EXPECT_EQ(2, DDVariableTypes(3).VariableType); EXPECT_EQ(0, DDVariableTypes(3).Next); @@ -2613,7 +2646,7 @@ namespace OutputProcessor { EXPECT_EQ("Site Outdoor Air Humidity Ratio", DDVariableTypes(3).VarNameOnly); EXPECT_EQ(OutputProcessor::Unit::kgWater_kgDryAir, DDVariableTypes(3).units); - EXPECT_EQ(1, DDVariableTypes(4).IndexType); + EXPECT_EQ(OutputProcessor::TimeStepType::TimeStepZone, DDVariableTypes(4).timeStepType); EXPECT_EQ(StoreType::Averaged, DDVariableTypes(4).storeType); EXPECT_EQ(2, DDVariableTypes(4).VariableType); EXPECT_EQ(0, DDVariableTypes(4).Next); @@ -2637,7 +2670,7 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary( - {{"1", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}}); + {{"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}}); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); EXPECT_EQ(1, NumExtraVars); @@ -2649,7 +2682,7 @@ namespace OutputProcessor { EXPECT_EQ("", ReqRepVars(1).SchedName); EXPECT_EQ(true, ReqRepVars(1).Used); - EXPECT_EQ(1, DDVariableTypes(1).IndexType); + EXPECT_EQ(OutputProcessor::TimeStepType::TimeStepZone, DDVariableTypes(1).timeStepType); EXPECT_EQ(StoreType::Averaged, DDVariableTypes(1).storeType); EXPECT_EQ(2, DDVariableTypes(1).VariableType); EXPECT_EQ(0, DDVariableTypes(1).Next); @@ -2672,9 +2705,9 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Gas Rate", "Run Period", "", "W"}, - {"2", "0", "Avg", "System", "Zone", "Boiler2", "Boiler Gas Rate", "Run Period", "", "W"}, - {"3", "0", "Avg", "System", "Zone", "Boiler3", "Boiler Gas Rate", "Run Period", "", "W"}, + {"1", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Gas Rate", "Run Period", "", "W"}, + {"2", "0", "Avg", "System", "HVAC System", "Boiler2", "Boiler Gas Rate", "Run Period", "", "W"}, + {"3", "0", "Avg", "System", "HVAC System", "Boiler3", "Boiler Gas Rate", "Run Period", "", "W"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -2703,8 +2736,8 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Gas Rate", "Run Period", "", "W"}, - {"2", "0", "Avg", "System", "Zone", "Boiler3", "Boiler Gas Rate", "Run Period", "", "W"}, + {"1", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Gas Rate", "Run Period", "", "W"}, + {"2", "0", "Avg", "System", "HVAC System", "Boiler3", "Boiler Gas Rate", "Run Period", "", "W"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -2732,9 +2765,9 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Gas Rate", "Run Period", "", "W"}, - {"2", "0", "Avg", "System", "Zone", "Boiler2", "Boiler Gas Rate", "Run Period", "", "W"}, - {"3", "0", "Avg", "System", "Zone", "Boiler3", "Boiler Gas Rate", "Run Period", "", "W"}, + {"1", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Gas Rate", "Run Period", "", "W"}, + {"2", "0", "Avg", "System", "HVAC System", "Boiler2", "Boiler Gas Rate", "Run Period", "", "W"}, + {"3", "0", "Avg", "System", "HVAC System", "Boiler3", "Boiler Gas Rate", "Run Period", "", "W"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -2768,10 +2801,10 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "System", "Zone", "Zn003:Wall001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, - {"2", "0", "Avg", "System", "Zone", "Zn003:Wall002", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, - {"3", "0", "Avg", "System", "Zone", "Zn003:Wall002:Win001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, - {"4", "0", "Avg", "System", "Zone", "Zn003:Wall003", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"1", "0", "Avg", "System", "HVAC System", "Zn003:Wall001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"2", "0", "Avg", "System", "HVAC System", "Zn003:Wall002", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"3", "0", "Avg", "System", "HVAC System", "Zn003:Wall002:Win001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"4", "0", "Avg", "System", "HVAC System", "Zn003:Wall003", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -2809,10 +2842,10 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "System", "Zone", "ZN003:WALL001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, - {"2", "0", "Avg", "System", "Zone", "ZN003:WALL002", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, - {"3", "0", "Avg", "System", "Zone", "ZN003:WALL002:WIN001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, - {"4", "0", "Avg", "System", "Zone", "ZN003:WALL003", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"1", "0", "Avg", "System", "HVAC System", "ZN003:WALL001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"2", "0", "Avg", "System", "HVAC System", "ZN003:WALL002", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"3", "0", "Avg", "System", "HVAC System", "ZN003:WALL002:WIN001", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, + {"4", "0", "Avg", "System", "HVAC System", "ZN003:WALL003", "AFN Linkage Node 1 to Node 2 Volume Flow Rate", "Zone Timestep", "", "m3/s"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -3072,15 +3105,15 @@ namespace OutputProcessor { DataEnvironment::EndMonthFlag = true; } - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0 / 6; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).CurMinute = 50; - TimeValue(2).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 50; GetReportVariableInput(); SetupOutputVariable("Site Outdoor Air Drybulb Temperature", OutputProcessor::Unit::C, DataEnvironment::OutDryBulbTemp, "Zone", "Average", @@ -3105,7 +3138,7 @@ namespace OutputProcessor { UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); auto timeResults = queryResult("SELECT * FROM Time;", "Time"); @@ -3122,16 +3155,16 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Zone Timestep", "", "C"}, - {"2", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}, - {"3", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Daily", "", "C"}, - {"4", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Monthly", "", "C"}, - {"5", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, - {"7", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Zone Timestep", "", "J"}, - {"8", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Hourly", "", "J"}, - {"9", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Daily", "", "J"}, - {"10", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Monthly", "", "J"}, - {"12", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Run Period", "", "J"}, + {"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Zone Timestep", "", "C"}, + {"2", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}, + {"3", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Daily", "", "C"}, + {"4", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Monthly", "", "C"}, + {"5", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, + {"7", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Zone Timestep", "", "J"}, + {"8", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Hourly", "", "J"}, + {"9", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Daily", "", "J"}, + {"10", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Monthly", "", "J"}, + {"12", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Run Period", "", "J"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -3256,15 +3289,15 @@ namespace OutputProcessor { DataEnvironment::EndMonthFlag = true; } - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0 / 6; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).CurMinute = 50; - TimeValue(2).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 50; GetReportVariableInput(); SetupOutputVariable("Site Outdoor Air Drybulb Temperature", OutputProcessor::Unit::C, DataEnvironment::OutDryBulbTemp, "Zone", "Average", @@ -3293,7 +3326,7 @@ namespace OutputProcessor { UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); auto timeResults = queryResult("SELECT * FROM Time;", "Time"); @@ -3310,19 +3343,19 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "HVAC System Timestep", "", "C"}, - {"2", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Zone Timestep", "", "C"}, - {"3", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}, - {"4", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Daily", "", "C"}, - {"5", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Monthly", "", "C"}, - {"6", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, - {"8", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "HVAC System Timestep", "", "J"}, - {"9", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Hourly", "", "J"}, - {"10", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Daily", "", "J"}, - {"11", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Monthly", "", "J"}, - {"13", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Run Period", "", "J"}, - {"180", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Heating Rate", "HVAC System Timestep", "", "W"}, - {"181", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Gas Rate", "HVAC System Timestep", "", "W"}, + {"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "HVAC System Timestep", "", "C"}, + {"2", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Zone Timestep", "", "C"}, + {"3", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}, + {"4", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Daily", "", "C"}, + {"5", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Monthly", "", "C"}, + {"6", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, + {"8", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "HVAC System Timestep", "", "J"}, + {"9", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Hourly", "", "J"}, + {"10", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Daily", "", "J"}, + {"11", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Monthly", "", "J"}, + {"13", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Run Period", "", "J"}, + {"180", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Heating Rate", "HVAC System Timestep", "", "W"}, + {"181", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Gas Rate", "HVAC System Timestep", "", "W"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -3453,15 +3486,15 @@ namespace OutputProcessor { DataEnvironment::EndMonthFlag = true; } - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0 / 6; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).CurMinute = 50; - TimeValue(2).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 50; GetReportVariableInput(); SetupOutputVariable("Site Outdoor Air Drybulb Temperature", OutputProcessor::Unit::C, DataEnvironment::OutDryBulbTemp, "Zone", "Average", @@ -3490,7 +3523,7 @@ namespace OutputProcessor { UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); auto timeResults = queryResult("SELECT * FROM Time;", "Time"); @@ -3503,19 +3536,19 @@ namespace OutputProcessor { auto reportDataDictionaryResults = queryResult("SELECT * FROM ReportDataDictionary;", "ReportDataDictionary"); std::vector> reportDataDictionary({ - {"1", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "HVAC System Timestep", "", "C"}, - {"2", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Zone Timestep", "", "C"}, - {"3", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}, - {"4", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Daily", "", "C"}, - {"5", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Monthly", "", "C"}, - {"6", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, - {"8", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "HVAC System Timestep", "", "J"}, - {"9", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Hourly", "", "J"}, - {"10", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Daily", "", "J"}, - {"11", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Monthly", "", "J"}, - {"13", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Electricity:Facility", "Run Period", "", "J"}, - {"180", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Heating Rate", "HVAC System Timestep", "", "W"}, - {"181", "0", "Avg", "System", "Zone", "Boiler1", "Boiler Gas Rate", "HVAC System Timestep", "", "W"}, + {"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "HVAC System Timestep", "", "C"}, + {"2", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Zone Timestep", "", "C"}, + {"3", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}, + {"4", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Daily", "", "C"}, + {"5", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Monthly", "", "C"}, + {"6", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Run Period", "", "C"}, + {"8", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "HVAC System Timestep", "", "J"}, + {"9", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Hourly", "", "J"}, + {"10", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Daily", "", "J"}, + {"11", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Monthly", "", "J"}, + {"13", "1", "Sum", "Facility:Electricity", "Zone", "", "Electricity:Facility", "Run Period", "", "J"}, + {"180", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Heating Rate", "HVAC System Timestep", "", "W"}, + {"181", "0", "Avg", "System", "HVAC System", "Boiler1", "Boiler Gas Rate", "HVAC System Timestep", "", "W"}, }); EXPECT_EQ(reportDataDictionary, reportDataDictionaryResults); @@ -3597,13 +3630,13 @@ namespace OutputProcessor { if (DataEnvironment::DayOfMonth == WeatherManager::EndDayOfMonth(DataEnvironment::Month)) { DataEnvironment::EndMonthFlag = true; } - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0 / 6; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).CurMinute = 10; - TimeValue(2).CurMinute = 10; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 10; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 10; DataGlobals::WarmupFlag = true; @@ -3617,33 +3650,33 @@ namespace OutputProcessor { PurchAir(1).TotHeatEnergy = 1.1; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 1.3; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 1.5; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 1.7; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 1.9; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 2.2; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); DataGlobals::WarmupFlag = false; PurchAir(1).TotHeatEnergy = 2.4; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::ZoneTSReporting); // zone timestep + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); // zone timestep compare_eso_stream(delimited_string({ "7,1,,Zone Ideal Loads Supply Air Total Heating Energy [J] !Each Call", @@ -3668,15 +3701,15 @@ namespace OutputProcessor { PurchAir(1).TotHeatEnergy = 100.0; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 200.0; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::HVACTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepSystem); PurchAir(1).TotHeatEnergy = 300.0; UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::ZoneTSReporting); // zone timestep + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); // zone timestep compare_eso_stream(delimited_string({ "2,365,12,31, 0,24, 0.00,10.00,Tuesday", @@ -3723,15 +3756,15 @@ namespace OutputProcessor { DataEnvironment::EndMonthFlag = true; } - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0 / 6; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).CurMinute = 50; - TimeValue(2).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 50; GetReportVariableInput(); SetupOutputVariable("Site Outdoor Air Drybulb Temperature", OutputProcessor::Unit::C, DataEnvironment::OutDryBulbTemp, "Zone", "Average", @@ -3740,7 +3773,7 @@ namespace OutputProcessor { SetupOutputVariable("Lights Electric Energy", OutputProcessor::Unit::J, light_consumption, "Zone", "Sum", "SPACE1-1 LIGHTS 1", _, "Electricity", "InteriorLights", "GeneralLights", "Building", "SPACE1-1", 1, 1); UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); GenOutputVariablesAuditReport(); @@ -3789,15 +3822,15 @@ namespace OutputProcessor { DataEnvironment::EndMonthFlag = true; } - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0 / 6; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).CurMinute = 50; - TimeValue(2).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute = 50; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).CurMinute = 50; OutputReportTabular::GetInputTabularMonthly(); OutputReportTabular::InitializeTabularMonthly(); @@ -3809,7 +3842,7 @@ namespace OutputProcessor { SetupOutputVariable("Lights Electric Energy", OutputProcessor::Unit::J, light_consumption, "Zone", "Sum", "SPACE1-1 LIGHTS 1", _, "Electricity", "InteriorLights", "GeneralLights", "Building", "SPACE1-1", 1, 1); UpdateMeterReporting(); - UpdateDataandReport(DataGlobals::ZoneTSReporting); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); NumExtraVars = 0; BuildKeyVarList("Air Loop 1|AirSupply InletNode", "SYSTEM NODE SETPOINT TEMPERATURE", 1, 2); @@ -3888,18 +3921,27 @@ namespace OutputProcessor { TEST_F(EnergyPlusFixture, OutputProcessor_unitStringFromDDitem) { - AddToOutputVariableList("energy variable 1", 1, StoreType::Averaged, 1, OutputProcessor::Unit::J); - AddToOutputVariableList("energy variable 2", 1, StoreType::Averaged, 1, OutputProcessor::Unit::J); - AddToOutputVariableList("energy variable 3", 1, StoreType::Averaged, 1, OutputProcessor::Unit::J); - - AddToOutputVariableList("humidity ratio variable 1", 1, StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_kgDryAir); - AddToOutputVariableList("humidity ratio variable 2", 1, StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_kgDryAir); - - AddToOutputVariableList("flow variable 1", 1, StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_s); - AddToOutputVariableList("flow variable 2", 1, StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_s); - - AddToOutputVariableList("user defined EMS variable 1", 1, StoreType::Averaged, 1, OutputProcessor::Unit::customEMS, "ergs/century"); - AddToOutputVariableList("user defined EMS variable 2", 1, StoreType::Averaged, 1, OutputProcessor::Unit::customEMS, "swamps/county"); + AddToOutputVariableList("energy variable 1", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::J); + AddToOutputVariableList("energy variable 2", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::J); + AddToOutputVariableList("energy variable 3", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::J); + + AddToOutputVariableList("humidity ratio variable 1", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_kgDryAir); + AddToOutputVariableList("humidity ratio variable 2", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_kgDryAir); + + AddToOutputVariableList("flow variable 1", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_s); + AddToOutputVariableList("flow variable 2", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::kgWater_s); + + AddToOutputVariableList("user defined EMS variable 1", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::customEMS, "ergs/century"); + AddToOutputVariableList("user defined EMS variable 2", OutputProcessor::TimeStepType::TimeStepZone, + StoreType::Averaged, 1, OutputProcessor::Unit::customEMS, "swamps/county"); EXPECT_EQ(" [J]", unitStringFromDDitem(3)); diff --git a/tst/EnergyPlus/unit/OutputReportData.unit.cc b/tst/EnergyPlus/unit/OutputReportData.unit.cc index 84678d6f1b0..48f7bf05dbd 100644 --- a/tst/EnergyPlus/unit/OutputReportData.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportData.unit.cc @@ -96,7 +96,7 @@ TEST_F(EnergyPlusFixture, OutputReportData_getVariableKeys) int keyCount = 0; int typeVar = 0; OutputProcessor::StoreType avgSumVar; - int stepTypeVar = 0; + OutputProcessor::TimeStepType stepTypeVar; OutputProcessor::Unit unitsVar = OutputProcessor::Unit::None; fldStTest.m_variMeter = "EXTERIOR LIGHTS ELECTRIC ENERGY"; diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 0ddeda690fd..01932cbb40c 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -1452,7 +1452,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ZoneMultiplierTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); ManageSimulation(); // run the design day over the warmup period (24 hrs, 25 days) @@ -1467,7 +1467,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ZoneMultiplierTest) DataGlobals::DoWeathSim = true; // flag to trick tabular reports to scan meters DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) - UpdateTabularReports(OutputReportTabular::stepTypeHVAC); + UpdateTabularReports(OutputProcessor::TimeStepType::TimeStepSystem); // zone equipment should report single zone magnitude, multipliers do not apply, should be > 0 or what's the point EXPECT_EQ(DataHeatBalance::ZnRpt(1).PeopleRadGain, DataHeatBalance::ZnRpt(2).PeopleRadGain); @@ -2489,7 +2489,7 @@ TEST_F(EnergyPlusFixture, AirloopHVAC_ZoneSumTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); // DataGlobals::DDOnlySimulation = true; ManageSimulation(); // run the design day over the warmup period (24 hrs, 25 days) @@ -2498,7 +2498,7 @@ TEST_F(EnergyPlusFixture, AirloopHVAC_ZoneSumTest) DataGlobals::DoWeathSim = true; // flag to trick tabular reports to scan meters DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) - UpdateTabularReports(OutputReportTabular::stepTypeHVAC); + UpdateTabularReports(OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_NEAR(1.86168, DataSizing::FinalSysSizing(1).DesOutAirVolFlow, 0.0001); } @@ -3463,7 +3463,7 @@ TEST_F(EnergyPlusFixture, AirloopHVAC_ZoneSumTest) // ASSERT_TRUE( process_idf( idf_objects ) ); -// OutputProcessor::TimeValue.allocate( 2 ); +// OutputProcessor::TimeValue.allocate(2); ////DataGlobals::DDOnlySimulation = true; // ManageSimulation(); // run the design day over the warmup period (24 hrs, 25 days) @@ -3473,7 +3473,7 @@ TEST_F(EnergyPlusFixture, AirloopHVAC_ZoneSumTest) // DataGlobals::DoWeathSim = true; // flag to trick tabular reports to scan meters // DataGlobals::KindOfSim = DataGlobals::ksRunPeriodWeather; // fake a weather run since a weather file can't be used (could it?) -// UpdateTabularReports( OutputReportTabular::stepTypeHVAC ); +// UpdateTabularReports( OutputProcessor::TimeStepType::TimeStepSystem ); // EXPECT_NEAR( 1.86168, DataSizing::FinalSysSizing( 1 ).DesOutAirVolFlow, 0.0001 ); @@ -3539,20 +3539,20 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthly_ResetMonthlyGathering) DataEnvironment::Month = 12; - GatherMonthlyResultsForTimestep(1); + GatherMonthlyResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 1, MonthlyColumns(1).reslt(12)); - GatherMonthlyResultsForTimestep(1); + GatherMonthlyResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 2, MonthlyColumns(1).reslt(12)); - GatherMonthlyResultsForTimestep(1); + GatherMonthlyResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 3, MonthlyColumns(1).reslt(12)); ResetMonthlyGathering(); EXPECT_EQ(0., MonthlyColumns(1).reslt(12)); - GatherMonthlyResultsForTimestep(1); + GatherMonthlyResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 1, MonthlyColumns(1).reslt(12)); } @@ -3595,15 +3595,15 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) DataGlobals::DoWeathSim = true; DataGlobals::TimeStepZone = 1.0; displayTabularBEPS = true; - TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); auto timeStep = 1.0; SetupTimePointers("Zone", timeStep); SetupTimePointers("HVAC", timeStep); - TimeValue(1).TimeStep = 60; - TimeValue(2).TimeStep = 60; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep = 60; + TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep = 60; GetInputOutputTableSummaryReports(); @@ -3612,18 +3612,18 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) DataEnvironment::Month = 12; UpdateMeterReporting(); - UpdateDataandReport(1); - GatherBEPSResultsForTimestep(1); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); + GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, endUseExteriorLights)); UpdateMeterReporting(); - UpdateDataandReport(1); - GatherBEPSResultsForTimestep(1); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); + GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 6, gatherEndUseBEPS(1, endUseExteriorLights)); UpdateMeterReporting(); - UpdateDataandReport(1); - GatherBEPSResultsForTimestep(1); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); + GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 9, gatherEndUseBEPS(1, endUseExteriorLights)); ResetBEPSGathering(); @@ -3631,8 +3631,8 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_ConfirmResetBEPSGathering) EXPECT_EQ(0., gatherEndUseBEPS(1, endUseExteriorLights)); UpdateMeterReporting(); - UpdateDataandReport(1); - GatherBEPSResultsForTimestep(1); + UpdateDataandReport(OutputProcessor::TimeStepType::TimeStepZone); + GatherBEPSResultsForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(extLitUse * 3, gatherEndUseBEPS(1, endUseExteriorLights)); } @@ -3677,7 +3677,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) EnergyMeters(endUseMeterNum).CurTSValue = 47.0 * DataGlobals::TimeStepZoneSec; // create the current value for the end use meter EnergyMeters(subEndUseMeterNum).CurTSValue = 28.0 * DataGlobals::TimeStepZoneSec; // create the current value for the sub end use meter - GatherPeakDemandForTimestep(ZoneTSReporting); + GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(123., gatherDemandTotal(resourceNum)); @@ -3693,7 +3693,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) EnergyMeters(endUseMeterNum).CurTSValue = 57.0 * DataGlobals::TimeStepZoneSec; // create the current value for the end use meter EnergyMeters(subEndUseMeterNum).CurTSValue = 38.0 * DataGlobals::TimeStepZoneSec; // create the current value for the sub end use meter - GatherPeakDemandForTimestep(ZoneTSReporting); + GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(133., gatherDemandTotal(resourceNum)); @@ -3709,7 +3709,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) EnergyMeters(endUseMeterNum).CurTSValue = 61.0 * DataGlobals::TimeStepZoneSec; // create the current value for the end use meter EnergyMeters(subEndUseMeterNum).CurTSValue = 42.0 * DataGlobals::TimeStepZoneSec; // create the current value for the sub end use meter - GatherPeakDemandForTimestep(ZoneTSReporting); + GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(133., gatherDemandTotal(resourceNum)); @@ -3725,7 +3725,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherPeakDemandForTimestep) EnergyMeters(endUseMeterNum).CurTSValue = 59.0 * DataGlobals::TimeStepZoneSec; // create the current value for the end use meter EnergyMeters(subEndUseMeterNum).CurTSValue = 39.0 * DataGlobals::TimeStepZoneSec; // create the current value for the sub end use meter - GatherPeakDemandForTimestep(ZoneTSReporting); + GatherPeakDemandForTimestep(OutputProcessor::TimeStepType::TimeStepZone); EXPECT_EQ(143., gatherDemandTotal(resourceNum)); @@ -3762,7 +3762,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) Real64 reliefEnergy = 2.0 * TimeStepSysSec; Real64 condenserReject = 1.0 * TimeStepSysSec + 50.0; - GatherHeatEmissionReport(HVACTSReporting); + GatherHeatEmissionReport(OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_EQ(reliefEnergy, DataHeatBalance::SysTotalHVACReliefHeatLoss); EXPECT_EQ(reliefEnergy * DataGlobals::convertJtoGJ, BuildingPreDefRep.emiHVACRelief); @@ -3788,7 +3788,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabular_GatherHeatEmissionReport) Real64 coilReject = 1.0 * TimeStepSysSec + 200.0 + 10.0; - GatherHeatEmissionReport(HVACTSReporting); + GatherHeatEmissionReport(OutputProcessor::TimeStepType::TimeStepSystem); EXPECT_EQ(reliefEnergy, DataHeatBalance::SysTotalHVACReliefHeatLoss); EXPECT_EQ(2 * reliefEnergy * DataGlobals::convertJtoGJ, BuildingPreDefRep.emiHVACRelief); EXPECT_EQ(condenserReject + coilReject, DataHeatBalance::SysTotalHVACRejectHeatLoss); @@ -4942,7 +4942,7 @@ TEST_F(EnergyPlusFixture, OutputTableTimeBins_GetInput) // ASSERT_TRUE( process_idf( idf_objects ) ); -// OutputProcessor::TimeValue.allocate( 2 ); +// OutputProcessor::TimeValue.allocate(2); ////DataGlobals::DDOnlySimulation = true; // ManageSimulation(); @@ -6036,7 +6036,7 @@ TEST_F(EnergyPlusFixture, OutputTableTimeBins_GetInput) // ASSERT_TRUE( process_idf( idf_objects ) ); -// OutputProcessor::TimeValue.allocate( 2 ); +// OutputProcessor::TimeValue.allocate(2); ////DataGlobals::DDOnlySimulation = true; // ManageSimulation(); diff --git a/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc b/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc index 1b73b53c944..bd0d6df5469 100644 --- a/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc @@ -196,7 +196,7 @@ TEST_F(EnergyPlusFixture, OutputReportTabularAnnual_GatherResults) extLitUse = 1.01; // UpdateDataandReport( 1 ); not sure if this is needed - GatherAnnualResultsForTimeStep(1); + GatherAnnualResultsForTimeStep(OutputProcessor::TimeStepType::TimeStepZone); // STOPPPED HERE. NOT SEEING THE POWER VARIABLE SHOWING UP diff --git a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc index 65b6982afa9..b8677337f6c 100644 --- a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc +++ b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc @@ -1068,7 +1068,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileHi) OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); PlantManager::CheckIfAnyPlant(); @@ -2159,7 +2159,7 @@ TEST_F(EnergyPlusFixture, PlantHXModulatedDualDeadDefectFileLo) OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); PlantManager::CheckIfAnyPlant(); diff --git a/tst/EnergyPlus/unit/SQLite.unit.cc b/tst/EnergyPlus/unit/SQLite.unit.cc index aa523b66e3c..385c3fad6f6 100644 --- a/tst/EnergyPlus/unit/SQLite.unit.cc +++ b/tst/EnergyPlus/unit/SQLite.unit.cc @@ -52,6 +52,7 @@ // EnergyPlus Headers #include "Fixtures/SQLiteFixture.hh" +#include "OutputProcessor.hh" namespace EnergyPlus { @@ -232,12 +233,12 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createSQLiteReportDictionaryRecord) EnergyPlus::sqlite->sqliteCommit(); ASSERT_EQ(5ul, result.size()); - std::vector testResult0{"1", "0", "Avg", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", + std::vector testResult0{"1", "0", "Avg", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}; - std::vector testResult1{"2", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Facility:Electricity", "Hourly", "", "J"}; - std::vector testResult2{"3", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Facility:Electricity", "Monthly", "", "J"}; - std::vector testResult3{"4", "0", "Avg", "HVAC", "Zone", "", "AHU-1", "Hourly", "", ""}; - std::vector testResult4{"5", "0", "Avg", "HVAC", "Zone", "", "AHU-1", "Hourly", "test schedule", ""}; + std::vector testResult1{"2", "1", "Sum", "Facility:Electricity", "Zone", "", "Facility:Electricity", "Hourly", "", "J"}; + std::vector testResult2{"3", "1", "Sum", "Facility:Electricity", "Zone", "", "Facility:Electricity", "Monthly", "", "J"}; + std::vector testResult3{"4", "0", "Avg", "HVAC", "HVAC System", "", "AHU-1", "Hourly", "", ""}; + std::vector testResult4{"5", "0", "Avg", "HVAC", "HVAC System", "", "AHU-1", "Hourly", "test schedule", ""}; EXPECT_EQ(testResult0, result[0]); EXPECT_EQ(testResult1, result[1]); EXPECT_EQ(testResult2, result[2]); @@ -253,11 +254,11 @@ TEST_F(SQLiteFixture, SQLiteProcedures_createSQLiteReportDictionaryRecord) EnergyPlus::sqlite->sqliteCommit(); ASSERT_EQ(9ul, result.size()); - std::vector testResult5{"6", "0", "Unknown!!!", "Zone", "HVAC System", "Environment", "Site Outdoor Air Drybulb Temperature", + std::vector testResult5{"6", "0", "Unknown!!!", "Zone", "Zone", "Environment", "Site Outdoor Air Drybulb Temperature", "Hourly", "", "C"}; std::vector testResult6{"7", "1", "Sum", "Facility:Electricity", "Unknown!!!", "", "Facility:Electricity", "Hourly", "", "J"}; - std::vector testResult7{"8", "1", "Sum", "Facility:Electricity", "HVAC System", "", "Facility:Electricity", "Unknown!!!", "", "J"}; - std::vector testResult8{"9", "0", "Avg", "HVAC", "Zone", "", "AHU-1", "Unknown!!!", "", ""}; + std::vector testResult7{"8", "1", "Sum", "Facility:Electricity", "Zone", "", "Facility:Electricity", "Unknown!!!", "", "J"}; + std::vector testResult8{"9", "0", "Avg", "HVAC", "HVAC System", "", "AHU-1", "Unknown!!!", "", ""}; EXPECT_EQ(testResult5, result[5]); EXPECT_EQ(testResult6, result[6]); EXPECT_EQ(testResult7, result[7]); @@ -433,10 +434,13 @@ TEST_F(SQLiteFixture, SQLiteProcedures_privateMethods) EXPECT_EQ("Unknown!!!", storageType(-1)); // test timestepTypeName - EXPECT_EQ("HVAC System", timestepTypeName(1)); - EXPECT_EQ("Zone", timestepTypeName(2)); + EXPECT_EQ("Zone", timestepTypeName(1)); + EXPECT_EQ("HVAC System", timestepTypeName(2)); EXPECT_EQ("Unknown!!!", timestepTypeName(3)); EXPECT_EQ("Unknown!!!", timestepTypeName(-1)); + // Let's ensure we never get an unexpected change of mapping between enum and the corresponding int value + EXPECT_EQ(1, static_cast(OutputProcessor::TimeStepType::TimeStepZone)); + EXPECT_EQ(2, static_cast(OutputProcessor::TimeStepType::TimeStepSystem)); // test reportingFreqName EXPECT_EQ("HVAC System Timestep", reportingFreqName(-1)); diff --git a/tst/EnergyPlus/unit/SingleDuct.unit.cc b/tst/EnergyPlus/unit/SingleDuct.unit.cc index 18d86278eba..34da32912ce 100644 --- a/tst/EnergyPlus/unit/SingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/SingleDuct.unit.cc @@ -1252,7 +1252,7 @@ TEST_F(EnergyPlusFixture, SingleDuct_ZeroFloorAreaTest) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); ManageSimulation(); // run the design day over the warmup period (24 hrs, 25 days) @@ -2451,7 +2451,7 @@ TEST_F(EnergyPlusFixture, SingleDuct_VAVWaterCoilSizing) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); ManageSimulation(); // run the design days diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index 04f687a4026..bbfc7cfc868 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -116,9 +116,8 @@ class SizingAnalysisObjectsTest : public testing::Test Environment(4).DesignDayNum = 2; Environment(4).SeedEnvrnNum = 2; - TimeValue.allocate(2); - TimeValue(1).TimeStep >>= TimeStepZone; - TimeValue(2).TimeStep >>= DataHVACGlobals::TimeStepSys; + OutputProcessor::SetupTimePointers("ZONE", TimeStepZone); + OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); PlantSizData.allocate(1); @@ -149,7 +148,7 @@ class SizingAnalysisObjectsTest : public testing::Test PlantLoop.deallocate(); Environment.deallocate(); PlantSizData.deallocate(); - TimeValue.deallocate(); + TimeValue.clear(); } }; @@ -410,18 +409,17 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) HourofDay = hr; for (int timeStp = 1; timeStp <= 4; ++timeStp) { // 15 minute zone timestep for (int subTimeStp = 1; subTimeStp <= 5; ++subTimeStp) { // 5 system substeps, so 3 minute system timestep - int const sysIndex(2); Real64 const minutesPerHour(60.0); ZoneTimestepObject tmpztStepStamp(KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, numTimeStepsInHour); // call constructor SystemTimestepObject tmpSysStepStamp; tmpSysStepStamp.CurMinuteEnd = (timeStp - 1) * (minutesPerHour * zoneTimeStepDuration) + - (subTimeStp)*OutputProcessor::TimeValue(sysIndex).TimeStep * minutesPerHour; + (subTimeStp)*OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * minutesPerHour; if (tmpSysStepStamp.CurMinuteEnd == 0.0) { tmpSysStepStamp.CurMinuteEnd = minutesPerHour; } - tmpSysStepStamp.CurMinuteStart = tmpSysStepStamp.CurMinuteEnd - OutputProcessor::TimeValue(sysIndex).TimeStep * minutesPerHour; - tmpSysStepStamp.TimeStepDuration = OutputProcessor::TimeValue(sysIndex).TimeStep; + tmpSysStepStamp.CurMinuteStart = tmpSysStepStamp.CurMinuteEnd - OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * minutesPerHour; + tmpSysStepStamp.TimeStepDuration = OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep; TestLogObj.FillSysStep(tmpztStepStamp, tmpSysStepStamp); } @@ -437,18 +435,17 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) HourofDay = hr; for (int timeStp = 1; timeStp <= 4; ++timeStp) { // 15 minute zone timestep for (int subTimeStp = 1; subTimeStp <= 5; ++subTimeStp) { // 5 system substeps, so 3 minute system timestep - int const sysIndex(2); Real64 const minutesPerHour(60.0); ZoneTimestepObject tmpztStepStamp(KindOfSim, Envrn, DayOfSim, HourofDay, timeStp, zoneTimeStepDuration, numTimeStepsInHour); // call constructor SystemTimestepObject tmpSysStepStamp; tmpSysStepStamp.CurMinuteEnd = (timeStp - 1) * (minutesPerHour * zoneTimeStepDuration) + - (subTimeStp)*OutputProcessor::TimeValue(sysIndex).TimeStep * minutesPerHour; + (subTimeStp)*OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * minutesPerHour; if (tmpSysStepStamp.CurMinuteEnd == 0.0) { tmpSysStepStamp.CurMinuteEnd = minutesPerHour; } - tmpSysStepStamp.CurMinuteStart = tmpSysStepStamp.CurMinuteEnd - OutputProcessor::TimeValue(sysIndex).TimeStep * minutesPerHour; - tmpSysStepStamp.TimeStepDuration = OutputProcessor::TimeValue(sysIndex).TimeStep; + tmpSysStepStamp.CurMinuteStart = tmpSysStepStamp.CurMinuteEnd - OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep * minutesPerHour; + tmpSysStepStamp.TimeStepDuration = OutputProcessor::TimeValue.at(OutputProcessor::TimeStepType::TimeStepSystem).TimeStep; TestLogObj.FillSysStep(tmpztStepStamp, tmpSysStepStamp); } diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index 189770972af..86fd9945f3c 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -708,7 +708,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortFanger) ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; ManageSimulation(); diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index 181abbbdde3..b71573e1322 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -1112,7 +1112,7 @@ TEST_F(EnergyPlusFixture, UnitHeater_HWHeatingCoilUAAutoSizingTest) HeatBalanceManager::GetProjectControlData(ErrorsFound); // read project control data EXPECT_FALSE(ErrorsFound); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; GetProjectData(); @@ -2425,7 +2425,7 @@ TEST_F(EnergyPlusFixture, UnitHeater_SecondPriorityZoneEquipment) }); ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; ManageSimulation(); diff --git a/tst/EnergyPlus/unit/WindowAC.unit.cc b/tst/EnergyPlus/unit/WindowAC.unit.cc index e0951472bc2..51e91364dc3 100644 --- a/tst/EnergyPlus/unit/WindowAC.unit.cc +++ b/tst/EnergyPlus/unit/WindowAC.unit.cc @@ -437,7 +437,7 @@ TEST_F(EnergyPlusFixture, WindowAC_VStest1) bool errorsFound(false); HeatBalanceManager::GetProjectControlData(errorsFound); // read project control data EXPECT_FALSE(errorsFound); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); DataGlobals::DDOnlySimulation = true; SimulationManager::GetProjectData(); diff --git a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc index 6c1833fafac..5aafb8d6304 100644 --- a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc +++ b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc @@ -524,7 +524,7 @@ TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBMaximizeBeamSolar) }); ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); // + // OutputProcessor::TimeValue.allocate(2); // SimulationManager::ManageSimulation(); // re-set the hour of the day to mide day DataGlobals::TimeStep = 1; @@ -881,7 +881,7 @@ TEST_F(EnergyPlusFixture, WindowEquivalentLayer_VBBlockBeamSolar) }); ASSERT_TRUE(process_idf(idf_objects)); - OutputProcessor::TimeValue.allocate(2); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); // re-set the hour of the day to noon DataGlobals::TimeStep = 1;