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


C++ OSOptionalQuantity::units方法代码示例

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


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

示例1: sched

TEST_F(ModelFixture,ZoneHVACFourPipeFanCoil_MaximumSupplyAirFlowRate_Quantity) {
  Model model;
  EXPECT_EQ(0u,model.objects().size());
  EXPECT_TRUE(model.versionObject());
  // need schedule
  ScheduleConstant sched(model);
  EXPECT_EQ(1u,model.objects().size());
  sched.setValue(1.0); // Always on
  // need fan
  FanConstantVolume fan(model,sched);
  // need cooling and heating coils
  CoilCoolingWater coolingCoil(model,sched);
  CoilHeatingWater heatingCoil(model,sched);
  // construct object
  ZoneHVACFourPipeFanCoil zoneHVACFourPipeFanCoil(model,sched,fan,coolingCoil,heatingCoil);
  EXPECT_EQ(6u,model.objects().size());

  Unit units = zoneHVACFourPipeFanCoil.getMaximumSupplyAirFlowRate(true).units(); // Get IP units.
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(zoneHVACFourPipeFanCoil.setMaximumSupplyAirFlowRate(testQ));
  OSOptionalQuantity q = zoneHVACFourPipeFanCoil.getMaximumSupplyAirFlowRate(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:26,代码来源:ZoneHVACFourPipeFanCoil_GTest.cpp

示例2: peopleDefinition

TEST_F(ModelFixture,PeopleDefinition_SensibleHeatFraction_Quantity) {
  Model model;
  PeopleDefinition peopleDefinition(model);

  Unit units = peopleDefinition.getSensibleHeatFraction(true).units(); // Get IP units.
  double value(0.5);
  Quantity testQ(value,units);
  EXPECT_TRUE(peopleDefinition.setSensibleHeatFraction(testQ));
  OSOptionalQuantity q = peopleDefinition.getSensibleHeatFraction(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:Rahjou,项目名称:OpenStudio,代码行数:13,代码来源:People_GTest.cpp

示例3: value

TEST_F(ModelFixture,HeatExchangerAirToAirSensibleAndLatent_RateofDefrostTimeFractionIncrease_Quantity) {
  Model model;
  HeatExchangerAirToAirSensibleAndLatent heatExchangerAirToAirSensibleAndLatent(model);

  Unit units = heatExchangerAirToAirSensibleAndLatent.getRateofDefrostTimeFractionIncrease(true).units(); // Get IP units.
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(heatExchangerAirToAirSensibleAndLatent.setRateofDefrostTimeFractionIncrease(testQ));
  OSOptionalQuantity q = heatExchangerAirToAirSensibleAndLatent.getRateofDefrostTimeFractionIncrease(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:13,代码来源:HeatExchangerAirToAirSensibleAndLatent_GTest.cpp

示例4: boilerSteam

TEST_F(ModelFixture,BoilerSteam_MinimumPartLoadRatio_Quantity) {
  Model model;
  // TODO: Check constructor.
  BoilerSteam boilerSteam(model);

  Unit units = boilerSteam.getMinimumPartLoadRatio(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(boilerSteam.setMinimumPartLoadRatio(testQ));
  OSOptionalQuantity q = boilerSteam.getMinimumPartLoadRatio(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:15,代码来源:BoilerSteam_GTest.cpp

示例5: gasMixture

TEST_F(ModelFixture,GasMixture_Gas4Fraction_Quantity) {
  Model model;
  // TODO: Check constructor.
  GasMixture gasMixture(model);

  Unit units = gasMixture.getGas4Fraction(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(gasMixture.setGas4Fraction(testQ));
  OSOptionalQuantity q = gasMixture.getGas4Fraction(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:15,代码来源:GasMixture_GTest.cpp

示例6: airGap

TEST_F(ModelFixture,AirGap_ThermalResistance_Quantity) {
  Model model;
  // TODO: Check constructor.
  AirGap airGap(model);

  Unit units = airGap.getThermalResistance(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(airGap.setThermalResistance(testQ));
  OSOptionalQuantity q = airGap.getThermalResistance(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:15,代码来源:AirGap_GTest.cpp

示例7: scheduleTypeLimits

TEST_F(ModelFixture,ScheduleTypeLimits_UpperLimitValue_Quantity) {
  Model model;
  // TODO: Check constructor.
  ScheduleTypeLimits scheduleTypeLimits(model);

  Unit units = scheduleTypeLimits.getUpperLimitValue(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(scheduleTypeLimits.setUpperLimitValue(testQ));
  OSOptionalQuantity q = scheduleTypeLimits.getUpperLimitValue(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:15,代码来源:ScheduleTypeLimits_GTest.cpp

示例8: zone

TEST_F(ModelFixture,SizingZone_ZoneHeatingSizingFactor_Quantity) {
  Model model;
  ThermalZone zone(model);
  SizingZone sizingZone(model,zone);

  Unit units = sizingZone.getZoneHeatingSizingFactor(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(sizingZone.setZoneHeatingSizingFactor(testQ));
  OSOptionalQuantity q = sizingZone.getZoneHeatingSizingFactor(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:15,代码来源:SizingZone_GTest.cpp

示例9: standardGlazing

TEST_F(ModelFixture,StandardGlazing_VisibleTransmittanceatNormalIncidence_Quantity) {
  Model model;
  // TODO: Check constructor.
  StandardGlazing standardGlazing(model);

  Unit units = standardGlazing.getVisibleTransmittanceatNormalIncidence(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(standardGlazing.setVisibleTransmittanceatNormalIncidence(testQ));
  OSOptionalQuantity q = standardGlazing.getVisibleTransmittanceatNormalIncidence(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:15,代码来源:StandardGlazing_GTest.cpp

示例10: zoneHVACIdealLoadsAirSystem

TEST_F(ModelFixture,ZoneHVACIdealLoadsAirSystem_MaximumHeatingAirFlowRate_Quantity) {
  Model model;
  // TODO: Check constructor.
  ZoneHVACIdealLoadsAirSystem zoneHVACIdealLoadsAirSystem(model);

  Unit units = zoneHVACIdealLoadsAirSystem.getMaximumHeatingAirFlowRate(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(zoneHVACIdealLoadsAirSystem.setMaximumHeatingAirFlowRate(testQ));
  OSOptionalQuantity q = zoneHVACIdealLoadsAirSystem.getMaximumHeatingAirFlowRate(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:pepsi7959,项目名称:OpenStudio,代码行数:15,代码来源:ZoneHVACIdealLoadsAirSystem_GTest.cpp

示例11: simpleGlazing

TEST_F(ModelFixture,SimpleGlazing_VisibleTransmittance_Quantity) {
  Model model;
  // TODO: Check constructor.
  SimpleGlazing simpleGlazing(model);

  Unit units = simpleGlazing.getVisibleTransmittance(true).units(); // Get IP units.

  // Bounds: 0.0 < value < 1.0

  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_FALSE(simpleGlazing.setVisibleTransmittance(testQ));

  double value2(0.1);
  Quantity testQ2(value2,units);
  EXPECT_TRUE(simpleGlazing.setVisibleTransmittance(testQ2));
  OSOptionalQuantity q = simpleGlazing.getVisibleTransmittance(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value2,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:21,代码来源:SimpleGlazing_GTest.cpp

示例12: gas

TEST_F(ModelFixture,Gas_MolecularWeight_Quantity) {
    Model model;
    // TODO: Check constructor.
    Gas gas(model);

    Unit units = gas.getMolecularWeight(true).units(); // Get IP units.

    // Bounds: 20 <= value <= 200)

    double value(1.0);
    Quantity testQ(value,units);
    EXPECT_FALSE(gas.setMolecularWeight(testQ));

    double value2(20.0);
    Quantity testQ2(value2,units);
    EXPECT_TRUE(gas.setMolecularWeight(testQ2));
    OSOptionalQuantity q = gas.getMolecularWeight(true);
    ASSERT_TRUE(q.isSet());
    EXPECT_NEAR(value2,q.get().value(),1.0E-8);
    EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:mattXGS,项目名称:OpenStudio,代码行数:21,代码来源:Gas_GTest.cpp

示例13: blind

TEST_F(ModelFixture,Blind_BackSideSlatDiffuseVisibleReflectance_Quantity) {
  Model model;
  // TODO: Check constructor.
  Blind blind(model);

  Unit units = blind.getBackSideSlatDiffuseVisibleReflectance(true).units(); // Get IP units.

  // Bounds: 0.0 <= value < 1.0

  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_FALSE(blind.setBackSideSlatDiffuseVisibleReflectance(testQ));

  double value2(0.1);
  Quantity testQ2(value2,units);
  EXPECT_TRUE(blind.setBackSideSlatDiffuseVisibleReflectance(testQ2));
  OSOptionalQuantity q = blind.getBackSideSlatDiffuseVisibleReflectance(true);
  ASSERT_TRUE(q.isSet());
  EXPECT_NEAR(value2,q.get().value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:21,代码来源:Blind_GTest.cpp

示例14: setPerimeterExposed

 bool FFactorGroundFloorConstruction_Impl::setPerimeterExposed(double perimeterExposed) {
   OSOptionalQuantity temp = getQuantity(OS_Construction_FfactorGroundFloorFields::PerimeterExposed,true,false);
   bool result = setPerimeterExposed(Quantity(perimeterExposed,temp.units()));
   return result;
 }
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:5,代码来源:FFactorGroundFloorConstruction.cpp

示例15: setArea

 bool FFactorGroundFloorConstruction_Impl::setArea(double area) {
   OSOptionalQuantity temp = getQuantity(OS_Construction_FfactorGroundFloorFields::Area,true,false);
   bool result = setArea(Quantity(area,temp.units()));
   return result;
 }
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:5,代码来源:FFactorGroundFloorConstruction.cpp


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