本文整理汇总了C++中OptionalModelObject::get方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionalModelObject::get方法的具体用法?C++ OptionalModelObject::get怎么用?C++ OptionalModelObject::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionalModelObject
的用法示例。
在下文中一共展示了OptionalModelObject::get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _airDistributionUnit
boost::optional<IdfObject> ForwardTranslator::translateAirTerminalSingleDuctConstantVolumeFourPipeInduction( AirTerminalSingleDuctConstantVolumeFourPipeInduction & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
IdfObject _airDistributionUnit(openstudio::IddObjectType::ZoneHVAC_AirDistributionUnit);
_airDistributionUnit.setName(modelObject.name().get() + " Air Distribution Unit");
m_idfObjects.push_back(_airDistributionUnit);
// Name
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::AirTerminal_SingleDuct_ConstantVolume_FourPipeInduction, modelObject);
// Availability Schedule Name
if( (temp = modelObject.availabilitySchedule()) )
{
if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(temp.get()) )
{
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::AvailabilityScheduleName,_schedule->name().get());
}
}
// Maximum Total Air Flow Rate
if( (d = modelObject.maximumTotalAirFlowRate()) )
{
idfObject.setDouble(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::MaximumTotalAirFlowRate,d.get());
}
else if( modelObject.isMaximumTotalAirFlowRateAutosized() )
{
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::MaximumTotalAirFlowRate,"Autosize");
}
// Induction Ratio
if( (d = modelObject.inductionRatio()) )
{
idfObject.setDouble(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::InductionRatio,d.get());
}
// Supply Air Inlet Node Name
if( auto node = modelObject.inletModelObject() ) {
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::SupplyAirInletNodeName,node->name().get());
}
// Induced Air Inlet Node Name
if( auto node = modelObject.inducedAirInletNode() ) {
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::InducedAirInletNodeName,node->name().get());
}
// Air Outlet Node Name
if( auto node = modelObject.outletModelObject() ) {
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::AirOutletNodeName,node->name().get());
}
// Hot Water Inlet Node Name
// deprecated
// Cold Water Inlet Node Name
//deprecated
// Heating Coil Object Type
// Heating Coil Name
boost::optional<IdfObject> _heatingCoil;
{
auto heatingCoil = modelObject.heatingCoil();
if( (_heatingCoil = translateAndMapModelObject(heatingCoil)) ) {
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::HeatingCoilObjectType,_heatingCoil->iddObject().name());
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::HeatingCoilName,_heatingCoil->name().get());
}
}
// Maximum Hot Water Flow Rate
if( (d = modelObject.maximumHotWaterFlowRate()) )
{
idfObject.setDouble(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::MaximumHotWaterFlowRate,d.get());
}
else if( modelObject.isMaximumHotWaterFlowRateAutosized() )
{
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::MaximumHotWaterFlowRate,"Autosize");
}
// Minimum Hot Water Flow Rate
if( (d = modelObject.minimumHotWaterFlowRate()) )
{
idfObject.setDouble(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::MinimumHotWaterFlowRate,d.get());
}
// Heating Convergence Tolerance
if( (d = modelObject.heatingConvergenceTolerance()) )
{
idfObject.setDouble(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::HeatingConvergenceTolerance,d.get());
}
// Cooling Coil Object Type
// Cooling Coil Name
boost::optional<IdfObject> _coolingCoil;
if( auto coolingCoil = modelObject.coolingCoil() ) {
if( (_coolingCoil = translateAndMapModelObject(coolingCoil.get())) ) {
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::CoolingCoilObjectType,_coolingCoil->iddObject().name());
idfObject.setString(AirTerminal_SingleDuct_ConstantVolume_FourPipeInductionFields::CoolingCoilName,_coolingCoil->name().get());
}
//.........这里部分代码省略.........
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateAirTerminalSingleDuctConstantVolumeFourPipeInduction.cpp
示例2: idfObject
boost::optional<IdfObject> ForwardTranslator::translateCoolingTowerSingleSpeed( CoolingTowerSingleSpeed & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
// Create a new IddObjectType::Fan_ConstantVolume
IdfObject idfObject(IddObjectType::CoolingTower_SingleSpeed);
m_idfObjects.push_back(idfObject);
// Name
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
// WaterInletNodeName
temp = modelObject.inletModelObject();
if(temp)
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::WaterInletNodeName,temp->name().get());
}
// WaterOutletNodeName
temp = modelObject.outletModelObject();
if(temp)
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::WaterOutletNodeName,temp->name().get());
}
// DesignWaterFlowRate
if( istringEqual(modelObject.performanceInputMethod(),"NominalCapacity") )
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::DesignWaterFlowRate,"");
}
else
{
if( (d = modelObject.designWaterFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_SingleSpeedFields::DesignWaterFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::DesignWaterFlowRate,"Autosize");
}
}
// DesignAirFlowRate
if( (d = modelObject.designAirFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_SingleSpeedFields::DesignAirFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::DesignAirFlowRate,"Autosize");
}
// FanPoweratDesignAirFlowRate
if( (d = modelObject.fanPoweratDesignAirFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_SingleSpeedFields::FanPoweratDesignAirFlowRate,d.get());
}
else if( modelObject.isFanPoweratDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::FanPoweratDesignAirFlowRate,"Autosize");
}
// UFactorTimesAreaValueatDesignAirFlowRate
if( (d = modelObject.uFactorTimesAreaValueatDesignAirFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_SingleSpeedFields::UFactorTimesAreaValueatDesignAirFlowRate,d.get());
}
else if( modelObject.isUFactorTimesAreaValueatFreeConvectionAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::UFactorTimesAreaValueatDesignAirFlowRate,"Autosize");
}
// AirFlowRateinFreeConvectionRegime
if( (d = modelObject.airFlowRateinFreeConvectionRegime()) )
{
idfObject.setDouble(openstudio::CoolingTower_SingleSpeedFields::AirFlowRateinFreeConvectionRegime,d.get());
}
else if( modelObject.isAirFlowRateinFreeConvectionRegimeAutosized() )
{
idfObject.setString(openstudio::CoolingTower_SingleSpeedFields::AirFlowRateinFreeConvectionRegime,"Autosize");
}
// UFactorTimesAreaValueatFreeConvectionAirFlowRate
if( (d = modelObject.uFactorTimesAreaValueatFreeConvectionAirFlowRate()) )
//.........这里部分代码省略.........
示例3: if
boost::optional<IdfObject> ForwardTranslator::translateHumidifierSteamElectric( HumidifierSteamElectric & modelObject )
{
OptionalDouble d;
OptionalModelObject temp;
// Name
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Humidifier_Steam_Electric, modelObject);
// Availability Schedule Name
if( (temp = modelObject.availabilitySchedule()) )
{
if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(temp.get()) )
{
idfObject.setString(Humidifier_Steam_ElectricFields::AvailabilityScheduleName,_schedule->name().get());
}
}
// Rated Capacity
if( modelObject.isRatedCapacityAutosized() ) {
idfObject.setString(Humidifier_Steam_ElectricFields::RatedCapacity,"Autosize");
} if( (d = modelObject.ratedCapacity()) ) {
idfObject.setDouble(Humidifier_Steam_ElectricFields::RatedCapacity,d.get());
}
// Rated Power
if( (d = modelObject.ratedPower()) )
{
idfObject.setDouble(Humidifier_Steam_ElectricFields::RatedPower,d.get());
}
else if( modelObject.isRatedPowerAutosized() )
{
idfObject.setString(Humidifier_Steam_ElectricFields::RatedPower,"Autosize");
}
// Rated Fan Power
if( (d = modelObject.ratedFanPower()) )
{
idfObject.setDouble(Humidifier_Steam_ElectricFields::RatedFanPower,d.get());
}
// Standby Power
if( (d = modelObject.standbyPower()) )
{
idfObject.setDouble(Humidifier_Steam_ElectricFields::StandbyPower,d.get());
}
// Air Inlet Node Name
temp = modelObject.inletModelObject();
if(temp)
{
idfObject.setString(Humidifier_Steam_ElectricFields::AirInletNodeName,temp->name().get());
}
// Air Outlet Node Name
temp = modelObject.outletModelObject();
if(temp)
{
idfObject.setString(Humidifier_Steam_ElectricFields::AirOutletNodeName,temp->name().get());
}
// Water Storage Tank Name
// not currently used
return idfObject;
}
示例4: idfObject
boost::optional<IdfObject> ForwardTranslator::translateCoolingTowerVariableSpeed( CoolingTowerVariableSpeed & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
IdfObject idfObject(IddObjectType::CoolingTower_VariableSpeed);
m_idfObjects.push_back(idfObject);
// Name
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
// WaterInletNodeName
temp = modelObject.inletModelObject();
if(temp)
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::WaterInletNodeName,temp->name().get());
}
// WaterOutletNodeName
temp = modelObject.outletModelObject();
if(temp)
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::WaterOutletNodeName,temp->name().get());
}
// ModelType
if( s = modelObject.modelType() )
{
idfObject.setString(CoolingTower_VariableSpeedFields::ModelType,s.get());
}
// ModelCoefficient
if( boost::optional<ModelObject> mo = modelObject.modelCoefficient() )
{
if( boost::optional<IdfObject> _mo = translateAndMapModelObject(mo.get()) )
{
idfObject.setString(CoolingTower_VariableSpeedFields::ModelCoefficientName,_mo->name().get());
}
}
// DesignInletAirWetBulbTemperature
if( d = modelObject.designInletAirWetBulbTemperature() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignInletAirWetBulbTemperature,d.get());
}
// DesignApproachTemperature
if( d = modelObject.designApproachTemperature() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignApproachTemperature,d.get());
}
// DesignRangeTemperature
if( d = modelObject.designRangeTemperature() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignRangeTemperature,d.get());
}
// DesignWaterFlowRate
if( (d = modelObject.designWaterFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_VariableSpeedFields::DesignWaterFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::DesignWaterFlowRate,"Autosize");
}
// DesignAirFlowRate
if( (d = modelObject.designAirFlowRate()) )
{
idfObject.setDouble(openstudio::CoolingTower_VariableSpeedFields::DesignAirFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::CoolingTower_VariableSpeedFields::DesignAirFlowRate,"Autosize");
}
// DesignFanPower
if( d = modelObject.designFanPower() )
{
idfObject.setDouble(CoolingTower_VariableSpeedFields::DesignFanPower,d.get());
}
//.........这里部分代码省略.........
示例5: idfObject
boost::optional<IdfObject> ForwardTranslator::translateEvaporativeFluidCoolerSingleSpeed( EvaporativeFluidCoolerSingleSpeed & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
// Create a new IddObjectType::Evaporative_FluidCoolerSingleSpeed
IdfObject idfObject(IddObjectType::EvaporativeFluidCooler_SingleSpeed);
m_idfObjects.push_back(idfObject);
//Name
s = modelObject.name();
if(s)
{
idfObject.setName(*s);
}
// WaterInletNodeName
temp = modelObject.inletModelObject();
if(temp)
{
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::WaterInletNodeName,temp->name().get());
}
// WaterOutletNodeName
temp = modelObject.outletModelObject();
if(temp)
{
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::WaterOutletNodeName,temp->name().get());
}
// DesignAirFlowRate
if( (d = modelObject.designAirFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignAirFlowRate,d.get());
}
else if( modelObject.isDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignAirFlowRate,"Autosize");
}
// FanPoweratDesignAirFlowRate
if( (d = modelObject.fanPoweratDesignAirFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignAirFlowRateFanPower,d.get());
}
else if( modelObject.isFanPoweratDesignAirFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignAirFlowRateFanPower,"Autosize");
}
// DesignWaterFlowRate
if( (d = modelObject.designWaterFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignWaterFlowRate,d.get());
}
else if( modelObject.isDesignWaterFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignWaterFlowRate,"Autosize");
}
// DesignSprayWaterFlowRate
if( (d = modelObject.designSprayWaterFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_SingleSpeedFields::DesignSprayWaterFlowRate,d.get());
}
// PerformanceInputMethod
if( (s = modelObject.performanceInputMethod()) )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::PerformanceInputMethod,s.get());
}
// OutdoorAirInletNodeName
idfObject.setString(openstudio::EvaporativeFluidCooler_SingleSpeedFields::OutdoorAirInletNodeName,"");
// StandardDesignCapacity
if( (d = modelObject.standardDesignCapacity()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_SingleSpeedFields::StandardDesignCapacity,d.get());
}
// UFactorTimesAreaValueatDesignAirFlowRate
if( (d = modelObject.ufactorTimesAreaValueatDesignAirFlowRate()) )
{
//.........这里部分代码省略.........
示例6: if
boost::optional<IdfObject> ForwardTranslator::translateEvaporativeFluidCoolerTwoSpeed( EvaporativeFluidCoolerTwoSpeed & modelObject )
{
OptionalString s;
OptionalDouble d;
OptionalModelObject temp;
//Name
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::EvaporativeFluidCooler_TwoSpeed, modelObject);
// WaterInletNodeName
temp = modelObject.inletModelObject();
if(temp) {
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::WaterInletNodeName,temp->name().get());
}
// WaterOutletNodeName
temp = modelObject.outletModelObject();
if(temp) {
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::WaterOutletNodeName,temp->name().get());
}
// HighFanSpeedAirFlowRate
if( modelObject.isHighFanSpeedAirFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedAirFlowRate,"Autosize");
}
else if( (d = modelObject.highFanSpeedAirFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedAirFlowRate,d.get());
}
// HighFanSpeedFanPower
if( modelObject.isHighFanSpeedFanPowerAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedFanPower,"Autosize");
}
else if( (d = modelObject.highFanSpeedFanPower()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighFanSpeedFanPower,d.get());
}
// LowFanSpeedAirFlowRate
if( modelObject.isLowFanSpeedAirFlowRateAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRate,"Autocalculate");
}
else if( (d = modelObject.lowFanSpeedAirFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRate,d.get());
}
// LowFanSpeedAirFlowRateSizingFactor
if( (d = modelObject.lowFanSpeedAirFlowRateSizingFactor()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedAirFlowRateSizingFactor,d.get());
}
// LowFanSpeedFanPower
if( modelObject.isLowFanSpeedFanPowerAutosized() )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPower,"Autocalculate");
}
else if( (d = modelObject.lowFanSpeedFanPower()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPower,d.get());
}
// LowFanSpeedFanPowerSizingFactor
if( (d = modelObject.lowFanSpeedFanPowerSizingFactor()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::LowFanSpeedFanPowerSizingFactor,d.get());
}
// DesignSprayWaterFlowRate
if( (d = modelObject.designSprayWaterFlowRate()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::DesignSprayWaterFlowRate,d.get());
}
// PerformanceInputMethod
if( (s = modelObject.performanceInputMethod()) )
{
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::PerformanceInputMethod,s.get());
}
// OutdoorAirInletNodeName
idfObject.setString(openstudio::EvaporativeFluidCooler_TwoSpeedFields::OutdoorAirInletNodeName,"");
// HeatRejectionCapacityandNominalCapacitySizingRatio
if( (d = modelObject.heatRejectionCapacityandNominalCapacitySizingRatio()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HeatRejectionCapacityandNominalCapacitySizingRatio,d.get());
}
// HighSpeedStandardDesignCapacity
if( (d = modelObject.highSpeedStandardDesignCapacity()) )
{
idfObject.setDouble(openstudio::EvaporativeFluidCooler_TwoSpeedFields::HighSpeedStandardDesignCapacity,d.get());
}
//.........这里部分代码省略.........