本文整理汇总了C++中Mixer::nextInletPort方法的典型用法代码示例。如果您正苦于以下问题:C++ Mixer::nextInletPort方法的具体用法?C++ Mixer::nextInletPort怎么用?C++ Mixer::nextInletPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mixer
的用法示例。
在下文中一共展示了Mixer::nextInletPort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeFromPlantLoop
bool WaterToAirComponent_Impl::removeFromPlantLoop()
{
boost::optional<PlantLoop> _loop = plantLoop();
OptionalNode targetModelObject;
OptionalNode sourceModelObject;
OptionalUnsigned targetPort;
OptionalUnsigned sourcePort;
OptionalModelObject target2ModelObject;
OptionalModelObject source2ModelObject;
OptionalUnsigned target2Port;
OptionalUnsigned source2Port;
HVACComponent thisObject = getObject<HVACComponent>();
if( _loop && _loop->demandComponent(handle()) )
{
targetModelObject = waterOutletModelObject()->optionalCast<Node>();
sourceModelObject = waterInletModelObject()->optionalCast<Node>();
targetPort = connectedObjectPort(waterOutletPort());
sourcePort = connectedObjectPort(waterInletPort());
target2ModelObject = targetModelObject->outletModelObject();
source2ModelObject = sourceModelObject->inletModelObject();
target2Port = targetModelObject->connectedObjectPort(targetModelObject->outletPort());
source2Port = sourceModelObject->connectedObjectPort(sourceModelObject->inletPort());
boost::optional<Node> demandInletNode = _loop->demandInletNode();
boost::optional<Node> demandOutletNode = _loop->demandOutletNode();
Mixer mixer = _loop->demandMixer();
Splitter splitter = _loop->demandSplitter();
// If the component is stuck directly between the inlet and outlet node.
if( demandInletNode->handle() == waterInletModelObject()->handle()
&&
demandOutletNode->handle() == waterOutletModelObject()->handle() )
{
model().disconnect(thisObject,waterOutletPort());
model().disconnect(thisObject,waterInletPort());
model().connect( demandInletNode.get(), demandInletNode->outletPort(),
demandOutletNode.get(), demandOutletNode->inletPort() );
return true;
}
// If the component is at the very end of the supply path, but there is another component preceeding this one.
else if( demandOutletNode->handle() == waterOutletModelObject()->handle() )
{
model().disconnect(thisObject,waterOutletPort());
model().disconnect(thisObject,waterInletPort());
model().connect( source2ModelObject.get(), source2Port.get(),
demandOutletNode.get(), demandOutletNode->inletPort() );
sourceModelObject->remove();
return true;
}
// If the component is the only component (except nodes) between a splitter mixer pair
else if( (target2ModelObject.get() == mixer) &&
(source2ModelObject.get() == splitter) )
{
Model _model = model();
int i = splitter.branchIndexForOutletModelObject(sourceModelObject.get());
int j = mixer.branchIndexForInletModelObject(targetModelObject.get());
BOOST_ASSERT(i == j);
splitter.removePortForBranch(i);
mixer.removePortForBranch(i);
_model.disconnect(thisObject,waterOutletPort());
_model.disconnect(thisObject,waterInletPort());
targetModelObject->remove();
sourceModelObject->remove();
if( ! splitter.lastOutletModelObject() )
{
Node newNode(_model);
_model.connect(splitter,splitter.nextOutletPort(),newNode,newNode.inletPort());
_model.connect(newNode,newNode.outletPort(),mixer,mixer.nextInletPort());
}
return true;
}
// Else remove the component and the outlet node
else
{
model().disconnect(thisObject,waterOutletPort());
model().disconnect(thisObject,waterInletPort());
model().connect( sourceModelObject.get(), sourcePort.get(),
target2ModelObject.get(), target2Port.get() );
targetModelObject->remove();
return true;
}
}
//.........这里部分代码省略.........