本文整理汇总了C++中LIB_PIN::SetConvert方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_PIN::SetConvert方法的具体用法?C++ LIB_PIN::SetConvert怎么用?C++ LIB_PIN::SetConvert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_PIN
的用法示例。
在下文中一共展示了LIB_PIN::SetConvert方法的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: CreatePin
/*
* Create a new pin.
*/
void LIB_EDIT_FRAME::CreatePin( wxDC* DC )
{
LIB_PART* part = GetCurPart();
if( !part )
return;
part->ClearStatus();
LIB_PIN* pin = new LIB_PIN( part );
m_drawItem = pin;
pin->SetFlags( IS_NEW );
pin->SetUnit( m_unit );
pin->SetConvert( m_convert );
// Flag pins to consider
if( SynchronizePins() )
pin->SetFlags( IS_LINKED );
pin->Move( GetCrossHairPosition( true ) );
pin->SetLength( GetLastPinLength() );
pin->SetOrientation( LastPinOrient );
pin->SetType( LastPinType );
pin->SetShape( LastPinShape );
pin->SetNameTextSize( GetLastPinNameSize() );
pin->SetNumberTextSize( GetLastPinNumSize() );
pin->SetConvert( LastPinCommonConvert ? 0 : m_convert );
pin->SetUnit( LastPinCommonUnit ? 0 : m_unit );
pin->SetVisible( LastPinVisible );
PinPreviousPos = pin->GetPosition();
m_canvas->SetIgnoreMouseEvents( true );
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetId( ID_LIBEDIT_EDIT_PIN );
GetEventHandler()->ProcessEvent( cmd );
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
if( pin->GetFlags() & IS_CANCELLED )
{
deleteItem( DC );
}
else
{
ClearTempCopyComponent();
m_canvas->SetMouseCapture( DrawMovePin, AbortPinMove );
if( DC )
{
int show_opts = PIN_DRAW_TEXTS | PIN_DRAW_DANGLING | PIN_DANGLING_HIDDEN;
if( GetShowElectricalType() )
show_opts |= PIN_DRAW_ELECTRICAL_TYPE_NAME;
// In LIB_PIN::Draw() a void* parameter used as flag to pass show_opts.
// Build it:
void* showOptions = reinterpret_cast<void*>( show_opts );
pin->Draw( m_canvas, DC, wxPoint( 0, 0 ), UNSPECIFIED_COLOR, GR_COPY,
showOptions, DefaultTransform );
}
}
}