当前位置: 首页>>代码示例>>C++>>正文


C++ SCH_REFERENCE类代码示例

本文整理汇总了C++中SCH_REFERENCE的典型用法代码示例。如果您正苦于以下问题:C++ SCH_REFERENCE类的具体用法?C++ SCH_REFERENCE怎么用?C++ SCH_REFERENCE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SCH_REFERENCE类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SCH_REFERENCE

void SCH_SHEET_PATH::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols )
{
    // Search to sheet path number:
    int sheetnumber = 1;    // 1 = root

    SCH_SHEET_LIST sheetList;

    for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext(), sheetnumber++ )
    {
        if( Cmp( *path ) == 0 )
            break;
    }

    for( SCH_ITEM* item = LastDrawList(); item; item = item->Next() )
    {
        if( item->Type() == SCH_COMPONENT_T )
        {
            SCH_COMPONENT* component = (SCH_COMPONENT*) item;

            // Skip pseudo components, which have a reference starting with #.  This mainly
            // affects power symbols.
            if( !aIncludePowerSymbols && component->GetRef( this )[0] == wxT( '#' ) )
                continue;

            LIB_PART* part = aLibs->FindLibPart( component->GetPartName() );
            if( part )
            {
                SCH_REFERENCE reference = SCH_REFERENCE( component, part, *this );
                reference.SetSheetNumber( sheetnumber );
                aReferences.AddItem( reference );
            }
        }
    }
}
开发者ID:bpkempke,项目名称:kicad-source-mirror,代码行数:34,代码来源:sch_sheet_path.cpp

示例2: buildFullReference

// A helper function to build a full reference string of a SCH_REFERENCE item
wxString buildFullReference( const SCH_REFERENCE& aItem )
{
    wxString fullref;
    fullref = aItem.GetRef() + aItem.GetRefNumber();
    fullref << ".." << aItem.GetUnit();

    return fullref;
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:9,代码来源:component_references_lister.cpp

示例3: AddUnit

/**
 * Try to add a unit to this component
 * If the references match, it will be added
 */
bool BOM_TABLE_COMPONENT::AddUnit( const SCH_REFERENCE& aUnit )
{
    // Addition is successful if the references match or there are currently no units in the group
    if( Units.size() == 0  || Units[0].GetRef().Cmp( aUnit.GetRef() ) == 0 )
    {
        Units.push_back( aUnit );

        wxString value;

        // Extract the component data
        for( auto column : m_columnList->Columns )
        {
            auto cmp = aUnit.GetComp();

            switch( column->Id() )
            {
            case BOM_COL_ID_QUANTITY:
                value = wxEmptyString;
                break;

            case BOM_COL_ID_DESCRIPTION:
                value = cmp->GetAliasDescription();
                break;

            case BOM_COL_ID_DATASHEET:
                value = cmp->GetField( DATASHEET )->GetText();
                if( value.IsEmpty() )
                {
                    value = cmp->GetAliasDocumentation();
                }
                break;

            case BOM_COL_ID_REFERENCE:
                value = aUnit.GetRef();
                break;

            case BOM_COL_ID_VALUE:
                value = cmp->GetField( VALUE )->GetText();
                break;

            case BOM_COL_ID_FOOTPRINT:
                value = cmp->GetField( FOOTPRINT )->GetText();
                break;

            // User fields
            default:
                value = cmp->GetFieldText( column->Title(), false );
                break;
            }

            m_fieldValues->SetFieldValue( column->Id(), value );
        }

        return true;
    }

    return false;
}
开发者ID:cpavlina,项目名称:kicad,代码行数:62,代码来源:bom_table_model.cpp

示例4: sortByRefAndValue

bool SCH_REFERENCE_LIST::sortByRefAndValue( const SCH_REFERENCE& item1,
                                            const SCH_REFERENCE& item2 )
{
    int ii = item1.CompareRef( item2 );
    if( ii == 0 )
        ii = item1.CompareValue( item2 );
    if( ii == 0 )
        ii = item1.m_Unit - item2.m_Unit;
    if( ii == 0 )
        ii = item1.m_SheetNum - item2.m_SheetNum;
    if( ii == 0 )
        ii = item1.m_CmpPos.x - item2.m_CmpPos.x;
    if( ii == 0 )
        ii = item1.m_CmpPos.y - item2.m_CmpPos.y;
    if( ii == 0 )
        ii = item1.m_TimeStamp - item2.m_TimeStamp;

    return ii < 0;
}
开发者ID:grtwall,项目名称:kicad-source-mirror,代码行数:19,代码来源:component_references_lister.cpp

示例5: sortByReferenceOnly

bool SCH_REFERENCE_LIST::sortByReferenceOnly( const SCH_REFERENCE& item1,
                                              const SCH_REFERENCE& item2 )
{
    int             ii;

    ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() );

    if( ii == 0 )
    {
        ii = item1.m_RootCmp->GetField( VALUE )->GetText().CmpNoCase( item2.m_RootCmp->GetField( VALUE )->GetText() );
    }

    if( ii == 0 )
    {
        ii = item1.m_Unit - item2.m_Unit;
    }

    return ii < 0;
}
开发者ID:grtwall,项目名称:kicad-source-mirror,代码行数:19,代码来源:component_references_lister.cpp


注:本文中的SCH_REFERENCE类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。