diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 01102c725ec..798fefbf24c 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -6007,7 +6007,7 @@ namespace DXCoils { lAlphaBlanks2.deallocate(); lNumericBlanks2.deallocate(); bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the current DX coil unit being simulated diff --git a/src/EnergyPlus/DataGlobalConstants.hh b/src/EnergyPlus/DataGlobalConstants.hh index 8b88b5d47ce..d17b3b5e860 100644 --- a/src/EnergyPlus/DataGlobalConstants.hh +++ b/src/EnergyPlus/DataGlobalConstants.hh @@ -252,31 +252,6 @@ namespace DataGlobalConstants { ReadAllWeatherData = 6 // a weather period for reading all weather data prior to the simulation }; - // Parameters for EMS Calling Points - enum class EMSCallFrom { - Unassigned, - ZoneSizing, - SystemSizing, - BeginNewEnvironment, - BeginNewEnvironmentAfterWarmUp, - BeginTimestepBeforePredictor, - BeforeHVACManagers, - AfterHVACManagers, - HVACIterationLoop, - EndSystemTimestepBeforeHVACReporting, - EndSystemTimestepAfterHVACReporting, - EndZoneTimestepBeforeZoneReporting, - EndZoneTimestepAfterZoneReporting, - SetupSimulation, - ExternalInterface, - ComponentGetInput, - UserDefinedComponentModel, - UnitarySystemSizing, - BeginZoneTimestepBeforeInitHeatBalance, - BeginZoneTimestepAfterInitHeatBalance, - BeginZoneTimestepBeforeSetCurrentWeather - }; - Real64 constexpr MaxEXPArg () { return 709.78; } // maximum exponent in EXP() function Real64 constexpr Pi () { return 3.14159265358979324; } // Pi 3.1415926535897932384626435 Real64 constexpr PiOvr2 () { return Pi() / 2.0; } // Pi/2 diff --git a/src/EnergyPlus/DataRuntimeLanguage.cc b/src/EnergyPlus/DataRuntimeLanguage.cc index c14f142ca60..135adf1e70a 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.cc +++ b/src/EnergyPlus/DataRuntimeLanguage.cc @@ -49,7 +49,6 @@ #include // EnergyPlus Headers -#include #include #include @@ -69,9 +68,6 @@ namespace DataRuntimeLanguage { // METHODOLOGY EMPLOYED: na - // Using/Aliasing - using namespace DataPrecisionGlobals; - // Data // module should be available to other modules and routines. // Thus, all variables in this module must be PUBLIC. diff --git a/src/EnergyPlus/DataRuntimeLanguage.hh b/src/EnergyPlus/DataRuntimeLanguage.hh index 39a161dd0b9..b7b15cae791 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.hh +++ b/src/EnergyPlus/DataRuntimeLanguage.hh @@ -60,6 +60,7 @@ // EnergyPlus Headers #include +#include #include namespace EnergyPlus { @@ -353,12 +354,12 @@ namespace DataRuntimeLanguage { // Members // structure for Erl program calling managers std::string Name; // user defined name for calling manager - DataGlobalConstants::EMSCallFrom CallingPoint; // EMS Calling point for this manager, see parameters emsCallFrom* + EMSManager::EMSCallFrom CallingPoint; // EMS Calling point for this manager, see parameters emsCallFrom* int NumErlPrograms; // count of total number of Erl programs called by this manager Array1D_int ErlProgramARR; // list of integer pointers to Erl programs used by this manager // Default Constructor - EMSProgramCallManagementType() : CallingPoint(DataGlobalConstants::EMSCallFrom::Unassigned), NumErlPrograms(0) + EMSProgramCallManagementType() : CallingPoint(EMSManager::EMSCallFrom::Unassigned), NumErlPrograms(0) { } }; diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 05f30c4cb65..e9f196021da 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -240,7 +240,7 @@ namespace EMSManager { // MODULE SUBROUTINES: void ManageEMS(EnergyPlusData &state, - DataGlobalConstants::EMSCallFrom const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. + EMSCallFrom const iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. bool &anyProgramRan, // true if any Erl programs ran for this call Optional_int_const ProgramManagerToRun // specific program manager to run ) @@ -283,7 +283,7 @@ namespace EMSManager { anyProgramRan = false; if (!AnyEnergyManagementSystemInModel) return; // quick return if nothing to do - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironment) { + if (iCalledFrom == EMSCallFrom::BeginNewEnvironment) { BeginEnvrnInitializeRuntimeLanguage(); PluginManagement::onBeginEnvironment(); } @@ -292,21 +292,21 @@ namespace EMSManager { // also call plugins and callbacks here for convenience bool anyPluginsOrCallbacksRan = false; - if (iCalledFrom != DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { // don't run user-defined component plugins this way + if (iCalledFrom != EMSCallFrom::UserDefinedComponentModel) { // don't run user-defined component plugins this way PluginManagement::runAnyRegisteredCallbacks(state, iCalledFrom, anyPluginsOrCallbacksRan); if (anyPluginsOrCallbacksRan) { anyProgramRan = true; } } - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::SetupSimulation) { + if (iCalledFrom == EMSCallFrom::SetupSimulation) { ProcessEMSInput(state, true); return; } // Run the Erl programs depending on calling point. - if (iCalledFrom != DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { + if (iCalledFrom != EMSCallFrom::UserDefinedComponentModel) { for (ProgramManagerNum = 1; ProgramManagerNum <= NumProgramCallManagers; ++ProgramManagerNum) { if (EMSProgramCallManager(ProgramManagerNum).CallingPoint == iCalledFrom) { @@ -325,7 +325,7 @@ namespace EMSManager { } } - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ExternalInterface) { + if (iCalledFrom == EMSCallFrom::ExternalInterface) { anyProgramRan = true; } @@ -375,7 +375,7 @@ namespace EMSManager { ReportEMS(); } - void InitEMS(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom const iCalledFrom) // indicates where subroutine was called from, parameters in DataGlobals. + void InitEMS(EnergyPlusData &state, EMSCallFrom const iCalledFrom) // indicates where subroutine was called from, parameters in DataGlobals. { // SUBROUTINE INFORMATION: @@ -450,8 +450,8 @@ namespace EMSManager { InitializeRuntimeLanguage(state); - if ((BeginEnvrnFlag) || (iCalledFrom == DataGlobalConstants::EMSCallFrom::ZoneSizing) || (iCalledFrom == DataGlobalConstants::EMSCallFrom::SystemSizing) || - (iCalledFrom == DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel)) { + if ((BeginEnvrnFlag) || (iCalledFrom == EMSCallFrom::ZoneSizing) || (iCalledFrom == EMSCallFrom::SystemSizing) || + (iCalledFrom == EMSCallFrom::UserDefinedComponentModel)) { // another pass at trying to setup input data. if (FinishProcessingUserInput) { @@ -942,41 +942,41 @@ namespace EMSManager { auto const SELECT_CASE_var(cAlphaArgs(2)); if (SELECT_CASE_var == "BEGINNEWENVIRONMENT") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginNewEnvironment; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginNewEnvironment; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPBEFORESETCURRENTWEATHER") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather; } else if (SELECT_CASE_var == "AFTERNEWENVIRONMENTWARMUPISCOMPLETE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginNewEnvironmentAfterWarmUp; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPBEFOREINITHEATBALANCE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance; } else if (SELECT_CASE_var == "BEGINZONETIMESTEPAFTERINITHEATBALANCE") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance; } else if (SELECT_CASE_var == "BEGINTIMESTEPBEFOREPREDICTOR") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeginTimestepBeforePredictor; } else if (SELECT_CASE_var == "AFTERPREDICTORBEFOREHVACMANAGERS") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::BeforeHVACManagers; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::BeforeHVACManagers; } else if (SELECT_CASE_var == "AFTERPREDICTORAFTERHVACMANAGERS") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::AfterHVACManagers; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::AfterHVACManagers; } else if (SELECT_CASE_var == "INSIDEHVACSYSTEMITERATIONLOOP") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::HVACIterationLoop; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::HVACIterationLoop; } else if (SELECT_CASE_var == "ENDOFZONETIMESTEPBEFOREZONEREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndZoneTimestepBeforeZoneReporting; } else if (SELECT_CASE_var == "ENDOFZONETIMESTEPAFTERZONEREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndZoneTimestepAfterZoneReporting; } else if (SELECT_CASE_var == "ENDOFSYSTEMTIMESTEPBEFOREHVACREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndSystemTimestepBeforeHVACReporting; } else if (SELECT_CASE_var == "ENDOFSYSTEMTIMESTEPAFTERHVACREPORTING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::EndSystemTimestepAfterHVACReporting; } else if (SELECT_CASE_var == "ENDOFZONESIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::ZoneSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::ZoneSizing; } else if (SELECT_CASE_var == "ENDOFSYSTEMSIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::SystemSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::SystemSizing; } else if (SELECT_CASE_var == "AFTERCOMPONENTINPUTREADIN") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::ComponentGetInput; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::ComponentGetInput; } else if (SELECT_CASE_var == "USERDEFINEDCOMPONENTMODEL") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::UserDefinedComponentModel; } else if (SELECT_CASE_var == "UNITARYSYSTEMSIZING") { - EMSProgramCallManager(CallManagerNum).CallingPoint = DataGlobalConstants::EMSCallFrom::UnitarySystemSizing; + EMSProgramCallManager(CallManagerNum).CallingPoint = EMSCallFrom::UnitarySystemSizing; } else { ShowSevereError("Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); @@ -1820,31 +1820,31 @@ namespace EMSManager { nodeSetpointCheck.needsSetpointChecking = false; if (nodeSetpointCheck.checkTemperatureSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iTemperatureSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iTemperatureSetPoint, true); } if (nodeSetpointCheck.checkTemperatureMinSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iTemperatureMinSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iTemperatureMinSetPoint, true); } if (nodeSetpointCheck.checkTemperatureMaxSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iTemperatureMaxSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iTemperatureMaxSetPoint, true); } if (nodeSetpointCheck.checkHumidityRatioSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iHumidityRatioSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iHumidityRatioSetPoint, true); } if (nodeSetpointCheck.checkHumidityRatioMinSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iHumidityRatioMinSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iHumidityRatioMinSetPoint, true); } if (nodeSetpointCheck.checkHumidityRatioMaxSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iHumidityRatioMaxSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iHumidityRatioMaxSetPoint, true); } if (nodeSetpointCheck.checkMassFlowRateSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iMassFlowRateSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iMassFlowRateSetPoint, true); } if (nodeSetpointCheck.checkMassFlowRateMinSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iMassFlowRateMinSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iMassFlowRateMinSetPoint, true); } if (nodeSetpointCheck.checkMassFlowRateMaxSetPoint) { - nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, EMSManager::iMassFlowRateMaxSetPoint, true); + nodeSetpointCheck.needsSetpointChecking |= !CheckIfNodeSetPointManaged(NodeNum, iMassFlowRateMaxSetPoint, true); } if (nodeSetpointCheck.needsSetpointChecking) { diff --git a/src/EnergyPlus/EMSManager.hh b/src/EnergyPlus/EMSManager.hh index 545f15c0b39..cdc3b9f6b99 100644 --- a/src/EnergyPlus/EMSManager.hh +++ b/src/EnergyPlus/EMSManager.hh @@ -85,6 +85,31 @@ namespace EMSManager { extern bool ZoneThermostatActuatorsHaveBeenSetup; extern bool FinishProcessingUserInput; // Flag to indicate still need to process input + // Parameters for EMS Calling Points + enum class EMSCallFrom { + Unassigned, + ZoneSizing, + SystemSizing, + BeginNewEnvironment, + BeginNewEnvironmentAfterWarmUp, + BeginTimestepBeforePredictor, + BeforeHVACManagers, + AfterHVACManagers, + HVACIterationLoop, + EndSystemTimestepBeforeHVACReporting, + EndSystemTimestepAfterHVACReporting, + EndZoneTimestepBeforeZoneReporting, + EndZoneTimestepAfterZoneReporting, + SetupSimulation, + ExternalInterface, + ComponentGetInput, + UserDefinedComponentModel, + UnitarySystemSizing, + BeginZoneTimestepBeforeInitHeatBalance, + BeginZoneTimestepAfterInitHeatBalance, + BeginZoneTimestepBeforeSetCurrentWeather + }; + // SUBROUTINE SPECIFICATIONS: // Functions @@ -95,12 +120,12 @@ namespace EMSManager { // MODULE SUBROUTINES: void ManageEMS(EnergyPlusData &state, - DataGlobalConstants::EMSCallFrom iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. + EMSCallFrom iCalledFrom, // indicates where subroutine was called from, parameters in DataGlobals. bool &anyProgramRan, // true if any Erl programs ran for this call Optional_int_const ProgramManagerToRun = _ // specific program manager to run ); - void InitEMS(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom); // indicates where subroutine was called from, parameters in DataGlobals. + void InitEMS(EnergyPlusData &state, EMSCallFrom iCalledFrom); // indicates where subroutine was called from, parameters in DataGlobals. void ReportEMS(); diff --git a/src/EnergyPlus/ExternalInterface.cc b/src/EnergyPlus/ExternalInterface.cc index a025d98e508..0ef5532c54e 100644 --- a/src/EnergyPlus/ExternalInterface.cc +++ b/src/EnergyPlus/ExternalInterface.cc @@ -942,7 +942,7 @@ namespace ExternalInterface { // If we have Erl variables, we need to call ManageEMS so that they get updated in the Erl data structure if (useEMS) { bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); } FirstCallGetSetDoStep = false; @@ -2408,7 +2408,7 @@ namespace ExternalInterface { // If we have Erl variables, we need to call ManageEMS so that they get updated in the Erl data structure if (useEMS) { bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ExternalInterface, anyRan, ObjexxFCL::Optional_int_const()); } firstCall = false; // bug fix causing external interface to send zero at the beginning of sim, Thierry Nouidui diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 796a015643f..4262af79a2b 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -999,7 +999,7 @@ namespace Fans { } bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); MySizeFlag.dimension(state.dataFans->NumFans, true); } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 0128092f521..0ba77b386fc 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -4746,7 +4746,7 @@ namespace Furnaces { } } bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyRan, ObjexxFCL::Optional_int_const()); } // End of Get Input subroutines for this Module @@ -6085,7 +6085,7 @@ namespace Furnaces { Real64 MulSpeedFlowScale; // variable speed air flow scaling factor int IHPCoilIndex(0); // refer to cooling or heating coil in IHP bool anyRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, anyRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::UnitarySystemSizing, anyRan, ObjexxFCL::Optional_int_const()); // calling point ThisCtrlZoneNum = 0; DXCoolCap = 0.0; diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index c32f0c42e2e..dfdc79752fb 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -657,7 +657,7 @@ namespace HVACFan { isNumericFieldBlank.deallocate(); bool anyEMSRan = false; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } void diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index bebbb6f95c9..45c9a0242d6 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -366,7 +366,7 @@ namespace HVACManager { FracTimeStepZone = TimeStepSys / TimeStepZone; bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point SetOutAirNodes(state); @@ -508,7 +508,7 @@ namespace HVACManager { OutputReportTabular::CalcHeatEmissionReport(state); } - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point // This is where output processor data is updated for System Timestep reporting if (!WarmupFlag) { @@ -609,7 +609,7 @@ namespace HVACManager { } UpdateDataandReport(state, OutputProcessor::TimeStepType::TimeStepSystem); } - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS calling point // UPDATE SYSTEM CLOCKS SysTimeElapsed += TimeStepSys; @@ -859,7 +859,7 @@ namespace HVACManager { // Before the HVAC simulation, call ManageSetPoints to set all the HVAC // node setpoints bool anyEMSRan = false; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeforeHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point ManageSetPoints(state); @@ -870,8 +870,8 @@ namespace HVACManager { // the system on/off flags ManageSystemAvailability(state); - ManageEMS(state, DataGlobalConstants::EMSCallFrom::AfterHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point - ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id + ManageEMS(state, EMSManager::EMSCallFrom::AfterHVACManagers, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id // first explicitly call each system type with FirstHVACIteration, @@ -901,7 +901,7 @@ namespace HVACManager { if (state.dataGlobal->stopSimulation) break; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id + ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point id // Manages the various component simulations SimSelectedEquipment(state, SimAirLoopsFlag, diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 9f367eed7ed..f4848486091 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -302,7 +302,7 @@ void ManageHVACSizingSimulation(EnergyPlusData &state, bool &ErrorsFound) NumOfWarmupDays = 0; bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point while ((DayOfSim < NumOfDayInEnvrn) || (WarmupFlag)) { // Begin day loop ... diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index c234c80c5c1..6b2e14db333 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -360,13 +360,13 @@ namespace HeatBalanceManager { bool anyRan; ManageEMS(state, - DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, + EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point // These Inits will still have to be looked at as the routines are re-engineered further InitHeatBalance(state); // Initialize all heat balance related parameters - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point // Solve the zone heat balance by first calling the Surface Heat Balance Manager // and then the Air Heat Balance Manager is called by the Surface Heat Balance @@ -376,7 +376,7 @@ namespace HeatBalanceManager { // the HVAC system (called from the Air Heat Balance) and the zone (simulated // in the Surface Heat Balance Manager). In the future, this may be improved. ManageSurfaceHeatBalance(state); - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point RecKeepHeatBalance(state); // Do any heat balance related record keeping // This call has been moved to the FanSystemModule and does effect the output file @@ -385,7 +385,7 @@ namespace HeatBalanceManager { ReportHeatBalance(state); // Manage heat balance reporting until the new reporting is in place - ManageEMS(state, DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point + ManageEMS(state, EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point UpdateEMSTrendVariables(); EnergyPlus::PluginManagement::PluginManager::updatePluginValues(); @@ -397,7 +397,7 @@ namespace HeatBalanceManager { DayOfSim = 0; // Reset DayOfSim if Warmup converged state.dataGlobal->DayOfSimChr = "0"; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); // calling point } } diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 4dd14f50fdb..9baf76076eb 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -2086,7 +2086,7 @@ CurrentModuleObject, PlantOpSchemeName); if (BeginEnvrnFlag && this_op_scheme.MyEnvrnFlag) { if (this_op_scheme.ErlInitProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this_op_scheme.ErlInitProgramMngr); + ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this_op_scheme.ErlInitProgramMngr); } else if (this_op_scheme.initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this_op_scheme.initPluginLocation); } @@ -3096,7 +3096,7 @@ CurrentModuleObject, PlantOpSchemeName); // Call EMS program(s) if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); + ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); } else if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation); diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 2e36e9bb19f..cef875d6a3c 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -62,7 +62,7 @@ namespace EnergyPlus { namespace PluginManagement { std::unique_ptr pluginManager; - std::map>> callbacks; + std::map>> callbacks; std::vector plugins; std::vector trends; std::vector globalVariableNames; @@ -72,7 +72,7 @@ namespace PluginManagement { bool fullyReady = false; bool apiErrorFlag = false; - void registerNewCallback(EnergyPlusData &EP_UNUSED(state), DataGlobalConstants::EMSCallFrom iCalledFrom, const std::function &f) + void registerNewCallback(EnergyPlusData &EP_UNUSED(state), EMSManager::EMSCallFrom iCalledFrom, const std::function &f) { callbacks[iCalledFrom].push_back(f); } @@ -93,7 +93,7 @@ namespace PluginManagement { return (int)callbacks.size(); } - void runAnyRegisteredCallbacks(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, bool &anyRan) + void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, bool &anyRan) { if (DataGlobals::KickOffSimulation) return; for (auto const &cb : callbacks[iCalledFrom]) { @@ -923,97 +923,97 @@ namespace PluginManagement { } #if LINK_WITH_PYTHON == 1 - bool PluginInstance::run(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom) const + bool PluginInstance::run(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom) const { // returns true if a plugin actually ran PyObject *pFunctionName = nullptr; const char * functionName = nullptr; - if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironment) { + if (iCalledFrom == EMSManager::EMSCallFrom::BeginNewEnvironment) { if (this->bHasBeginNewEnvironment) { pFunctionName = this->pBeginNewEnvironment; functionName = this->sHookBeginNewEnvironment; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather) { if (this->bHasBeginZoneTimestepBeforeSetCurrentWeather) { pFunctionName = this->pBeginZoneTimestepBeforeSetCurrentWeather; functionName = this->sHookBeginZoneTimestepBeforeSetCurrentWeather; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ZoneSizing) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::ZoneSizing) { if (this->bHasEndOfZoneSizing) { pFunctionName = this->pEndOfZoneSizing; functionName = this->sHookEndOfZoneSizing; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::SystemSizing) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::SystemSizing) { if (this->bHasEndOfSystemSizing) { pFunctionName = this->pEndOfSystemSizing; functionName = this->sHookEndOfSystemSizing; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp) { if (this->bHasAfterNewEnvironmentWarmUpIsComplete) { pFunctionName = this->pAfterNewEnvironmentWarmUpIsComplete; functionName = this->sHookAfterNewEnvironmentWarmUpIsComplete; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginTimestepBeforePredictor) { if (this->bHasBeginTimestepBeforePredictor) { pFunctionName = this->pBeginTimestepBeforePredictor; functionName = this->sHookBeginTimestepBeforePredictor; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeforeHVACManagers) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeforeHVACManagers) { if (this->bHasAfterPredictorBeforeHVACManagers) { pFunctionName = this->pAfterPredictorBeforeHVACManagers; functionName = this->sHookAfterPredictorBeforeHVACManagers; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::AfterHVACManagers) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::AfterHVACManagers) { if (this->bHasAfterPredictorAfterHVACManagers) { pFunctionName = this->pAfterPredictorAfterHVACManagers; functionName = this->sHookAfterPredictorAfterHVACManagers; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::HVACIterationLoop) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::HVACIterationLoop) { if (this->bHasInsideHVACSystemIterationLoop) { pFunctionName = this->pInsideHVACSystemIterationLoop; functionName = this->sHookInsideHVACSystemIterationLoop; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting) { if (this->bHasEndOfSystemTimestepBeforeHVACReporting) { pFunctionName = this->pEndOfSystemTimestepBeforeHVACReporting; functionName = this->sHookEndOfSystemTimestepBeforeHVACReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting) { if (this->bHasEndOfSystemTimestepAfterHVACReporting) { pFunctionName = this->pEndOfSystemTimestepAfterHVACReporting; functionName = this->sHookEndOfSystemTimestepAfterHVACReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting) { if (this->bHasEndOfZoneTimestepBeforeZoneReporting) { pFunctionName = this->pEndOfZoneTimestepBeforeZoneReporting; functionName = this->sHookEndOfZoneTimestepBeforeZoneReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting) { if (this->bHasEndOfZoneTimestepAfterZoneReporting) { pFunctionName = this->pEndOfZoneTimestepAfterZoneReporting; functionName = this->sHookEndOfZoneTimestepAfterZoneReporting; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::ComponentGetInput) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::ComponentGetInput) { if (this->bHasAfterComponentInputReadIn) { pFunctionName = this->pAfterComponentInputReadIn; functionName = this->sHookAfterComponentInputReadIn; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::UserDefinedComponentModel) { if (this->bHasUserDefinedComponentModel) { pFunctionName = this->pUserDefinedComponentModel; functionName = this->sHookUserDefinedComponentModel; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::UnitarySystemSizing) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::UnitarySystemSizing) { if (this->bHasUnitarySystemSizing) { pFunctionName = this->pUnitarySystemSizing; functionName = this->sHookUnitarySystemSizing; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance) { if (this->bHasBeginZoneTimestepBeforeInitHeatBalance) { pFunctionName = this->pBeginZoneTimestepBeforeInitHeatBalance; functionName = this->sHookBeginZoneTimestepBeforeInitHeatBalance; } - } else if (iCalledFrom == DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance) { + } else if (iCalledFrom == EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance) { if (this->bHasBeginZoneTimestepAfterInitHeatBalance) { pFunctionName = this->pBeginZoneTimestepAfterInitHeatBalance; functionName = this->sHookBeginZoneTimestepAfterInitHeatBalance; @@ -1340,7 +1340,7 @@ namespace PluginManagement { #if LINK_WITH_PYTHON == 1 void PluginManager::runSingleUserDefinedPlugin(EnergyPlusData &state, int index) { - plugins[index].run(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel); + plugins[index].run(state, EMSManager::EMSCallFrom::UserDefinedComponentModel); } #else void PluginManager::runSingleUserDefinedPlugin(EnergyPlusData &EP_UNUSED(state), int EP_UNUSED(index)) diff --git a/src/EnergyPlus/PluginManager.hh b/src/EnergyPlus/PluginManager.hh index ead03f4897c..2f66e565456 100644 --- a/src/EnergyPlus/PluginManager.hh +++ b/src/EnergyPlus/PluginManager.hh @@ -48,11 +48,15 @@ #ifndef EPLUS_PLUGIN_MANAGER_HH #define EPLUS_PLUGIN_MANAGER_HH +// C++ Headers #include #include #include #include + +// EnergyPlus Headers #include +#include #include #if LINK_WITH_PYTHON @@ -76,8 +80,8 @@ struct EnergyPlusData; namespace PluginManagement { - void registerNewCallback(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, const std::function& f); - void runAnyRegisteredCallbacks(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCalledFrom, bool &anyRan); + void registerNewCallback(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, const std::function& f); + void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, bool &anyRan); void onBeginEnvironment(); std::string pythonStringForUsage(); @@ -108,7 +112,7 @@ namespace PluginManagement { // methods static void reportPythonError(); - bool run(EnergyPlusData &state, DataGlobalConstants::EMSCallFrom iCallingPoint) const; // calls main() on this plugin instance + bool run(EnergyPlusData &state, EMSManager::EMSCallFrom iCallingPoint) const; // calls main() on this plugin instance // plugin calling point hooks const char * sHookBeginNewEnvironment = "on_begin_new_environment"; diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 2952ff31c5c..2102f49dbb1 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -7129,7 +7129,7 @@ namespace SimAirServingZones { // EMS calling point to customize system sizing results bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::SystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::SystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // EMS override point if (AnyEnergyManagementSystemInModel) { diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 1c15a203df0..6c216b896b2 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -453,7 +453,7 @@ namespace SimulationManager { CreateEnergyReportStructure(); bool anyEMSRan; ManageEMS(state, - DataGlobalConstants::EMSCallFrom::SetupSimulation, + EMSManager::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); // point to finish setup processing EMS, sensor ready now @@ -544,7 +544,7 @@ namespace SimulationManager { HVACManager::ResetNodeData(); // Reset here, because some zone calcs rely on node data (e.g. ZoneITEquip) bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point while ((DayOfSim < NumOfDayInEnvrn) || (WarmupFlag)) { // Begin day loop ... if (state.dataGlobal->stopSimulation) break; diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 915ff6297dd..4e3250307fd 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -1527,7 +1527,7 @@ namespace UnitarySystems { EqSizing.OAVolFlow = 0.0; // UnitarySys doesn't have OA bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::UnitarySystemSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point bool HardSizeNoDesRun; // Indicator to a hard-sized field with no design sizing data // Initiate all reporting variables @@ -7426,7 +7426,7 @@ namespace UnitarySystems { } // can this be called each time a system is gottem? bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::ComponentGetInput, anyEMSRan, ObjexxFCL::Optional_int_const()); } } } diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index abd3e3aff26..30807d6c60d 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -168,7 +168,7 @@ namespace UserDefinedComponents { if (thisLoop > 0) { if (this->Loop(thisLoop).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlInitProgramMngr); } else if (this->Loop(thisLoop).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->Loop(thisLoop).initPluginLocation); } @@ -238,14 +238,14 @@ namespace UserDefinedComponents { if (thisLoop > 0) { if (this->Loop(thisLoop).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlSimProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->Loop(thisLoop).ErlSimProgramMngr); } else if (this->Loop(thisLoop).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->Loop(thisLoop).simPluginLocation); } } if (this->ErlSimProgramMngr > 0) { - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->ErlSimProgramMngr); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, this->ErlSimProgramMngr); } else if (this->simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, this->simPluginLocation); } @@ -299,7 +299,7 @@ namespace UserDefinedComponents { if (DataGlobals::BeginEnvrnFlag) { if (UserCoil(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlInitProgramMngr); } else if (UserCoil(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserCoil(CompNum).initPluginLocation); } @@ -322,7 +322,7 @@ namespace UserDefinedComponents { UserCoil(CompNum).initialize(state); if (UserCoil(CompNum).ErlSimProgramMngr > 0) { - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlSimProgramMngr); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserCoil(CompNum).ErlSimProgramMngr); } else if (UserCoil(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserCoil(CompNum).simPluginLocation); } @@ -391,7 +391,7 @@ namespace UserDefinedComponents { if (UserZoneAirHVAC(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlInitProgramMngr); } else if (UserZoneAirHVAC(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserZoneAirHVAC(CompNum).initPluginLocation); } @@ -418,7 +418,7 @@ namespace UserDefinedComponents { if (UserZoneAirHVAC(CompNum).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlSimProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserZoneAirHVAC(CompNum).ErlSimProgramMngr); } else if (UserZoneAirHVAC(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserZoneAirHVAC(CompNum).simPluginLocation); } @@ -487,7 +487,7 @@ namespace UserDefinedComponents { if (UserAirTerminal(CompNum).ErlInitProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlInitProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlInitProgramMngr); } else if (UserAirTerminal(CompNum).initPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserAirTerminal(CompNum).initPluginLocation); } @@ -514,7 +514,7 @@ namespace UserDefinedComponents { if (UserAirTerminal(CompNum).ErlSimProgramMngr > 0) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlSimProgramMngr); + state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, UserAirTerminal(CompNum).ErlSimProgramMngr); } else if (UserAirTerminal(CompNum).simPluginLocation > -1) { EnergyPlus::PluginManagement::pluginManager->runSingleUserDefinedPlugin(state, UserAirTerminal(CompNum).simPluginLocation); } diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 16147313594..6f5e5d970cb 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -145,7 +145,7 @@ namespace WeatherManager { // Cannot call this during sizing, because EMS will not initialize properly until after simulation kickoff if (!DataGlobals::DoingSizing && !DataGlobals::KickOffSimulation) { EMSManager::ManageEMS( - state, DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point + state, EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, anyEMSRan, ObjexxFCL::Optional_int_const()); // calling point } SetCurrentWeather(state); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index e1232da12e2..aed79b498af 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1785,7 +1785,7 @@ namespace ZoneEquipmentManager { // candidate EMS calling point to customize CalcFinalZoneSizing bool anyEMSRan; - ManageEMS(state, DataGlobalConstants::EMSCallFrom::ZoneSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); + ManageEMS(state, EMSManager::EMSCallFrom::ZoneSizing, anyEMSRan, ObjexxFCL::Optional_int_const()); // now apply EMS overrides (if any) diff --git a/src/EnergyPlus/api/runtime.cc b/src/EnergyPlus/api/runtime.cc index d3b763b9648..59f668fefe2 100644 --- a/src/EnergyPlus/api/runtime.cc +++ b/src/EnergyPlus/api/runtime.cc @@ -108,162 +108,162 @@ void registerExternalHVACManager(EnergyPlusState state, void (*f)(EnergyPlusStat void callbackBeginNewEnvironment(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironment, f); } void callbackBeginNewEnvironment(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironment, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, std::function const& f) { auto* thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackBeginZoneTimestepBeforeSetCurrentWeather(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto* thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeSetCurrentWeather, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); } void callbackAfterNewEnvironmentWarmupComplete(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepBeforeInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginZoneTimeStepAfterInitHeatBalance(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, f); } void callbackBeginTimeStepBeforePredictor(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeforeHVACManagers, f); } void callbackAfterPredictorBeforeHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::BeforeHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::BeforeHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::AfterHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::AfterHVACManagers, f); } void callbackAfterPredictorAfterHVACManagers(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::AfterHVACManagers, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::AfterHVACManagers, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::HVACIterationLoop, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::HVACIterationLoop, f); } void callbackInsideSystemIterationLoop(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::HVACIterationLoop, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::HVACIterationLoop, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepBeforeZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepBeforeZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); } void callbackEndOfZoneTimeStepAfterZoneReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndZoneTimestepAfterZoneReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepBeforeHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepBeforeHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); } void callbackEndOfSystemTimeStepAfterHVACReporting(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::EndSystemTimestepAfterHVACReporting, f); } void callbackEndOfZoneSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ZoneSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ZoneSizing, f); } void callbackEndOfZoneSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ZoneSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ZoneSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::SystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::SystemSizing, f); } void callbackEndOfSystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::SystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::SystemSizing, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ComponentGetInput, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ComponentGetInput, f); } void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::ComponentGetInput, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::ComponentGetInput, f); } //void callbackUserDefinedComponentModel(EnergyPlusState state, std::function f) { @@ -276,10 +276,10 @@ void callbackEndOfAfterComponentGetInput(EnergyPlusState state, void (*f)(Energy void callbackUnitarySystemSizing(EnergyPlusState state, std::function const &f) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::UnitarySystemSizing, f); } void callbackUnitarySystemSizing(EnergyPlusState state, void (*f)(EnergyPlusState)) { auto *thisState = reinterpret_cast(state); - EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::DataGlobalConstants::EMSCallFrom::UnitarySystemSizing, f); + EnergyPlus::PluginManagement::registerNewCallback(*thisState, EnergyPlus::EMSManager::EMSCallFrom::UnitarySystemSizing, f); } diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index d690ecd3610..0f25ec2966d 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -165,9 +165,9 @@ TEST_F(EnergyPlusFixture, Dual_NodeTempSetpoints) EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPointHi, 20.0, 0.000001); @@ -283,13 +283,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo bool anyRan; // set up EMS - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -319,7 +319,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); @@ -344,7 +344,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo // dummy value set above should reset to 0 on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point // override flag should also be true - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -447,12 +447,12 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate bool anyRan; // set up EMS - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -482,7 +482,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); @@ -509,7 +509,7 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // dummy value set above should reset to 0 on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point // override flag should also be true - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); @@ -707,8 +707,8 @@ TEST_F(EnergyPlusFixture, Test_EMSLogic) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 11.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(2).TempSetPoint, 12.0, 0.0000001); @@ -718,7 +718,7 @@ TEST_F(EnergyPlusFixture, Test_EMSLogic) EXPECT_NEAR(DataLoopNode::Node(6).TempSetPoint, 16.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(7).TempSetPoint, 17.0, 0.0000001); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 21.0, 0.0000001); EXPECT_NEAR(DataLoopNode::Node(2).TempSetPoint, 22.0, 0.0000001); @@ -775,8 +775,8 @@ TEST_F(EnergyPlusFixture, Debug_EMSLogic) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_NEAR(DataLoopNode::Node(1).TempSetPoint, 1.0, 0.0000001); } @@ -815,13 +815,13 @@ TEST_F(EnergyPlusFixture, TestAnyRanArgument) EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyRan); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_FALSE(anyRan); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); } @@ -850,14 +850,14 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable1) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // Find the variable in the list int internalVarNum = RuntimeLanguageProcessor::FindEMSVariable("TempSetpoint1", 0); ASSERT_GT(internalVarNum, 0); // Expect the variable to not yet be initialized EXPECT_FALSE(ErlVariable(internalVarNum).Value.initialized); // next run a small program that sets the value - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); // check that it worked and the value came thru EXPECT_NEAR(ErlVariable(internalVarNum).Value.Number, 21.0, 0.0000001); // check of state to see if now initialized @@ -908,7 +908,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) EMSManager::CheckIfAnyEMS(state); EMSManager::FinishProcessingUserInput = true; bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // Expect the variable to not yet be initialized, call EvaluateExpresssion and check argument ErlValueType ReturnValue; @@ -920,7 +920,7 @@ TEST_F(EnergyPlusFixture, TestUnInitializedEMSVariable2) EXPECT_TRUE(seriousErrorFound); // next run a small program that sets the global variable value - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); // now check that it worked, should stay false seriousErrorFound = false; ReturnValue = RuntimeLanguageProcessor::EvaluateExpression(state, @@ -1091,7 +1091,7 @@ TEST_F(EnergyPlusFixture, EMSManager_TestFuntionCall) EXPECT_FALSE(ErrorsFound); bool anyRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); for (int i = 1; i <= 6; ++i) { @@ -1102,7 +1102,7 @@ TEST_F(EnergyPlusFixture, EMSManager_TestFuntionCall) } EMSManager::ManageEMS(state, - DataGlobalConstants::EMSCallFrom::HVACIterationLoop, + EMSManager::EMSCallFrom::HVACIterationLoop, anyRan, ObjexxFCL::Optional_int_const()); // process trend functions again using above data EXPECT_TRUE(anyRan); diff --git a/tst/EnergyPlus/unit/HVACFan.unit.cc b/tst/EnergyPlus/unit/HVACFan.unit.cc index 0d5d4e34c8e..bf716910ba2 100644 --- a/tst/EnergyPlus/unit/HVACFan.unit.cc +++ b/tst/EnergyPlus/unit/HVACFan.unit.cc @@ -630,8 +630,8 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) // reset the pressure rise to -100.0 using EMS program bool anyRan(false); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); // simulate the fan with -100.0 Pa fan pressure rise HVACFan::fanObjs[0]->simulate(state, _, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); diff --git a/tst/EnergyPlus/unit/NodeInputManager.unit.cc b/tst/EnergyPlus/unit/NodeInputManager.unit.cc index 9a924dccb5c..e14f6296856 100644 --- a/tst/EnergyPlus/unit/NodeInputManager.unit.cc +++ b/tst/EnergyPlus/unit/NodeInputManager.unit.cc @@ -104,7 +104,7 @@ TEST_F(EnergyPlusFixture, NodeMoreInfoEMSsensorCheck1) EMSManager::FinishProcessingUserInput = true; bool anyEMSRan; - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyEMSRan, ObjexxFCL::Optional_int_const()); DataLoopNode::Node(1).Temp = 20.0; DataLoopNode::Node(1).HumRat = 0.01; diff --git a/tst/EnergyPlus/unit/api/datatransfer.unit.cc b/tst/EnergyPlus/unit/api/datatransfer.unit.cc index 298f918c7a3..ab2fd7f5531 100644 --- a/tst/EnergyPlus/unit/api/datatransfer.unit.cc +++ b/tst/EnergyPlus/unit/api/datatransfer.unit.cc @@ -662,7 +662,7 @@ TEST_F(DataExchangeAPIUnitTestFixture, DataTransfer_Python_EMS_Override) EMSManager::FinishProcessingUserInput = true; bool anyRan; // Calls SetupNodeSetpointsAsActuator (via InitEMS, which calls GetEMSInput too) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan); EXPECT_GT(EnergyPlus::DataRuntimeLanguage::numEMSActuatorsAvailable, 0); EXPECT_EQ(1, DataRuntimeLanguage::numActuatorsUsed); @@ -707,7 +707,7 @@ TEST_F(DataExchangeAPIUnitTestFixture, DataTransfer_Python_Python_Override) EMSManager::FinishProcessingUserInput = true; bool anyRan; // Calls SetupNodeSetpointsAsActuator (via InitEMS, which calls GetEMSInput too) - EMSManager::ManageEMS(state, DataGlobalConstants::EMSCallFrom::SetupSimulation, anyRan); + EMSManager::ManageEMS(state, EMSManager::EMSCallFrom::SetupSimulation, anyRan); EXPECT_GT(EnergyPlus::DataRuntimeLanguage::numEMSActuatorsAvailable, 0); EXPECT_EQ(0, DataRuntimeLanguage::numActuatorsUsed);