本文整理汇总了C++中LIB_PIN::Type方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_PIN::Type方法的具体用法?C++ LIB_PIN::Type怎么用?C++ LIB_PIN::Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_PIN
的用法示例。
在下文中一共展示了LIB_PIN::Type方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findAllInstancesOfComponent
void NETLIST_EXPORTER::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
LIB_PART* aEntry,
SCH_SHEET_PATH* aSheetPath )
{
wxString ref = aComponent->GetRef( aSheetPath );
wxString ref2;
SCH_SHEET_LIST sheetList;
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
{
for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
{
if( item->Type() != SCH_COMPONENT_T )
continue;
SCH_COMPONENT* comp2 = (SCH_COMPONENT*) item;
ref2 = comp2->GetRef( sheet );
if( ref2.CmpNoCase( ref ) != 0 )
continue;
int unit2 = comp2->GetUnitSelection( sheet ); // slow
for( LIB_PIN* pin = aEntry->GetNextPin(); pin; pin = aEntry->GetNextPin( pin ) )
{
wxASSERT( pin->Type() == LIB_PIN_T );
if( pin->GetUnit() && pin->GetUnit() != unit2 )
continue;
if( pin->GetConvert() && pin->GetConvert() != comp2->GetConvert() )
continue;
// A suitable pin is found: add it to the current list
addPinToComponentPinList( comp2, sheet, pin );
}
}
}
}
示例2: PlacePin
/**
* Managed cursor callback for placing component pins.
*/
void LIB_EDIT_FRAME::PlacePin()
{
LIB_PIN* Pin;
LIB_PIN* CurrentPin = (LIB_PIN*) m_drawItem;
bool ask_for_pin = true;
wxPoint newpos;
bool status;
// Some tests
if( (CurrentPin == NULL) || (CurrentPin->Type() != LIB_PIN_T) )
{
wxMessageBox( wxT( "LIB_EDIT_FRAME::PlacePin() error" ) );
return;
}
newpos = GetCrossHairPosition( true );
// Test for an other pin in same new position:
for( Pin = m_component->GetNextPin(); Pin != NULL; Pin = m_component->GetNextPin( Pin ) )
{
if( Pin == CurrentPin || newpos != Pin->GetPosition() || Pin->GetFlags() )
continue;
if( ask_for_pin && SynchronizePins() )
{
m_canvas->SetIgnoreMouseEvents( true );
status =
IsOK( this, _( "This position is already occupied by \
another pin. Continue?" ) );
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
if( !status )
return;
else
ask_for_pin = false;
}
}
示例3: AbortPinMove
/**
* Clean up after aborting a move pin command.
*/
static void AbortPinMove( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
LIB_EDIT_FRAME* parent = (LIB_EDIT_FRAME*) Panel->GetParent();
if( parent == NULL )
return;
LIB_PIN* pin = (LIB_PIN*) parent->GetDrawItem();
if( pin == NULL || pin->Type() != LIB_PIN_T )
return;
pin->ClearFlags();
if( pin->IsNew() )
delete pin;
else
parent->RestoreComponent();
// clear edit flags
parent->SetDrawItem( NULL );
parent->SetLastDrawItem( NULL );
Panel->Refresh( true );
}
示例4: findNextComponentAndCreatePinList
SCH_COMPONENT* NETLIST_EXPORTER::findNextComponentAndCreatePinList( EDA_ITEM* aItem,
SCH_SHEET_PATH* aSheetPath )
{
wxString ref;
m_SortedComponentPinList.clear();
// continue searching from the middle of a linked list (the draw list)
for( ; aItem; aItem = aItem->Next() )
{
if( aItem->Type() != SCH_COMPONENT_T )
continue;
// found next component
SCH_COMPONENT* comp = (SCH_COMPONENT*) aItem;
// Power symbols and other components which have the reference starting
// with "#" are not included in netlist (pseudo or virtual components)
ref = comp->GetRef( aSheetPath );
if( ref[0] == wxChar( '#' ) )
continue;
// if( Component->m_FlagControlMulti == 1 )
// continue; /* yes */
// removed because with multiple instances of one schematic
// (several sheets pointing to 1 screen), this will be erroneously be
// toggled.
LIB_PART* part = m_libs->FindLibPart( comp->GetPartName() );
if( !part )
continue;
// If component is a "multi parts per package" type
if( part->GetUnitCount() > 1 )
{
// test if this reference has already been processed, and if so skip
if( m_ReferencesAlreadyFound.Lookup( ref ) )
continue;
// Collect all pins for this reference designator by searching
// the entire design for other parts with the same reference designator.
// This is only done once, it would be too expensive otherwise.
findAllInstancesOfComponent( comp, part, aSheetPath );
}
else // entry->GetUnitCount() <= 1 means one part per package
{
LIB_PINS pins; // constructed once here
part->GetPins( pins, comp->GetUnitSelection( aSheetPath ), comp->GetConvert() );
for( size_t i = 0; i < pins.size(); i++ )
{
LIB_PIN* pin = pins[i];
wxASSERT( pin->Type() == LIB_PIN_T );
addPinToComponentPinList( comp, aSheetPath, pin );
}
}
// Sort pins in m_SortedComponentPinList by pin number
sort( m_SortedComponentPinList.begin(),
m_SortedComponentPinList.end(), sortPinsByNum );
// Remove duplicate Pins in m_SortedComponentPinList
eraseDuplicatePins( );
// record the usage of this library component entry.
m_LibParts.insert( part ); // rejects non-unique pointers
return comp;
}
return NULL;
}