本文整理汇总了C++中HVACComponent类的典型用法代码示例。如果您正苦于以下问题:C++ HVACComponent类的具体用法?C++ HVACComponent怎么用?C++ HVACComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HVACComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clone
ModelObject AirTerminalSingleDuctParallelPIUReheat_Impl::clone(Model model) const
{
AirTerminalSingleDuctParallelPIUReheat modelObjectClone = StraightComponent_Impl::clone(model).cast<AirTerminalSingleDuctParallelPIUReheat>();
modelObjectClone.setString(modelObjectClone.secondaryAirInletPort(),"");
// clone coil
HVACComponent coil = this->reheatCoil();
HVACComponent coilClone = coil.clone(model).cast<HVACComponent>();
modelObjectClone.setReheatCoil(coilClone);
// clone fan
HVACComponent fan = this->fan();
HVACComponent fanClone = fan.clone(model).cast<HVACComponent>();
modelObjectClone.setFan(fanClone);
return modelObjectClone;
}
示例2: setFan
void AirTerminalSingleDuctParallelPIUReheat_Impl::setFan( HVACComponent & hvacComponent )
{
bool isTypeCorrect = false;
if( hvacComponent.iddObjectType() == IddObjectType::OS_Fan_ConstantVolume )
{
isTypeCorrect = true;
}
if( isTypeCorrect )
{
setPointer(OS_AirTerminal_SingleDuct_ParallelPIU_ReheatFields::FanName,hvacComponent.handle());
}
}
示例3: ModelObject
PortList::PortList(const HVACComponent& comp)
: ModelObject(PortList::iddObjectType(),comp.model())
{
OS_ASSERT(getImpl<detail::PortList_Impl>());
getImpl<detail::PortList_Impl>()->setHVACComponent(comp);
}
示例4: operationSchemeComponent
// Some plant components air in a containingHVACComponent() and it is that
// container which needs to go on the plant operation scheme. Here is a filter to
// figure that out.
HVACComponent operationSchemeComponent(const HVACComponent & component) {
boost::optional<HVACComponent> result;
switch(component.iddObject().type().value())
{
case openstudio::IddObjectType::OS_WaterHeater_Mixed :
{
auto waterHeater = component.cast<WaterHeaterMixed>();
if( auto hpwh = waterHeater.containingZoneHVACComponent() ) {
result = hpwh;
}
break;
}
case openstudio::IddObjectType::OS_WaterHeater_Stratified :
{
auto waterHeater = component.cast<WaterHeaterStratified>();
if( auto hpwh = waterHeater.containingZoneHVACComponent() ) {
result = hpwh;
}
break;
}
default:
{
break;
}
}
if( result ) {
return result.get();
}
return component;
}
示例5: setReheatCoil
void AirTerminalSingleDuctParallelPIUReheat_Impl::setReheatCoil( HVACComponent & hvacComponent )
{
bool isTypeCorrect = false;
if( hvacComponent.iddObjectType() == IddObjectType::OS_Coil_Heating_Electric )
{
isTypeCorrect = true;
}
else if( hvacComponent.iddObjectType() == IddObjectType::OS_Coil_Heating_Gas )
{
isTypeCorrect = true;
}
else if( hvacComponent.iddObjectType() == IddObjectType::OS_Coil_Heating_Water )
{
isTypeCorrect = true;
}
if( isTypeCorrect )
{
setPointer(OS_AirTerminal_SingleDuct_ParallelPIU_ReheatFields::ReheatCoilName,hvacComponent.handle());
}
}
示例6: setSupplyAirFan
bool ZoneHVACTerminalUnitVariableRefrigerantFlow_Impl::setSupplyAirFan(const HVACComponent & component)
{
return setPointer(OS_ZoneHVAC_TerminalUnit_VariableRefrigerantFlowFields::SupplyAirFan,component.handle());
}
示例7: setWaterCoil
void ControllerWaterCoil_Impl::setWaterCoil( const HVACComponent & comp )
{
auto result = setPointer(OS_Controller_WaterCoilFields::WaterCoilName,comp.handle());
OS_ASSERT(result);
}
示例8: setHeatingCoil
bool ZoneHVACUnitHeater_Impl::setHeatingCoil(const HVACComponent & heatingCoil)
{
bool result = setPointer(OS_ZoneHVAC_UnitHeaterFields::HeatingCoilName, heatingCoil.handle());
return result;
}
示例9: setPointer
bool ZoneHVACUnitHeater_Impl::setSupplyAirFan(const HVACComponent& HVACComponent)
{
bool result = setPointer(OS_ZoneHVAC_UnitHeaterFields::SupplyAirFanName, HVACComponent.handle());
return result;
}
示例10: setHeatingCoil
bool AirTerminalSingleDuctConstantVolumeFourPipeBeam_Impl::setHeatingCoil(const HVACComponent& coilHeatingFourPipeBeam) {
bool result = setPointer(OS_AirTerminal_SingleDuct_ConstantVolume_FourPipeBeamFields::HeatingCoilName, coilHeatingFourPipeBeam.handle());
if (!result) {
if ( !coilHeatingFourPipeBeam.optionalCast<CoilHeatingFourPipeBeam>() ) {
LOG(Error, "Cannot set the heating coil to something else than CoilHeatingFourPipeBeam for " << briefDescription());
}
}
return result;
}
示例11: model
bool HVACComponent_Impl::removeFromLoop( const HVACComponent & systemStartComponent,
const HVACComponent & systemEndComponent,
unsigned componentInletPort,
unsigned componentOutletPort )
{
auto _model = model();
auto thisObject = getObject<HVACComponent>();
if( systemStartComponent.model() != _model ) return false;
if( systemEndComponent.model() != _model ) return false;
auto inletComponent = connectedObject( componentInletPort );
auto outletComponent = connectedObject( componentOutletPort );
auto inletComponentOutletPort = connectedObjectPort( componentInletPort );
auto outletComponentInletPort = connectedObjectPort( componentOutletPort );
if( ! inletComponent ) return false;
if( ! outletComponent ) return false;
if( ! inletComponentOutletPort ) return false;
if( ! outletComponentInletPort ) return false;
auto inletNode = inletComponent->optionalCast<Node>();
auto outletNode = outletComponent->optionalCast<Node>();
boost::optional<Splitter> splitter;
boost::optional<Mixer> mixer;
if( inletNode ) {
if( auto mo = inletNode->inletModelObject() ) {
splitter = mo->optionalCast<Splitter>();
}
}
if( outletNode ) {
if( auto mo = outletNode->outletModelObject() ) {
mixer = mo->optionalCast<Mixer>();
}
}
if( systemStartComponent.handle() == inletComponent->handle()
&& systemEndComponent.handle() == outletComponent->handle() ) {
// This component is between the systemStartComponent and the systemEndComponent
// ie. the supply or demand inlet or outlet Nodes,
// or the oa system end points on either the relief or inlet air streams.
_model.disconnect(thisObject,componentInletPort);
_model.disconnect(thisObject,componentOutletPort);
_model.connect( inletComponent.get(), inletComponentOutletPort.get(),
outletComponent.get(), outletComponentInletPort.get() );
return true;
} else if( systemEndComponent.handle() == outletComponent->handle() ) {
// Here the systemEndComponent is immediately downstream of this component,
// but there are other components (besides systemStartComponent) upstream.
boost::optional<ModelObject> newInletComponent;
boost::optional<unsigned> newInletComponentOutletPort;
// Make sure we don't end up with two nodes next to each other after this component is removed
if( inletNode && outletNode ) {
newInletComponent = inletNode->inletModelObject();
newInletComponentOutletPort = inletNode->connectedObjectPort(inletNode->inletPort());
OS_ASSERT(newInletComponent);
OS_ASSERT(newInletComponentOutletPort);
} else {
newInletComponent = inletComponent;
newInletComponentOutletPort = inletComponentOutletPort;
}
_model.disconnect(thisObject,componentInletPort);
_model.disconnect(thisObject,componentOutletPort);
// inletNode->remove() would have failed if we did it before the disconnect
if( inletNode && outletNode ) {
inletNode->remove();
}
_model.connect( newInletComponent.get(), newInletComponentOutletPort.get(),
outletComponent.get(), outletComponentInletPort.get() );
return true;
} else if( splitter && mixer ) {
// If the component is the only component (except nodes) between a splitter mixer pair
OS_ASSERT(inletNode);
OS_ASSERT(outletNode);
int i = splitter->branchIndexForOutletModelObject(inletNode.get());
int j = mixer->branchIndexForInletModelObject(outletNode.get());
OS_ASSERT(i == j);
splitter->removePortForBranch(i);
mixer->removePortForBranch(i);
_model.disconnect(thisObject,componentInletPort);
_model.disconnect(thisObject,componentOutletPort);
inletNode->remove();
outletNode->remove();
if( ! splitter->lastOutletModelObject() )
{
Node newNode(_model);
_model.connect(splitter.get(),splitter->nextOutletPort(),newNode,newNode.inletPort());
//.........这里部分代码省略.........
示例12: _airDistributionUnit
boost::optional<IdfObject> ForwardTranslator::translateAirTerminalSingleDuctParallelPIUReheat( AirTerminalSingleDuctParallelPIUReheat & modelObject )
{
OptionalModelObject temp;
OptionalString optS;
boost::optional<std::string> s;
boost::optional<double> value;
IdfObject _airDistributionUnit(openstudio::IddObjectType::ZoneHVAC_AirDistributionUnit);
_airDistributionUnit.setName(modelObject.name().get() + " Air Distribution Unit");
m_idfObjects.push_back(_airDistributionUnit);
IdfObject idfObject(openstudio::IddObjectType::AirTerminal_SingleDuct_ParallelPIU_Reheat);
idfObject.setName(modelObject.name().get());
m_idfObjects.push_back(idfObject);
HVACComponent coil = modelObject.reheatCoil();
boost::optional<IdfObject> _reheatCoil = translateAndMapModelObject(coil);
HVACComponent fan = modelObject.fan();
boost::optional<IdfObject> _fan = translateAndMapModelObject(fan);
std::string fanOutletNodeName = modelObject.name().get() + " Fan Outlet";
std::string mixerOutletNodeName = modelObject.name().get() + " Mixer Outlet";
boost::optional<std::string> inletNodeName;
boost::optional<std::string> secondaryAirInletNodeName;
boost::optional<std::string> outletNodeName;
if( boost::optional<ModelObject> inletModelObject = modelObject.inletModelObject() )
{
if( boost::optional<Node> inletNode = inletModelObject->optionalCast<Node>() )
{
inletNodeName = inletNode->name().get();
}
}
if( boost::optional<ModelObject> outletModelObject = modelObject.outletModelObject() )
{
if( boost::optional<Node> outletNode = outletModelObject->optionalCast<Node>() )
{
outletNodeName = outletNode->name().get();
}
}
if( boost::optional<Node> secondaryInletNode = modelObject.secondaryAirInletNode() )
{
if( secondaryInletNode )
{
secondaryAirInletNodeName = secondaryInletNode->name().get();
}
}
if( outletNodeName )
{
idfObject.setString(AirTerminal_SingleDuct_ParallelPIU_ReheatFields::OutletNodeName,outletNodeName.get());
}
if( inletNodeName )
{
idfObject.setString(AirTerminal_SingleDuct_ParallelPIU_ReheatFields::SupplyAirInletNodeName,inletNodeName.get());
}
if( secondaryAirInletNodeName )
{
idfObject.setString(AirTerminal_SingleDuct_ParallelPIU_ReheatFields::SecondaryAirInletNodeName,secondaryAirInletNodeName.get());
}
// Populate fields for AirDistributionUnit
if( outletNodeName )
{
_airDistributionUnit.setString(ZoneHVAC_AirDistributionUnitFields::AirDistributionUnitOutletNodeName,outletNodeName.get());
}
_airDistributionUnit.setString(ZoneHVAC_AirDistributionUnitFields::AirTerminalObjectType,idfObject.iddObject().name());
_airDistributionUnit.setString(ZoneHVAC_AirDistributionUnitFields::AirTerminalName,idfObject.name().get());
// MixerName
IdfObject _mixer(IddObjectType::AirLoopHVAC_ZoneMixer);
_mixer.setName(modelObject.name().get() + " Mixer");
m_idfObjects.push_back(_mixer);
_mixer.clearExtensibleGroups();
_mixer.setString(AirLoopHVAC_ZoneMixerFields::OutletNodeName,mixerOutletNodeName);
IdfExtensibleGroup eg = _mixer.pushExtensibleGroup();
eg.setString(AirLoopHVAC_ZoneMixerExtensibleFields::InletNodeName,fanOutletNodeName);
if( inletNodeName )
{
eg = _mixer.pushExtensibleGroup();
eg.setString(AirLoopHVAC_ZoneMixerExtensibleFields::InletNodeName,inletNodeName.get());
}
idfObject.setString(AirTerminal_SingleDuct_ParallelPIU_ReheatFields::ZoneMixerName,_mixer.name().get());
// FanName
if( _fan || _fan->name() )
{
//.........这里部分代码省略.........
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:101,代码来源:ForwardTranslateAirTerminalSingleDuctParallelPIUReheat.cpp
示例13: setExhaustAirFan
bool ZoneHVACEnergyRecoveryVentilator_Impl::setExhaustAirFan(const HVACComponent& exhaustAirFan) {
bool result = setPointer(OS_ZoneHVAC_EnergyRecoveryVentilatorFields::ExhaustAirFanName, exhaustAirFan.handle());
return result;
}
示例14: setHeatExchanger
bool ZoneHVACEnergyRecoveryVentilator_Impl::setHeatExchanger(const HVACComponent& hxAirToAirSensibleAndLatent) {
bool result = setPointer(OS_ZoneHVAC_EnergyRecoveryVentilatorFields::HeatExchangerName, hxAirToAirSensibleAndLatent.handle());
return result;
}
示例15: flowrate
boost::optional<double> flowrate(const HVACComponent & component)
{
boost::optional<double> result;
switch(component.iddObject().type().value()) {
case openstudio::IddObjectType::OS_Boiler_HotWater :
{
auto boiler = component.cast<BoilerHotWater>();
result = boiler.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_WaterHeater_Mixed :
{
auto waterHeater = component.cast<WaterHeaterMixed>();
result = waterHeater.useSideDesignFlowRate();
break;
}
case openstudio::IddObjectType::OS_WaterHeater_Stratified :
{
auto waterHeater = component.cast<WaterHeaterStratified>();
result = waterHeater.useSideDesignFlowRate();
break;
}
case openstudio::IddObjectType::OS_DistrictHeating :
{
break;
}
case openstudio::IddObjectType::OS_Chiller_Electric_EIR :
{
auto chiller = component.cast<ChillerElectricEIR>();
result = chiller.referenceChilledWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_Chiller_Absorption_Indirect :
{
auto chiller = component.cast<ChillerAbsorptionIndirect>();
result = chiller.designChilledWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_Chiller_Absorption :
{
auto chiller = component.cast<ChillerAbsorption>();
result = chiller.designChilledWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_ThermalStorage_Ice_Detailed :
{
break;
}
case openstudio::IddObjectType::OS_DistrictCooling :
{
break;
}
case openstudio::IddObjectType::OS_CoolingTower_SingleSpeed :
{
auto tower = component.cast<CoolingTowerSingleSpeed>();
result = tower.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_CoolingTower_VariableSpeed :
{
auto tower = component.cast<CoolingTowerVariableSpeed>();
result = tower.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_CoolingTower_TwoSpeed:
{
auto tower = component.cast<CoolingTowerTwoSpeed>();
result = tower.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_EvaporativeFluidCooler_SingleSpeed:
{
auto mo = component.cast<EvaporativeFluidCoolerSingleSpeed>();
result = mo.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_FluidCooler_SingleSpeed:
{
auto mo = component.cast<FluidCoolerSingleSpeed>();
result = mo.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_FluidCooler_TwoSpeed:
{
auto mo = component.cast<FluidCoolerTwoSpeed>();
result = mo.designWaterFlowRate();
break;
}
case openstudio::IddObjectType::OS_GroundHeatExchanger_Vertical :
{
auto hx = component.cast<GroundHeatExchangerVertical>();
result = hx.maximumFlowRate();
break;
}
case openstudio::IddObjectType::OS_GroundHeatExchanger_HorizontalTrench :
{
auto hx = component.cast<GroundHeatExchangerHorizontalTrench>();
result = hx.designFlowRate();
break;
}
//.........这里部分代码省略.........