diff --git a/src/model/CoilCoolingWaterPanelRadiant.cpp b/src/model/CoilCoolingWaterPanelRadiant.cpp index 06525bba82..a5773eaa06 100644 --- a/src/model/CoilCoolingWaterPanelRadiant.cpp +++ b/src/model/CoilCoolingWaterPanelRadiant.cpp @@ -54,6 +54,17 @@ namespace model { return CoilCoolingWaterPanelRadiant::iddObjectType(); } + std::vector CoilCoolingWaterPanelRadiant_Impl::getScheduleTypeKeys(const Schedule& schedule) const { + std::vector result; + UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + UnsignedVector::const_iterator b(fieldIndices.begin()); + UnsignedVector::const_iterator e(fieldIndices.end()); + if (std::find(b, e, OS_Coil_Cooling_Water_Panel_RadiantFields::CoolingControlTemperatureScheduleName) != e) { + result.push_back(ScheduleTypeKey("CoilCoolingWaterPanelRadiant", "Cooling Control Temperature Schedule")); + } + return result; + } + unsigned CoilCoolingWaterPanelRadiant_Impl::inletPort() const { return OS_Coil_Cooling_Water_Panel_RadiantFields::WaterInletNodeName; } @@ -252,7 +263,7 @@ namespace model { bool CoilCoolingWaterPanelRadiant_Impl::setCoolingControlTemperatureSchedule(Schedule& coolingControlTemperatureSchedule) { bool result = setSchedule(OS_Coil_Cooling_Water_Panel_RadiantFields::CoolingControlTemperatureScheduleName, "CoilCoolingWaterPanelRadiant", - "Cooling Control Temperature", coolingControlTemperatureSchedule); + "Cooling Control Temperature Schedule", coolingControlTemperatureSchedule); return result; } diff --git a/src/model/CoilCoolingWaterPanelRadiant.hpp b/src/model/CoilCoolingWaterPanelRadiant.hpp index bfa5ddc3ad..49ac269ce1 100644 --- a/src/model/CoilCoolingWaterPanelRadiant.hpp +++ b/src/model/CoilCoolingWaterPanelRadiant.hpp @@ -13,6 +13,8 @@ namespace openstudio { namespace model { + class Schedule; + namespace detail { class CoilCoolingWaterPanelRadiant_Impl; diff --git a/src/model/CoilCoolingWaterPanelRadiant_Impl.hpp b/src/model/CoilCoolingWaterPanelRadiant_Impl.hpp index c99d9bd049..c03e34c664 100644 --- a/src/model/CoilCoolingWaterPanelRadiant_Impl.hpp +++ b/src/model/CoilCoolingWaterPanelRadiant_Impl.hpp @@ -14,6 +14,8 @@ namespace openstudio { namespace model { + class Schedule; + namespace detail { /** CoilCoolingWaterPanelRadiant_Impl is a StraightComponent_Impl that is the implementation class for CoilCoolingWaterPanelRadiant.*/ @@ -39,6 +41,8 @@ namespace model { virtual IddObjectType iddObjectType() const override; + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; + virtual unsigned inletPort() const override; virtual unsigned outletPort() const override; diff --git a/src/model/ScheduleTypeRegistry.cpp b/src/model/ScheduleTypeRegistry.cpp index 040e7efca9..c294e6a872 100644 --- a/src/model/ScheduleTypeRegistry.cpp +++ b/src/model/ScheduleTypeRegistry.cpp @@ -207,7 +207,8 @@ namespace model { {"CoilCoolingLowTempRadiantVarFlow", "Cooling Control Temperature Schedule", "coolingControlTemperatureSchedule", true, "Temperature", OptionalDouble(), OptionalDouble()}, {"CoilCoolingWater", "Availability", "availabilitySchedule", false, "Availability", 0.0, 1.0}, - {"CoilCoolingWaterPanelRadiant", "Cooling Control Temperature", "coolingControlTemperatureSchedule", true, "", 0.0, OptionalDouble()}, + {"CoilCoolingWaterPanelRadiant", "Cooling Control Temperature Schedule", "coolingControlTemperatureSchedule", true, "Temperature", + OptionalDouble(), OptionalDouble()}, {"CoilCoolingWaterToAirHeatPumpEquationFit", "Availability Schedule", "availabilitySchedule", false, "Availability", 0.0, 1.0}, {"CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit", "Availability Schedule", "availabilitySchedule", false, "Availability", 0.0, 1.0}, {"CoilHeatingDesuperheater", "Availability", "availabilitySchedule", false, "Availability", 0.0, 1.0}, diff --git a/src/model/test/CoilCoolingWaterPanelRadiant_GTest.cpp b/src/model/test/CoilCoolingWaterPanelRadiant_GTest.cpp index db4899c800..7d9d457e80 100644 --- a/src/model/test/CoilCoolingWaterPanelRadiant_GTest.cpp +++ b/src/model/test/CoilCoolingWaterPanelRadiant_GTest.cpp @@ -19,6 +19,8 @@ #include "../ScheduleConstant_Impl.hpp" #include "../AirLoopHVAC.hpp" #include "../AirLoopHVACZoneSplitter.hpp" +#include "../ScheduleRuleset.hpp" +#include "../ScheduleTypeLimits.hpp" using namespace openstudio; using namespace openstudio::model; @@ -111,3 +113,22 @@ TEST_F(ModelFixture, CoilCoolingWaterPanelRadiant_SetGetFields) { coil.resetCoolingControlTemperatureSchedule(); EXPECT_FALSE(coil.coolingControlTemperatureSchedule()); } + +TEST_F(ModelFixture, CoilCoolingWaterPanelRadiant_CoolingControlTemperatureSchedule) { + // Address #5595, "CoilCoolingWaterPanelRadiant.setCoolingControlTemperatureSchedule" but + // keep getting 'incompatible ScheduleTypeLimits' error. + + Model m; + CoilCoolingWaterPanelRadiant coil(m); + + ScheduleTypeLimits temperatureLimits(m); + EXPECT_TRUE(temperatureLimits.setLowerLimitValue(-60)); + EXPECT_TRUE(temperatureLimits.setUpperLimitValue(200)); + EXPECT_TRUE(temperatureLimits.setNumericType("Continuous")); + EXPECT_TRUE(temperatureLimits.setUnitType("Temperature")); + + ScheduleRuleset temperatureSchedule(m); + EXPECT_TRUE(temperatureSchedule.setScheduleTypeLimits(temperatureLimits)); + + EXPECT_TRUE(coil.setCoolingControlTemperatureSchedule(temperatureSchedule)); +}