本文整理汇总了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 );
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}