本文整理汇总了C++中OSOptionalQuantity::isSet方法的典型用法代码示例。如果您正苦于以下问题:C++ OSOptionalQuantity::isSet方法的具体用法?C++ OSOptionalQuantity::isSet怎么用?C++ OSOptionalQuantity::isSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSOptionalQuantity
的用法示例。
在下文中一共展示了OSOptionalQuantity::isSet方法的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: thermalZone
TEST_F(ModelFixture,ThermalZone_Volume_Quantity) {
Model model;
ThermalZone thermalZone(model);
Unit units = thermalZone.getVolume(true).units(); // Get IP units.
double value(1.0);
Quantity testQ(value,units);
EXPECT_TRUE(thermalZone.setVolume(testQ));
OSOptionalQuantity q = thermalZone.getVolume(true);
ASSERT_TRUE(q.isSet());
EXPECT_NEAR(value,q.get().value(),1.0E-8);
EXPECT_EQ(units.standardString(),q.get().units().standardString());
}
示例5: convert
TEST_F(IdfFixture, IdfObject_GetQuantity)
{
std::string text = "Building, !- Building \n\
Building, !- Name \n\
30., !- North Axis {deg} \n\
City, !- Terrain \n\
0.04, !- Loads Convergence Tolerance Value \n\
0.4, !- Temperature Convergence Tolerance Value {deltaC} \n\
FullExterior, !- Solar Distribution \n\
25; !- Maximum Number of Warmup Days";
// make an idf object
OptionalIdfObject oObj = IdfObject::load(text);
ASSERT_TRUE(oObj);
// Test get.
OSOptionalQuantity ooq = oObj->getQuantity (4);
ASSERT_TRUE(ooq.isSet());
Quantity q = ooq.get();
EXPECT_TRUE(q.value() == 0.4);
EXPECT_TRUE(q.system() == UnitSystem::SI);
EXPECT_TRUE(q.standardUnitsString() == "K");
// Test set.
OptionalQuantity oq = convert(q,UnitSystem(UnitSystem::IP));
ASSERT_TRUE(oq);
EXPECT_TRUE(oq->system() == UnitSystem::IP);
EXPECT_DOUBLE_EQ(0.72,oq->value());
oq->setValue(1.5);
EXPECT_TRUE(oObj->setQuantity(4, *oq));
ooq = oObj->getQuantity(4);
ASSERT_TRUE(ooq.isSet());
q = ooq.get();
EXPECT_DOUBLE_EQ(0.83333333333333333,q.value());
EXPECT_TRUE(q.system() == UnitSystem::SI);
EXPECT_TRUE(q.standardUnitsString() == "K");
}
示例6: setMaximumAirFlowRate
bool AirTerminalSingleDuctUncontrolled_Impl::setMaximumAirFlowRate(const OSOptionalQuantity& maximumAirFlowRate) {
bool result(false);
OptionalDouble value;
if (maximumAirFlowRate.isSet()) {
value = getDoubleFromQuantity(OS_AirTerminal_SingleDuct_UncontrolledFields::MaximumAirFlowRate,maximumAirFlowRate.get());
if (value) {
result = setMaximumAirFlowRate(value);
}
}
else {
result = setMaximumAirFlowRate(value);
}
return result;
}
示例7: setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures
bool SiteWaterMainsTemperature_Impl::setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(const OSOptionalQuantity& maximumDifferenceInMonthlyAverageOutdoorAirTemperatures) {
bool result(false);
OptionalDouble value;
if (maximumDifferenceInMonthlyAverageOutdoorAirTemperatures.isSet()) {
value = getDoubleFromQuantity(OS_Site_WaterMainsTemperatureFields::MaximumDifferenceInMonthlyAverageOutdoorAirTemperatures,maximumDifferenceInMonthlyAverageOutdoorAirTemperatures.get());
if (value) {
result = setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(value);
}
}
else {
result = setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(value);
}
return result;
}
示例8: setOptimumPartLoadRatio
bool BoilerSteam_Impl::setOptimumPartLoadRatio(const OSOptionalQuantity& optimumPartLoadRatio) {
bool result(false);
OptionalDouble value;
if (optimumPartLoadRatio.isSet()) {
value = getDoubleFromQuantity(OS_Boiler_SteamFields::OptimumPartLoadRatio,optimumPartLoadRatio.get());
if (value) {
result = setOptimumPartLoadRatio(value);
}
}
else {
result = setOptimumPartLoadRatio(value);
}
return result;
}
示例9: result
bool GasMixture_Impl::setGas4Fraction(const OSOptionalQuantity& gas4Fraction) {
bool result(false);
OptionalDouble value;
if (gas4Fraction.isSet()) {
value = getDoubleFromQuantity(OS_WindowMaterial_GasMixtureFields::Gas4Fraction,gas4Fraction.get());
if (value) {
result = setGas4Fraction(value);
}
}
else {
result = setGas4Fraction(value);
}
return result;
}
示例10: setSpecificHeatRatio
bool Gas_Impl::setSpecificHeatRatio(const OSOptionalQuantity& specificHeatRatio) {
bool result(false);
OptionalDouble value;
if (specificHeatRatio.isSet()) {
value = getDoubleFromQuantity(OS_WindowMaterial_GasFields::SpecificHeatRatio,specificHeatRatio.get());
if (value) {
result = setSpecificHeatRatio(value);
}
}
else {
result = setSpecificHeatRatio(value);
}
return result;
}
示例11: setMolecularWeight
bool Gas_Impl::setMolecularWeight(const OSOptionalQuantity& molecularWeight) {
bool result(false);
OptionalDouble value;
if (molecularWeight.isSet()) {
value = getDoubleFromQuantity(OS_WindowMaterial_GasFields::MolecularWeight,molecularWeight.get());
if (value) {
result = setMolecularWeight(value);
}
}
else {
result = setMolecularWeight(value);
}
return result;
}
示例12: setThermalResistance
bool AirGap_Impl::setThermalResistance(const OSOptionalQuantity& thermalResistance) {
bool result(false);
OptionalDouble value;
if (thermalResistance.isSet()) {
value = getDoubleFromQuantity(OS_Material_AirGapFields::ThermalResistance,thermalResistance.get());
if (value) {
result = setThermalResistance(value);
}
}
else {
result = setThermalResistance(value);
}
return result;
}
示例13: setViscosityCoefficientA
bool Gas_Impl::setViscosityCoefficientA(const OSOptionalQuantity& viscosityCoefficientA) {
bool result(false);
OptionalDouble value;
if (viscosityCoefficientA.isSet()) {
value = getDoubleFromQuantity(OS_WindowMaterial_GasFields::ViscosityCoefficientA,viscosityCoefficientA.get());
if (value) {
result = setViscosityCoefficientA(value);
}
}
else {
result = setViscosityCoefficientA(value);
}
return result;
}
示例14: setVisibleTransmittance
bool SimpleGlazing_Impl::setVisibleTransmittance(const OSOptionalQuantity& visibleTransmittance) {
bool result(false);
OptionalDouble value;
if (visibleTransmittance.isSet()) {
value = getDoubleFromQuantity(OS_WindowMaterial_SimpleGlazingSystemFields::VisibleTransmittance,visibleTransmittance.get());
if (value) {
result = setVisibleTransmittance(value);
}
}
else {
result = setVisibleTransmittance(value);
}
return result;
}
示例15: setMaximumFlowRate
bool FanConstantVolume_Impl::setMaximumFlowRate(const OSOptionalQuantity& maximumFlowRate) {
bool result(false);
OptionalDouble value;
if (maximumFlowRate.isSet()) {
value = getDoubleFromQuantity(OS_Fan_ConstantVolumeFields::MaximumFlowRate,maximumFlowRate.get());
if (value) {
result = setMaximumFlowRate(value);
}
}
else {
result = setMaximumFlowRate(value);
}
return result;
}