本文整理汇总了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;
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}