当前位置: 首页>>代码示例>>C++>>正文


C++ ThermalZone::airflowNetworkZone方法代码示例

本文整理汇总了C++中ThermalZone::airflowNetworkZone方法的典型用法代码示例。如果您正苦于以下问题:C++ ThermalZone::airflowNetworkZone方法的具体用法?C++ ThermalZone::airflowNetworkZone怎么用?C++ ThermalZone::airflowNetworkZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ThermalZone的用法示例。


在下文中一共展示了ThermalZone::airflowNetworkZone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: thermalZone

TEST_F(ModelFixture, AirflowNetwork_Zone_Basic)
{
  Model model;
  ThermalZone thermalZone(model);
  Space space1(model);
  Space space2(model);

  EXPECT_FALSE(thermalZone.airflowNetworkZone());
  EXPECT_FALSE(space1.thermalZone());
  EXPECT_FALSE(space2.thermalZone());
  EXPECT_EQ(0u, thermalZone.spaces().size());

  EXPECT_TRUE(space1.setThermalZone(thermalZone));
  ASSERT_TRUE(space1.thermalZone());
  EXPECT_EQ(thermalZone.handle(), space1.thermalZone()->handle());
  EXPECT_FALSE(space2.thermalZone());
  EXPECT_EQ(1u, thermalZone.spaces().size());

  ASSERT_TRUE(space1.thermalZone());
  EXPECT_EQ(thermalZone.handle(), space1.thermalZone()->handle());
  EXPECT_TRUE(space2.setThermalZone(thermalZone));
  ASSERT_TRUE(space2.thermalZone());
  EXPECT_EQ(thermalZone.handle(), space2.thermalZone()->handle());
  EXPECT_EQ(2u, thermalZone.spaces().size());

  auto zone = thermalZone.getAirflowNetworkZone();
  auto optzone = thermalZone.airflowNetworkZone();
  ASSERT_TRUE(optzone);
  EXPECT_EQ(zone, optzone.get());

  zone.setFacadeWidth(50.0);
  CurveLinear curve(model);
  curve.setCoefficient1Constant(55.0);
  curve.setCoefficient2x(0.0);

  AirflowNetworkOccupantVentilationControl ovc(model, curve);
  EXPECT_FALSE(zone.occupantVentilationControl());
  EXPECT_TRUE(zone.setOccupantVentilationControl(ovc));
  ASSERT_TRUE(zone.occupantVentilationControl());
  EXPECT_EQ(ovc, zone.occupantVentilationControl().get());

  ThermalZone thermalZoneClone = thermalZone.clone(model).cast<ThermalZone>();
  optzone = thermalZoneClone.airflowNetworkZone();
  ASSERT_TRUE(optzone);
  EXPECT_NE(zone, optzone.get());
  EXPECT_EQ(50.0, optzone.get().facadeWidth());
  ASSERT_TRUE(optzone.get().occupantVentilationControl());
  EXPECT_EQ(ovc, optzone.get().occupantVentilationControl().get());

}
开发者ID:NREL,项目名称:OpenStudio,代码行数:50,代码来源:AirflowNetworkZone_GTest.cpp


注:本文中的ThermalZone::airflowNetworkZone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。