2012-05-09 17:37:25 +00:00
|
|
|
/**
|
|
|
|
* @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-05-09 17:37:25 +00:00
|
|
|
}
|
|
|
|
|
2012-07-06 19:10:55 +00:00
|
|
|
/**
|
|
|
|
* FOOTPRINT_WIZARD system wide static list
|
|
|
|
*/
|
2012-05-09 17:37:25 +00:00
|
|
|
std::vector<FOOTPRINT_WIZARD*> FOOTPRINT_WIZARDS::m_FootprintWizards;
|
|
|
|
|
2012-05-09 23:04:08 +00:00
|
|
|
|
2012-07-06 19:10:55 +00:00
|
|
|
FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( int aIndex )
|
2012-05-09 23:04:08 +00:00
|
|
|
{
|
|
|
|
return m_FootprintWizards[aIndex];
|
|
|
|
}
|
|
|
|
|
2012-07-06 19:10:55 +00:00
|
|
|
FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( wxString aName )
|
2012-05-09 23:04:08 +00:00
|
|
|
{
|
|
|
|
int max = GetSize();
|
|
|
|
|
2012-07-06 19:10:55 +00:00
|
|
|
for( int i=0; i<max;i++ )
|
2012-05-09 23:04:08 +00:00
|
|
|
{
|
2012-07-06 19:10:55 +00:00
|
|
|
FOOTPRINT_WIZARD *wizard = GetWizard( i );
|
|
|
|
|
2012-05-09 23:04:08 +00:00
|
|
|
wxString name = wizard->GetName();
|
2012-07-06 19:10:55 +00:00
|
|
|
|
|
|
|
if ( name.Cmp(aName) )
|
2012-05-09 23:04:08 +00:00
|
|
|
return wizard;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
int FOOTPRINT_WIZARDS::GetSize()
|
|
|
|
{
|
|
|
|
return m_FootprintWizards.size();
|
|
|
|
}
|
|
|
|
|
2012-05-09 17:37:25 +00:00
|
|
|
void FOOTPRINT_WIZARDS::register_wizard(FOOTPRINT_WIZARD *aWizard)
|
|
|
|
{
|
|
|
|
|
|
|
|
wxString name = aWizard->GetName();
|
|
|
|
m_FootprintWizards.push_back(aWizard);
|
|
|
|
|
2012-07-06 19:10:55 +00:00
|
|
|
//printf("Registered footprint wizard '%s'\n",(const char*)name.mb_str() );
|
2012-05-09 17:37:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|