TEST_F(ModelFixture, ZoneAirMassFlowConservation) { Model model; EXPECT_FALSE(model.getOptionalUniqueModelObject<ZoneAirMassFlowConservation>()); ZoneAirMassFlowConservation zamfc = model.getUniqueModelObject<ZoneAirMassFlowConservation>(); EXPECT_FALSE(zamfc.adjustZoneMixingForZoneAirMassFlowBalance()); EXPECT_TRUE(zamfc.isAdjustZoneMixingForZoneAirMassFlowBalanceDefaulted()); EXPECT_EQ("AddInfiltrationFlow", zamfc.infiltrationBalancingMethod()); EXPECT_TRUE(zamfc.isInfiltrationBalancingMethodDefaulted()); EXPECT_EQ("MixingSourceZonesOnly", zamfc.infiltrationBalancingZones()); EXPECT_TRUE(zamfc.isInfiltrationBalancingZonesDefaulted()); zamfc.setAdjustZoneMixingForZoneAirMassFlowBalance(true); EXPECT_TRUE(zamfc.adjustZoneMixingForZoneAirMassFlowBalance()); EXPECT_FALSE(zamfc.isAdjustZoneMixingForZoneAirMassFlowBalanceDefaulted()); EXPECT_TRUE(zamfc.setInfiltrationBalancingMethod("AdjustInfiltrationFlow")); EXPECT_EQ("AdjustInfiltrationFlow", zamfc.infiltrationBalancingMethod()); EXPECT_FALSE(zamfc.isInfiltrationBalancingMethodDefaulted()); EXPECT_TRUE(zamfc.setInfiltrationBalancingZones("AllZones")); EXPECT_EQ("AllZones", zamfc.infiltrationBalancingZones()); EXPECT_FALSE(zamfc.isInfiltrationBalancingZonesDefaulted()); EXPECT_TRUE(model.getOptionalUniqueModelObject<ZoneAirMassFlowConservation>()); }
boost::optional<IdfObject> ForwardTranslator::translateZoneAirMassFlowConservation( ZoneAirMassFlowConservation & modelObject) { // Makes sure the modelObject gets put in the map, and that the new idfObject gets put in // the final file. Also set's the idfObject's name. IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::ZoneAirMassFlowConservation, modelObject); if (modelObject.adjustZoneMixingForZoneAirMassFlowBalance()){ idfObject.setString(ZoneAirMassFlowConservationFields::AdjustZoneMixingForZoneAirMassFlowBalance, "Yes"); }else{ idfObject.setString(ZoneAirMassFlowConservationFields::AdjustZoneMixingForZoneAirMassFlowBalance, "No"); } idfObject.setString(ZoneAirMassFlowConservationFields::SourceZoneInfiltrationTreatment, modelObject.sourceZoneInfiltrationTreatment()); return idfObject; }