本文整理汇总了C++中FPID::SetFootprintName方法的典型用法代码示例。如果您正苦于以下问题:C++ FPID::SetFootprintName方法的具体用法?C++ FPID::SetFootprintName怎么用?C++ FPID::SetFootprintName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FPID
的用法示例。
在下文中一共展示了FPID::SetFootprintName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClickOnFootprintList
void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event )
{
if( m_footprintList->GetCount() == 0 )
return;
int ii = m_footprintList->GetSelection();
if( ii < 0 )
return;
wxString name = m_footprintList->GetString( ii );
if( m_footprintName.CmpNoCase( name ) != 0 )
{
m_footprintName = name;
SetCurItem( NULL );
// Delete the current footprint
GetBoard()->m_Modules.DeleteAll();
FPID id;
id.SetLibNickname( m_libraryName );
id.SetFootprintName( m_footprintName );
try
{
GetBoard()->Add( loadFootprint( id ) );
}
catch( const IO_ERROR& ioe )
{
wxString msg;
msg.Printf( _( "Could not load footprint \"%s\" from library \"%s\".\n\n"
"Error %s." ), GetChars( m_footprintName ), GetChars( m_libraryName ),
GetChars( ioe.errorText ) );
DisplayError( this, msg );
}
UpdateTitle();
Zoom_Automatique( false );
m_canvas->Refresh();
Update3D_Frame();
}
}
示例2: table
FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType ) :
PCB_BASE_FRAME( aKiway, aParent, aFrameType, _( "Footprint Library Browser" ),
wxDefaultPosition, wxDefaultSize,
aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ?
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT :
KICAD_DEFAULT_DRAWFRAME_STYLE,
GetFootprintViewerFrameName() )
{
wxASSERT( aFrameType==FRAME_PCB_MODULE_VIEWER || aFrameType==FRAME_PCB_MODULE_VIEWER_MODAL );
if( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL )
SetModal( true );
wxAcceleratorTable table( DIM( accels ), accels );
m_FrameName = GetFootprintViewerFrameName();
m_configPath = wxT( "FootprintViewer" );
m_showAxis = true; // true to draw axis.
// Give an icon
wxIcon icon;
icon.CopyFromBitmap( KiBitmap( modview_icon_xpm ) );
SetIcon( icon );
m_HotkeysZoomAndGridList = g_Module_Viewer_Hokeys_Descr;
m_libList = new wxListBox( this, ID_MODVIEW_LIB_LIST,
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL );
m_footprintList = new wxListBox( this, ID_MODVIEW_FOOTPRINT_LIST,
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_HSCROLL );
SetBoard( new BOARD() );
// Ensure all layers and items are visible:
GetBoard()->SetVisibleAlls();
SetScreen( new PCB_SCREEN( GetPageSizeIU() ) );
GetScreen()->m_Center = true; // Center coordinate origins on screen.
LoadSettings( config() );
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
ReCreateHToolbar();
ReCreateVToolbar();
ReCreateLibraryList();
UpdateTitle();
// If a footprint was previously loaded, reload it
if( getCurNickname().size() && getCurFootprintName().size() )
{
FPID id;
id.SetLibNickname( getCurNickname() );
id.SetFootprintName( getCurFootprintName() );
GetBoard()->Add( loadFootprint( id ) );
}
if( m_canvas )
m_canvas->SetAcceleratorTable( table );
m_auimgr.SetManagedWindow( this );
wxSize minsize(100,-1); // Min size of list boxes
// Main toolbar is initially docked at the top of the main window and dockable on any side.
// The close button is disable because the footprint viewer has no main menu to re-enable it.
// The tool bar will only be dockable on the top or bottom of the main frame window. This is
// most likely due to the fact that the other windows are not dockable and are preventing the
// tool bar from docking on the right and left.
wxAuiPaneInfo toolbarPaneInfo;
toolbarPaneInfo.Name( wxT( "m_mainToolBar" ) ).ToolbarPane().Top().CloseButton( false );
EDA_PANEINFO info;
info.InfoToolbarPane();
EDA_PANEINFO mesg;
mesg.MessageToolbarPane();
// Manage main toolbar, top pane
m_auimgr.AddPane( m_mainToolBar, toolbarPaneInfo );
// Manage the list of libraries, left pane.
m_auimgr.AddPane( m_libList,
wxAuiPaneInfo( info ).Name( wxT( "m_libList" ) )
.Left().Row( 1 ).MinSize( minsize ) );
// Manage the list of footprints, center pane.
m_auimgr.AddPane( m_footprintList,
wxAuiPaneInfo( info ).Name( wxT( "m_footprintList" ) )
.Left().Row( 2 ).MinSize( minsize ) );
// Manage the draw panel, right pane.
m_auimgr.AddPane( m_canvas,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
// Manage the message panel, bottom pane.
//.........这里部分代码省略.........
示例3: loadComponent
COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText )
throw( PARSE_ERROR, boost::bad_pointer )
{
char* text;
wxString msg;
wxString timeStamp; // the full time stamp read from netlist
wxString footprintName; // the footprint name read from netlist
wxString value; // the component value read from netlist
wxString reference; // the component schematic reference designator read from netlist
wxString name; // the name of component that was placed in the schematic
char line[1024];
strcpy( line, aText );
value = wxT( "~" );
// Sample component line: /40C08647 $noname R20 4.7K {Lib=R}
// Read time stamp (first word)
if( ( text = strtok( line, " ()\t\n" ) ) == NULL )
{
msg = _( "Cannot parse time stamp in component section of netlist." );
THROW_PARSE_ERROR( msg, m_lineReader->GetSource(), line, m_lineReader->LineNumber(),
m_lineReader->Length() );
}
timeStamp = FROM_UTF8( text );
// Read footprint name (second word)
if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL )
{
msg = _( "Cannot parse footprint name in component section of netlist." );
THROW_PARSE_ERROR( msg, m_lineReader->GetSource(), aText, m_lineReader->LineNumber(),
m_lineReader->Length() );
}
footprintName = FROM_UTF8( text );
// The footprint name will have to be looked up in the *.cmp file.
if( footprintName == wxT( "$noname" ) )
footprintName = wxEmptyString;
// Read schematic reference designator (third word)
if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL )
{
msg = _( "Cannot parse reference designator in component section of netlist." );
THROW_PARSE_ERROR( msg, m_lineReader->GetSource(), aText, m_lineReader->LineNumber(),
m_lineReader->Length() );
}
reference = FROM_UTF8( text );
// Read schematic value (forth word)
if( ( text = strtok( NULL, " ()\t\n" ) ) == NULL )
{
msg = _( "Cannot parse value in component section of netlist." );
THROW_PARSE_ERROR( msg, m_lineReader->GetSource(), aText, m_lineReader->LineNumber(),
m_lineReader->Length() );
}
value = FROM_UTF8( text );
// Read component name (fifth word) {Lib=C}
// This is an optional field (a comment), which does not always exists
if( ( text = strtok( NULL, " ()\t\n" ) ) != NULL )
{
name = FROM_UTF8( text ).AfterFirst( wxChar( '=' ) ).BeforeLast( wxChar( '}' ) );
}
FPID fpid;
if( !footprintName.IsEmpty() )
fpid.SetFootprintName( footprintName );
COMPONENT* component = new COMPONENT( fpid, reference, value, timeStamp );
component->SetName( name );
m_netlist->AddComponent( component );
return component;
}