Esempio n. 1
0
 bool GasEquipment_Impl::isAbsolute() const {
   GasEquipmentDefinition definition = gasEquipmentDefinition();
   if (definition.designLevel()) {
     return true;
   }
   return false;
 }
Esempio n. 2
0
  bool GasEquipment_Impl::hardSize()
  {
    boost::optional<Space> space = this->space();
    if (!space){
      return false;
    }

    this->makeUnique();

    GasEquipmentDefinition gasEquipmentDefinition = this->gasEquipmentDefinition();
    for (LifeCycleCost cost : gasEquipmentDefinition.lifeCycleCosts()){
      cost.convertToCostPerEach();
    }

    boost::optional<double> designLevel = gasEquipmentDefinition.designLevel();
    if (designLevel){
      return true;
    }

    boost::optional<double> wattsperSpaceFloorArea = gasEquipmentDefinition.wattsperSpaceFloorArea();
    if (wattsperSpaceFloorArea){
      return gasEquipmentDefinition.setDesignLevel(*wattsperSpaceFloorArea * space->floorArea());
    }

    boost::optional<double> wattsperPerson = gasEquipmentDefinition.wattsperPerson();
    if (wattsperPerson){
      return gasEquipmentDefinition.setDesignLevel(*wattsperPerson * space->numberOfPeople());
    }

    return false;
  }
boost::optional<IdfObject> ForwardTranslator::translateGasEquipment( GasEquipment& modelObject )
{
  IdfObject idfObject(openstudio::IddObjectType::GasEquipment);
  m_idfObjects.push_back(idfObject);

  for (LifeCycleCost lifeCycleCost : modelObject.lifeCycleCosts()){
    translateAndMapModelObject(lifeCycleCost);
  }

  GasEquipmentDefinition definition = modelObject.gasEquipmentDefinition();

  idfObject.setString(GasEquipmentFields::Name, modelObject.name().get());

  boost::optional<Space> space = modelObject.space();
  boost::optional<SpaceType> spaceType = modelObject.spaceType();
  if (space){
    boost::optional<ThermalZone> thermalZone = space->thermalZone();
    if (thermalZone){
      idfObject.setString(GasEquipmentFields::ZoneorZoneListName, thermalZone->name().get());
    }
  }else if(spaceType){
    idfObject.setString(GasEquipmentFields::ZoneorZoneListName, spaceType->name().get());
  }

  boost::optional<Schedule> schedule = modelObject.schedule();
  if (schedule){
    idfObject.setString(GasEquipmentFields::ScheduleName, schedule->name().get());
  }

  idfObject.setString(GasEquipmentFields::DesignLevelCalculationMethod, definition.designLevelCalculationMethod());

  double multiplier = modelObject.multiplier();

  OptionalDouble d = definition.designLevel();
  if (d){
    idfObject.setDouble(GasEquipmentFields::DesignLevel, (*d)*multiplier);
  }

  d = definition.wattsperSpaceFloorArea();
  if (d){
    idfObject.setDouble(GasEquipmentFields::PowerperZoneFloorArea, (*d)*multiplier);
  }

  d = definition.wattsperPerson();
  if (d){
    idfObject.setDouble(GasEquipmentFields::PowerperPerson, (*d)*multiplier);
  }

  if (!definition.isFractionLatentDefaulted()){
    idfObject.setDouble(GasEquipmentFields::FractionLatent, definition.fractionLatent());
  }

  if (!definition.isFractionRadiantDefaulted()){
    idfObject.setDouble(GasEquipmentFields::FractionRadiant, definition.fractionRadiant());
  }

  if (!definition.isFractionLostDefaulted()){
    idfObject.setDouble(GasEquipmentFields::FractionLost, definition.fractionLost());
  }

  if (!definition.isCarbonDioxideGenerationRateDefaulted()){
    idfObject.setDouble(GasEquipmentFields::CarbonDioxideGenerationRate, definition.carbonDioxideGenerationRate());
  }

  if (!modelObject.isEndUseSubcategoryDefaulted()){
    idfObject.setString(GasEquipmentFields::EndUseSubcategory, modelObject.endUseSubcategory());
  }

  return idfObject;
}
Esempio n. 4
0
 bool GasEquipment_Impl::setGasEquipmentDefinition(const GasEquipmentDefinition& definition)
 {
   return this->setPointer(this->definitionIndex(), definition.handle());
 }