kicad/pcbnew/class_footprint_wizard.cpp

58 lines
1.0 KiB
C++
Raw Normal View History

/**
* @file class_footprint_wizard.cpp
* @brief Class FOOTPRINT_WIZARD and FOOTPRINT_WIZARDS
*/
#include "class_footprint_wizard.h"
#include <stdio.h>
void FOOTPRINT_WIZARD::register_wizard()
{
2012-07-06 19:10:55 +00:00
FOOTPRINT_WIZARDS::register_wizard( this );
}
2012-07-06 19:10:55 +00:00
/**
* FOOTPRINT_WIZARD system wide static list
*/
std::vector<FOOTPRINT_WIZARD*> FOOTPRINT_WIZARDS::m_FootprintWizards;
2012-07-06 19:10:55 +00:00
FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( int aIndex )
{
return m_FootprintWizards[aIndex];
}
2012-07-06 19:10:55 +00:00
FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( wxString aName )
{
int max = GetSize();
for( int i=0; i<max; i++ )
{
2012-07-06 19:10:55 +00:00
FOOTPRINT_WIZARD *wizard = GetWizard( i );
wxString name = wizard->GetName();
2012-07-06 19:10:55 +00:00
if ( name.Cmp( aName ) )
return wizard;
}
return NULL;
}
int FOOTPRINT_WIZARDS::GetSize()
{
return m_FootprintWizards.size();
}
void FOOTPRINT_WIZARDS::register_wizard(FOOTPRINT_WIZARD *aWizard)
{
wxString name = aWizard->GetName();
m_FootprintWizards.push_back( aWizard );
}