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


C++ OptionalModelObject::name方法代码示例

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


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

示例1: idfObject

boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACZoneMixer( AirLoopHVACZoneMixer & modelObject )
{
  std::string s;
  OptionalString optS;
  OptionalModelObject temp;

  IdfObject idfObject(openstudio::IddObjectType::AirLoopHVAC_ZoneMixer);

  m_idfObjects.push_back(idfObject);

  ///////////////////////////////////////////////////////////////////////////
  // Field: Name ////////////////////////////////////////////////////////////
  s = modelObject.name().get();
  idfObject.setName(s);

  ////////////////////////////////////////////////////////////////////////////
  // Field: Outlet Node Name /////////////////////////////////////////////////
  temp = modelObject.outletModelObject();
  if(temp)
  {
    optS = temp->name();
    if(optS)
      idfObject.setString(openstudio::AirLoopHVAC_ZoneMixerFields::OutletNodeName,*optS);
  }
  ///////////////////////////////////////////////////////////////////////////
  // Field: Inlet 1-N Node Name ///////////////////////////////////////////////
  std::vector<ModelObject> inletModelObjects = modelObject.inletModelObjects();
  int i = 2;
  for( std::vector<ModelObject>::iterator it = inletModelObjects.begin();
       it < inletModelObjects.end();
       ++it )
  {
    optS = it->name();
    if(optS)
    {
      idfObject.setString(i,*optS);
    }
    i++;
  }

  return boost::optional<IdfObject>(idfObject);
}
开发者ID:CraigCasey,项目名称:OpenStudio,代码行数:42,代码来源:ForwardTranslateAirLoopHVACZoneMixer.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()) )
//.........这里部分代码省略.........
开发者ID:CraigCasey,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateCoolingTowerSingleSpeed.cpp

示例3: idfObject

boost::optional<IdfObject> ForwardTranslator::translateFanVariableVolume( FanVariableVolume& modelObject )
{
  OptionalString s;
  OptionalDouble d;
  OptionalModelObject temp;

  // Create a new IddObjectType::Fan_VariableVolume
  IdfObject idfObject(IddObjectType::Fan_VariableVolume);

  m_idfObjects.push_back(idfObject);

  // Field: Name ////////////////////////////////////////////////////////////
  s = modelObject.name();
  if(s)
  {
    idfObject.setName(*s);
  }

  // AvailabilityScheduleName

  if( boost::optional<model::AirLoopHVAC> airLoopHVAC = modelObject.airLoopHVAC() )
  {
    Schedule sched = airLoopHVAC->availabilitySchedule();
    boost::optional<IdfObject> schedIdf = translateAndMapModelObject(sched);
    if( schedIdf )
    {
      idfObject.setString(Fan_VariableVolumeFields::AvailabilityScheduleName,schedIdf->name().get());
    }
  }
  else
  {
    Schedule sched = modelObject.availabilitySchedule();
    translateAndMapModelObject(sched);
    idfObject.setString(Fan_VariableVolumeFields::AvailabilityScheduleName,sched.name().get());
  }

  // Fan Efficiency /////////////////////////////////////////////////////////
  idfObject.setDouble(openstudio::Fan_VariableVolumeFields::FanTotalEfficiency,modelObject.fanEfficiency());

  // Pressure Rise //////////////////////////////////////////////////////////
  idfObject.setDouble(openstudio::Fan_VariableVolumeFields::PressureRise,modelObject.pressureRise());

  // Maximum Flow Rate //////////////////////////////////////////////////////
  if( modelObject.isMaximumFlowRateAutosized() )
  {
    idfObject.setString(openstudio::Fan_VariableVolumeFields::MaximumFlowRate,"AutoSize");
  }
  else if( (d = modelObject.maximumFlowRate()) )
  {
    idfObject.setDouble(openstudio::Fan_VariableVolumeFields::MaximumFlowRate,d.get());
  }

  // FanPowerMinimumFlowRateInputMethod
  if( (s = modelObject.fanPowerMinimumFlowRateInputMethod()) )
  {
    idfObject.setString(Fan_VariableVolumeFields::FanPowerMinimumFlowRateInputMethod,s.get());
  }

  // FanPowerMinimumFlowFraction
  if( (d = modelObject.fanPowerMinimumFlowFraction()) )
  {
    idfObject.setDouble(Fan_VariableVolumeFields::FanPowerMinimumFlowFraction,d.get());
  }

  // FanPowerMinimumAirFlowRate

  if( (d = modelObject.fanPowerMinimumAirFlowRate()) )
  {
    idfObject.setDouble(Fan_VariableVolumeFields::FanPowerMinimumAirFlowRate,d.get());
  }

  // Motor Efficiency ///////////////////////////////////////////////////////
  idfObject.setDouble(openstudio::Fan_VariableVolumeFields::MotorEfficiency,modelObject.motorEfficiency());

  // FanPowerCoefficient1

  if( (d = modelObject.fanPowerCoefficient1()) )
  {
    idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient1,d.get());
  }

  // FanPowerCoefficient2

  if( (d = modelObject.fanPowerCoefficient2()) )
  {
    idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient2,d.get());
  }

  // FanPowerCoefficient3

  if( (d = modelObject.fanPowerCoefficient3()) )
  {
    idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient3,d.get());
  }

  // FanPowerCoefficient4

  if( (d = modelObject.fanPowerCoefficient4()) )
  {
    idfObject.setDouble(Fan_VariableVolumeFields::FanPowerCoefficient4,d.get());
//.........这里部分代码省略.........
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateFanVariableVolume.cpp

示例4: idfObject

boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXTwoSpeedWithoutUnitary( model::CoilCoolingDXTwoSpeed & modelObject )
{
  //setup two boost optionals to use to store get method returns
  boost::optional<std::string> s;
  boost::optional<double> d;

  //create the IdfObject that will be the coil
  IdfObject idfObject(IddObjectType::Coil_Cooling_DX_TwoSpeed);

  //Name
  m_idfObjects.push_back(idfObject);
  s = modelObject.name();
  if( s )
  {
    idfObject.setName(*s);
  }

  //  A2 , \field Availability Schedule Name
  Schedule sched = modelObject.getAvailabilitySchedule();
  translateAndMapModelObject(sched);
  idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::AvailabilityScheduleName,
                      sched.name().get() );

  //  N1 , \field Rated High Speed Total Cooling Capacity
  d = modelObject.getRatedHighSpeedTotalCoolingCapacity();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedTotalCoolingCapacity,*d);
  }
  else
  {
    idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedTotalCoolingCapacity,"Autosize");
  }

  //  N2 , \field Rated High Speed Sensible Heat Ratio
  d = modelObject.getRatedHighSpeedSensibleHeatRatio();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedSensibleHeatRatio,*d);
  }
  else
  {
    idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedSensibleHeatRatio,"Autosize");
  }

  //  N3 , \field Rated High Speed COP
  d = modelObject.getRatedHighSpeedCOP();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedCOP,*d);
  }

  //  N4 , \field Rated High Speed Air Flow Rate
  d = modelObject.getRatedHighSpeedAirFlowRate();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedAirFlowRate,*d);
  }
  else
  {
    idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::RatedHighSpeedAirFlowRate,"Autosize");
  }

  //A3 , \field Air Inlet Node Name
  OptionalModelObject omo = modelObject.inletModelObject();
  if( omo )
  {
    translateAndMapModelObject(*omo);
    s = omo->name();
    if(s)
    {
      idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::AirInletNodeName,*s );
    }
  }

  //A4 , \field Air Outlet Node Name
  omo= modelObject.outletModelObject();
  if( omo )
  {
    translateAndMapModelObject(*omo);
    s = omo->name();
    if(s)
    {
      idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::AirOutletNodeName,*s);
    }
  }

  //  A5 , \field Total Cooling Capacity Function of Temperature Curve Name
  Curve cb =  modelObject.getTotalCoolingCapacityFunctionOfTemperatureCurve();
  translateAndMapModelObject(cb);
  idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::TotalCoolingCapacityFunctionofTemperatureCurveName,
                     cb.name().get());

  //  A6 , \field Total Cooling Capacity Function of Flow Fraction Curve Name
  cb =  modelObject.getTotalCoolingCapacityFunctionOfFlowFractionCurve();
  translateAndMapModelObject(cb);
  idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::TotalCoolingCapacityFunctionofFlowFractionCurveName,
                     cb.name().get());

  //  A7 , \field Energy Input Ratio Function of Temperature Curve Name
//.........这里部分代码省略.........
开发者ID:Zicao,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateCoilCoolingDXTwoSpeed.cpp

示例5: idfObject

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

  IdfObject idfObject(IddObjectType::AirConditioner_VariableRefrigerantFlow);

  m_idfObjects.push_back(idfObject);

  // Name

  s = modelObject.name();
  if( s )
  {
    idfObject.setString(AirConditioner_VariableRefrigerantFlowFields::HeatPumpName,*s);
  }

  // AvailabilityScheduleName

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

  // RatedTotalCoolingCapacity

  if( modelObject.isRatedTotalCoolingCapacityAutosized() )
  {
    idfObject.setString(AirConditioner_VariableRefrigerantFlowFields::GrossRatedTotalCoolingCapacity,"Autosize");
  }
  else if( (value = modelObject.ratedTotalCoolingCapacity()) )
  {
    idfObject.setDouble(AirConditioner_VariableRefrigerantFlowFields::GrossRatedTotalCoolingCapacity,value.get());
  }

  // RatedCoolingCOP

  if( (value = modelObject.ratedCoolingCOP()) )
  {
    idfObject.setDouble(AirConditioner_VariableRefrigerantFlowFields::GrossRatedCoolingCOP,value.get());
  }

  // MinimumOutdoorTemperatureinCoolingMode

  if( (value = modelObject.minimumOutdoorTemperatureinCoolingMode()) )
  {
    idfObject.setDouble(AirConditioner_VariableRefrigerantFlowFields::MinimumOutdoorTemperatureinCoolingMode,value.get());
  }

  // MaximumOutdoorTemperatureinCoolingMode

  if( (value = modelObject.maximumOutdoorTemperatureinCoolingMode()) )
  {
    idfObject.setDouble(AirConditioner_VariableRefrigerantFlowFields::MaximumOutdoorTemperatureinCoolingMode,value.get());
  }


  // CoolingCapacityRatioModifierFunctionofLowTemperatureCurveName

  if( boost::optional<model::CurveBiquadratic> curve = modelObject.coolingCapacityRatioModifierFunctionofLowTemperatureCurve() )
  {
    if( boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get()) )
    {
      idfObject.setString(AirConditioner_VariableRefrigerantFlowFields::CoolingCapacityRatioModifierFunctionofLowTemperatureCurveName,_curve->name().get());
    } 
  }
  
  // CoolingCapacityRatioBoundaryCurveName

  if( boost::optional<model::CurveCubic> curve = modelObject.coolingCapacityRatioBoundaryCurve() )
  {
    if( boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get()) )
    {
      idfObject.setString(AirConditioner_VariableRefrigerantFlowFields::CoolingCapacityRatioBoundaryCurveName,_curve->name().get());
    }
  }

  // CoolingCapacityRatioModifierFunctionofHighTemperatureCurveName
  
  if( boost::optional<model::CurveBiquadratic> curve = modelObject.coolingCapacityRatioModifierFunctionofHighTemperatureCurve() )
  {
    if( boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get()) )
    {
      idfObject.setString(AirConditioner_VariableRefrigerantFlowFields::CoolingCapacityRatioModifierFunctionofHighTemperatureCurveName,_curve->name().get());
    }
  }
  
  // CoolingEnergyInputRatioModifierFunctionofLowTemperatureCurveName

  if( boost::optional<model::CurveBiquadratic> curve = modelObject.coolingEnergyInputRatioModifierFunctionofLowTemperatureCurve() )
  {
    if( boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get()) )
    {
      idfObject.setString(AirConditioner_VariableRefrigerantFlowFields::CoolingEnergyInputRatioModifierFunctionofLowTemperatureCurveName,_curve->name().get());
    }
  }

//.........这里部分代码省略.........
开发者ID:ChengXinDL,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateAirConditionerVariableRefrigerantFlow.cpp

示例6: 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;
}
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:65,代码来源:ForwardTranslateHumidifierSteamElectric.cpp

示例7: createRegisterAndNameIdfObject

boost::optional<IdfObject> ForwardTranslator::translateRefrigerationCondenserWaterCooled( RefrigerationCondenserWaterCooled & modelObject )
{
  OptionalModelObject temp;
  OptionalString optS;
  boost::optional<std::string> s;
  boost::optional<double> d;

  // Name
  IdfObject waterCooled = createRegisterAndNameIdfObject(openstudio::IddObjectType::Refrigeration_Condenser_WaterCooled, modelObject);

  // Rated Effective Total Heat Rejection Rate
  d = modelObject.ratedEffectiveTotalHeatRejectionRate();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedEffectiveTotalHeatRejectionRate,d.get());
  }

  // Rated Condensing Temperature
  d = modelObject.ratedCondensingTemperature();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedCondensingTemperature,d.get());
  }
        
  // Rated Subcooling Temperature Difference
  d = modelObject.ratedSubcoolingTemperatureDifference();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedSubcoolingTemperatureDifference,d.get());
  }
   
  // Rated Water Inlet Temperature
  d = modelObject.ratedWaterInletTemperature();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::RatedWaterInletTemperature,d.get());
  }

  // Water Inlet Node Name
  if( (temp = modelObject.inletModelObject()) )
  {
	  if(temp->name())
	  {
		waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterInletNodeName,temp->name().get());
	  }
  }
  
  // Water Outlet Node Name
  if( (temp = modelObject.outletModelObject()) )
  {
	  if(temp->name())
	  {
		waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterOutletNodeName,temp->name().get());
	  }
  }

  // Water-Cooled Loop Flow Type
  s = modelObject.waterCooledLoopFlowType();
  if (s) {
    waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterCooledLoopFlowType,s.get());
  }

  // Water Outlet Temperature Schedule Name
  boost::optional<Schedule> waterOutletTemperatureSchedule = modelObject.waterOutletTemperatureSchedule();

  if( waterOutletTemperatureSchedule )
  {
    boost::optional<IdfObject> _waterOutletTemperatureSchedule = translateAndMapModelObject(waterOutletTemperatureSchedule.get());

    if( _waterOutletTemperatureSchedule && _waterOutletTemperatureSchedule->name() )
    {
      waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::WaterOutletTemperatureScheduleName,_waterOutletTemperatureSchedule->name().get());
    }
  }
  

  // Water Design Flow Rate
  d = modelObject.waterDesignFlowRate();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterDesignFlowRate,d.get());
  }

  // Water Maximum Flow Rate
  d = modelObject.waterMaximumFlowRate();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterMaximumFlowRate,d.get());
  }

  // Water Maximum Water Outlet Temperature
  d = modelObject.waterMaximumWaterOutletTemperature();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterMaximumWaterOutletTemperature,d.get());
  }

  // Water Minimum Water Inlet Temperature
  d = modelObject.waterMinimumWaterInletTemperature();
  if (d) {
  	waterCooled.setDouble(Refrigeration_Condenser_WaterCooledFields::WaterMinimumWaterInletTemperature,d.get());
  }

  // End-Use Subcategory
  s = modelObject.endUseSubcategory();
  if (s) {
    waterCooled.setString(Refrigeration_Condenser_WaterCooledFields::EndUseSubcategory,s.get());
//.........这里部分代码省略.........
开发者ID:Zicao,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateRefrigerationCondenserWaterCooled.cpp

示例8: idfObject

boost::optional<IdfObject> ForwardTranslator::translateCoilHeatingGas( CoilHeatingGas & modelObject )
{
  OptionalString s;
  OptionalModelObject temp;

  // Create a new IddObjectType::Fan_OnOff
  IdfObject idfObject(IddObjectType::Coil_Heating_Gas);

  ///////////////////////////////////////////////////////////////////////////
  // Field: Name ////////////////////////////////////////////////////////////
  s = modelObject.name();
  if( s )
  {
    idfObject.setName(*s);
  }
  ///////////////////////////////////////////////////////////////////////////

  // hook up required objects
  try {
    Schedule sched = modelObject.availableSchedule();
    translateAndMapModelObject(sched);
    idfObject.setString(Coil_Heating_GasFields::AvailabilityScheduleName,
                        sched.name().get() );
  }
  catch (std::exception& e) {
    LOG(Error,"Could not translate " << modelObject.briefDescription() << ", because " 
        << e.what() << ".");
    return boost::none;
  }

  ///////////////////////////////////////////////////////////////////////////
  // Field: Gas Burner Efficiency ///////////////////////////////////////////
  idfObject.setDouble(openstudio::Coil_Heating_GasFields::GasBurnerEfficiency,modelObject.gasBurnerEfficiency());
  ///////////////////////////////////////////////////////////////////////////

  ///////////////////////////////////////////////////////////////////////////
  // Field: Nominal Capacity ////////////////////////////////////////////////
  OptionalDouble d=modelObject.nominalCapacity();
  if(d)
  {
    idfObject.setDouble(openstudio::Coil_Heating_GasFields::NominalCapacity,*d);
  }
  else
  {
    idfObject.setString(openstudio::Coil_Heating_GasFields::NominalCapacity,"AutoSize");
  }
  ///////////////////////////////////////////////////////////////////////////
  idfObject.setDouble(openstudio::Coil_Heating_GasFields::ParasiticElectricLoad,modelObject.parasiticElectricLoad());
  idfObject.setDouble(openstudio::Coil_Heating_GasFields::ParasiticGasLoad,modelObject.parasiticGasLoad());


  ///////////////////////////////////////////////////////////////////////////
  // Field: Air Inlet Node Name /////////////////////////////////////////////
  temp = modelObject.inletModelObject();
  if(temp)
  {
    s=temp->name();
    if( s )
    {
      idfObject.setString(openstudio::Coil_Heating_GasFields::AirInletNodeName,*s);
    }
  }
  ///////////////////////////////////////////////////////////////////////////

  ///////////////////////////////////////////////////////////////////////////
  // Field: Air Outlet Node Name ////////////////////////////////////////////
  temp = modelObject.outletModelObject();
  if(temp)
  {
    s=temp->name();
    if( s)
    {
      idfObject.setString(openstudio::Coil_Heating_GasFields::AirOutletNodeName,*s);
      idfObject.setString(openstudio::Coil_Heating_GasFields::TemperatureSetpointNodeName,*s);
    }
  }
  ///////////////////////////////////////////////////////////////////////////

  m_idfObjects.push_back(idfObject);

  // Part Load Fraction Correlation Curve 
  if( boost::optional<model::Curve> curve = modelObject.partLoadFractionCorrelationCurve() )
  {
    if( boost::optional<IdfObject> _curve = translateAndMapModelObject(curve.get()) )
    {
      idfObject.setString(Coil_Heating_GasFields::PartLoadFractionCorrelationCurveName,_curve->name().get()); 
    }
  }

  return boost::optional<IdfObject>(idfObject);
}
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:91,代码来源:ForwardTranslateCoilHeatingGas.cpp

示例9: idfObject

boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXSingleSpeedWithoutUnitary( model::CoilCoolingDXSingleSpeed & modelObject )
{
  OptionalString s;
  IdfObject idfObject(IddObjectType::Coil_Cooling_DX_SingleSpeed);

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

  // hook up required objects
  try {
    Schedule sched = modelObject.getAvailabilitySchedule();
    translateAndMapModelObject(sched);
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::AvailabilityScheduleName,
                        sched.name().get() );

    Curve cb =  modelObject.getTotalCoolingCapacityFunctionOfTemperatureCurve();
    translateAndMapModelObject(cb);
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::TotalCoolingCapacityFunctionofTemperatureCurveName,
                       cb.name().get());

    Curve cq = modelObject.getTotalCoolingCapacityFunctionOfFlowFractionCurve();
    translateAndMapModelObject(cq);
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::TotalCoolingCapacityFunctionofFlowFractionCurveName,
                        cq.name().get());

    cb =modelObject.getEnergyInputRatioFunctionOfTemperatureCurve();
    translateAndMapModelObject(cb);
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::EnergyInputRatioFunctionofTemperatureCurveName,
                        cb.name().get());

    cq=modelObject.getEnergyInputRatioFunctionOfFlowFractionCurve();
    translateAndMapModelObject(cq);
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::EnergyInputRatioFunctionofFlowFractionCurveName,
                        cq.name().get());

    cq=modelObject.getPartLoadFractionCorrelationCurve();
    translateAndMapModelObject(cq);
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::PartLoadFractionCorrelationCurveName,
                        cq.name().get());
  }
  catch (std::exception& e) {
    LOG(Error,"Could not translate " << modelObject.briefDescription() << ", because " 
        << e.what() << ".");
    return boost::none;
  }

  OptionalDouble d = modelObject.ratedTotalCoolingCapacity();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_SingleSpeedFields::GrossRatedTotalCoolingCapacity,*d);
  }
  else
  {
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::GrossRatedTotalCoolingCapacity,"Autosize");
  }

  d = modelObject.ratedSensibleHeatRatio();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_SingleSpeedFields::GrossRatedSensibleHeatRatio,*d);
  }
  else
  {
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::GrossRatedSensibleHeatRatio,"Autosize");
  }

  d = modelObject.getRatedCOP();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_SingleSpeedFields::GrossRatedCoolingCOP,*d);
  }

  d = modelObject.ratedAirFlowRate();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_SingleSpeedFields::RatedAirFlowRate,*d);
  }
  else
  {
    idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::RatedAirFlowRate,"Autosize");
  }

  d = modelObject.getRatedEvaporatorFanPowerPerVolumeFlowRate();
  if( d )
  {
    idfObject.setDouble(Coil_Cooling_DX_SingleSpeedFields::RatedEvaporatorFanPowerPerVolumeFlowRate,*d);
  }

  OptionalModelObject omo = modelObject.inletModelObject();
  if( omo )
  {
    translateAndMapModelObject(*omo);
    s = omo->name();
    if(s)
    {
      idfObject.setString(Coil_Cooling_DX_SingleSpeedFields::AirInletNodeName,*s );
    }
//.........这里部分代码省略.........
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateCoilCoolingDXSingleSpeed.cpp

示例10: idfObject

boost::optional<IdfObject> ForwardTranslator::translateHeatExchangerAirToAirSensibleAndLatent( HeatExchangerAirToAirSensibleAndLatent & modelObject )
{
  OptionalString s;
  OptionalDouble d;
  OptionalModelObject temp;

  IdfObject idfObject(IddObjectType::HeatExchanger_AirToAir_SensibleAndLatent);

  m_idfObjects.push_back(idfObject);

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

  // AvailabilityScheduleName
  Schedule sched = modelObject.availabilitySchedule();
  translateAndMapModelObject(sched);
  idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::AvailabilityScheduleName,sched.name().get());

  // NominalSupplyAirFlowRate
  if( modelObject.isNominalSupplyAirFlowRateAutosized() )
  {
    idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate,"Autosize");
  }
  else
  {
    d = modelObject.nominalSupplyAirFlowRate();
    if( d )
    {
      idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate,d.get());
    }
  }

  // SensibleEffectivenessat100_HeatingAirFlow
  d = modelObject.sensibleEffectivenessat100HeatingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_HeatingAirFlow,d.get());
  }

  // LatentEffectivenessat100_HeatingAirFlow
  d = modelObject.latentEffectivenessat100HeatingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_HeatingAirFlow,d.get());
  }

  // SensibleEffectivenessat75_HeatingAirFlow
  d = modelObject.sensibleEffectivenessat75HeatingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat75_HeatingAirFlow,d.get());
  }

  // LatentEffectivenessat75_HeatingAirFlow
  d = modelObject.latentEffectivenessat75HeatingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat75_HeatingAirFlow,d.get());
  }

  // SensibleEffectivenessat100_CoolingAirFlow
  d = modelObject.sensibleEffectivenessat100CoolingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_CoolingAirFlow,d.get());
  }

  // LatentEffectivenessat100_CoolingAirFlow
  d = modelObject.latentEffectivenessat100CoolingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_CoolingAirFlow,d.get());
  }

  // SensibleEffectivenessat75_CoolingAirFlow
  d = modelObject.sensibleEffectivenessat75CoolingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat75_CoolingAirFlow,d.get());
  }

  // LatentEffectivenessat75_CoolingAirFlow
  d = modelObject.latentEffectivenessat75CoolingAirFlow();
  if( d )
  {
    idfObject.setDouble(HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat75_CoolingAirFlow,d.get());
  }

  // SupplyAirInletNodeName
  temp = modelObject.primaryAirInletModelObject();
  if(temp)
  {
    s = temp->name();
    if(s)
    {
      idfObject.setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirInletNodeName,*s);
//.........这里部分代码省略.........
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateHeatExchangerAirToAirSensibleAndLatent.cpp

示例11: 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()) )
  {
//.........这里部分代码省略.........
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateEvaporativeFluidCoolerSingleSpeed.cpp

示例12: idfObject

boost::optional<IdfObject> ForwardTranslator::translateEvaporativeCoolerDirectResearchSpecial( EvaporativeCoolerDirectResearchSpecial & modelObject )
{
  OptionalString s;
  OptionalDouble d;
  OptionalModelObject temp;
  double value;

  IdfObject idfObject(IddObjectType::EvaporativeCooler_Direct_ResearchSpecial);

  m_idfObjects.push_back(idfObject);

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

  // AvailabilityScheduleName
  Schedule sched = modelObject.availableSchedule();
  translateAndMapModelObject(sched);
  idfObject.setString(EvaporativeCooler_Direct_ResearchSpecialFields::AvailabilityScheduleName,sched.name().get());

  // CoolerEffectiveness
  value = modelObject.coolerEffectiveness();
  idfObject.setDouble(EvaporativeCooler_Direct_ResearchSpecialFields::CoolerEffectiveness,value);

  // RecirculatingWaterPumpPowerConsumption
  value = modelObject.recirculatingWaterPumpPowerConsumption();
  idfObject.setDouble(EvaporativeCooler_Direct_ResearchSpecialFields::RecirculatingWaterPumpPowerConsumption,value);

  // AirInletNodeName
  temp = modelObject.inletModelObject();
  if(temp)
  {
    s = temp->name();
    if(s)
    {
      idfObject.setString(EvaporativeCooler_Direct_ResearchSpecialFields::AirInletNodeName,*s);
    }
  }

  // AirOutletNodeName
  temp = modelObject.outletModelObject();
  if(temp)
  {
    s = temp->name();
    if(s)
    {
      idfObject.setString(EvaporativeCooler_Direct_ResearchSpecialFields::AirOutletNodeName,*s);
    }
  }

  // SensorNodeName
  temp = modelObject.sensorNode();
  if(temp)
  {
    s = temp->name();
    if(s)
    {
      idfObject.setString(EvaporativeCooler_Direct_ResearchSpecialFields::SensorNodeName,*s);
    }
  }

  // DriftLossFraction
  value = modelObject.driftLossFraction();
  idfObject.setDouble(EvaporativeCooler_Direct_ResearchSpecialFields::DriftLossFraction,value);

  // BlowdownConcentrationRatio
  value = modelObject.blowdownConcentrationRatio();
  if( value < 2 )
  {
    idfObject.setDouble(EvaporativeCooler_Direct_ResearchSpecialFields::BlowdownConcentrationRatio,2.0);
  }
  else
  {
    idfObject.setDouble(EvaporativeCooler_Direct_ResearchSpecialFields::BlowdownConcentrationRatio,value);
  }

  return boost::optional<IdfObject>(idfObject);
}
开发者ID:CheyenneBerlin,项目名称:OpenStudio,代码行数:81,代码来源:ForwardTranslateEvaporativeCoolerDirectResearchSpecial.cpp

示例13: 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());
  }

//.........这里部分代码省略.........
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateEvaporativeFluidCoolerTwoSpeed.cpp

示例14: idfObject

boost::optional<IdfObject> ForwardTranslator::translateHeatExchangerFluidToFluid( HeatExchangerFluidToFluid & modelObject )
{
  OptionalString s;
  OptionalDouble d;
  OptionalModelObject mo;
  boost::optional<IdfObject> idfo;

  IdfObject idfObject(IddObjectType::HeatExchanger_FluidToFluid);

  m_idfObjects.push_back(idfObject);

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

  // AvailabilityScheduleName
  boost::optional<Schedule> sched = modelObject.availabilitySchedule();
  if( (idfo = translateAndMapModelObject(sched.get())) )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::AvailabilityScheduleName,idfo->name().get());
  }

  // LoopDemandSideInletNode
  mo = modelObject.demandInletModelObject();
  if( mo )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::LoopDemandSideInletNodeName,mo->name().get());
  }

  // LoopDemandSideOutletNode
  mo = modelObject.demandOutletModelObject();
  if( mo )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::LoopDemandSideOutletNodeName,mo->name().get());
  }

  // LoopDemandSideDesignFlowRate
  if( modelObject.isLoopDemandSideDesignFlowRateAutosized() )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::LoopDemandSideDesignFlowRate,"Autosize");
  }
  else
  {
    if( (d = modelObject.loopDemandSideDesignFlowRate()) )
    {
      idfObject.setDouble(HeatExchanger_FluidToFluidFields::LoopDemandSideDesignFlowRate,d.get());
    }
  }

  // LoopSupplySideInletNode
  mo = modelObject.supplyInletModelObject();
  if( mo )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::LoopSupplySideInletNodeName,mo->name().get());
  }

  // LoopSupplySideOutletNode
  mo = modelObject.supplyOutletModelObject();
  if( mo )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::LoopSupplySideOutletNodeName,mo->name().get());
  }

  // LoopSupplySideDesignFlowRate
  if( modelObject.isLoopSupplySideDesignFlowRateAutosized() )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::LoopSupplySideDesignFlowRate,"Autosize");
  }
  else
  {
    if( (d = modelObject.loopSupplySideDesignFlowRate()) )
    {
      idfObject.setDouble(HeatExchanger_FluidToFluidFields::LoopSupplySideDesignFlowRate,d.get());
    }
  }

  // HeatExchangeModelType
  if( (s = modelObject.heatExchangeModelType()) )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::HeatExchangeModelType,s.get());
  }

  // HeatExchangerUFactorTimesAreaValue
  if( modelObject.isHeatExchangerUFactorTimesAreaValueAutosized() )
  {
    idfObject.setString(HeatExchanger_FluidToFluidFields::HeatExchangerUFactorTimesAreaValue,"Autosize");
  }
  else
  {
    if( (d = modelObject.heatExchangerUFactorTimesAreaValue()) )
    {
      idfObject.setDouble(HeatExchanger_FluidToFluidFields::HeatExchangerUFactorTimesAreaValue,d.get());
    }
  }

  // ControlType
  if( (s = modelObject.controlType()) )
//.........这里部分代码省略.........
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateHeatExchangerFluidToFluid.cpp

示例15: createRegisterAndNameIdfObject

boost::optional<IdfObject> ForwardTranslator::translateFanOnOff( FanOnOff & modelObject )
{
  //setup boost optionals to use to store get method returns
  boost::optional<std::string> s;
  boost::optional<double> value;
  boost::optional<Node> node;
  OptionalModelObject mo;
  
  // Make sure the modelObject gets ut into the map, and the new idfObject gets put into the final file.
  // Also sets the idfObjects name

  IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::Fan_OnOff,modelObject);
  
  // Model Name
  std::string baseName = modelObject.name().get();

  //  A3 ,Field Availability Schedule Name
  
  Schedule availabilitySchedule = modelObject.availabilitySchedule();
  translateAndMapModelObject(availabilitySchedule);
  
  s = availabilitySchedule.name();
  
  if(s)
  {
				idfObject.setString(Fan_OnOffFields::AvailabilityScheduleName,*s);
  }
  
  //  N1 ,Field Fan Efficiency
  
  value = modelObject.fanEfficiency();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::FanEfficiency,*value);
  }
  
  //  N2 Pressure Rise
  
  value = modelObject.pressureRise();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::PressureRise,*value);
  }
  
  // N3,  Field Maximum Flow Rate
  
  value = modelObject.maximumFlowRate();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::MaximumFlowRate,*value);
  }
  
  else
  {
    idfObject.setString(Fan_OnOffFields::MaximumFlowRate,"Autosize");
  }
  
  // N4,  Field Motor Efficiency
  
  value = modelObject.motorEfficiency();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::MotorEfficiency,*value);
  }
  
  //   N5, Field Motor In Airstream Fraction

  value = modelObject.motorInAirstreamFraction();
  
  if( value )
  {
    idfObject.setDouble(Fan_OnOffFields::MotorInAirstreamFraction,*value);
  }
  
  // A4 Air Inlet Node Name
  
  mo = modelObject.inletModelObject();
  if(mo)
  {
    s = mo->name();
    if(s)
    {
      idfObject.setString(openstudio::Fan_OnOffFields::AirInletNodeName,*s);
    }
  }

  // A5 , Field Air Outlet Node Name
  
  mo = modelObject.outletModelObject();
  if(mo)
  {
    s = mo->name();
    if(s)
    {
      idfObject.setString(openstudio::Fan_OnOffFields::AirOutletNodeName,*s);
    }
//.........这里部分代码省略.........
开发者ID:ORNL-BTRIC,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateFanOnOff.cpp


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