本文整理汇总了C++中FOOTPRINT_WIZARD类的典型用法代码示例。如果您正苦于以下问题:C++ FOOTPRINT_WIZARD类的具体用法?C++ FOOTPRINT_WIZARD怎么用?C++ FOOTPRINT_WIZARD使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FOOTPRINT_WIZARD类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMyWizard
void FOOTPRINT_WIZARD_FRAME::ReCreatePageList()
{
if( m_pageList == NULL )
return;
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( !footprintWizard )
return;
m_pageList->Clear();
int max_page = footprintWizard->GetNumParameterPages();
for( int i = 0; i<max_page; i++ )
{
wxString name = footprintWizard->GetParameterPageName( i );
m_pageList->Append( name );
}
m_pageList->SetSelection( 0, true );
ReCreateParameterList();
ReCreateHToolbar();
DisplayWizardInfos();
m_canvas->Refresh();
}
示例2: GetMyWizard
void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
{
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( !footprintWizard )
return;
SetCurItem( NULL );
// Delete the current footprint
GetBoard()->m_Modules.DeleteAll();
// Creates the module
wxString msg;
MODULE* module = footprintWizard->GetFootprint( &msg );
DisplayBuildMessage( msg );
if( module )
{
// Add the object to board
GetBoard()->Add( module, ADD_APPEND );
module->SetPosition( wxPoint( 0, 0 ) );
}
else
{
DBG(printf( "footprintWizard->GetFootprint() returns NULL\n" );)
}
m_canvas->Refresh();
}
示例3: GetMyWizard
void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
{
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( !footprintWizard )
return;
SetCurItem( NULL );
// Delete the current footprint
GetBoard()->m_Modules.DeleteAll();
// Creates the module
MODULE* module = footprintWizard->GetModule();
if( module )
{
// Add the object to board
module->SetParent( (EDA_ITEM*) GetBoard() );
GetBoard()->m_Modules.Append( module );
module->SetPosition( wxPoint( 0, 0 ) );
}
else
{
DBG(printf( "footprintWizard->GetModule() returns NULL\n" );)
}
m_canvas->Refresh();
}
示例4: DIALOG_FOOTPRINT_WIZARD_LIST
void FOOTPRINT_WIZARD_FRAME::SelectFootprintWizard()
{
DIALOG_FOOTPRINT_WIZARD_LIST* selectWizard =
new DIALOG_FOOTPRINT_WIZARD_LIST( this );
if( selectWizard->ShowModal() != wxID_OK )
return;
FOOTPRINT_WIZARD* footprintWizard = selectWizard->GetWizard();
if( footprintWizard )
{
m_wizardName = footprintWizard->GetName();
m_wizardDescription = footprintWizard->GetDescription();
}
else
{
m_wizardName = wxT( "" );
m_wizardDescription = wxT( "" );
}
ReloadFootprint();
Zoom_Automatique( false );
DisplayWizardInfos();
ReCreatePageList();
ReCreateParameterList();
}
示例5: GetBuiltFootprint
MODULE* FOOTPRINT_WIZARD_FRAME::GetBuiltFootprint()
{
FOOTPRINT_WIZARD* footprintWizard = FOOTPRINT_WIZARDS::GetWizard( m_wizardName );
if( footprintWizard && m_exportRequest )
{
return footprintWizard->GetModule();
}
return NULL;
}
示例6: GetBuiltFootprint
MODULE* FOOTPRINT_WIZARD_FRAME::GetBuiltFootprint()
{
FOOTPRINT_WIZARD* footprintWizard = FOOTPRINT_WIZARDS::GetWizard( m_wizardName );
if( footprintWizard && m_modal_ret_val )
{
wxString msg;
MODULE * footprint = footprintWizard->GetFootprint( &msg );
DisplayBuildMessage( msg );
return footprint;
}
return NULL;
}
示例7: GetSize
FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( wxString aName )
{
int max = GetSize();
for( int i=0; i<max; i++ )
{
FOOTPRINT_WIZARD *wizard = GetWizard( i );
wxString name = wizard->GetName();
if ( name.Cmp( aName ) )
return wizard;
}
return NULL;
}
示例8: GetWizardsCount
bool FOOTPRINT_WIZARDS::deregister_object( void* aObject )
{
int max = GetWizardsCount();
for( int i = 0; i<max; i++ )
{
FOOTPRINT_WIZARD* wizard = GetWizard( i );
if( wizard->GetObject() == aObject )
{
m_FootprintWizards.erase( m_FootprintWizards.begin() + i );
delete wizard;
return true;
}
}
return false;
}
示例9: initLists
void DIALOG_FOOTPRINT_WIZARD_LIST::initLists()
{
// Current wizard selection, empty or first
m_footprintWizard = NULL;
int n_wizards = FOOTPRINT_WIZARDS::GetWizardsCount();
if( n_wizards )
m_footprintWizard = FOOTPRINT_WIZARDS::GetWizard( 0 );
// Choose selection mode and insert the needed rows
m_footprintGeneratorsGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
int curr_row_cnt = m_footprintGeneratorsGrid->GetNumberRows();
m_footprintGeneratorsGrid->DeleteRows( 0, curr_row_cnt );
m_footprintGeneratorsGrid->InsertRows( 0, n_wizards );
// Put all wizards in the list
for( int ii = 0; ii < n_wizards; ii++ )
{
wxString num = wxString::Format( "%d", ii+1 );
FOOTPRINT_WIZARD *wizard = FOOTPRINT_WIZARDS::GetWizard( ii );
wxString name = wizard->GetName();
wxString description = wizard->GetDescription();
wxString image = wizard->GetImage();
m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_NUMBER, num );
m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_NAME, name );
m_footprintGeneratorsGrid->SetCellValue( ii, FP_GEN_ROW_DESCR, description );
}
m_footprintGeneratorsGrid->AutoSizeColumns();
// Auto-expand the description column
int width = m_footprintGeneratorsGrid->GetClientSize().GetWidth() -
m_footprintGeneratorsGrid->GetRowLabelSize() -
m_footprintGeneratorsGrid->GetColSize( FP_GEN_ROW_NAME );
if ( width > m_footprintGeneratorsGrid->GetColMinimalAcceptableWidth() )
m_footprintGeneratorsGrid->SetColSize( FP_GEN_ROW_DESCR, width );
// Select the first row
m_footprintGeneratorsGrid->ClearSelection();
m_footprintGeneratorsGrid->SelectRow( 0, false );
// Display info about scripts: Search paths
wxString message;
pcbnewGetScriptsSearchPaths( message );
m_tcSearchPaths->SetValue( message );
// Display info about scripts: unloadable scripts (due to syntax errors is python source)
pcbnewGetUnloadableScriptNames( message );
if( message.IsEmpty() )
{
m_tcNotLoaded->SetValue( _( "All footprint generator scripts were loaded" ) );
m_buttonShowTrace->Show( false );
}
else
m_tcNotLoaded->SetValue( message );
}
示例10: GetMyWizard
void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList()
{
if( m_parameterGrid == NULL )
return;
FOOTPRINT_WIZARD* footprintWizard = GetMyWizard();
if( footprintWizard == NULL )
return;
int page = m_pageList->GetSelection();
if( page<0 )
return;
m_parameterGrid->ClearGrid();
// Get the list of names, values, and types
wxArrayString fpList = footprintWizard->GetParameterNames( page );
wxArrayString fvList = footprintWizard->GetParameterValues( page );
wxArrayString ptList = footprintWizard->GetParameterTypes( page );
// Dimension the wxGrid
if( m_parameterGrid->GetNumberRows() > 0 )
m_parameterGrid->DeleteRows( 0, m_parameterGrid->GetNumberRows() );
m_parameterGrid->AppendRows( fpList.size() );
wxString value, units;
for( unsigned int i = 0; i< fpList.size(); i++ )
{
value = fvList[i];
m_parameterGrid->SetCellValue( i, m_columnPrmName, fpList[i] );
m_parameterGrid->SetReadOnly( i, m_columnPrmName );
if( ptList[i]==wxT( "IU" ) )
{
LOCALE_IO toggle;
// We are handling internal units, so convert them to the current
// system selected units and store into value.
double dValue;
value.ToDouble( &dValue );
dValue = To_User_Unit( g_UserUnit, dValue );
if( g_UserUnit==INCHES ) // we convert inches into mils for more detail
{
dValue = dValue * 1000.0;
units = wxT( "mils" );
}
else if( g_UserUnit==MILLIMETRES )
{
units = wxT( "mm" );
}
// Use Double2Str to build the string, because useless trailing 0
// are removed. The %f format does not remove them
std::string s = Double2Str( dValue );
value = FROM_UTF8( s.c_str() );
}
else if( ptList[i]==wxT( "UNITS" ) ) // 1,2,3,4,5 ... N
{
units = wxT( "" );
}
m_parameterGrid->SetCellValue( i, m_columnPrmValue, value );
m_parameterGrid->SetCellValue( i, m_columnPrmUnit, units );
m_parameterGrid->SetReadOnly( i, m_columnPrmUnit );
}
m_parameterGrid->AutoSizeColumns();
}