Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

void CircuitDocument::recursivePinAdd ( Pin pin,
Circuitoid *  circuitoid,
PinList *  unassignedPins 
) [private]

Construct a circuit from the given node, stopping at the groundnodes

Definition at line 603 of file circuitdocument.cpp.

References Pin::circuitDependentPins(), Pin::elements(), Pin::eqId(), Pin::groundDependentPins(), Pin::inputWireList(), Pin::localConnectedPins(), and Pin::outputWireList().

Referenced by splitIntoCircuits().

{
      if (!pin)
            return;
      
      if ( pin->eqId() != -1 )
            unassignedPins->remove(pin);
      
      if ( circuitoid->contains(pin) )
            return;
      circuitoid->addPin(pin);
      
      if ( pin->eqId() == -1 )
            return;
      
      const PinList localConnectedPins = pin->localConnectedPins();
      const PinList::const_iterator end = localConnectedPins.end();
      for ( PinList::const_iterator it = localConnectedPins.begin(); it != end; ++it )
            recursivePinAdd( *it, circuitoid, unassignedPins );
      
      const WireList inputList = pin->inputWireList();
      WireList::const_iterator conEnd = inputList.end();
      for ( WireList::const_iterator it = inputList.begin(); it != conEnd; ++it )
            circuitoid->addWire(*it);
      
      const WireList outputList = pin->outputWireList();
      conEnd = outputList.end();
      for ( WireList::const_iterator it = outputList.begin(); it != conEnd; ++it )
            circuitoid->addWire(*it);
      
      const PinList groundDependentPins = pin->groundDependentPins();
      const PinList::const_iterator gdEnd = groundDependentPins.end();
      for ( PinList::const_iterator it = groundDependentPins.begin(); it != gdEnd; ++it )
            recursivePinAdd( *it, circuitoid, unassignedPins );
      
      const PinList circuitDependentPins = pin->circuitDependentPins();
      const PinList::const_iterator cdEnd = circuitDependentPins.end();
      for ( PinList::const_iterator it = circuitDependentPins.begin(); it != cdEnd; ++it )
            recursivePinAdd( *it, circuitoid, unassignedPins );
      
      const ElementList elements = pin->elements();
      const ElementList::const_iterator eEnd = elements.end();
      for ( ElementList::const_iterator it = elements.begin(); it != eEnd; ++it )
            circuitoid->addElement(*it);
}


Generated by  Doxygen 1.6.0   Back to index