void SCH_SCREEN::CheckComponentsToPartsLinks()
{
    // Initialize or reinitialize the pointer to the LIB_PART for each component
    // found in m_drawList, but only if needed (change in lib or schematic)
    // therefore the calculation time is usually very low.

    if( m_drawList.GetCount() )
    {
        PART_LIBS*  libs = Prj().SchLibs();
        int         mod_hash = libs->GetModifyHash();

        // Must we resolve?
        if( m_modification_sync != mod_hash )
        {
            SCH_TYPE_COLLECTOR c;

            c.Collect( GetDrawItems(), SCH_COLLECTOR::ComponentsOnly );

            SCH_COMPONENT::ResolveAll( c, libs );

            m_modification_sync = mod_hash;     // note the last mod_hash

            // guard against unneeded runs through this code path by printing trace
            DBG(printf("%s: resync-ing %s\n", __func__, TO_UTF8( GetFileName() ) );)
        }
示例#2
0
void SCH_SCREEN::UpdateSymbolLinks( bool aForce )
{
    // Initialize or reinitialize the pointer to the LIB_PART for each component
    // found in m_drawList, but only if needed (change in lib or schematic)
    // therefore the calculation time is usually very low.
    if( m_drawList.GetCount() )
    {
        SYMBOL_LIB_TABLE* libs = Prj().SchSymbolLibTable();
        int mod_hash = libs->GetModifyHash();
        SCH_TYPE_COLLECTOR c;

        c.Collect( GetDrawItems(), SCH_COLLECTOR::ComponentsOnly );

        // Must we resolve?
        if( (m_modification_sync != mod_hash) || aForce )
        {
            SCH_COMPONENT::ResolveAll( c, *libs, Prj().SchLibs()->GetCacheLibrary() );

            m_modification_sync = mod_hash;     // note the last mod_hash
        }
        // Resolving will update the pin caches but we must ensure that this happens
        // even if the libraries don't change.
        else
            SCH_COMPONENT::UpdateAllPinCaches( c );
    }
}
示例#3
0
void SCH_SCREEN::BuildSchCmpLinksToLibCmp()
{
    // Initialize or reinitialize the pointer to the LIB_PART for each component
    // found in m_drawList, but only if needed (change in lib or schematic)
    // therefore the calculation time is usually very low.

    if( m_drawList.GetCount() )
    {
        PART_LIBS*  libs = Prj().SchLibs();
        int         mod_hash = libs->GetModifyHash();

        // Must we resolve?
        if( m_modification_sync != mod_hash )
        {
            SCH_TYPE_COLLECTOR c;

            c.Collect( GetDrawItems(), SCH_COLLECTOR::ComponentsOnly );

            SCH_COMPONENT::ResolveAll( c, libs );

            m_modification_sync = mod_hash;     // note the last mod_hash
        }
    }
}