本文整理汇总了C++中LIB_PIN::SetPinNumFromString方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_PIN::SetPinNumFromString方法的具体用法?C++ LIB_PIN::SetPinNumFromString怎么用?C++ LIB_PIN::SetPinNumFromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_PIN
的用法示例。
在下文中一共展示了LIB_PIN::SetPinNumFromString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateImagePins
void LIB_EDIT_FRAME::CreateImagePins( LIB_PIN* aPin, int aUnit, int aConvert, bool aDeMorgan )
{
int ii;
LIB_PIN* NewPin;
if( !SynchronizePins() )
return;
// Create "convert" pin at the current position.
if( aDeMorgan && ( aPin->GetConvert() != 0 ) )
{
NewPin = (LIB_PIN*) aPin->Clone();
if( aPin->GetConvert() > 1 )
NewPin->SetConvert( 1 );
else
NewPin->SetConvert( 2 );
aPin->GetParent()->AddDrawItem( NewPin );
}
for( ii = 1; ii <= aPin->GetParent()->GetUnitCount(); ii++ )
{
if( ii == aUnit || aPin->GetUnit() == 0 )
continue; // Pin common to all units.
NewPin = (LIB_PIN*) aPin->Clone();
// To avoid mistakes, gives this pin a new pin number because
// it does no have the save pin number as the master pin
// Because we do not know the actual number, give it '??'
wxString unknownNum( wxT( "??" ) );
NewPin->SetPinNumFromString( unknownNum );
if( aConvert != 0 )
NewPin->SetConvert( 1 );
NewPin->SetUnit( ii );
aPin->GetParent()->AddDrawItem( NewPin );
if( !( aDeMorgan && ( aPin->GetConvert() != 0 ) ) )
continue;
NewPin = (LIB_PIN*) aPin->Clone();
NewPin->SetConvert( 2 );
// Gives this pin a new pin number
// Because we do not know the actual number, give it '??'
NewPin->SetPinNumFromString( unknownNum );
if( aPin->GetUnit() != 0 )
NewPin->SetUnit( ii );
aPin->GetParent()->AddDrawItem( NewPin );
}
}
示例2: RepeatPinItem
// Create a new pin based on the previous pin with an incremented pin number.
void LIB_EDIT_FRAME::RepeatPinItem( wxDC* DC, LIB_PIN* SourcePin )
{
wxString msg;
LIB_PART* part = GetCurPart();
if( !part || !SourcePin || SourcePin->Type() != LIB_PIN_T )
return;
LIB_PIN* pin = (LIB_PIN*) SourcePin->Clone();
pin->ClearFlags();
pin->SetFlags( IS_NEW );
wxPoint step;
switch( pin->GetOrientation() )
{
case PIN_UP:
step.x = GetRepeatPinStep();
break;
case PIN_DOWN:
step.x = GetRepeatPinStep();
break;
case PIN_LEFT:
step.y = - GetRepeatPinStep();
break;
case PIN_RIGHT:
step.y = - GetRepeatPinStep();
break;
}
pin->Move( pin->GetPosition() + step );
wxString nextName = pin->GetName();
IncrementLabelMember( nextName, GetRepeatDeltaLabel() );
pin->SetName( nextName );
pin->PinStringNum( msg );
IncrementLabelMember( msg, GetRepeatDeltaLabel() );
pin->SetPinNumFromString( msg );
m_drawItem = pin;
if( SynchronizePins() )
pin->SetFlags( IS_LINKED );
wxPoint savepos = GetCrossHairPosition();
m_canvas->CrossHairOff( DC );
SetCrossHairPosition( wxPoint( pin->GetPosition().x, -pin->GetPosition().y ) );
// Add this new pin in list, and creates pins for others parts if needed
m_drawItem = pin;
ClearTempCopyComponent();
PlacePin();
m_lastDrawItem = pin;
SetCrossHairPosition( savepos );
m_canvas->CrossHairOn( DC );
MSG_PANEL_ITEMS items;
pin->GetMsgPanelInfo( items );
SetMsgPanel( items );
OnModify( );
}