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

void Component::initDIP ( const QStringList &  pins  )  [protected, inherited]

This creates a set of nodes with their internal IDs set to those in QStringList pins. The pins are in a DIP arrangement, and are spaced width() apart.

Definition at line 410 of file component.cpp.

References Component::updateAttachedPositioning().

Referenced by PICComponent::initPackage(), Multiplexer::initPins(), Demultiplexer::initPins(), DAC::initPins(), ADC::initPins(), and ECSubcircuit::setNumExtCon().

{
    const int numPins = pins.size();
    const int numSide = numPins/2 + numPins%2;

    // Pins along left
    for ( int i=0; i<numSide; i++ )
    {
        if ( !pins[i].isEmpty() )
        {
            const int nodeX = -8+offsetX();
            const int nodeY = (i+1)*16+offsetY();
            ECNode *node = ecNodeWithID(pins[i]);
            if (node)
            {
                m_nodeMap[pins[i]].x = nodeX;
                m_nodeMap[pins[i]].y = nodeY;
                m_nodeMap[pins[i]].orientation = 0;
            }
            else
                createPin( nodeX, nodeY, 0, pins[i] );
        }
    }
    // Pins along right
    for ( int i=numSide; i<numPins; i++ )
    {
        if ( !pins[i].isEmpty() )
        {
            const int nodeX = width()+8+offsetX();
            const int nodeY = (2*numSide-i)*16+offsetY();
            ECNode *node = ecNodeWithID(pins[i]);
            if (node)
            {
                m_nodeMap[pins[i]].x = nodeX;
                m_nodeMap[pins[i]].y = nodeY;
                m_nodeMap[pins[i]].orientation = 180;
            }
            else
                createPin( nodeX, nodeY, 180, pins[i] );
        }
    }

    updateAttachedPositioning();
}


Generated by  Doxygen 1.6.0   Back to index