diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACExhaustSystem.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACExhaustSystem.cpp index 2e4cbf28fe..b07e31e01b 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACExhaustSystem.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACExhaustSystem.cpp @@ -48,7 +48,7 @@ namespace openstudio { namespace energyplus { - boost::optional ForwardTranslator::translateAirLoopHVACExhaustSystem(model::AirLoopHVACExhaustSystem& modelObject) { + boost::optional ForwardTranslator::translateAirLoopHVACExhaustSystem( model::AirLoopHVACExhaustSystem& modelObject ) { // Instantiate an IdfObject of the class to store the values IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::AirLoopHVAC_ExhaustSystem, modelObject); @@ -67,7 +67,7 @@ namespace energyplus { // Zone Mixer Name: Required Object ZoneMixers zoneMixer = modelObject.zoneMixer(); - if (boost::optional wo_ = translateAndMapModelObject(zoneMixer)) { + if (boost::optional wo_ = translateAndMapModelObject(zoneMixer)) { idfObject.setString(AirLoopHVAC_ExhaustSystemFields::ZoneMixerName, wo_->nameString()); } @@ -75,9 +75,10 @@ namespace energyplus { const std::string fanObjectType = modelObject.fanObjectType(); idfObject.setString(AirLoopHVAC_ExhaustSystemFields::FanObjectType, fanObjectType); + // Fan Name: Required Object FansSystemModel fan = modelObject.fan(); - if (boost::optional wo_ = translateAndMapModelObject(fan)) { + if (boost::optional wo_ = translateAndMapModelObject(fan)) { idfObject.setString(AirLoopHVAC_ExhaustSystemFields::FanName, wo_->nameString()); } diff --git a/src/energyplus/Test/AirLoopHVACExhaustSystem_GTest.cpp b/src/energyplus/Test/AirLoopHVACExhaustSystem_GTest.cpp index 8d59a183d6..b0f0eba25d 100644 --- a/src/energyplus/Test/AirLoopHVACExhaustSystem_GTest.cpp +++ b/src/energyplus/Test/AirLoopHVACExhaustSystem_GTest.cpp @@ -69,6 +69,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_AirLoopHVACExhaustSystem) { FansSystemModel fan(m); EXPECT_TRUE(airLoopHVACExhaustSystem.setFan(fan)); + // TODO: you're responsible for creating all other objects needed so this object actually gets ForwardTranslated const Workspace w = ft.translateModel(m); @@ -76,7 +77,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_AirLoopHVACExhaustSystem) { ASSERT_EQ(1u, idfObjs.size()); const auto& idfObject = idfObjs.front(); - EXPECT_EQ(zoneMixer.nameString(), idfObject.getString(AirLoopHVAC_ExhaustSystemFields::ZoneMixerName).get()); - EXPECT_EQ("Fan:SystemModel", idfObject.getString(AirLoopHVAC_ExhaustSystemFields::FanObjectType).get()); - EXPECT_EQ(fan.nameString(), idfObject.getString(AirLoopHVAC_ExhaustSystemFields::FanName).get()); + EXPECT_EQ(zoneMixer.nameString(), idfObject.getString(AirLoopHVAC_ExhaustSystemFields::ZoneMixerName).get()); + EXPECT_EQ("Fan:SystemModel", idfObject.getString(AirLoopHVAC_ExhaustSystemFields::FanObjectType).get()); EXPECT_EQ(fan.nameString(), idfObject.getString(AirLoopHVAC_ExhaustSystemFields::FanName).get()); + } diff --git a/src/model/AirloopHVACExhaustSystem.cpp b/src/model/AirloopHVACExhaustSystem.cpp index add1e1ad8a..975b1f5ac5 100644 --- a/src/model/AirloopHVACExhaustSystem.cpp +++ b/src/model/AirloopHVACExhaustSystem.cpp @@ -27,8 +27,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***********************************************************************************************************************/ -#include "AirloopHVACExhaustSystem.hpp" -#include "AirloopHVACExhaustSystem_Impl.hpp" +#include "AirLoopHVACExhaustSystem.hpp" +#include "AirLoopHVACExhaustSystem_Impl.hpp" // TODO: Check the following class names against object getters and setters. #include "ZoneMixers.hpp" @@ -47,53 +47,55 @@ namespace model { namespace detail { - AirloopHVACExhaustSystem_Impl::AirloopHVACExhaustSystem_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) + AirLoopHVACExhaustSystem_Impl::AirLoopHVACExhaustSystem_Impl(const IdfObject& idfObject, + Model_Impl* model, bool keepHandle) : StraightComponent_Impl(idfObject, model, keepHandle) { - OS_ASSERT(idfObject.iddObject().type() == AirloopHVACExhaustSystem::iddObjectType()); + OS_ASSERT(idfObject.iddObject().type() == AirLoopHVACExhaustSystem::iddObjectType()); } - AirloopHVACExhaustSystem_Impl::AirloopHVACExhaustSystem_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, - bool keepHandle) + AirLoopHVACExhaustSystem_Impl::AirLoopHVACExhaustSystem_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, bool keepHandle) : StraightComponent_Impl(other, model, keepHandle) { - OS_ASSERT(other.iddObject().type() == AirloopHVACExhaustSystem::iddObjectType()); + OS_ASSERT(other.iddObject().type() == AirLoopHVACExhaustSystem::iddObjectType()); } - AirloopHVACExhaustSystem_Impl::AirloopHVACExhaustSystem_Impl(const AirloopHVACExhaustSystem_Impl& other, Model_Impl* model, bool keepHandle) - : StraightComponent_Impl(other, model, keepHandle) {} + AirLoopHVACExhaustSystem_Impl::AirLoopHVACExhaustSystem_Impl(const AirLoopHVACExhaustSystem_Impl& other, + Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(other, model, keepHandle) {} - const std::vector& AirloopHVACExhaustSystem_Impl::outputVariableNames() const { + const std::vector& AirLoopHVACExhaustSystem_Impl::outputVariableNames() const { static std::vector result; - if (result.empty()) { + if (result.empty()){ } return result; } - IddObjectType AirloopHVACExhaustSystem_Impl::iddObjectType() const { - return AirloopHVACExhaustSystem::iddObjectType(); + IddObjectType AirLoopHVACExhaustSystem_Impl::iddObjectType() const { + return AirLoopHVACExhaustSystem::iddObjectType(); } - ComponentType AirloopHVACExhaustSystem_Impl::componentType() const { + ComponentType AirLoopHVACExhaustSystem_Impl::componentType() const { // TODO return ComponentType::None; } - std::vector AirloopHVACExhaustSystem_Impl::coolingFuelTypes() const { + std::vector AirLoopHVACExhaustSystem_Impl::coolingFuelTypes() const { // TODO return {}; } - std::vector AirloopHVACExhaustSystem_Impl::heatingFuelTypes() const { + std::vector AirLoopHVACExhaustSystem_Impl::heatingFuelTypes() const { // TODO return {}; } - std::vector AirloopHVACExhaustSystem_Impl::appGHeatingFuelTypes() const { + std::vector AirLoopHVACExhaustSystem_Impl::appGHeatingFuelTypes() const { // TODO return {}; } - ZoneMixers AirloopHVACExhaustSystem_Impl::zoneMixer() const { + ZoneMixers AirLoopHVACExhaustSystem_Impl::zoneMixer() const { boost::optional value = optionalZoneMixer(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have an Zone Mixer attached."); @@ -101,7 +103,7 @@ namespace model { return value.get(); } - FansSystemModel AirloopHVACExhaustSystem_Impl::fan() const { + FansSystemModel AirLoopHVACExhaustSystem_Impl::fan() const { boost::optional value = optionalFan(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have an Fan attached."); @@ -109,28 +111,29 @@ namespace model { return value.get(); } - bool AirloopHVACExhaustSystem_Impl::setZoneMixer(const ZoneMixers& zoneMixers) { + bool AirLoopHVACExhaustSystem_Impl::setZoneMixer(const ZoneMixers& zoneMixers) { const bool result = setPointer(OS_AirLoopHVAC_ExhaustSystemFields::ZoneMixerName, zoneMixers.handle()); return result; } - bool AirloopHVACExhaustSystem_Impl::setFan(const FansSystemModel& fansSystemModel) { + bool AirLoopHVACExhaustSystem_Impl::setFan(const FansSystemModel& fansSystemModel) { const bool result = setPointer(OS_AirLoopHVAC_ExhaustSystemFields::FanName, fansSystemModel.handle()); return result; } - boost::optional AirloopHVACExhaustSystem_Impl::optionalZoneMixer() const { + boost::optional AirLoopHVACExhaustSystem_Impl::optionalZoneMixer() const { return getObject().getModelObjectTarget(OS_AirLoopHVAC_ExhaustSystemFields::ZoneMixerName); } - boost::optional AirloopHVACExhaustSystem_Impl::optionalFan() const { + boost::optional AirLoopHVACExhaustSystem_Impl::optionalFan() const { return getObject().getModelObjectTarget(OS_AirLoopHVAC_ExhaustSystemFields::FanName); } } // namespace detail - AirloopHVACExhaustSystem::AirloopHVACExhaustSystem(const Model& model) : StraightComponent(AirloopHVACExhaustSystem::iddObjectType(), model) { - OS_ASSERT(getImpl()); + AirLoopHVACExhaustSystem::AirLoopHVACExhaustSystem(const Model& model) + : StraightComponent(AirLoopHVACExhaustSystem::iddObjectType(), model) { + OS_ASSERT(getImpl()); // TODO: consider adding (overloaded or not) explicit ctors taking required objects as argument @@ -144,28 +147,29 @@ namespace model { OS_ASSERT(ok); } - IddObjectType AirloopHVACExhaustSystem::iddObjectType() { + IddObjectType AirLoopHVACExhaustSystem::iddObjectType() { return {IddObjectType::OS_AirLoopHVAC_ExhaustSystem}; } - ZoneMixers AirloopHVACExhaustSystem::zoneMixer() const { - return getImpl()->zoneMixer(); + ZoneMixers AirLoopHVACExhaustSystem::zoneMixer() const { + return getImpl()->zoneMixer(); } - FansSystemModel AirloopHVACExhaustSystem::fan() const { - return getImpl()->fan(); + FansSystemModel AirLoopHVACExhaustSystem::fan() const { + return getImpl()->fan(); } - bool AirloopHVACExhaustSystem::setZoneMixer(const ZoneMixers& zoneMixers) { - return getImpl()->setZoneMixer(zoneMixers); + bool AirLoopHVACExhaustSystem::setZoneMixer(const ZoneMixers& zoneMixers) { + return getImpl()->setZoneMixer(zoneMixers); } - bool AirloopHVACExhaustSystem::setFan(const FansSystemModel& fansSystemModel) { - return getImpl()->setFan(fansSystemModel); + bool AirLoopHVACExhaustSystem::setFan(const FansSystemModel& fansSystemModel) { + return getImpl()->setFan(fansSystemModel); } /// @cond - AirloopHVACExhaustSystem::AirloopHVACExhaustSystem(std::shared_ptr impl) + AirLoopHVACExhaustSystem::AirLoopHVACExhaustSystem( + std::shared_ptr impl) : StraightComponent(std::move(impl)) {} /// @endcond diff --git a/src/model/AirloopHVACExhaustSystem.hpp b/src/model/AirloopHVACExhaustSystem.hpp index d2924ac76b..6dfa8ba0ad 100644 --- a/src/model/AirloopHVACExhaustSystem.hpp +++ b/src/model/AirloopHVACExhaustSystem.hpp @@ -42,25 +42,25 @@ namespace model { namespace detail { - class AirloopHVACExhaustSystem_Impl; + class AirLoopHVACExhaustSystem_Impl; } // namespace detail - /** AirloopHVACExhaustSystem is a StraightComponent that wraps the OpenStudio IDD object 'OS:AirLoopHVAC:ExhaustSystem'. */ - class MODEL_API AirloopHVACExhaustSystem : public StraightComponent + /** AirLoopHVACExhaustSystem is a StraightComponent that wraps the OpenStudio IDD object 'OS:AirLoopHVAC:ExhaustSystem'. */ + class MODEL_API AirLoopHVACExhaustSystem : public StraightComponent { public: /** @name Constructors and Destructors */ //@{ - explicit AirloopHVACExhaustSystem(const Model& model); + explicit AirLoopHVACExhaustSystem(const Model& model); - virtual ~AirloopHVACExhaustSystem() = default; + virtual ~AirLoopHVACExhaustSystem() = default; // Default the copy and move operators because the virtual dtor is explicit - AirloopHVACExhaustSystem(const AirloopHVACExhaustSystem& other) = default; - AirloopHVACExhaustSystem(AirloopHVACExhaustSystem&& other) = default; - AirloopHVACExhaustSystem& operator=(const AirloopHVACExhaustSystem&) = default; - AirloopHVACExhaustSystem& operator=(AirloopHVACExhaustSystem&&) = default; + AirLoopHVACExhaustSystem(const AirLoopHVACExhaustSystem& other) = default; + AirLoopHVACExhaustSystem(AirLoopHVACExhaustSystem&& other) = default; + AirLoopHVACExhaustSystem& operator=(const AirLoopHVACExhaustSystem&) = default; + AirLoopHVACExhaustSystem& operator=(AirLoopHVACExhaustSystem&&) = default; //@} @@ -92,24 +92,24 @@ namespace model { //@} protected: /// @cond - using ImplType = detail::AirloopHVACExhaustSystem_Impl; + using ImplType = detail::AirLoopHVACExhaustSystem_Impl; - explicit AirloopHVACExhaustSystem(std::shared_ptr impl); + explicit AirLoopHVACExhaustSystem(std::shared_ptr impl); - friend class detail::AirloopHVACExhaustSystem_Impl; + friend class detail::AirLoopHVACExhaustSystem_Impl; friend class Model; friend class IdfObject; friend class openstudio::detail::IdfObject_Impl; /// @endcond private: - REGISTER_LOGGER("openstudio.model.AirloopHVACExhaustSystem"); + REGISTER_LOGGER("openstudio.model.AirLoopHVACExhaustSystem"); }; - /** \relates AirloopHVACExhaustSystem*/ - using OptionalAirloopHVACExhaustSystem = boost::optional; + /** \relates AirLoopHVACExhaustSystem*/ + using OptionalAirLoopHVACExhaustSystem = boost::optional; - /** \relates AirloopHVACExhaustSystem*/ - using AirloopHVACExhaustSystemVector = std::vector; + /** \relates AirLoopHVACExhaustSystem*/ + using AirLoopHVACExhaustSystemVector = std::vector; } // namespace model } // namespace openstudio diff --git a/src/model/AirloopHVACExhaustSystem_Impl.hpp b/src/model/AirloopHVACExhaustSystem_Impl.hpp index 1a2e162438..ce4703a848 100644 --- a/src/model/AirloopHVACExhaustSystem_Impl.hpp +++ b/src/model/AirloopHVACExhaustSystem_Impl.hpp @@ -42,20 +42,26 @@ namespace model { namespace detail { - /** AirloopHVACExhaustSystem_Impl is a StraightComponent_Impl that is the implementation class for AirloopHVACExhaustSystem.*/ - class MODEL_API AirloopHVACExhaustSystem_Impl : public StraightComponent_Impl + /** AirLoopHVACExhaustSystem_Impl is a StraightComponent_Impl that is the implementation class for AirLoopHVACExhaustSystem.*/ + class MODEL_API AirLoopHVACExhaustSystem_Impl : public StraightComponent_Impl { public: /** @name Constructors and Destructors */ //@{ - AirloopHVACExhaustSystem_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); + AirLoopHVACExhaustSystem_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); - AirloopHVACExhaustSystem_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); + AirLoopHVACExhaustSystem_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); - AirloopHVACExhaustSystem_Impl(const AirloopHVACExhaustSystem_Impl& other, Model_Impl* model, bool keepHandle); + AirLoopHVACExhaustSystem_Impl(const AirLoopHVACExhaustSystem_Impl& other, + Model_Impl* model, + bool keepHandle); - virtual ~AirloopHVACExhaustSystem_Impl() = default; + virtual ~AirLoopHVACExhaustSystem_Impl() = default; //@} /** @name Virtual Methods */ @@ -97,8 +103,8 @@ namespace model { //@} protected: private: - REGISTER_LOGGER("openstudio.model.AirloopHVACExhaustSystem"); - + REGISTER_LOGGER("openstudio.model.AirLoopHVACExhaustSystem"); + // TODO: Check the return types of these methods. // Optional getters for use by methods like children() so can remove() if the constructor fails. // There are other ways for the public versions of these getters to fail--perhaps all required diff --git a/src/model/test/AirloopHVACExhaustSystem_GTest.cpp b/src/model/test/AirloopHVACExhaustSystem_GTest.cpp index 5205fe04a9..575c58c755 100644 --- a/src/model/test/AirloopHVACExhaustSystem_GTest.cpp +++ b/src/model/test/AirloopHVACExhaustSystem_GTest.cpp @@ -29,8 +29,8 @@ #include "ModelFixture.hpp" -#include "../AirloopHVACExhaustSystem.hpp" -#include "../AirloopHVACExhaustSystem_Impl.hpp" +#include "../AirLoopHVACExhaustSystem.hpp" +#include "../AirLoopHVACExhaustSystem_Impl.hpp" // TODO: Check the following class names against object getters and setters. #include "../ZoneMixers.hpp" @@ -42,34 +42,35 @@ using namespace openstudio; using namespace openstudio::model; -TEST_F(ModelFixture, AirloopHVACExhaustSystem_GettersSetters) { +TEST_F(ModelFixture, AirLoopHVACExhaustSystem_GettersSetters) { Model m; // TODO: Check regular Ctor arguments - AirloopHVACExhaustSystem airloopHVACExhaustSystem(m); + AirLoopHVACExhaustSystem airLoopHVACExhaustSystem(m); // TODO: Or if a UniqueModelObject (and make sure _Impl is included) - // AirloopHVACExhaustSystem airloopHVACExhaustSystem = m.getUniqueModelObject(); + // AirLoopHVACExhaustSystem airLoopHVACExhaustSystem = m.getUniqueModelObject(); - airloopHVACExhaustSystem.setName("My AirloopHVACExhaustSystem"); + airLoopHVACExhaustSystem.setName("My AirLoopHVACExhaustSystem"); // Zone Mixer Name: Required Object ZoneMixers zoneMixer(m); - EXPECT_TRUE(airloopHVACExhaustSystem.setZoneMixer(zoneMixer)); - EXPECT_EQ(zoneMixer, airloopHVACExhaustSystem.zoneMixer()); + EXPECT_TRUE(airLoopHVACExhaustSystem.setZoneMixer(zoneMixer)); + EXPECT_EQ(zoneMixer, airLoopHVACExhaustSystem.zoneMixer()); // Fan Name: Required Object FansSystemModel fan(m); - EXPECT_TRUE(airloopHVACExhaustSystem.setFan(fan)); - EXPECT_EQ(fan, airloopHVACExhaustSystem.fan()); + EXPECT_TRUE(airLoopHVACExhaustSystem.setFan(fan)); + EXPECT_EQ(fan, airLoopHVACExhaustSystem.fan()); + } -TEST_F(ModelFixture, AirloopHVACExhaustSystem_HeatCoolFuelTypes) { +TEST_F(ModelFixture, AirLoopHVACExhaustSystem_HeatCoolFuelTypes) { Model m; // TODO: Check regular Ctor arguments - AirloopHVACExhaustSystem airloopHVACExhaustSystem(m); + AirLoopHVACExhaustSystem airLoopHVACExhaustSystem(m); // TODO: Or if a UniqueModelObject (and make sure _Impl is included) - // AirloopHVACExhaustSystem airloopHVACExhaustSystem = m.getUniqueModelObject(); + // AirLoopHVACExhaustSystem airLoopHVACExhaustSystem = m.getUniqueModelObject(); - EXPECT_EQ(ComponentType(ComponentType::Both), airloopHVACExhaustSystem.componentType()); - testFuelTypeEquality({FuelType::Electricity}, airloopHVACExhaustSystem.coolingFuelTypes()); - testFuelTypeEquality({FuelType::Electricity, FuelType::Propane}, airloopHVACExhaustSystem.heatingFuelTypes()); - testAppGFuelTypeEquality({AppGFuelType::Fuel, AppGFuelType::HeatPump}, airloopHVACExhaustSystem.appGHeatingFuelTypes()); + EXPECT_EQ(ComponentType(ComponentType::Both), airLoopHVACExhaustSystem.componentType()); + testFuelTypeEquality({FuelType::Electricity}, airLoopHVACExhaustSystem.coolingFuelTypes()); + testFuelTypeEquality({FuelType::Electricity, FuelType::Propane}, airLoopHVACExhaustSystem.heatingFuelTypes()); + testAppGFuelTypeEquality({AppGFuelType::Fuel, AppGFuelType::HeatPump}, airLoopHVACExhaustSystem.appGHeatingFuelTypes()); }