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


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

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


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

示例1: wl

bool operator==(const Quantity& lQuantity,const Quantity& rQuantity) {
  if ((lQuantity.system() == rQuantity.system()) && (lQuantity.units() == rQuantity.units())) {
    Quantity wl(lQuantity), wr(rQuantity);
    wl.setScale(0);
    wr.setScale(0);
    return equal(wl.value(),wr.value());
  }
  return false;
}
开发者ID:urbanengr,项目名称:OpenStudio,代码行数:9,代码来源:Quantity.cpp

示例2: sched

TEST_F(ModelFixture,ZoneHVACFourPipeFanCoil_MediumSpeedSupplyAirFlowRatio_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.getMediumSpeedSupplyAirFlowRatio(true).units(); // Get IP units.
  double value(0.66);
  Quantity testQ(value,units);
  EXPECT_TRUE(zoneHVACFourPipeFanCoil.setMediumSpeedSupplyAirFlowRatio(testQ));
  Quantity q = zoneHVACFourPipeFanCoil.getMediumSpeedSupplyAirFlowRatio(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:25,代码来源:ZoneHVACFourPipeFanCoil_GTest.cpp

示例3: push_back

void OSQuantityVector::push_back(Quantity q) {
  if (!(q.units() == units())) {
    LOG_AND_THROW("Quantity " << q << " is incompatible with this OSQuantityVector, which has "
                  "units " << units() << ".");
  }
  else if (q.scale() != scale()) {
    q.setScale(scale().exponent);
  }
  m_values.push_back(q.value());
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:10,代码来源:OSQuantityVector.cpp

示例4: value

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

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

示例5: thermalZone

TEST_F(ModelFixture,ThermalZone_FractionofZoneControlledbySecondaryDaylightingControl_Quantity) {
  Model model;
  ThermalZone thermalZone(model);

  Unit units = thermalZone.getFractionofZoneControlledbySecondaryDaylightingControl(true).units(); // Get IP units.
  double value(0.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(thermalZone.setFractionofZoneControlledbySecondaryDaylightingControl(testQ));
  Quantity q = thermalZone.getFractionofZoneControlledbySecondaryDaylightingControl(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:urbanengr,项目名称:OpenStudio,代码行数:12,代码来源:ThermalZone_GTest.cpp

示例6: peopleDefinition

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

  Unit units = peopleDefinition.getCarbonDioxideGenerationRate(true).units(); // Get IP units.
  double value(1.0E-7);
  Quantity testQ(value,units);
  EXPECT_TRUE(peopleDefinition.setCarbonDioxideGenerationRate(testQ));
  Quantity q = peopleDefinition.getCarbonDioxideGenerationRate(true);
  EXPECT_NEAR(value,q.value(),1.0E-15);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:Rahjou,项目名称:OpenStudio,代码行数:12,代码来源:People_GTest.cpp

示例7: value

TEST_F(ModelFixture,ZoneCapacitanceMultiplierResearchSpecial_TemperatureCapacityMultiplier_Quantity) {
  Model model;
  // TODO: Check constructor.
  ZoneCapacitanceMultiplierResearchSpecial zoneCapacitanceMultiplierResearchSpecial = model.getUniqueModelObject<ZoneCapacitanceMultiplierResearchSpecial>();
  Unit units = zoneCapacitanceMultiplierResearchSpecial.getTemperatureCapacityMultiplier(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(zoneCapacitanceMultiplierResearchSpecial.setTemperatureCapacityMultiplier(testQ));
  Quantity q = zoneCapacitanceMultiplierResearchSpecial.getTemperatureCapacityMultiplier(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:13,代码来源:ZoneCapacitanceMultiplierResearchSpecial_GTest.cpp

示例8: zone

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

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

示例9: value

TEST_F(ModelFixture,SimulationControl_TemperatureConvergenceToleranceValue_Quantity) {
  Model model;

  SimulationControl simulationControl = model.getUniqueModelObject<SimulationControl>();

  Unit units = simulationControl.getTemperatureConvergenceToleranceValue(true).units(); // Get IP units.

  double value(0.3);
  Quantity testQ(value,units);
  EXPECT_TRUE(simulationControl.setTemperatureConvergenceToleranceValue(testQ));
  Quantity q = simulationControl.getTemperatureConvergenceToleranceValue(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:14,代码来源:SimulationControl_GTest.cpp

示例10: masslessOpaqueMaterial

TEST_F(ModelFixture,MasslessOpaqueMaterial_SolarAbsorptance_Quantity) {
  Model model;
  // TODO: Check constructor.
  MasslessOpaqueMaterial masslessOpaqueMaterial(model);

  Unit units = masslessOpaqueMaterial.getSolarAbsorptance(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(masslessOpaqueMaterial.setSolarAbsorptance(testQ));
  Quantity q = masslessOpaqueMaterial.getSolarAbsorptance(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:14,代码来源:MasslessOpaqueMaterial_GTest.cpp

示例11: roofVegetation

TEST_F(ModelFixture,RoofVegetation_LeafEmissivity_Quantity) {
  Model model;
  // TODO: Check constructor.
  RoofVegetation roofVegetation(model);

  Unit units = roofVegetation.getLeafEmissivity(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(roofVegetation.setLeafEmissivity(testQ));
  Quantity q = roofVegetation.getLeafEmissivity(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:14,代码来源:RoofVegetation_GTest.cpp

示例12: value

TEST_F(ModelFixture,RadianceParameters_DirectPretest_Quantity) {
  Model model;
  // TODO: Check constructor.
  RadianceParameters radianceParameters = model.getUniqueModelObject<RadianceParameters>();

  Unit units = radianceParameters.getDirectPretest(true).units(); // Get IP units.
  // TODO: Check that value is appropriate (within bounds)
  double value(1.0);
  Quantity testQ(value,units);
  EXPECT_TRUE(radianceParameters.setDirectPretest(testQ));
  Quantity q = radianceParameters.getDirectPretest(true);
  EXPECT_NEAR(value,q.value(),1.0E-8);
  EXPECT_EQ(units.standardString(),q.units().standardString());
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:14,代码来源:RadianceParameters_GTest.cpp

示例13: boilerSteam

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

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

示例14: standardGlazing

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

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

示例15: zoneHVACIdealLoadsAirSystem

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

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


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