From 9265da31d5d44649f788200cc3a17fe682623db6 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Mon, 23 Dec 2024 16:08:29 -0700 Subject: [PATCH] Fix and improve model and ft tests. --- ...TranslateZoneHVACEvaporativeCoolerUnit.cpp | 6 +- .../ZoneHVACEvaporativeCoolerUnit_GTest.cpp | 165 +++++++++++++++++- src/model/ZoneHVACEvaporativeCoolerUnit.cpp | 91 +++++++++- .../ZoneHVACEvaporativeCoolerUnit_Impl.hpp | 6 + .../ZoneHVACEvaporativeCoolerUnit_GTest.cpp | 6 +- src/osversion/VersionTranslator.cpp | 22 ++- 6 files changed, 270 insertions(+), 26 deletions(-) diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACEvaporativeCoolerUnit.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACEvaporativeCoolerUnit.cpp index 970f107edb..edbdb1d04e 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACEvaporativeCoolerUnit.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACEvaporativeCoolerUnit.cpp @@ -218,16 +218,16 @@ namespace energyplus { inletNodeName = outdoorAirInletNodeName.get(); } - if (fan_) { + if (istringEqual(fanPlacement, "DrawThrough") && fan_) { outletNodeName = baseName + " Second Evaporative Cooler - Fan Node"; } else { - outletNodeName = outdoorAirInletNodeName.get(); + outletNodeName = coolerOutletNodeName.get(); } if (secondEvaporativeCooler_->iddObject().type() == IddObjectType::EvaporativeCooler_Direct_ResearchSpecial) { secondEvaporativeCooler_->setString(EvaporativeCooler_Direct_ResearchSpecialFields::AirInletNodeName, inletNodeName); secondEvaporativeCooler_->setString(EvaporativeCooler_Direct_ResearchSpecialFields::AirOutletNodeName, outletNodeName); - } else if (firstEvaporativeCooler.iddObject().type() == IddObjectType::EvaporativeCooler_Indirect_ResearchSpecial) { + } else if (secondEvaporativeCooler_->iddObject().type() == IddObjectType::EvaporativeCooler_Indirect_ResearchSpecial) { secondEvaporativeCooler_->setString(EvaporativeCooler_Indirect_ResearchSpecialFields::PrimaryAirInletNodeName, inletNodeName); secondEvaporativeCooler_->setString(EvaporativeCooler_Indirect_ResearchSpecialFields::PrimaryAirOutletNodeName, outletNodeName); } else { diff --git a/src/energyplus/Test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp b/src/energyplus/Test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp index bc2403f886..ed331a958f 100644 --- a/src/energyplus/Test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp +++ b/src/energyplus/Test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp @@ -52,6 +52,9 @@ #include #include #include +#include +#include +#include using namespace openstudio::energyplus; using namespace openstudio::model; @@ -94,10 +97,12 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_ZoneHVACEvaporativeCoolerUnit) { EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::Name).get()); EXPECT_EQ(availabilitySchedule.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityScheduleName).get()); - EXPECT_EQ("", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityManagerListName).get()); - EXPECT_EQ("", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName).get()); - EXPECT_EQ("", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerOutletNodeName).get()); - EXPECT_EQ("", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::ZoneReliefAirNodeName).get()); + EXPECT_TRUE(idfObject.isEmpty(ZoneHVAC_EvaporativeCoolerUnitFields::AvailabilityManagerListName)); + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.airInletModelObject()->nameString(), + idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName).get()); + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.airOutletModelObject()->nameString(), + idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerOutletNodeName).get()); + EXPECT_TRUE(idfObject.isEmpty(ZoneHVAC_EvaporativeCoolerUnitFields::ZoneReliefAirNodeName)); EXPECT_EQ("Fan:ComponentModel", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanObjectType).get()); EXPECT_EQ(supplyAirFan.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanName).get()); EXPECT_EQ(0.9, idfObject.getDouble(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSupplyAirFlowRate).get()); @@ -111,6 +116,156 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_ZoneHVACEvaporativeCoolerUnit) { EXPECT_EQ("EvaporativeCooler:Indirect:ResearchSpecial", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerObjectType).get()); EXPECT_EQ(secondEvaporativeCooler.nameString(), idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerName).get()); - EXPECT_EQ("", idfObject.getString(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSpecificationZoneHVACSizingObjectName).get()); + EXPECT_TRUE(idfObject.isEmpty(ZoneHVAC_EvaporativeCoolerUnitFields::DesignSpecificationZoneHVACSizingObjectName)); EXPECT_EQ(95.0, idfObject.getDouble(ZoneHVAC_EvaporativeCoolerUnitFields::ShutOffRelativeHumidity).get()); + + auto idf_supplyAirFan = idfObject.getTarget(ZoneHVAC_EvaporativeCoolerUnitFields::SupplyAirFanName).get(); + EXPECT_EQ(idf_supplyAirFan.iddObject().type(), IddObjectType::Fan_ComponentModel); + + auto idf_firstEvaporativeCooler = idfObject.getTarget(ZoneHVAC_EvaporativeCoolerUnitFields::FirstEvaporativeCoolerObjectName).get(); + EXPECT_EQ(idf_firstEvaporativeCooler.iddObject().type(), IddObjectType::EvaporativeCooler_Direct_ResearchSpecial); + + auto idf_secondEvaporativeCooler = idfObject.getTarget(ZoneHVAC_EvaporativeCoolerUnitFields::SecondEvaporativeCoolerName).get(); + EXPECT_EQ(idf_secondEvaporativeCooler.iddObject().type(), IddObjectType::EvaporativeCooler_Indirect_ResearchSpecial); + + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.airInletModelObject()->nameString(), + idf_supplyAirFan.getString(Fan_ComponentModelFields::AirInletNodeName).get()); + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.nameString() + " Fan - First Evaporative Cooler Node", + idf_supplyAirFan.getString(Fan_ComponentModelFields::AirOutletNodeName).get()); + + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.nameString() + " Fan - First Evaporative Cooler Node", + idf_firstEvaporativeCooler.getString(EvaporativeCooler_Direct_ResearchSpecialFields::AirInletNodeName).get()); + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.nameString() + " First Evaporative Cooler - Second Evaporative Cooler Node", + idf_firstEvaporativeCooler.getString(EvaporativeCooler_Direct_ResearchSpecialFields::AirOutletNodeName).get()); + + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.nameString() + " First Evaporative Cooler - Second Evaporative Cooler Node", + idf_secondEvaporativeCooler.getString(EvaporativeCooler_Indirect_ResearchSpecialFields::PrimaryAirInletNodeName).get()); + EXPECT_EQ(zoneHVACEvaporativeCoolerUnit.airOutletModelObject()->nameString(), + idf_secondEvaporativeCooler.getString(EvaporativeCooler_Indirect_ResearchSpecialFields::PrimaryAirOutletNodeName).get()); +} + +std::vector getEvaporativeCoolerUnitNodes(const Workspace& workspace) { + WorkspaceObjectVector idfEvaporativeCoolerUnits(workspace.getObjectsByType(IddObjectType::ZoneHVAC_EvaporativeCoolerUnit)); + if (idfEvaporativeCoolerUnits.empty()) { + return {}; + } + + auto& idfEvaporativeCoolerUnit = idfEvaporativeCoolerUnits[0]; + + return { + idfEvaporativeCoolerUnit.getString(ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName).get(), + idfEvaporativeCoolerUnit.getString(ZoneHVAC_EvaporativeCoolerUnitFields::CoolerOutletNodeName).get(), + }; +} + +std::vector getSupplyAirFanNodes(const Workspace& workspace) { + WorkspaceObjectVector idfFans(workspace.getObjectsByType(IddObjectType::Fan_ComponentModel)); + if (idfFans.empty()) { + return {}; + } + + auto& idfFan = idfFans[0]; + + return { + idfFan.getString(Fan_ComponentModelFields::AirInletNodeName).get(), + idfFan.getString(Fan_ComponentModelFields::AirOutletNodeName).get(), + }; +} + +std::vector getFirstEvaporativeCoolerNodes(const Workspace& workspace) { + WorkspaceObjectVector idfFirstEvaporativeCoolers(workspace.getObjectsByType(IddObjectType::EvaporativeCooler_Direct_ResearchSpecial)); + if (idfFirstEvaporativeCoolers.empty()) { + return {}; + } + + auto& idfFirstEvaporativeCooler = idfFirstEvaporativeCoolers[0]; + + return { + idfFirstEvaporativeCooler.getString(EvaporativeCooler_Direct_ResearchSpecialFields::AirInletNodeName).get(), + idfFirstEvaporativeCooler.getString(EvaporativeCooler_Direct_ResearchSpecialFields::AirOutletNodeName).get(), + }; +} + +std::vector getSecondEvaporativeCoolerNodes(const Workspace& workspace) { + WorkspaceObjectVector idfSecondEvaporativeCoolers(workspace.getObjectsByType(IddObjectType::EvaporativeCooler_Indirect_ResearchSpecial)); + if (idfSecondEvaporativeCoolers.empty()) { + return {}; + } + + auto& idfSecondEvaporativeCooler = idfSecondEvaporativeCoolers[0]; + + return { + idfSecondEvaporativeCooler.getString(EvaporativeCooler_Indirect_ResearchSpecialFields::PrimaryAirInletNodeName).get(), + idfSecondEvaporativeCooler.getString(EvaporativeCooler_Indirect_ResearchSpecialFields::PrimaryAirOutletNodeName).get(), + }; +} + +TEST_F(EnergyPlusFixture, ForwardTranslator_ZoneHVACEvaporativeCoolerUnit_Nodes) { + for (std::string fanPlacement : {"BlowThrough", "DrawThrough"}) { + + // first evaporative cooler + { + Model m; + + ZoneHVACEvaporativeCoolerUnit zoneHVACEvaporativeCoolerUnit(m); + zoneHVACEvaporativeCoolerUnit.setFanPlacement(fanPlacement); + + ThermalZone z(m); + zoneHVACEvaporativeCoolerUnit.addToThermalZone(z); + Space s(m); + s.setThermalZone(z); + + ForwardTranslator ft; + Workspace workspace = ft.translateModel(m); + + std::vector evaporativeCoolerUnitNodes = getEvaporativeCoolerUnitNodes(workspace); + std::vector fanNodes = getSupplyAirFanNodes(workspace); + std::vector firstEvaporativeCoolerNodes = getFirstEvaporativeCoolerNodes(workspace); + + if (fanPlacement == "BlowThrough") { + EXPECT_EQ(evaporativeCoolerUnitNodes[0], fanNodes[0]); + EXPECT_EQ(fanNodes[1], firstEvaporativeCoolerNodes[0]); + EXPECT_EQ(firstEvaporativeCoolerNodes[1], evaporativeCoolerUnitNodes[1]); + } else if (fanPlacement == "DrawThrough") { + EXPECT_EQ(evaporativeCoolerUnitNodes[0], firstEvaporativeCoolerNodes[0]); + EXPECT_EQ(firstEvaporativeCoolerNodes[1], fanNodes[0]); + EXPECT_EQ(fanNodes[1], evaporativeCoolerUnitNodes[1]); + } + } + + // first evaporative cooler, second evaporative cooler + { + Model m; + + ZoneHVACEvaporativeCoolerUnit zoneHVACEvaporativeCoolerUnit(m); + zoneHVACEvaporativeCoolerUnit.setFanPlacement(fanPlacement); + EvaporativeCoolerIndirectResearchSpecial secondEvaporativeCooler(m); + EXPECT_TRUE(zoneHVACEvaporativeCoolerUnit.setSecondEvaporativeCooler(secondEvaporativeCooler)); + + ThermalZone z(m); + zoneHVACEvaporativeCoolerUnit.addToThermalZone(z); + Space s(m); + s.setThermalZone(z); + + ForwardTranslator ft; + Workspace workspace = ft.translateModel(m); + + std::vector evaporativeCoolerUnitNodes = getEvaporativeCoolerUnitNodes(workspace); + std::vector fanNodes = getSupplyAirFanNodes(workspace); + std::vector firstEvaporativeCoolerNodes = getFirstEvaporativeCoolerNodes(workspace); + std::vector secondEvaporativeCoolerNodes = getSecondEvaporativeCoolerNodes(workspace); + + if (fanPlacement == "BlowThrough") { + EXPECT_EQ(evaporativeCoolerUnitNodes[0], fanNodes[0]); + EXPECT_EQ(fanNodes[1], firstEvaporativeCoolerNodes[0]); + EXPECT_EQ(firstEvaporativeCoolerNodes[1], secondEvaporativeCoolerNodes[0]); + EXPECT_EQ(secondEvaporativeCoolerNodes[1], evaporativeCoolerUnitNodes[1]); + } else if (fanPlacement == "DrawThrough") { + EXPECT_EQ(evaporativeCoolerUnitNodes[0], firstEvaporativeCoolerNodes[0]); + EXPECT_EQ(firstEvaporativeCoolerNodes[1], secondEvaporativeCoolerNodes[0]); + EXPECT_EQ(secondEvaporativeCoolerNodes[1], fanNodes[0]); + EXPECT_EQ(fanNodes[1], evaporativeCoolerUnitNodes[1]); + } + } + } } diff --git a/src/model/ZoneHVACEvaporativeCoolerUnit.cpp b/src/model/ZoneHVACEvaporativeCoolerUnit.cpp index 97b920a1e9..3377d1b0a8 100644 --- a/src/model/ZoneHVACEvaporativeCoolerUnit.cpp +++ b/src/model/ZoneHVACEvaporativeCoolerUnit.cpp @@ -70,6 +70,44 @@ namespace model { bool keepHandle) : ZoneHVACComponent_Impl(other, model, keepHandle) {} + ModelObject ZoneHVACEvaporativeCoolerUnit_Impl::clone(Model model) const { + auto evaporativeCoolUnitClone = ZoneHVACComponent_Impl::clone(model).cast(); + + if (OptionalHVACComponent intermediate = optionalSupplyAirFan()) { + evaporativeCoolUnitClone.setSupplyAirFan(intermediate->clone(model).cast()); + } + if (OptionalHVACComponent intermediate = optionalFirstEvaporativeCooler()) { + evaporativeCoolUnitClone.setFirstEvaporativeCooler(intermediate->clone(model).cast()); + } + if (OptionalHVACComponent intermediate = secondEvaporativeCooler()) { + evaporativeCoolUnitClone.setSecondEvaporativeCooler(intermediate->clone(model).cast()); + } + + return std::move(evaporativeCoolUnitClone); + } + + std::vector ZoneHVACEvaporativeCoolerUnit_Impl::remove() { + std::vector result; + + if (OptionalHVACComponent intermediate = optionalSupplyAirFan()) { + std::vector removedSupplyAirFans = intermediate->remove(); + result.insert(result.end(), removedSupplyAirFans.begin(), removedSupplyAirFans.end()); + } + if (OptionalHVACComponent intermediate = optionalFirstEvaporativeCooler()) { + std::vector removedFirstEvaporativeCoolers = intermediate->remove(); + result.insert(result.end(), removedFirstEvaporativeCoolers.begin(), removedFirstEvaporativeCoolers.end()); + } + if (OptionalHVACComponent intermediate = secondEvaporativeCooler()) { + std::vector removedSecondEvaporativeCoolers = intermediate->remove(); + result.insert(result.end(), removedSecondEvaporativeCoolers.begin(), removedSecondEvaporativeCoolers.end()); + } + + std::vector removedZoneHVACEvaporativeCoolerUnit = ZoneHVACComponent_Impl::remove(); + result.insert(result.end(), removedZoneHVACEvaporativeCoolerUnit.begin(), removedZoneHVACEvaporativeCoolerUnit.end()); + + return result; + } + const std::vector& ZoneHVACEvaporativeCoolerUnit_Impl::outputVariableNames() const { static std::vector result; if (result.empty()) { @@ -91,6 +129,20 @@ namespace model { return result; } + std::vector ZoneHVACEvaporativeCoolerUnit_Impl::children() const { + std::vector result; + if (OptionalHVACComponent intermediate = optionalSupplyAirFan()) { + result.push_back(*intermediate); + } + if (OptionalHVACComponent intermediate = optionalFirstEvaporativeCooler()) { + result.push_back(*intermediate); + } + if (OptionalHVACComponent intermediate = secondEvaporativeCooler()) { + result.push_back(*intermediate); + } + return result; + } + unsigned ZoneHVACEvaporativeCoolerUnit_Impl::inletPort() const { return OS_ZoneHVAC_EvaporativeCoolerUnitFields::OutdoorAirInletNodeName; } @@ -100,19 +152,46 @@ namespace model { } ComponentType ZoneHVACEvaporativeCoolerUnit_Impl::componentType() const { - return ComponentType::None; + return ComponentType::Cooling; } std::vector ZoneHVACEvaporativeCoolerUnit_Impl::coolingFuelTypes() const { - return {}; + std::set result; + for (auto ft : firstEvaporativeCooler().coolingFuelTypes()) { + result.insert(ft); + } + if (auto secondEvaporativeCooler_ = secondEvaporativeCooler()) { + for (auto ft : secondEvaporativeCooler_->coolingFuelTypes()) { + result.insert(ft); + } + } + return {result.begin(), result.end()}; } std::vector ZoneHVACEvaporativeCoolerUnit_Impl::heatingFuelTypes() const { - return {}; + std::set result; + for (auto ft : firstEvaporativeCooler().heatingFuelTypes()) { + result.insert(ft); + } + if (auto secondEvaporativeCooler_ = secondEvaporativeCooler()) { + for (auto ft : secondEvaporativeCooler_->heatingFuelTypes()) { + result.insert(ft); + } + } + return {result.begin(), result.end()}; } std::vector ZoneHVACEvaporativeCoolerUnit_Impl::appGHeatingFuelTypes() const { - return {}; + std::set result; + for (auto ft : firstEvaporativeCooler().appGHeatingFuelTypes()) { + result.insert(ft); + } + if (auto secondEvaporativeCooler_ = secondEvaporativeCooler()) { + for (auto ft : secondEvaporativeCooler_->appGHeatingFuelTypes()) { + result.insert(ft); + } + } + return {result.begin(), result.end()}; } Schedule ZoneHVACEvaporativeCoolerUnit_Impl::availabilitySchedule() const { @@ -286,7 +365,7 @@ namespace model { ok = setAvailabilitySchedule(alwaysOn); OS_ASSERT(ok); - FanComponentModel supplyAirFan(model); // StripMallZoneEvapCooler.idf + FanComponentModel supplyAirFan(model); ok = setSupplyAirFan(supplyAirFan); OS_ASSERT(ok); @@ -301,7 +380,7 @@ namespace model { OS_ASSERT(ok); EvaporativeCoolerDirectResearchSpecial firstEvaporativeCooler(model, alwaysOn); - ok = setFirstEvaporativeCooler(firstEvaporativeCooler); // StripMallZoneEvapCooler.idf + ok = setFirstEvaporativeCooler(firstEvaporativeCooler); OS_ASSERT(ok); ok = setShutOffRelativeHumidity(100.0); diff --git a/src/model/ZoneHVACEvaporativeCoolerUnit_Impl.hpp b/src/model/ZoneHVACEvaporativeCoolerUnit_Impl.hpp index eb891a3fe1..f97b213240 100644 --- a/src/model/ZoneHVACEvaporativeCoolerUnit_Impl.hpp +++ b/src/model/ZoneHVACEvaporativeCoolerUnit_Impl.hpp @@ -60,12 +60,18 @@ namespace model { /** @name Virtual Methods */ //@{ + virtual ModelObject clone(Model model) const override; + + virtual std::vector remove() override; + virtual const std::vector& outputVariableNames() const override; virtual IddObjectType iddObjectType() const override; virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; + virtual std::vector children() const override; + virtual unsigned inletPort() const override; virtual unsigned outletPort() const override; diff --git a/src/model/test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp b/src/model/test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp index 65c8b75f0a..2d51594ca9 100644 --- a/src/model/test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp +++ b/src/model/test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp @@ -127,8 +127,8 @@ TEST_F(ModelFixture, ZoneHVACEvaporativeCoolerUnit_HeatCoolFuelTypes) { ZoneHVACEvaporativeCoolerUnit zoneHVACEvaporativeCoolerUnit(m); - EXPECT_EQ(ComponentType(ComponentType::Both), zoneHVACEvaporativeCoolerUnit.componentType()); + EXPECT_EQ(ComponentType(ComponentType::Cooling), zoneHVACEvaporativeCoolerUnit.componentType()); testFuelTypeEquality({FuelType::Electricity}, zoneHVACEvaporativeCoolerUnit.coolingFuelTypes()); - testFuelTypeEquality({FuelType::Electricity, FuelType::Propane}, zoneHVACEvaporativeCoolerUnit.heatingFuelTypes()); - testAppGFuelTypeEquality({AppGFuelType::Fuel, AppGFuelType::HeatPump}, zoneHVACEvaporativeCoolerUnit.appGHeatingFuelTypes()); + testFuelTypeEquality({}, zoneHVACEvaporativeCoolerUnit.heatingFuelTypes()); + testAppGFuelTypeEquality({}, zoneHVACEvaporativeCoolerUnit.appGHeatingFuelTypes()); } diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index 534c778af0..507dc9d1d8 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -333,7 +333,8 @@ namespace osversion { OS_ASSERT(tempModel.strictnessLevel() == StrictnessLevel::Minimal); std::vector> issueInfo = fixInterobjectIssuesStage1(tempModel, m_originalVersion); if (!tempModel.isValid(StrictnessLevel::Draft)) { - LOG(Error, "Model with Version " << openStudioVersion() << " IDD is not valid to draft " << "strictness level."); + LOG(Error, "Model with Version " << openStudioVersion() << " IDD is not valid to draft " + << "strictness level."); LOG(Error, tempModel.validityReport(StrictnessLevel::Draft)); return boost::none; } @@ -382,7 +383,8 @@ namespace osversion { // bracket allowable versions LOG(Debug, "Starting translation from Version " << currentVersion.str() << "."); if (currentVersion < VersionString("0.7.0")) { - LOG(Error, "Version translation is not provided for OpenStudio models created prior to " << "Version 0.7.0."); + LOG(Error, "Version translation is not provided for OpenStudio models created prior to " + << "Version 0.7.0."); return; } if (currentVersion > VersionString(openStudioVersion())) { @@ -390,8 +392,8 @@ namespace osversion { // if currentVersion is just one ahead, may be a developer using the cloud. // let it pass as if currentVersion == openStudioVersion(), with a warning if (VersionString(openStudioVersion()).isNextVersion(currentVersion)) { - LOG(Warn, "Version extracted from file '" << currentVersion.str() << "' is one " << "increment ahead of OpenStudio Version " - << openStudioVersion() << ". " + LOG(Warn, "Version extracted from file '" << currentVersion.str() << "' is one " + << "increment ahead of OpenStudio Version " << openStudioVersion() << ". " << "Proceeding as if these versions are the same. Use with caution."); currentVersion = VersionString(openStudioVersion()); } else { @@ -620,7 +622,8 @@ namespace osversion { OS_ASSERT(ok); result = objCopy; } else { - LOG(Warn, "Tried to update the file path '" << original << "' to the new format, " << "but was unsuccessful."); + LOG(Warn, "Tried to update the file path '" << original << "' to the new format, " + << "but was unsuccessful."); } } } @@ -770,8 +773,8 @@ namespace osversion { match = candidates[0]; } if (match && match->name()) { - LOG(Warn, "Found match for object in OS:ComponentData contents list by type only, even " << "though this type of object (" << typeStr - << ") has a name field."); + LOG(Warn, "Found match for object in OS:ComponentData contents list by type only, even " + << "though this type of object (" << typeStr << ") has a name field."); } } @@ -785,7 +788,8 @@ namespace osversion { } else { LOG(Warn, "Unable to locate object in OS:ComponentData contents list called out " << "as object type '" << typeStr << "', and with name '" << nameStr - << "'. Skipping this object (that is, removing it from the Component " << "definition)."); + << "'. Skipping this object (that is, removing it from the Component " + << "definition)."); continue; } } @@ -1093,7 +1097,7 @@ namespace osversion { } } } // for keys - } // for users + } // for users m_refactored.emplace_back(originalSchedule, schedule.idfObject()); for (const auto& candidate : candidates) { model::ModelObjectVector wholeCandidate = getRecursiveChildren(candidate);