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