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


C++ ModelObject::get方法代码示例

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


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

示例1: idfObject

boost::optional<IdfObject> ForwardTranslator::translateCoilHeatingDXSingleSpeedWithoutUnitary( CoilHeatingDXSingleSpeed & modelObject )
{
  boost::optional<std::string> s;
  boost::optional<double> value;

  IdfObject idfObject(IddObjectType::Coil_Heating_DX_SingleSpeed);

  m_idfObjects.push_back(idfObject);

  // Name

  s = modelObject.name();
  if( s )
  {
    idfObject.setName(*s);
  }

  // AvailabilityScheduleName

  if( boost::optional<Schedule> schedule = modelObject.availabilitySchedule() )
  {
    if( boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get()) )
    {
      idfObject.setString(Coil_Heating_DX_SingleSpeedFields::AvailabilityScheduleName,_schedule->name().get());
    }
  }

  // AirInletNodeName

  boost::optional<std::string> airInletNodeName;

  if( boost::optional<ModelObject> mo = modelObject.inletModelObject() )
  {
    if( boost::optional<Node> node = mo->optionalCast<Node>() )
    {
      if( (s = node->name()) )
      {
        airInletNodeName = s;

        idfObject.setString(Coil_Heating_DX_SingleSpeedFields::AirInletNodeName,s.get());
      }
    }
  }

  // AirOutletNodeName

  boost::optional<std::string> airOutletNodeName;

  if( boost::optional<ModelObject> mo = modelObject.outletModelObject() )
  {
    if( boost::optional<Node> node = mo->optionalCast<Node>() )
    {
      if( (s = node->name()) )
      {
        airOutletNodeName = s;

        idfObject.setString(Coil_Heating_DX_SingleSpeedFields::AirOutletNodeName,s.get());
      }
    }
  }

  // RatedTotalHeatingCapacity

  if( modelObject.isRatedTotalHeatingCapacityAutosized() )
  {
    idfObject.setString(Coil_Heating_DX_SingleSpeedFields::RatedTotalHeatingCapacity,"Autosize");
  }
  else if( (value = modelObject.ratedTotalHeatingCapacity()) )
  {
    idfObject.setDouble(Coil_Heating_DX_SingleSpeedFields::RatedTotalHeatingCapacity,value.get());
  }

  // RatedCOP
  
  if( (value = modelObject.ratedCOP()) )
  {
    idfObject.setDouble(Coil_Heating_DX_SingleSpeedFields::RatedCOP,value.get());
  }

  // RatedAirFlowRate

  if( modelObject.isRatedAirFlowRateAutosized() )
  {
    idfObject.setString(Coil_Heating_DX_SingleSpeedFields::RatedAirFlowRate,"Autosize");
  }
  else if( (value = modelObject.ratedAirFlowRate()) )
  {
    idfObject.setDouble(Coil_Heating_DX_SingleSpeedFields::RatedAirFlowRate,value.get());
  }

  // TotalHeatingCapacityFunctionofTemperatureCurveName

  ModelObject curve = modelObject.totalHeatingCapacityFunctionofTemperatureCurve();

  if( boost::optional<IdfObject> _curve = translateAndMapModelObject(curve) )
  {
    idfObject.setString(Coil_Heating_DX_SingleSpeedFields::TotalHeatingCapacityFunctionofTemperatureCurveName,_curve->name().get());
  }

  // TotalHeatingCapacityFunctionofFlowFractionCurveName
//.........这里部分代码省略.........
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateCoilHeatingDXSingleSpeed.cpp


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