Sync to main branch r6614
This commit is contained in:
commit
ec580cff50
|
@ -436,8 +436,6 @@ void WIDGET_HOTKEY_LIST::OnSize( wxSizeEvent& aEvent )
|
||||||
|
|
||||||
if( hk_column_width < HOTKEY_MIN_WIDTH )
|
if( hk_column_width < HOTKEY_MIN_WIDTH )
|
||||||
hk_column_width = HOTKEY_MIN_WIDTH;
|
hk_column_width = HOTKEY_MIN_WIDTH;
|
||||||
else if( hk_column_width <= 0 )
|
|
||||||
hk_column_width = 1;
|
|
||||||
|
|
||||||
int name_column_width = rect.width - hk_column_width - HORIZ_MARGIN;
|
int name_column_width = rect.width - hk_column_width - HORIZ_MARGIN;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2013 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -69,7 +69,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
||||||
SCH_SCREENS screens;
|
SCH_SCREENS screens;
|
||||||
|
|
||||||
// Build the sheet list.
|
// Build the sheet list.
|
||||||
SCH_SHEET_LIST sheets;
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
|
|
||||||
// Map of locked components
|
// Map of locked components
|
||||||
SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
|
SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
|
||||||
|
@ -187,7 +187,7 @@ void SCH_EDIT_FRAME::AnnotateComponents( bool aAnnotateSchematic,
|
||||||
int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly )
|
int SCH_EDIT_FRAME::CheckAnnotate( wxArrayString* aMessageList, bool aOneSheetOnly )
|
||||||
{
|
{
|
||||||
// build the screen list
|
// build the screen list
|
||||||
SCH_SHEET_LIST SheetList;
|
SCH_SHEET_LIST SheetList( g_RootSheet );
|
||||||
SCH_REFERENCE_LIST ComponentsList;
|
SCH_REFERENCE_LIST ComponentsList;
|
||||||
|
|
||||||
// Build the list of components
|
// Build the list of components
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2008-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -53,7 +53,7 @@ void SCH_EDIT_FRAME::backAnnotateFootprints( const std::string& aChangedSetOfRef
|
||||||
{
|
{
|
||||||
// Build a flat list of components in schematic:
|
// Build a flat list of components in schematic:
|
||||||
SCH_REFERENCE_LIST refs;
|
SCH_REFERENCE_LIST refs;
|
||||||
SCH_SHEET_LIST sheets;
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
bool isChanged = false;
|
bool isChanged = false;
|
||||||
|
|
||||||
sheets.GetComponents( Prj().SchLibs(), refs, false );
|
sheets.GetComponents( Prj().SchLibs(), refs, false );
|
||||||
|
@ -135,7 +135,7 @@ bool SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile( const wxString& aFullFilenam
|
||||||
{
|
{
|
||||||
// Build a flat list of components in schematic:
|
// Build a flat list of components in schematic:
|
||||||
SCH_REFERENCE_LIST referencesList;
|
SCH_REFERENCE_LIST referencesList;
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
sheetList.GetComponents( Prj().SchLibs(), referencesList, false );
|
sheetList.GetComponents( Prj().SchLibs(), referencesList, false );
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2009-2015 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -448,7 +448,7 @@ void SCH_EDIT_FRAME::PasteListOfItems( wxDC* DC )
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
SCH_ITEM* item;
|
SCH_ITEM* item;
|
||||||
SCH_SHEET_LIST hierarchy; // This is the entire schematic hierarcy.
|
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the entire schematic hierarcy.
|
||||||
|
|
||||||
if( m_blockItems.GetCount() == 0 )
|
if( m_blockItems.GetCount() == 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -201,13 +201,13 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Search for the selected marker
|
// Search for the selected marker
|
||||||
SCH_SHEET_PATH* sheet;
|
unsigned i;
|
||||||
SCH_SHEET_LIST SheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
bool notFound = true;
|
bool notFound = true;
|
||||||
|
|
||||||
for( sheet = SheetList.GetFirst(); sheet; sheet = SheetList.GetNext() )
|
for( i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
SCH_ITEM* item = (SCH_ITEM*) sheet->LastDrawList();
|
SCH_ITEM* item = (SCH_ITEM*) sheetList[i].LastDrawList();
|
||||||
|
|
||||||
for( ; item; item = item->Next() )
|
for( ; item; item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -231,10 +231,10 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( *sheet != m_parent->GetCurrentSheet() )
|
if( sheetList[i] != m_parent->GetCurrentSheet() )
|
||||||
{
|
{
|
||||||
sheet->LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
|
sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() );
|
||||||
m_parent->SetCurrentSheet( *sheet );
|
m_parent->SetCurrentSheet( sheetList[i] );
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,14 +372,12 @@ void DIALOG_ERC::setDRCMatrixButtonState( wxBitmapButton *aButton, int aState )
|
||||||
|
|
||||||
void DIALOG_ERC::DisplayERC_MarkersList()
|
void DIALOG_ERC::DisplayERC_MarkersList()
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet);
|
||||||
m_MarkersList->ClearList();
|
m_MarkersList->ClearList();
|
||||||
|
|
||||||
SCH_SHEET_PATH* sheet = sheetList.GetFirst();
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
|
|
||||||
for( ; sheet != NULL; sheet = sheetList.GetNext() )
|
|
||||||
{
|
{
|
||||||
SCH_ITEM* item = sheet->LastDrawList();
|
SCH_ITEM* item = sheetList[i].LastDrawList();
|
||||||
|
|
||||||
for( ; item != NULL; item = item->Next() )
|
for( ; item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -455,7 +453,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
|
||||||
m_tstUniqueGlobalLabels = m_cbTestUniqueGlbLabels->GetValue();
|
m_tstUniqueGlobalLabels = m_cbTestUniqueGlbLabels->GetValue();
|
||||||
|
|
||||||
// Build the whole sheet list in hierarchy (sheet, not screen)
|
// Build the whole sheet list in hierarchy (sheet, not screen)
|
||||||
SCH_SHEET_LIST sheets;
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
sheets.AnnotatePowerSymbols( Prj().SchLibs() );
|
sheets.AnnotatePowerSymbols( Prj().SchLibs() );
|
||||||
|
|
||||||
if( m_parent->CheckAnnotate( aMessagesList, false ) )
|
if( m_parent->CheckAnnotate( aMessagesList, false ) )
|
||||||
|
|
|
@ -68,11 +68,11 @@ public:
|
||||||
|
|
||||||
ELECTRICAL_PINTYPE GetElectricalType( void )
|
ELECTRICAL_PINTYPE GetElectricalType( void )
|
||||||
{
|
{
|
||||||
return m_choiceElectricalType->GetSelection();
|
return m_choiceElectricalType->GetPinTypeSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStyle( GRAPHIC_PINSHAPE style ) { m_choiceStyle->SetSelection( style ); }
|
void SetStyle( GRAPHIC_PINSHAPE style ) { m_choiceStyle->SetSelection( style ); }
|
||||||
GRAPHIC_PINSHAPE GetStyle( void ) { return m_choiceStyle->GetSelection(); }
|
GRAPHIC_PINSHAPE GetStyle( void ) { return m_choiceStyle->GetPinShapeSelection(); }
|
||||||
|
|
||||||
void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); }
|
||||||
wxString GetPinName( void ) { return m_textPinName->GetValue(); }
|
wxString GetPinName( void ) { return m_textPinName->GetValue(); }
|
||||||
|
|
|
@ -315,6 +315,14 @@ void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
|
||||||
|
|
||||||
bool SCH_PRINTOUT::OnPrintPage( int page )
|
bool SCH_PRINTOUT::OnPrintPage( int page )
|
||||||
{
|
{
|
||||||
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
|
wxCHECK_MSG( page >= 1 && page <= (int)sheetList.size(), false,
|
||||||
|
wxT( "Cannot print invalid page number." ) );
|
||||||
|
|
||||||
|
wxCHECK_MSG( sheetList[ page - 1].LastScreen() != NULL, false,
|
||||||
|
wxT( "Cannot print page with NULL screen." ) );
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _( "Print page %d" ), page );
|
msg.Printf( _( "Print page %d" ), page );
|
||||||
m_parent->ClearMsgPanel();
|
m_parent->ClearMsgPanel();
|
||||||
|
@ -322,26 +330,10 @@ bool SCH_PRINTOUT::OnPrintPage( int page )
|
||||||
|
|
||||||
SCH_SCREEN* screen = m_parent->GetScreen();
|
SCH_SCREEN* screen = m_parent->GetScreen();
|
||||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
m_parent->SetCurrentSheet( sheetList[ page - 1 ] );
|
||||||
SCH_SHEET_PATH* sheetpath = SheetList.GetSheet( page - 1 );
|
|
||||||
SCH_SHEET_PATH list;
|
|
||||||
|
|
||||||
if( sheetpath )
|
|
||||||
{
|
|
||||||
list = *sheetpath;
|
|
||||||
m_parent->SetCurrentSheet( list );
|
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
m_parent->SetSheetNumberAndCount();
|
m_parent->SetSheetNumberAndCount();
|
||||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
screen = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( screen == NULL )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
DrawPage( screen );
|
DrawPage( screen );
|
||||||
m_parent->SetCurrentSheet( oldsheetpath );
|
m_parent->SetCurrentSheet( oldsheetpath );
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -538,15 +538,14 @@ bool WriteDiagnosticERC( const wxString& aFullFileName )
|
||||||
int err_count = 0;
|
int err_count = 0;
|
||||||
int warn_count = 0;
|
int warn_count = 0;
|
||||||
int total_count = 0;
|
int total_count = 0;
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
SCH_SHEET_PATH* sheet;
|
|
||||||
|
|
||||||
for( sheet = sheetList.GetFirst(); sheet != NULL; sheet = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
msg << wxString::Format( _( "\n***** Sheet %s\n" ),
|
msg << wxString::Format( _( "\n***** Sheet %s\n" ),
|
||||||
GetChars( sheet->PathHumanReadable() ) );
|
GetChars( sheetList[i].PathHumanReadable() ) );
|
||||||
|
|
||||||
for( SCH_ITEM* item = sheet->LastDrawList(); item != NULL; item = item->Next() )
|
for( SCH_ITEM* item = sheetList[i].LastDrawList(); item != NULL; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( item->Type() != SCH_MARKER_T )
|
if( item->Type() != SCH_MARKER_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||||
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2008-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -62,7 +62,7 @@ void SCH_EDIT_FRAME::OnFindDrcMarker( wxFindDialogEvent& event )
|
||||||
static SCH_MARKER* lastMarker = NULL;
|
static SCH_MARKER* lastMarker = NULL;
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
SCH_SHEET_LIST schematic;
|
SCH_SHEET_LIST schematic( g_RootSheet );
|
||||||
SCH_SHEET_PATH* sheetFoundIn = NULL;
|
SCH_SHEET_PATH* sheetFoundIn = NULL;
|
||||||
bool wrap = ( event.GetFlags() & FR_SEARCH_WRAP ) != 0;
|
bool wrap = ( event.GetFlags() & FR_SEARCH_WRAP ) != 0;
|
||||||
bool warpCursor = ( ( event.GetId() == wxEVT_COMMAND_FIND_CLOSE ) ||
|
bool warpCursor = ( ( event.GetId() == wxEVT_COMMAND_FIND_CLOSE ) ||
|
||||||
|
@ -113,7 +113,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
||||||
const wxString& aSearchText,
|
const wxString& aSearchText,
|
||||||
bool aWarpMouse )
|
bool aWarpMouse )
|
||||||
{
|
{
|
||||||
SCH_SHEET_PATH* sheet;
|
SCH_SHEET_PATH* sheet = NULL;
|
||||||
SCH_SHEET_PATH* sheetWithComponentFound = NULL;
|
SCH_SHEET_PATH* sheetWithComponentFound = NULL;
|
||||||
SCH_ITEM* item = NULL;
|
SCH_ITEM* item = NULL;
|
||||||
SCH_COMPONENT* Component = NULL;
|
SCH_COMPONENT* Component = NULL;
|
||||||
|
@ -121,16 +121,17 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
||||||
bool centerAndRedraw = false;
|
bool centerAndRedraw = false;
|
||||||
bool notFound = true;
|
bool notFound = true;
|
||||||
LIB_PIN* pin;
|
LIB_PIN* pin;
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
sheet = sheetList.GetFirst();
|
|
||||||
|
|
||||||
if( !aSearchHierarchy )
|
if( !aSearchHierarchy )
|
||||||
sheet = m_CurrentSheet;
|
sheetList.push_back( *m_CurrentSheet );
|
||||||
|
else
|
||||||
|
sheetList.BuildSheetList( g_RootSheet );
|
||||||
|
|
||||||
for( ; sheet != NULL; sheet = sheetList.GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = sheetList.begin(); it != sheetList.end(); ++it )
|
||||||
{
|
{
|
||||||
item = sheet->LastDrawList();
|
sheet = &(*it);
|
||||||
|
item = (*it).LastDrawList();
|
||||||
|
|
||||||
for( ; ( item != NULL ) && ( notFound == true ); item = item->Next() )
|
for( ; ( item != NULL ) && ( notFound == true ); item = item->Next() )
|
||||||
{
|
{
|
||||||
|
@ -181,7 +182,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (aSearchHierarchy == false) || (notFound == false) )
|
if( notFound == false )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +362,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
|
||||||
static int nextFoundIndex = 0;
|
static int nextFoundIndex = 0;
|
||||||
SCH_ITEM* item;
|
SCH_ITEM* item;
|
||||||
SCH_SHEET_PATH* sheet;
|
SCH_SHEET_PATH* sheet;
|
||||||
SCH_SHEET_LIST schematic;
|
SCH_SHEET_LIST schematic( g_RootSheet );
|
||||||
SCH_FIND_COLLECTOR_DATA data;
|
SCH_FIND_COLLECTOR_DATA data;
|
||||||
SCH_FIND_REPLACE_DATA searchCriteria;
|
SCH_FIND_REPLACE_DATA searchCriteria;
|
||||||
|
|
||||||
|
@ -454,7 +455,7 @@ void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
|
||||||
void SCH_EDIT_FRAME::updateFindReplaceView( wxFindDialogEvent& aEvent )
|
void SCH_EDIT_FRAME::updateFindReplaceView( wxFindDialogEvent& aEvent )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
SCH_SHEET_LIST schematic;
|
SCH_SHEET_LIST schematic( g_RootSheet );
|
||||||
SCH_FIND_COLLECTOR_DATA data;
|
SCH_FIND_COLLECTOR_DATA data;
|
||||||
SCH_FIND_REPLACE_DATA searchCriteria;
|
SCH_FIND_REPLACE_DATA searchCriteria;
|
||||||
bool warpCursor = !( aEvent.GetFlags() & FR_NO_WARP_CURSOR );
|
bool warpCursor = !( aEvent.GetFlags() & FR_NO_WARP_CURSOR );
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -72,7 +72,8 @@ static const BITMAP_DEF iconsPinsOrientations[] =
|
||||||
|
|
||||||
const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType )
|
const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType )
|
||||||
{
|
{
|
||||||
assert( aType >= 0 && aType < (int) PINTYPE_COUNT );
|
if( aType < 0 || aType >= (int) PINTYPE_COUNT );
|
||||||
|
return wxT( "???" );
|
||||||
|
|
||||||
// These strings are the canonical name of the electrictal type
|
// These strings are the canonical name of the electrictal type
|
||||||
// Not translated, no space in name, only ASCII chars.
|
// Not translated, no space in name, only ASCII chars.
|
||||||
|
@ -93,9 +94,6 @@ const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType
|
||||||
wxT( "NotConnected" )
|
wxT( "NotConnected" )
|
||||||
};
|
};
|
||||||
|
|
||||||
if( aType > (int) PINTYPE_COUNT )
|
|
||||||
return wxT( "???" );
|
|
||||||
|
|
||||||
return msgPinElectricType[ aType ];
|
return msgPinElectricType[ aType ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2013-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -67,7 +67,7 @@ int TestDuplicateSheetNames( bool aCreateMarker );
|
||||||
|
|
||||||
bool SCH_EDIT_FRAME::prepareForNetlist()
|
bool SCH_EDIT_FRAME::prepareForNetlist()
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheets;
|
SCH_SHEET_LIST sheets( g_RootSheet );
|
||||||
|
|
||||||
sheets.AnnotatePowerSymbols( Prj().SchLibs() );
|
sheets.AnnotatePowerSymbols( Prj().SchLibs() );
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ NETLIST_OBJECT_LIST* SCH_EDIT_FRAME::BuildNetListBase()
|
||||||
std::auto_ptr<NETLIST_OBJECT_LIST> ret( new NETLIST_OBJECT_LIST() );
|
std::auto_ptr<NETLIST_OBJECT_LIST> ret( new NETLIST_OBJECT_LIST() );
|
||||||
|
|
||||||
// Creates the flattened sheet list:
|
// Creates the flattened sheet list:
|
||||||
SCH_SHEET_LIST aSheets;
|
SCH_SHEET_LIST aSheets( g_RootSheet );
|
||||||
|
|
||||||
// Build netlist info
|
// Build netlist info
|
||||||
bool success = ret->BuildNetListInfo( aSheets );
|
bool success = ret->BuildNetListInfo( aSheets );
|
||||||
|
@ -197,9 +197,10 @@ bool NETLIST_OBJECT_LIST::BuildNetListInfo( SCH_SHEET_LIST& aSheets )
|
||||||
SCH_SHEET_PATH* sheet;
|
SCH_SHEET_PATH* sheet;
|
||||||
|
|
||||||
// Fill list with connected items from the flattened sheet list
|
// Fill list with connected items from the flattened sheet list
|
||||||
for( sheet = aSheets.GetFirst(); sheet != NULL;
|
for( unsigned i = 0; i < aSheets.size(); i++ )
|
||||||
sheet = aSheets.GetNext() )
|
|
||||||
{
|
{
|
||||||
|
sheet = &aSheets[i];
|
||||||
|
|
||||||
for( SCH_ITEM* item = sheet->LastScreen()->GetDrawItems(); item; item = item->Next() )
|
for( SCH_ITEM* item = sheet->LastScreen()->GetDrawItems(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
item->GetNetListItem( *this, sheet );
|
item->GetNetListItem( *this, sheet );
|
||||||
|
@ -420,8 +421,7 @@ static int getPriority( const NETLIST_OBJECT* Objet )
|
||||||
* evalLabelsPriority calculates the priority of alabel1 and aLabel2
|
* evalLabelsPriority calculates the priority of alabel1 and aLabel2
|
||||||
* return true if alabel1 has a higher priority than aLabel2
|
* return true if alabel1 has a higher priority than aLabel2
|
||||||
*/
|
*/
|
||||||
static bool evalLabelsPriority( const NETLIST_OBJECT* aLabel1,
|
static bool evalLabelsPriority( const NETLIST_OBJECT* aLabel1, const NETLIST_OBJECT* aLabel2 )
|
||||||
const NETLIST_OBJECT* aLabel2 )
|
|
||||||
{
|
{
|
||||||
// Global labels have the highest prioriy.
|
// Global labels have the highest prioriy.
|
||||||
// For local labels: names are prefixed by their sheetpath
|
// For local labels: names are prefixed by their sheetpath
|
||||||
|
@ -542,6 +542,7 @@ void NETLIST_OBJECT_LIST::findBestNetNameForEachNet()
|
||||||
for( unsigned ii = 0; ii < size(); ii++ )
|
for( unsigned ii = 0; ii < size(); ii++ )
|
||||||
{
|
{
|
||||||
item = GetItem( ii );
|
item = GetItem( ii );
|
||||||
|
|
||||||
if( !item->HasNetNameCandidate() )
|
if( !item->HasNetNameCandidate() )
|
||||||
list.push_back( item );
|
list.push_back( item );
|
||||||
}
|
}
|
||||||
|
@ -592,6 +593,7 @@ void NETLIST_OBJECT_LIST::findBestNetNameForEachNet()
|
||||||
// changed each time the netlist is built (power components)
|
// changed each time the netlist is built (power components)
|
||||||
// and anyway obviously they are not a good candidate
|
// and anyway obviously they are not a good candidate
|
||||||
SCH_COMPONENT* link = item->GetComponentParent();
|
SCH_COMPONENT* link = item->GetComponentParent();
|
||||||
|
|
||||||
if( link && link->IsInNetlist() )
|
if( link && link->IsInNetlist() )
|
||||||
{
|
{
|
||||||
// select the better between the previous and this one
|
// select the better between the previous and this one
|
||||||
|
@ -711,8 +713,7 @@ void NETLIST_OBJECT_LIST::propageNetCode( int aOldNetCode, int aNewNetCode, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NETLIST_OBJECT_LIST::pointToPointConnect( NETLIST_OBJECT* aRef, bool aIsBus,
|
void NETLIST_OBJECT_LIST::pointToPointConnect( NETLIST_OBJECT* aRef, bool aIsBus, int start )
|
||||||
int start )
|
|
||||||
{
|
{
|
||||||
int netCode;
|
int netCode;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -328,22 +328,23 @@ void NETLIST_EXPORTER::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
|
||||||
wxString ref = aComponent->GetRef( aSheetPath );
|
wxString ref = aComponent->GetRef( aSheetPath );
|
||||||
wxString ref2;
|
wxString ref2;
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
|
for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
if( item->Type() != SCH_COMPONENT_T )
|
if( item->Type() != SCH_COMPONENT_T )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SCH_COMPONENT* comp2 = (SCH_COMPONENT*) item;
|
SCH_COMPONENT* comp2 = (SCH_COMPONENT*) item;
|
||||||
|
|
||||||
ref2 = comp2->GetRef( sheet );
|
ref2 = comp2->GetRef( &sheetList[i] );
|
||||||
|
|
||||||
if( ref2.CmpNoCase( ref ) != 0 )
|
if( ref2.CmpNoCase( ref ) != 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int unit2 = comp2->GetUnitSelection( sheet ); // slow
|
int unit2 = comp2->GetUnitSelection( &sheetList[i] ); // slow
|
||||||
|
|
||||||
for( LIB_PIN* pin = aEntry->GetNextPin(); pin; pin = aEntry->GetNextPin( pin ) )
|
for( LIB_PIN* pin = aEntry->GetNextPin(); pin; pin = aEntry->GetNextPin( pin ) )
|
||||||
{
|
{
|
||||||
|
@ -356,7 +357,7 @@ void NETLIST_EXPORTER::findAllInstancesOfComponent( SCH_COMPONENT* aComponent,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// A suitable pin is found: add it to the current list
|
// A suitable pin is found: add it to the current list
|
||||||
addPinToComponentPinList( comp2, sheet, pin );
|
addPinToComponentPinList( comp2, &sheetList[i], pin );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -53,7 +53,6 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
|
||||||
|
|
||||||
wxString StartCmpDesc = StartLine + wxT( "ADD_COM" );
|
wxString StartCmpDesc = StartLine + wxT( "ADD_COM" );
|
||||||
wxString msg;
|
wxString msg;
|
||||||
SCH_SHEET_PATH* sheet;
|
|
||||||
EDA_ITEM* DrawList;
|
EDA_ITEM* DrawList;
|
||||||
SCH_COMPONENT* component;
|
SCH_COMPONENT* component;
|
||||||
wxString title = wxT( "Eeschema " ) + GetBuildVersion();
|
wxString title = wxT( "Eeschema " ) + GetBuildVersion();
|
||||||
|
@ -71,13 +70,13 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
|
||||||
// Create netlist module section
|
// Create netlist module section
|
||||||
m_ReferencesAlreadyFound.Clear();
|
m_ReferencesAlreadyFound.Clear();
|
||||||
|
|
||||||
SCH_SHEET_LIST SheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
for( DrawList = sheet->LastDrawList(); DrawList != NULL; DrawList = DrawList->Next() )
|
for( DrawList = sheetList[i].LastDrawList(); DrawList != NULL; DrawList = DrawList->Next() )
|
||||||
{
|
{
|
||||||
DrawList = component = findNextComponentAndCreatePinList( DrawList, sheet );
|
DrawList = component = findNextComponentAndCreatePinList( DrawList, &sheetList[i] );
|
||||||
|
|
||||||
if( component == NULL )
|
if( component == NULL )
|
||||||
break;
|
break;
|
||||||
|
@ -93,7 +92,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, unsig
|
||||||
footprint = wxT( "$noname" );
|
footprint = wxT( "$noname" );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
msg = component->GetRef( sheet );
|
msg = component->GetRef( &sheetList[i] );
|
||||||
ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) );
|
ret |= fprintf( f, "%s ", TO_UTF8( StartCmpDesc ) );
|
||||||
ret |= fprintf( f, "%s", TO_UTF8( msg ) );
|
ret |= fprintf( f, "%s", TO_UTF8( msg ) );
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -108,16 +108,16 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents()
|
||||||
|
|
||||||
m_ReferencesAlreadyFound.Clear();
|
m_ReferencesAlreadyFound.Clear();
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
// Output is xml, so there is no reason to remove spaces from the field values.
|
// Output is xml, so there is no reason to remove spaces from the field values.
|
||||||
// And XML element names need not be translated to various languages.
|
// And XML element names need not be translated to various languages.
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
for( EDA_ITEM* schItem = path->LastDrawList(); schItem; schItem = schItem->Next() )
|
for( EDA_ITEM* schItem = sheetList[i].LastDrawList(); schItem; schItem = schItem->Next() )
|
||||||
{
|
{
|
||||||
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( schItem, path );
|
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( schItem, &sheetList[i] );
|
||||||
if( !comp )
|
if( !comp )
|
||||||
break; // No component left
|
break; // No component left
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents()
|
||||||
// an element.
|
// an element.
|
||||||
|
|
||||||
xcomps->AddChild( xcomp = node( sComponent ) );
|
xcomps->AddChild( xcomp = node( sComponent ) );
|
||||||
xcomp->AddAttribute( sRef, comp->GetRef( path ) );
|
xcomp->AddAttribute( sRef, comp->GetRef( &sheetList[i] ) );
|
||||||
|
|
||||||
xcomp->AddChild( node( sValue, comp->GetField( VALUE )->GetText() ) );
|
xcomp->AddChild( node( sValue, comp->GetField( VALUE )->GetText() ) );
|
||||||
|
|
||||||
|
@ -178,8 +178,8 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents()
|
||||||
XNODE* xsheetpath;
|
XNODE* xsheetpath;
|
||||||
|
|
||||||
xcomp->AddChild( xsheetpath = node( sSheetPath ) );
|
xcomp->AddChild( xsheetpath = node( sSheetPath ) );
|
||||||
xsheetpath->AddAttribute( sNames, path->PathHumanReadable() );
|
xsheetpath->AddAttribute( sNames, sheetList[i].PathHumanReadable() );
|
||||||
xsheetpath->AddAttribute( sTStamps, path->Path() );
|
xsheetpath->AddAttribute( sTStamps, sheetList[i].Path() );
|
||||||
|
|
||||||
timeStamp.Printf( sTSFmt, (unsigned long)comp->GetTimeStamp() );
|
timeStamp.Printf( sTSFmt, (unsigned long)comp->GetTimeStamp() );
|
||||||
xcomp->AddChild( node( sTStamp, timeStamp ) );
|
xcomp->AddChild( node( sTStamp, timeStamp ) );
|
||||||
|
@ -193,7 +193,7 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeComponents()
|
||||||
XNODE* NETLIST_EXPORTER_GENERIC::makeDesignHeader()
|
XNODE* NETLIST_EXPORTER_GENERIC::makeDesignHeader()
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen;
|
SCH_SCREEN* screen;
|
||||||
XNODE* xdesign = node( wxT("design") );
|
XNODE* xdesign = node( wxT( "design" ) );
|
||||||
XNODE* xtitleBlock;
|
XNODE* xtitleBlock;
|
||||||
XNODE* xsheet;
|
XNODE* xsheet;
|
||||||
XNODE* xcomment;
|
XNODE* xcomment;
|
||||||
|
@ -211,21 +211,21 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeDesignHeader()
|
||||||
/*
|
/*
|
||||||
Export the sheets information
|
Export the sheets information
|
||||||
*/
|
*/
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
screen = sheet->LastScreen();
|
screen = sheetList[i].LastScreen();
|
||||||
|
|
||||||
xdesign->AddChild( xsheet = node( wxT( "sheet" ) ) );
|
xdesign->AddChild( xsheet = node( wxT( "sheet" ) ) );
|
||||||
|
|
||||||
// get the string representation of the sheet index number.
|
// get the string representation of the sheet index number.
|
||||||
// Note that sheet->GetIndex() is zero index base and we need to increment the number by one to make
|
// Note that sheet->GetIndex() is zero index base and we need to increment the
|
||||||
// human readable
|
// number by one to make it human readable
|
||||||
sheetTxt.Printf( wxT( "%d" ), ( sheetList.GetIndex() + 1 ) );
|
sheetTxt.Printf( wxT( "%u" ), i + 1 );
|
||||||
xsheet->AddAttribute( wxT( "number" ), sheetTxt );
|
xsheet->AddAttribute( wxT( "number" ), sheetTxt );
|
||||||
xsheet->AddAttribute( wxT( "name" ), sheet->PathHumanReadable() );
|
xsheet->AddAttribute( wxT( "name" ), sheetList[i].PathHumanReadable() );
|
||||||
xsheet->AddAttribute( wxT( "tstamps" ), sheet->Path() );
|
xsheet->AddAttribute( wxT( "tstamps" ), sheetList[i].Path() );
|
||||||
|
|
||||||
|
|
||||||
TITLE_BLOCK tb = screen->GetTitleBlock();
|
TITLE_BLOCK tb = screen->GetTitleBlock();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -66,13 +66,13 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName, uns
|
||||||
// Create netlist module section
|
// Create netlist module section
|
||||||
m_ReferencesAlreadyFound.Clear();
|
m_ReferencesAlreadyFound.Clear();
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
for( EDA_ITEM* item = path->LastDrawList(); item; item = item->Next() )
|
for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( item, path );
|
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( item, &sheetList[i] );
|
||||||
|
|
||||||
if( !comp )
|
if( !comp )
|
||||||
break;
|
break;
|
||||||
|
@ -87,7 +87,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName, uns
|
||||||
{
|
{
|
||||||
if( part->GetFootPrints().GetCount() != 0 ) // Put in list
|
if( part->GetFootPrints().GetCount() != 0 ) // Put in list
|
||||||
{
|
{
|
||||||
cmpList.push_back( SCH_REFERENCE( comp, part, *path ) );
|
cmpList.push_back( SCH_REFERENCE( comp, part, sheetList[i] ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,10 +99,10 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName, uns
|
||||||
else
|
else
|
||||||
footprint = wxT( "$noname" );
|
footprint = wxT( "$noname" );
|
||||||
|
|
||||||
field = comp->GetRef( path );
|
field = comp->GetRef( &sheetList[i] );
|
||||||
|
|
||||||
ret |= fprintf( f, " ( %s %s",
|
ret |= fprintf( f, " ( %s %s",
|
||||||
TO_UTF8( comp->GetPath( path ) ),
|
TO_UTF8( comp->GetPath( &sheetList[i] ) ),
|
||||||
TO_UTF8( footprint ) );
|
TO_UTF8( footprint ) );
|
||||||
|
|
||||||
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
ret |= fprintf( f, " %s", TO_UTF8( field ) );
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -79,11 +79,11 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
|
||||||
// commands) and create text list starting by [+]pspice , or [+]gnucap
|
// commands) and create text list starting by [+]pspice , or [+]gnucap
|
||||||
// (simulator commands)
|
// (simulator commands)
|
||||||
bufnum[BUFYPOS_LEN] = 0;
|
bufnum[BUFYPOS_LEN] = 0;
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
|
for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
size_t l1, l2;
|
size_t l1, l2;
|
||||||
wxChar ident;
|
wxChar ident;
|
||||||
|
@ -162,13 +162,13 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
|
||||||
|
|
||||||
m_ReferencesAlreadyFound.Clear();
|
m_ReferencesAlreadyFound.Clear();
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* sheet = sheetList.GetFirst(); sheet; sheet = sheetList.GetNext() )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
ret |= fprintf( f, "* Sheet Name: %s\n", TO_UTF8( sheet->PathHumanReadable() ) );
|
ret |= fprintf( f, "* Sheet Name: %s\n", TO_UTF8( sheetList[i].PathHumanReadable() ) );
|
||||||
|
|
||||||
for( EDA_ITEM* item = sheet->LastDrawList(); item; item = item->Next() )
|
for( EDA_ITEM* item = sheetList[i].LastDrawList(); item; item = item->Next() )
|
||||||
{
|
{
|
||||||
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( item, sheet );
|
SCH_COMPONENT* comp = findNextComponentAndCreatePinList( item, &sheetList[i] );
|
||||||
|
|
||||||
if( !comp )
|
if( !comp )
|
||||||
break;
|
break;
|
||||||
|
@ -235,7 +235,7 @@ bool NETLIST_EXPORTER_PSPICE::WriteNetlist( const wxString& aOutFileName, unsign
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get Standard Reference Designator:
|
//Get Standard Reference Designator:
|
||||||
wxString RefName = comp->GetRef( sheet );
|
wxString RefName = comp->GetRef( &sheetList[i] );
|
||||||
|
|
||||||
//Conditionally add Prefix only for devices that begin with U or IC:
|
//Conditionally add Prefix only for devices that begin with U or IC:
|
||||||
if( aUsePrefix )
|
if( aUsePrefix )
|
||||||
|
|
|
@ -40,7 +40,6 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
{
|
{
|
||||||
SCH_EDIT_FRAME* schframe = m_parent;
|
SCH_EDIT_FRAME* schframe = m_parent;
|
||||||
SCH_SCREEN* screen = schframe->GetScreen();
|
SCH_SCREEN* screen = schframe->GetScreen();
|
||||||
SCH_SHEET_PATH* sheetpath;
|
|
||||||
SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
|
SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
|
||||||
|
|
||||||
/* When printing all pages, the printed page is not the current page.
|
/* When printing all pages, the printed page is not the current page.
|
||||||
|
@ -49,26 +48,21 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
|
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
|
||||||
* is shared between many sheets
|
* is shared between many sheets
|
||||||
*/
|
*/
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
SCH_SHEET_LIST sheetList;
|
||||||
|
|
||||||
|
if( aPlotAll )
|
||||||
|
sheetList.BuildSheetList( g_RootSheet );
|
||||||
|
else
|
||||||
|
sheetList.push_back( schframe->GetCurrentSheet() );
|
||||||
|
|
||||||
sheetpath = SheetList.GetFirst();
|
|
||||||
SCH_SHEET_PATH list;
|
|
||||||
REPORTER& reporter = m_MessagesBox->Reporter();
|
REPORTER& reporter = m_MessagesBox->Reporter();
|
||||||
|
|
||||||
while( true )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
if( aPlotAll )
|
schframe->SetCurrentSheet( sheetList[i] );
|
||||||
{
|
|
||||||
if( sheetpath == NULL )
|
|
||||||
break;
|
|
||||||
|
|
||||||
list = *sheetpath;
|
|
||||||
schframe->SetCurrentSheet( list );
|
|
||||||
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
schframe->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
schframe->SetSheetNumberAndCount();
|
schframe->SetSheetNumberAndCount();
|
||||||
screen = schframe->GetCurrentSheet().LastScreen();
|
screen = schframe->GetCurrentSheet().LastScreen();
|
||||||
sheetpath = SheetList.GetNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
wxPoint plot_offset;
|
wxPoint plot_offset;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
@ -102,10 +96,6 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
schframe->SetSheetNumberAndCount();
|
schframe->SetSheetNumberAndCount();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( !aPlotAll )
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
schframe->SetCurrentSheet( oldsheetpath );
|
schframe->SetCurrentSheet( oldsheetpath );
|
||||||
|
|
|
@ -111,7 +111,6 @@ void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth()
|
||||||
void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen = m_parent->GetScreen();
|
SCH_SCREEN* screen = m_parent->GetScreen();
|
||||||
SCH_SHEET_PATH* sheetpath;
|
|
||||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||||
|
|
||||||
/* When printing all pages, the printed page is not the current page.
|
/* When printing all pages, the printed page is not the current page.
|
||||||
|
@ -120,23 +119,20 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
|
* because in complex hierarchies a SCH_SCREEN (a schematic drawings)
|
||||||
* is shared between many sheets
|
* is shared between many sheets
|
||||||
*/
|
*/
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
SCH_SHEET_LIST sheetList;
|
||||||
|
|
||||||
|
if( aPlotAll )
|
||||||
|
sheetList.BuildSheetList( g_RootSheet );
|
||||||
|
else
|
||||||
|
sheetList.push_back( m_parent->GetCurrentSheet() );
|
||||||
|
|
||||||
sheetpath = SheetList.GetFirst();
|
|
||||||
SCH_SHEET_PATH list;
|
|
||||||
REPORTER& reporter = m_MessagesBox->Reporter();
|
REPORTER& reporter = m_MessagesBox->Reporter();
|
||||||
|
|
||||||
SetHPGLPenWidth();
|
SetHPGLPenWidth();
|
||||||
|
|
||||||
while( true )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
if( aPlotAll )
|
m_parent->SetCurrentSheet( sheetList[i] );
|
||||||
{
|
|
||||||
if( sheetpath == NULL )
|
|
||||||
break;
|
|
||||||
|
|
||||||
list = *sheetpath;
|
|
||||||
m_parent->SetCurrentSheet( list );
|
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
m_parent->SetSheetNumberAndCount();
|
m_parent->SetSheetNumberAndCount();
|
||||||
|
|
||||||
|
@ -145,9 +141,6 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
if( !screen ) // LastScreen() may return NULL
|
if( !screen ) // LastScreen() may return NULL
|
||||||
screen = m_parent->GetScreen();
|
screen = m_parent->GetScreen();
|
||||||
|
|
||||||
sheetpath = SheetList.GetNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
const PAGE_INFO& curPage = screen->GetPageSettings();
|
const PAGE_INFO& curPage = screen->GetPageSettings();
|
||||||
|
|
||||||
PAGE_INFO plotPage = curPage;
|
PAGE_INFO plotPage = curPage;
|
||||||
|
@ -190,9 +183,6 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
GetChars( plotFileName.GetFullPath() ) );
|
GetChars( plotFileName.GetFullPath() ) );
|
||||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !aPlotAll )
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
catch( IO_ERROR& e )
|
catch( IO_ERROR& e )
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen = m_parent->GetScreen();
|
SCH_SCREEN* screen = m_parent->GetScreen();
|
||||||
SCH_SHEET_PATH* sheetpath;
|
|
||||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
|
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
|
||||||
|
|
||||||
/* When printing all pages, the printed page is not the current page. In
|
/* When printing all pages, the printed page is not the current page. In
|
||||||
|
@ -51,9 +50,12 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
* between many sheets and component references depend on the actual sheet
|
* between many sheets and component references depend on the actual sheet
|
||||||
* path used
|
* path used
|
||||||
*/
|
*/
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
SCH_SHEET_LIST sheetList;
|
||||||
|
|
||||||
sheetpath = SheetList.GetFirst();
|
if( aPlotAll )
|
||||||
|
sheetList.BuildSheetList( g_RootSheet );
|
||||||
|
else
|
||||||
|
sheetList.push_back( m_parent->GetCurrentSheet() );
|
||||||
|
|
||||||
// Allocate the plotter and set the job level parameter
|
// Allocate the plotter and set the job level parameter
|
||||||
PDF_PLOTTER* plotter = new PDF_PLOTTER();
|
PDF_PLOTTER* plotter = new PDF_PLOTTER();
|
||||||
|
@ -65,26 +67,14 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
wxFileName plotFileName;
|
wxFileName plotFileName;
|
||||||
REPORTER& reporter = m_MessagesBox->Reporter();
|
REPORTER& reporter = m_MessagesBox->Reporter();
|
||||||
|
|
||||||
// First page handling is different
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
bool first_page = true;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
// Step over the schematic hierarchy
|
m_parent->SetCurrentSheet( sheetList[i] );
|
||||||
if( aPlotAll )
|
|
||||||
{
|
|
||||||
wxCHECK_RET( sheetpath != NULL, wxT( "Attempt to plot undefined sheet path." ) );
|
|
||||||
|
|
||||||
SCH_SHEET_PATH list = *sheetpath;
|
|
||||||
|
|
||||||
m_parent->SetCurrentSheet( list );
|
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
m_parent->SetSheetNumberAndCount();
|
m_parent->SetSheetNumberAndCount();
|
||||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||||
sheetpath = SheetList.GetNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
if( first_page )
|
if( i == 0 )
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -107,8 +97,6 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
SetLocaleTo_C_standard();
|
SetLocaleTo_C_standard();
|
||||||
setupPlotPagePDF( plotter, screen );
|
setupPlotPagePDF( plotter, screen );
|
||||||
plotter->StartPlot();
|
plotter->StartPlot();
|
||||||
first_page = false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& e )
|
catch( const IO_ERROR& e )
|
||||||
{
|
{
|
||||||
|
@ -131,7 +119,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
}
|
}
|
||||||
|
|
||||||
plotOneSheetPDF( plotter, screen, aPlotFrameRef );
|
plotOneSheetPDF( plotter, screen, aPlotFrameRef );
|
||||||
} while( aPlotAll && sheetpath );
|
}
|
||||||
|
|
||||||
// Everything done, close the plot and restore the environment
|
// Everything done, close the plot and restore the environment
|
||||||
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
msg.Printf( _( "Plot: '%s' OK.\n" ), GetChars( plotFileName.GetFullPath() ) );
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
|
void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
{
|
{
|
||||||
SCH_SCREEN* screen = m_parent->GetScreen();
|
SCH_SCREEN* screen = m_parent->GetScreen();
|
||||||
SCH_SHEET_PATH* sheetpath;
|
|
||||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
|
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
|
||||||
PAGE_INFO actualPage; // page size selected in schematic
|
PAGE_INFO actualPage; // page size selected in schematic
|
||||||
PAGE_INFO plotPage; // page size selected to plot
|
PAGE_INFO plotPage; // page size selected to plot
|
||||||
|
@ -50,26 +49,19 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
* because in complex hierarchies a SCH_SCREEN (a drawing )
|
* because in complex hierarchies a SCH_SCREEN (a drawing )
|
||||||
* is shared between many sheets and component references depend on the actual sheet path used
|
* is shared between many sheets and component references depend on the actual sheet path used
|
||||||
*/
|
*/
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
SCH_SHEET_LIST sheetList;
|
||||||
|
|
||||||
sheetpath = SheetList.GetFirst();
|
|
||||||
SCH_SHEET_PATH list;
|
|
||||||
|
|
||||||
while( true )
|
|
||||||
{
|
|
||||||
if( aPlotAll )
|
if( aPlotAll )
|
||||||
{
|
sheetList.BuildSheetList( g_RootSheet );
|
||||||
if( sheetpath == NULL )
|
else
|
||||||
break;
|
sheetList.push_back( m_parent->GetCurrentSheet() );
|
||||||
|
|
||||||
list = *sheetpath;
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
m_parent->SetCurrentSheet( list );
|
{
|
||||||
|
m_parent->SetCurrentSheet( sheetList[i] );
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
m_parent->SetSheetNumberAndCount();
|
m_parent->SetSheetNumberAndCount();
|
||||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||||
sheetpath = SheetList.GetNext();
|
|
||||||
}
|
|
||||||
|
|
||||||
actualPage = screen->GetPageSettings();
|
actualPage = screen->GetPageSettings();
|
||||||
|
|
||||||
switch( m_pageSizeSelect )
|
switch( m_pageSizeSelect )
|
||||||
|
@ -129,9 +121,6 @@ void DIALOG_PLOT_SCHEMATIC::createPSFile( bool aPlotAll, bool aPlotFrameRef )
|
||||||
msg.Printf( wxT( "PS Plotter exception: %s"), GetChars( e.errorText ) );
|
msg.Printf( wxT( "PS Plotter exception: %s"), GetChars( e.errorText ) );
|
||||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !aPlotAll )
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_parent->SetCurrentSheet( oldsheetpath );
|
m_parent->SetCurrentSheet( oldsheetpath );
|
||||||
|
|
|
@ -45,29 +45,21 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
REPORTER& reporter = m_MessagesBox->Reporter();
|
REPORTER& reporter = m_MessagesBox->Reporter();
|
||||||
|
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
||||||
|
SCH_SHEET_LIST sheetList;
|
||||||
|
|
||||||
if( aPrintAll )
|
if( aPrintAll )
|
||||||
{
|
sheetList.BuildSheetList( g_RootSheet );
|
||||||
SCH_SHEET_PATH* sheetpath;
|
else
|
||||||
SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
|
sheetList.push_back( m_parent->GetCurrentSheet() );
|
||||||
SCH_SHEET_LIST SheetList( NULL );
|
|
||||||
sheetpath = SheetList.GetFirst();
|
|
||||||
SCH_SHEET_PATH list;
|
|
||||||
|
|
||||||
for( ; ; )
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
{
|
{
|
||||||
if( sheetpath == NULL )
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
SCH_SCREEN* screen;
|
SCH_SCREEN* screen;
|
||||||
list = *sheetpath;
|
m_parent->SetCurrentSheet( sheetList[i] );
|
||||||
m_parent->SetCurrentSheet( list );
|
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
m_parent->SetSheetNumberAndCount();
|
m_parent->SetSheetNumberAndCount();
|
||||||
screen = m_parent->GetCurrentSheet().LastScreen();
|
screen = m_parent->GetCurrentSheet().LastScreen();
|
||||||
sheetpath = SheetList.GetNext();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -98,53 +90,13 @@ void DIALOG_PLOT_SCHEMATIC::createSVGFile( bool aPrintAll, bool aPrintFrameRef )
|
||||||
// Cannot plot SVG file
|
// Cannot plot SVG file
|
||||||
msg.Printf( wxT( "SVG Plotter exception: %s" ), GetChars( e.errorText ) );
|
msg.Printf( wxT( "SVG Plotter exception: %s" ), GetChars( e.errorText ) );
|
||||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
reporter.Report( msg, REPORTER::RPT_ERROR );
|
||||||
|
break;
|
||||||
m_parent->SetCurrentSheet( oldsheetpath );
|
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
|
||||||
m_parent->SetSheetNumberAndCount();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_parent->SetCurrentSheet( oldsheetpath );
|
m_parent->SetCurrentSheet( oldsheetpath );
|
||||||
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
m_parent->GetCurrentSheet().UpdateAllScreenReferences();
|
||||||
m_parent->SetSheetNumberAndCount();
|
m_parent->SetSheetNumberAndCount();
|
||||||
}
|
|
||||||
else // Print current sheet
|
|
||||||
{
|
|
||||||
SCH_SCREEN* screen = (SCH_SCREEN*) m_parent->GetScreen();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
wxString fname = screen->GetFileName();
|
|
||||||
wxString ext = SVG_PLOTTER::GetDefaultFileExtension();
|
|
||||||
wxFileName fn = createPlotFileName( m_outputDirectoryName, fname, ext );
|
|
||||||
|
|
||||||
bool success = plotOneSheetSVG( m_parent, fn.GetFullPath(), screen,
|
|
||||||
getModeColor() ? false : true,
|
|
||||||
aPrintFrameRef );
|
|
||||||
if( success )
|
|
||||||
{
|
|
||||||
msg.Printf( _( "Plot: '%s' OK.\n" ),
|
|
||||||
GetChars( fn.GetFullPath() ) );
|
|
||||||
reporter.Report( msg, REPORTER::RPT_ACTION );
|
|
||||||
|
|
||||||
}
|
|
||||||
else // Error
|
|
||||||
{
|
|
||||||
msg.Printf( _( "Unable to create file '%s'.\n" ),
|
|
||||||
GetChars( fn.GetFullPath() ) );
|
|
||||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch( const IO_ERROR& e )
|
|
||||||
{
|
|
||||||
// Cannot plot SVG file
|
|
||||||
msg.Printf( wxT( "SVG Plotter exception: %s."), GetChars( e.errorText ) );
|
|
||||||
reporter.Report( msg, REPORTER::RPT_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2011-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -528,13 +528,12 @@ void SCH_FIND_COLLECTOR::Collect( SCH_FIND_REPLACE_DATA& aFindReplaceData,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST schematic;
|
SCH_SHEET_LIST schematic( g_RootSheet );
|
||||||
m_sheetPath = schematic.GetFirst();
|
|
||||||
|
|
||||||
while( m_sheetPath != NULL )
|
for( unsigned i = 0; i < schematic.size(); i++ )
|
||||||
{
|
{
|
||||||
|
m_sheetPath = &schematic[i];
|
||||||
EDA_ITEM::IterateForward( m_sheetPath->LastDrawList(), this, NULL, m_ScanTypes );
|
EDA_ITEM::IterateForward( m_sheetPath->LastDrawList(), this, NULL, m_ScanTypes );
|
||||||
m_sheetPath = schematic.GetNext();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -466,82 +466,23 @@ SCH_SHEET* SCH_SHEET_PATH::FindSheetByName( const wxString& aSheetName )
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
SCH_SHEET_LIST::SCH_SHEET_LIST( SCH_SHEET* aSheet )
|
SCH_SHEET_LIST::SCH_SHEET_LIST( SCH_SHEET* aSheet )
|
||||||
{
|
{
|
||||||
m_index = 0;
|
|
||||||
m_count = 0;
|
|
||||||
m_list = NULL;
|
|
||||||
m_isRootSheet = false;
|
m_isRootSheet = false;
|
||||||
|
|
||||||
if( aSheet == NULL )
|
if( aSheet != NULL )
|
||||||
aSheet = g_RootSheet;
|
|
||||||
|
|
||||||
BuildSheetList( aSheet );
|
BuildSheetList( aSheet );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET_PATH* SCH_SHEET_LIST::GetFirst()
|
|
||||||
{
|
|
||||||
m_index = 0;
|
|
||||||
|
|
||||||
if( GetCount() > 0 )
|
|
||||||
return &( m_list[0] );
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET_PATH* SCH_SHEET_LIST::GetNext()
|
|
||||||
{
|
|
||||||
if( m_index < GetCount() )
|
|
||||||
m_index++;
|
|
||||||
|
|
||||||
return GetSheet( m_index );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET_PATH* SCH_SHEET_LIST::GetLast()
|
|
||||||
{
|
|
||||||
if( GetCount() == 0 )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
m_index = GetCount() - 1;
|
|
||||||
|
|
||||||
return GetSheet( m_index );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET_PATH* SCH_SHEET_LIST::GetPrevious()
|
|
||||||
{
|
|
||||||
if( m_index == 0 )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
m_index -= 1;
|
|
||||||
|
|
||||||
return GetSheet( m_index );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheet( int aIndex ) const
|
|
||||||
{
|
|
||||||
if( aIndex < GetCount() )
|
|
||||||
return &( m_list[aIndex] );
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheetByPath( const wxString aPath, bool aHumanReadable )
|
SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheetByPath( const wxString aPath, bool aHumanReadable )
|
||||||
{
|
{
|
||||||
SCH_SHEET_PATH* sheet = GetFirst();
|
|
||||||
wxString sheetPath;
|
wxString sheetPath;
|
||||||
|
|
||||||
while( sheet )
|
for( unsigned i = 0; i < size(); i++ )
|
||||||
{
|
{
|
||||||
sheetPath = ( aHumanReadable ) ? sheet->PathHumanReadable() : sheet->Path();
|
sheetPath = ( aHumanReadable ) ? at( i ).PathHumanReadable() : at( i ).Path();
|
||||||
|
|
||||||
if( sheetPath == aPath )
|
if( sheetPath == aPath )
|
||||||
return sheet;
|
return &at( i );
|
||||||
|
|
||||||
sheet = GetNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -555,52 +496,41 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
|
||||||
if( aSheet == g_RootSheet )
|
if( aSheet == g_RootSheet )
|
||||||
m_isRootSheet = true;
|
m_isRootSheet = true;
|
||||||
|
|
||||||
if( m_list == NULL )
|
m_currentSheetPath.push_back( aSheet );
|
||||||
{
|
|
||||||
int count = aSheet->CountSheets();
|
|
||||||
|
|
||||||
m_count = count;
|
|
||||||
m_index = 0;
|
|
||||||
m_list = new SCH_SHEET_PATH[ count ];
|
|
||||||
m_currList.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_currList.push_back( aSheet );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo: Schematic page number is currently a left over relic and is generated as
|
* @todo: Schematic page number is currently a left over relic and is generated as
|
||||||
* SCH_SHEET_PATH object is pushed to the list. This only has meaning when
|
* SCH_SHEET_PATH object is pushed to the list. This only has meaning when
|
||||||
* entire hierarchy is created from the root sheet down.
|
* entire hierarchy is created from the root sheet down.
|
||||||
*/
|
*/
|
||||||
m_currList.SetPageNumber( m_index + 1 );
|
m_currentSheetPath.SetPageNumber( size() + 1 );
|
||||||
m_list[m_index] = m_currList;
|
push_back( m_currentSheetPath );
|
||||||
m_index++;
|
|
||||||
|
|
||||||
if( aSheet->GetScreen() )
|
if( aSheet->GetScreen() )
|
||||||
{
|
{
|
||||||
EDA_ITEM* strct = m_currList.LastDrawList();
|
EDA_ITEM* item = m_currentSheetPath.LastDrawList();
|
||||||
|
|
||||||
while( strct )
|
while( item )
|
||||||
{
|
{
|
||||||
if( strct->Type() == SCH_SHEET_T )
|
if( item->Type() == SCH_SHEET_T )
|
||||||
{
|
{
|
||||||
SCH_SHEET* sheet = (SCH_SHEET*) strct;
|
SCH_SHEET* sheet = (SCH_SHEET*) item;
|
||||||
BuildSheetList( sheet );
|
BuildSheetList( sheet );
|
||||||
}
|
}
|
||||||
|
|
||||||
strct = strct->Next();
|
item = item->Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_currList.pop_back();
|
m_currentSheetPath.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_SHEET_LIST::IsModified()
|
bool SCH_SHEET_LIST::IsModified()
|
||||||
{
|
{
|
||||||
for( SCH_SHEET_PATH* sheet = GetFirst(); sheet; sheet = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
{
|
{
|
||||||
if( sheet->LastScreen() && sheet->LastScreen()->IsModify() )
|
if( (*it).LastScreen() && (*it).LastScreen()->IsModify() )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,9 +540,9 @@ bool SCH_SHEET_LIST::IsModified()
|
||||||
|
|
||||||
bool SCH_SHEET_LIST::IsAutoSaveRequired()
|
bool SCH_SHEET_LIST::IsAutoSaveRequired()
|
||||||
{
|
{
|
||||||
for( SCH_SHEET_PATH* sheet = GetFirst(); sheet; sheet = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
{
|
{
|
||||||
if( sheet->LastScreen() && sheet->LastScreen()->IsSave() )
|
if( (*it).LastScreen() && (*it).LastScreen()->IsSave() )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,10 +552,10 @@ bool SCH_SHEET_LIST::IsAutoSaveRequired()
|
||||||
|
|
||||||
void SCH_SHEET_LIST::ClearModifyStatus()
|
void SCH_SHEET_LIST::ClearModifyStatus()
|
||||||
{
|
{
|
||||||
for( SCH_SHEET_PATH* sheet = GetFirst(); sheet; sheet = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
{
|
{
|
||||||
if( sheet->LastScreen() )
|
if( (*it).LastScreen() )
|
||||||
sheet->LastScreen()->ClrModify();
|
(*it).LastScreen()->ClrModify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,29 +564,32 @@ void SCH_SHEET_LIST::AnnotatePowerSymbols( PART_LIBS* aLibs )
|
||||||
{
|
{
|
||||||
int ref = 1;
|
int ref = 1;
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* path = GetFirst(); path; path = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
path->AnnotatePowerSymbols( aLibs, &ref );
|
(*it).AnnotatePowerSymbols( aLibs, &ref );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_SHEET_LIST::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences,
|
void SCH_SHEET_LIST::GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences,
|
||||||
bool aIncludePowerSymbols )
|
bool aIncludePowerSymbols )
|
||||||
{
|
{
|
||||||
for( SCH_SHEET_PATH* path = GetFirst(); path; path = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
path->GetComponents( aLibs, aReferences, aIncludePowerSymbols );
|
(*it).GetComponents( aLibs, aReferences, aIncludePowerSymbols );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCH_SHEET_LIST::GetMultiUnitComponents( PART_LIBS* aLibs,
|
void SCH_SHEET_LIST::GetMultiUnitComponents( PART_LIBS* aLibs,
|
||||||
SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols )
|
SCH_MULTI_UNIT_REFERENCE_MAP &aRefList,
|
||||||
|
bool aIncludePowerSymbols )
|
||||||
{
|
{
|
||||||
for( SCH_SHEET_PATH* path = GetFirst(); path; path = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
{
|
{
|
||||||
SCH_MULTI_UNIT_REFERENCE_MAP tempMap;
|
SCH_MULTI_UNIT_REFERENCE_MAP tempMap;
|
||||||
path->GetMultiUnitComponents( aLibs, tempMap );
|
(*it).GetMultiUnitComponents( aLibs, tempMap );
|
||||||
|
|
||||||
BOOST_FOREACH( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair, tempMap )
|
BOOST_FOREACH( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair, tempMap )
|
||||||
{
|
{
|
||||||
// Merge this list into the main one
|
// Merge this list into the main one
|
||||||
unsigned n_refs = pair.second.GetCount();
|
unsigned n_refs = pair.second.GetCount();
|
||||||
|
|
||||||
for( unsigned thisRef = 0; thisRef < n_refs; ++thisRef )
|
for( unsigned thisRef = 0; thisRef < n_refs; ++thisRef )
|
||||||
{
|
{
|
||||||
aRefList[pair.first].AddItem( pair.second[thisRef] );
|
aRefList[pair.first].AddItem( pair.second[thisRef] );
|
||||||
|
@ -673,11 +606,11 @@ SCH_ITEM* SCH_SHEET_LIST::FindNextItem( KICAD_T aType, SCH_SHEET_PATH** aSheetFo
|
||||||
bool firstItemFound = false;
|
bool firstItemFound = false;
|
||||||
|
|
||||||
SCH_ITEM* drawItem = NULL;
|
SCH_ITEM* drawItem = NULL;
|
||||||
SCH_SHEET_PATH* sheet = GetFirst();
|
SCH_SHEET_PATHS_ITER it = begin();
|
||||||
|
|
||||||
while( sheet )
|
while( it != end() )
|
||||||
{
|
{
|
||||||
drawItem = sheet->LastDrawList();
|
drawItem = (*it).LastDrawList();
|
||||||
|
|
||||||
while( drawItem )
|
while( drawItem )
|
||||||
{
|
{
|
||||||
|
@ -686,7 +619,7 @@ SCH_ITEM* SCH_SHEET_LIST::FindNextItem( KICAD_T aType, SCH_SHEET_PATH** aSheetFo
|
||||||
if( aLastItem == NULL || firstItemFound )
|
if( aLastItem == NULL || firstItemFound )
|
||||||
{
|
{
|
||||||
if( aSheetFoundIn )
|
if( aSheetFoundIn )
|
||||||
*aSheetFoundIn = sheet;
|
*aSheetFoundIn = &(*it);
|
||||||
|
|
||||||
return drawItem;
|
return drawItem;
|
||||||
}
|
}
|
||||||
|
@ -699,12 +632,12 @@ SCH_ITEM* SCH_SHEET_LIST::FindNextItem( KICAD_T aType, SCH_SHEET_PATH** aSheetFo
|
||||||
drawItem = drawItem->Next();
|
drawItem = drawItem->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
sheet = GetNext();
|
++it;
|
||||||
|
|
||||||
if( sheet == NULL && aLastItem && aWrap && !hasWrapped )
|
if( it == end() && aLastItem && aWrap && !hasWrapped )
|
||||||
{
|
{
|
||||||
hasWrapped = true;
|
hasWrapped = true;
|
||||||
sheet = GetFirst();
|
it = begin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,11 +651,11 @@ SCH_ITEM* SCH_SHEET_LIST::FindPreviousItem( KICAD_T aType, SCH_SHEET_PATH** aShe
|
||||||
bool hasWrapped = false;
|
bool hasWrapped = false;
|
||||||
bool firstItemFound = false;
|
bool firstItemFound = false;
|
||||||
SCH_ITEM* drawItem = NULL;
|
SCH_ITEM* drawItem = NULL;
|
||||||
SCH_SHEET_PATH* sheet = GetLast();
|
SCH_SHEET_PATHS_RITER it = rbegin();
|
||||||
|
|
||||||
while( sheet )
|
while( it != rend() )
|
||||||
{
|
{
|
||||||
drawItem = sheet->FirstDrawList();
|
drawItem = (*it).FirstDrawList();
|
||||||
|
|
||||||
while( drawItem )
|
while( drawItem )
|
||||||
{
|
{
|
||||||
|
@ -731,7 +664,7 @@ SCH_ITEM* SCH_SHEET_LIST::FindPreviousItem( KICAD_T aType, SCH_SHEET_PATH** aShe
|
||||||
if( aLastItem == NULL || firstItemFound )
|
if( aLastItem == NULL || firstItemFound )
|
||||||
{
|
{
|
||||||
if( aSheetFoundIn )
|
if( aSheetFoundIn )
|
||||||
*aSheetFoundIn = sheet;
|
*aSheetFoundIn = &(*it);
|
||||||
|
|
||||||
return drawItem;
|
return drawItem;
|
||||||
}
|
}
|
||||||
|
@ -744,12 +677,12 @@ SCH_ITEM* SCH_SHEET_LIST::FindPreviousItem( KICAD_T aType, SCH_SHEET_PATH** aShe
|
||||||
drawItem = drawItem->Back();
|
drawItem = drawItem->Back();
|
||||||
}
|
}
|
||||||
|
|
||||||
sheet = GetPrevious();
|
++it;
|
||||||
|
|
||||||
if( sheet == NULL && aLastItem && aWrap && !hasWrapped )
|
if( it == rend() && aLastItem && aWrap && !hasWrapped )
|
||||||
{
|
{
|
||||||
hasWrapped = true;
|
hasWrapped = true;
|
||||||
sheet = GetLast();
|
it = rbegin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,8 +695,8 @@ bool SCH_SHEET_LIST::SetComponentFootprint( const wxString& aReference,
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
for( SCH_SHEET_PATH* path = GetFirst(); path; path = GetNext() )
|
for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
|
||||||
found = path->SetComponentFootprint( aReference, aFootPrint, aSetVisible );
|
found = (*it).SetComponentFootprint( aReference, aFootPrint, aSetVisible );
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
@ -773,16 +706,16 @@ bool SCH_SHEET_LIST::IsComplexHierarchy() const
|
||||||
{
|
{
|
||||||
wxString fileName;
|
wxString fileName;
|
||||||
|
|
||||||
for( int i = 0; i < m_count; i++ )
|
for( unsigned i = 0; i < size(); i++ )
|
||||||
{
|
{
|
||||||
fileName = m_list[i].Last()->GetFileName();
|
fileName = at( i ).Last()->GetFileName();
|
||||||
|
|
||||||
for( int j = 0; j < m_count; j++ )
|
for( unsigned j = 0; j < size(); j++ )
|
||||||
{
|
{
|
||||||
if( i == j )
|
if( i == j )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( fileName == m_list[j].Last()->GetFileName() )
|
if( fileName == at( j ).Last()->GetFileName() )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -801,16 +734,16 @@ bool SCH_SHEET_LIST::TestForRecursion( const SCH_SHEET_LIST& aSrcSheetHierarchy,
|
||||||
destFn.MakeAbsolute( rootFn.GetPath() );
|
destFn.MakeAbsolute( rootFn.GetPath() );
|
||||||
|
|
||||||
// Test each SCH_SHEET_PATH in this SCH_SHEET_LIST for potential recursion.
|
// Test each SCH_SHEET_PATH in this SCH_SHEET_LIST for potential recursion.
|
||||||
for( int i = 0; i < m_count; i++ )
|
for( unsigned i = 0; i < size(); i++ )
|
||||||
{
|
{
|
||||||
// Test each SCH_SHEET_PATH in the source sheet.
|
// Test each SCH_SHEET_PATH in the source sheet.
|
||||||
for( int j = 0; j < aSrcSheetHierarchy.GetCount(); j++ )
|
for( unsigned j = 0; j < aSrcSheetHierarchy.size(); j++ )
|
||||||
{
|
{
|
||||||
SCH_SHEET_PATH* sheetPath = aSrcSheetHierarchy.GetSheet( j );
|
const SCH_SHEET_PATH* sheetPath = &aSrcSheetHierarchy[j];
|
||||||
|
|
||||||
for( unsigned k = 0; k < sheetPath->size(); k++ )
|
for( unsigned k = 0; k < sheetPath->size(); k++ )
|
||||||
{
|
{
|
||||||
if( m_list[i].TestForRecursion( sheetPath->GetSheet( k )->GetFileName(),
|
if( at( i ).TestForRecursion( sheetPath->GetSheet( k )->GetFileName(),
|
||||||
aDestFileName ) )
|
aDestFileName ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -824,9 +757,9 @@ bool SCH_SHEET_LIST::TestForRecursion( const SCH_SHEET_LIST& aSrcSheetHierarchy,
|
||||||
|
|
||||||
SCH_SHEET* SCH_SHEET_LIST::FindSheetByName( const wxString& aSheetName )
|
SCH_SHEET* SCH_SHEET_LIST::FindSheetByName( const wxString& aSheetName )
|
||||||
{
|
{
|
||||||
for( int i = 0; i < m_count; i++ )
|
for( unsigned i = 0; i < size(); i++ )
|
||||||
{
|
{
|
||||||
SCH_SHEET* sheet = m_list[i].FindSheetByName( aSheetName );
|
SCH_SHEET* sheet = at( i ).FindSheetByName( aSheetName );
|
||||||
|
|
||||||
if( sheet )
|
if( sheet )
|
||||||
return sheet;
|
return sheet;
|
||||||
|
|
|
@ -120,12 +120,19 @@ public:
|
||||||
|
|
||||||
int GetPageNumber() const { return m_pageNumber; }
|
int GetPageNumber() const { return m_pageNumber; }
|
||||||
|
|
||||||
|
const SCH_SHEET* GetSheet( unsigned aIndex ) const
|
||||||
|
{
|
||||||
|
SCH_SHEET* retv = NULL;
|
||||||
|
|
||||||
|
if( aIndex < size() )
|
||||||
|
retv = at( aIndex );
|
||||||
|
|
||||||
|
return const_cast< SCH_SHEET* >( retv );
|
||||||
|
}
|
||||||
|
|
||||||
SCH_SHEET* GetSheet( unsigned aIndex )
|
SCH_SHEET* GetSheet( unsigned aIndex )
|
||||||
{
|
{
|
||||||
if( aIndex < size() )
|
return const_cast< SCH_SHEET* >( static_cast< const SCH_SHEET_PATH& >( *this ).GetSheet( aIndex ) );
|
||||||
return at( aIndex );
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -305,100 +312,40 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef std::vector< SCH_SHEET_PATH > SCH_SHEET_PATHS;
|
||||||
|
typedef SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER;
|
||||||
|
typedef SCH_SHEET_PATHS::const_iterator SCH_SHEET_PATHS_CITER;
|
||||||
|
typedef SCH_SHEET_PATHS::reverse_iterator SCH_SHEET_PATHS_RITER;
|
||||||
|
typedef SCH_SHEET_PATHS::const_reverse_iterator SCH_SHEET_PATHS_CRITER;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SCH_SHEET_LIST
|
* Class SCH_SHEET_LIST
|
||||||
* handles the list of Sheets in a hierarchy.
|
*
|
||||||
* Sheets are not unique, there can be many sheets with the same
|
* handles a list of #SCH_SHEET_PATH objects in a flattened hierarchy.
|
||||||
* filename and the same SCH_SCREEN reference.
|
*
|
||||||
* The schematic (SCH_SCREEN) is shared between these sheets,
|
* #SCH_SHEET objects are not unique, there can be many sheets with the same filename and
|
||||||
* and component references are specific to a sheet path.
|
* that share the same #SCH_SCREEN reference. Each The schematic file (#SCH_SCREEN) may
|
||||||
* When a sheet is entered, component references and sheet number are updated.
|
* be shared between these sheets and component references are specific to a sheet path.
|
||||||
|
* When a sheet is entered, component references and sheet page number are updated.
|
||||||
*/
|
*/
|
||||||
class SCH_SHEET_LIST
|
class SCH_SHEET_LIST : public SCH_SHEET_PATHS
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SCH_SHEET_PATH* m_list;
|
|
||||||
int m_count; /* Number of sheets included in hierarchy,
|
|
||||||
* starting at the given sheet in constructor .
|
|
||||||
* the given sheet is counted
|
|
||||||
*/
|
|
||||||
int m_index; /* internal variable to handle GetNext(): cleared by
|
|
||||||
* GetFirst() and incremented by GetNext() after
|
|
||||||
* returning the next item in m_list. Also used for
|
|
||||||
* internal calculations in BuildSheetList()
|
|
||||||
*/
|
|
||||||
bool m_isRootSheet;
|
bool m_isRootSheet;
|
||||||
SCH_SHEET_PATH m_currList;
|
SCH_SHEET_PATH m_currentSheetPath;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* builds the list of sheets from aSheet.
|
* build a flattened list of SCH_SHEET_PATH objects from \a aSheet.
|
||||||
* If aSheet == NULL (default) build the whole list of sheets in hierarchy.
|
*
|
||||||
* So usually call it with no parameter.
|
* If aSheet == NULL, then this is an empty hierarchy which the user can populate.
|
||||||
*/
|
*/
|
||||||
SCH_SHEET_LIST( SCH_SHEET* aSheet = NULL );
|
SCH_SHEET_LIST( SCH_SHEET* aSheet = NULL );
|
||||||
|
|
||||||
~SCH_SHEET_LIST()
|
~SCH_SHEET_LIST() {}
|
||||||
{
|
|
||||||
if( m_list )
|
|
||||||
delete[] m_list;
|
|
||||||
|
|
||||||
m_list = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetCount
|
|
||||||
* @return the number of sheets in list:
|
|
||||||
* usually the number of sheets found in the whole hierarchy
|
|
||||||
*/
|
|
||||||
int GetCount() const { return m_count; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetIndex
|
|
||||||
* @return the last selected screen index.
|
|
||||||
*/
|
|
||||||
int GetIndex() const { return m_index; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetFirst
|
|
||||||
* @return the first item (sheet) in m_list and prepare calls to GetNext()
|
|
||||||
*/
|
|
||||||
SCH_SHEET_PATH* GetFirst();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetNext
|
|
||||||
* @return the next item (sheet) in m_list or NULL if no more item in
|
|
||||||
* sheet list
|
|
||||||
*/
|
|
||||||
SCH_SHEET_PATH* GetNext();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetLast
|
|
||||||
* returns the last sheet in the sheet list.
|
|
||||||
*
|
|
||||||
* @return Last sheet in the list or NULL if sheet list is empty.
|
|
||||||
*/
|
|
||||||
SCH_SHEET_PATH* GetLast();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetPrevious
|
|
||||||
* returns the previous sheet in the sheet list.
|
|
||||||
*
|
|
||||||
* @return The previous sheet in the sheet list or NULL if already at the
|
|
||||||
* beginning of the list.
|
|
||||||
*/
|
|
||||||
SCH_SHEET_PATH* GetPrevious();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function GetSheet
|
|
||||||
*
|
|
||||||
* @param aIndex A index in sheet list to get the sheet.
|
|
||||||
* @return the sheet at \a aIndex position in m_list or NULL if \a aIndex is
|
|
||||||
* outside the bounds of the index list.
|
|
||||||
*/
|
|
||||||
SCH_SHEET_PATH* GetSheet( int aIndex ) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetSheetByPath
|
* Function GetSheetByPath
|
||||||
|
@ -443,7 +390,8 @@ public:
|
||||||
* @param aReferences List of references to populate.
|
* @param aReferences List of references to populate.
|
||||||
* @param aIncludePowerSymbols Set to false to only get normal components.
|
* @param aIncludePowerSymbols Set to false to only get normal components.
|
||||||
*/
|
*/
|
||||||
void GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols = true );
|
void GetComponents( PART_LIBS* aLibs, SCH_REFERENCE_LIST& aReferences,
|
||||||
|
bool aIncludePowerSymbols = true );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetMultiUnitComponents
|
* Function GetMultiUnitComponents
|
||||||
|
@ -530,8 +478,6 @@ public:
|
||||||
*/
|
*/
|
||||||
SCH_SHEET* FindSheetByName( const wxString& aSheetName );
|
SCH_SHEET* FindSheetByName( const wxString& aSheetName );
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function BuildSheetList
|
* Function BuildSheetList
|
||||||
* builds the list of sheets and their sheet path from \a aSheet.
|
* builds the list of sheets and their sheet path from \a aSheet.
|
||||||
|
|
|
@ -477,15 +477,13 @@ void SCH_EDIT_FRAME::SetSheetNumberAndCount()
|
||||||
int sheet_count = g_RootSheet->CountSheets();
|
int sheet_count = g_RootSheet->CountSheets();
|
||||||
int SheetNumber = 1;
|
int SheetNumber = 1;
|
||||||
wxString current_sheetpath = m_CurrentSheet->Path();
|
wxString current_sheetpath = m_CurrentSheet->Path();
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
// Examine all sheets path to find the current sheets path,
|
// Examine all sheets path to find the current sheets path,
|
||||||
// and count them from root to the current sheet path:
|
// and count them from root to the current sheet path:
|
||||||
SCH_SHEET_PATH* sheet;
|
for( unsigned i = 0; i < sheetList.size(); i++ )
|
||||||
|
|
||||||
for( sheet = sheetList.GetFirst(); sheet != NULL; sheet = sheetList.GetNext() )
|
|
||||||
{
|
{
|
||||||
wxString sheetpath = sheet->Path();
|
wxString sheetpath = sheetList[i].Path();
|
||||||
|
|
||||||
if( sheetpath == current_sheetpath ) // Current sheet path found
|
if( sheetpath == current_sheetpath ) // Current sheet path found
|
||||||
break;
|
break;
|
||||||
|
@ -614,7 +612,7 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
if( sheetList.IsModified() )
|
if( sheetList.IsModified() )
|
||||||
{
|
{
|
||||||
|
@ -787,7 +785,7 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
|
void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
aEvent.Enable( sheetList.IsModified() );
|
aEvent.Enable( sheetList.IsModified() );
|
||||||
}
|
}
|
||||||
|
@ -1232,7 +1230,7 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
|
||||||
|
|
||||||
if( g_RootSheet != NULL )
|
if( g_RootSheet != NULL )
|
||||||
{
|
{
|
||||||
SCH_SHEET_LIST sheetList;
|
SCH_SHEET_LIST sheetList( g_RootSheet );
|
||||||
|
|
||||||
return sheetList.IsAutoSaveRequired();
|
return sheetList.IsAutoSaveRequired();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -46,7 +46,7 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy )
|
||||||
if( aSheet == NULL || aHierarchy == NULL )
|
if( aSheet == NULL || aHierarchy == NULL )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SCH_SHEET_LIST hierarchy; // This is the schematic sheet hierarchy.
|
SCH_SHEET_LIST hierarchy( g_RootSheet ); // This is the schematic sheet hierarchy.
|
||||||
|
|
||||||
// Get the new texts
|
// Get the new texts
|
||||||
DIALOG_SCH_SHEET_PROPS dlg( this );
|
DIALOG_SCH_SHEET_PROPS dlg( this );
|
||||||
|
|
|
@ -57,9 +57,9 @@ PinShapeComboBox::PinShapeComboBox( wxWindow* parent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GRAPHIC_PINSHAPE PinShapeComboBox::GetSelection()
|
GRAPHIC_PINSHAPE PinShapeComboBox::GetPinShapeSelection()
|
||||||
{
|
{
|
||||||
return static_cast<GRAPHIC_PINSHAPE>( wxBitmapComboBox::GetSelection() );
|
return static_cast<GRAPHIC_PINSHAPE>( GetSelection() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,6 @@ public:
|
||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxBitmapComboBoxNameStr );
|
const wxString& name = wxBitmapComboBoxNameStr );
|
||||||
|
|
||||||
GRAPHIC_PINSHAPE GetSelection();
|
GRAPHIC_PINSHAPE GetPinShapeSelection();
|
||||||
void SetSelection( GRAPHIC_PINSHAPE aShape );
|
void SetSelection( GRAPHIC_PINSHAPE aShape );
|
||||||
};
|
};
|
||||||
|
|
|
@ -57,9 +57,9 @@ PinTypeComboBox::PinTypeComboBox( wxWindow* parent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ELECTRICAL_PINTYPE PinTypeComboBox::GetSelection()
|
ELECTRICAL_PINTYPE PinTypeComboBox::GetPinTypeSelection()
|
||||||
{
|
{
|
||||||
return static_cast<ELECTRICAL_PINTYPE>( wxBitmapComboBox::GetSelection() );
|
return static_cast<ELECTRICAL_PINTYPE>( GetSelection() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,6 @@ public:
|
||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxBitmapComboBoxNameStr );
|
const wxString& name = wxBitmapComboBoxNameStr );
|
||||||
|
|
||||||
ELECTRICAL_PINTYPE GetSelection();
|
ELECTRICAL_PINTYPE GetPinTypeSelection();
|
||||||
void SetSelection( ELECTRICAL_PINTYPE aType );
|
void SetSelection( ELECTRICAL_PINTYPE aType );
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
LAUNCHER_PANEL::LAUNCHER_PANEL( wxWindow* parent ) :
|
LAUNCHER_PANEL::LAUNCHER_PANEL( wxWindow* parent ) :
|
||||||
wxPanel( parent, wxID_ANY )
|
wxPanel( parent, wxID_ANY )
|
||||||
{
|
{
|
||||||
m_bitmapButtons_maxHeigth = 0;
|
m_bitmapButtons_maxHeight = 0;
|
||||||
m_buttonSeparation = 10; // control of command buttons position
|
m_buttonSeparation = 10; // control of command buttons position
|
||||||
m_buttonsListPosition.x = m_buttonSeparation;
|
m_buttonsListPosition.x = m_buttonSeparation;
|
||||||
m_buttonsListPosition.y = m_buttonSeparation;
|
m_buttonsListPosition.y = m_buttonSeparation;
|
||||||
|
@ -48,7 +48,7 @@ LAUNCHER_PANEL::LAUNCHER_PANEL( wxWindow* parent ) :
|
||||||
|
|
||||||
int LAUNCHER_PANEL::GetPanelHeight() const
|
int LAUNCHER_PANEL::GetPanelHeight() const
|
||||||
{
|
{
|
||||||
int height = m_buttonsListPosition.y + m_bitmapButtons_maxHeigth
|
int height = m_buttonsListPosition.y + m_bitmapButtons_maxHeight
|
||||||
+ m_buttonSeparation;
|
+ m_buttonSeparation;
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
@ -104,8 +104,8 @@ wxBitmapButton* LAUNCHER_PANEL::AddBitmapButton( wxWindowID aId, const wxBitmap&
|
||||||
buttSize.x = aBitmap.GetWidth() + btn_margin;
|
buttSize.x = aBitmap.GetWidth() + btn_margin;
|
||||||
buttSize.y = aBitmap.GetHeight() + btn_margin;
|
buttSize.y = aBitmap.GetHeight() + btn_margin;
|
||||||
|
|
||||||
if( m_bitmapButtons_maxHeigth < buttSize.y )
|
if( m_bitmapButtons_maxHeight < buttSize.y )
|
||||||
m_bitmapButtons_maxHeigth = buttSize.y;
|
m_bitmapButtons_maxHeight = buttSize.y;
|
||||||
|
|
||||||
wxBitmapButton* btn = new wxBitmapButton( this, aId, aBitmap, buttPos, buttSize );
|
wxBitmapButton* btn = new wxBitmapButton( this, aId, aBitmap, buttPos, buttSize );
|
||||||
m_buttonLastPosition.x += buttSize.x + m_buttonSeparation;
|
m_buttonLastPosition.x += buttSize.x + m_buttonSeparation;
|
||||||
|
|
|
@ -308,7 +308,7 @@ private:
|
||||||
* of the first bitmap button
|
* of the first bitmap button
|
||||||
*/
|
*/
|
||||||
wxPoint m_buttonLastPosition; // position of the last button in the window
|
wxPoint m_buttonLastPosition; // position of the last button in the window
|
||||||
int m_bitmapButtons_maxHeigth; // height of bigger bitmap buttons
|
int m_bitmapButtons_maxHeight; // height of bigger bitmap buttons
|
||||||
// Used to calculate the height of the panel.
|
// Used to calculate the height of the panel.
|
||||||
|
|
||||||
public: LAUNCHER_PANEL( wxWindow* parent );
|
public: LAUNCHER_PANEL( wxWindow* parent );
|
||||||
|
|
|
@ -1176,6 +1176,7 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem,
|
||||||
new_item = new_pad;
|
new_item = new_pad;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PCB_MODULE_TEXT_T:
|
case PCB_MODULE_TEXT_T:
|
||||||
{
|
{
|
||||||
const TEXTE_MODULE* old_text = static_cast<const TEXTE_MODULE*>( aItem );
|
const TEXTE_MODULE* old_text = static_cast<const TEXTE_MODULE*>( aItem );
|
||||||
|
@ -1191,6 +1192,7 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PCB_MODULE_EDGE_T:
|
case PCB_MODULE_EDGE_T:
|
||||||
{
|
{
|
||||||
EDGE_MODULE* new_edge = new EDGE_MODULE(
|
EDGE_MODULE* new_edge = new EDGE_MODULE(
|
||||||
|
@ -1200,6 +1202,7 @@ BOARD_ITEM* MODULE::DuplicateAndAddItem( const BOARD_ITEM* aItem,
|
||||||
new_item = new_edge;
|
new_item = new_edge;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PCB_MODULE_T:
|
case PCB_MODULE_T:
|
||||||
// Ignore the module itself
|
// Ignore the module itself
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -57,11 +57,9 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrig
|
||||||
};
|
};
|
||||||
m_choicePriAxisNumbering->Set( DIM( charSetDescriptions ), charSetDescriptions );
|
m_choicePriAxisNumbering->Set( DIM( charSetDescriptions ), charSetDescriptions );
|
||||||
m_choiceSecAxisNumbering->Set( DIM( charSetDescriptions ), charSetDescriptions );
|
m_choiceSecAxisNumbering->Set( DIM( charSetDescriptions ), charSetDescriptions );
|
||||||
m_choiceCircNumberingType->Set( DIM( charSetDescriptions ), charSetDescriptions );;
|
|
||||||
|
|
||||||
m_choicePriAxisNumbering->SetSelection( 0 );
|
m_choicePriAxisNumbering->SetSelection( 0 );
|
||||||
m_choiceSecAxisNumbering->SetSelection( 0 );
|
m_choiceSecAxisNumbering->SetSelection( 0 );
|
||||||
m_choiceCircNumberingType->SetSelection( 0 );
|
|
||||||
|
|
||||||
Add( m_entryNx, m_options.m_gridNx );
|
Add( m_entryNx, m_options.m_gridNx );
|
||||||
Add( m_entryNy, m_options.m_gridNy );
|
Add( m_entryNy, m_options.m_gridNy );
|
||||||
|
@ -93,6 +91,9 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrig
|
||||||
Add( m_entryGridPriNumberingOffset, m_options.m_gridPriNumberingOffset );
|
Add( m_entryGridPriNumberingOffset, m_options.m_gridPriNumberingOffset );
|
||||||
Add( m_entryGridSecNumberingOffset, m_options.m_gridSecNumberingOffset );
|
Add( m_entryGridSecNumberingOffset, m_options.m_gridSecNumberingOffset );
|
||||||
|
|
||||||
|
Add( m_rbGridStartNumberingOpt, m_options.m_gridNumberingScheme );
|
||||||
|
Add( m_rbCircStartNumberingOpt, m_options.m_circNumberingScheme );
|
||||||
|
|
||||||
RestoreConfigToControls();
|
RestoreConfigToControls();
|
||||||
|
|
||||||
// Load units into labels
|
// Load units into labels
|
||||||
|
@ -119,19 +120,8 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, wxPoint aOrig
|
||||||
|
|
||||||
void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event )
|
void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
const wxObject* evObj = event.GetEventObject();
|
|
||||||
|
|
||||||
// some controls result in a change of enablement
|
|
||||||
if( evObj == m_radioBoxGridNumberingScheme
|
|
||||||
|| evObj == m_checkBoxGridRestartNumbering )
|
|
||||||
{
|
|
||||||
setControlEnablement();
|
setControlEnablement();
|
||||||
}
|
|
||||||
|
|
||||||
if( evObj == m_entryCentreX || evObj == m_entryCentreY )
|
|
||||||
{
|
|
||||||
calculateCircularArrayProperties();
|
calculateCircularArrayProperties();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,12 +132,12 @@ static const std::string& alphabetFromNumberingScheme(
|
||||||
static const std::string alphaHex = "0123456789ABCDEF";
|
static const std::string alphaHex = "0123456789ABCDEF";
|
||||||
static const std::string alphaFull = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
static const std::string alphaFull = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
static const std::string alphaNoIOSQXZ = "ABCDEFGHJKLMNPRTUVWY";
|
static const std::string alphaNoIOSQXZ = "ABCDEFGHJKLMNPRTUVWY";
|
||||||
static const std::string alphaEmpty = "";
|
|
||||||
|
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
case DIALOG_CREATE_ARRAY::NUMBERING_NUMERIC:
|
case DIALOG_CREATE_ARRAY::NUMBERING_NUMERIC:
|
||||||
return alphaNumeric;
|
break;
|
||||||
|
|
||||||
case DIALOG_CREATE_ARRAY::NUMBERING_HEX:
|
case DIALOG_CREATE_ARRAY::NUMBERING_HEX:
|
||||||
return alphaHex;
|
return alphaHex;
|
||||||
|
@ -157,12 +147,9 @@ static const std::string& alphabetFromNumberingScheme(
|
||||||
|
|
||||||
case DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_FULL:
|
case DIALOG_CREATE_ARRAY::NUMBERING_ALPHA_FULL:
|
||||||
return alphaFull;
|
return alphaFull;
|
||||||
|
|
||||||
default:
|
|
||||||
wxASSERT_MSG( false, wxString( "Un-handled numbering scheme: " ) << type );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return alphaEmpty;
|
return alphaNumeric;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,9 +170,6 @@ static bool getNumberingOffset( const std::string& str,
|
||||||
{
|
{
|
||||||
const std::string alphabet = alphabetFromNumberingScheme( type );
|
const std::string alphabet = alphabetFromNumberingScheme( type );
|
||||||
|
|
||||||
wxASSERT_MSG( !alphabet.empty(), wxString(
|
|
||||||
"Unable to determine alphabet for numbering scheme: " ) << type );
|
|
||||||
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
const int radix = alphabet.length();
|
const int radix = alphabet.length();
|
||||||
|
|
||||||
|
@ -242,8 +226,8 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event )
|
||||||
newGrid->m_2dArrayNumbering = m_radioBoxGridNumberingScheme->GetSelection() != 0;
|
newGrid->m_2dArrayNumbering = m_radioBoxGridNumberingScheme->GetSelection() != 0;
|
||||||
|
|
||||||
// this is only correct if you set the choice up according to the enum size and order
|
// this is only correct if you set the choice up according to the enum size and order
|
||||||
ok = ok && m_choicePriAxisNumbering->GetSelection() < NUMBERING_TYPE_Max
|
ok = ok && m_choicePriAxisNumbering->GetSelection() <= NUMBERING_TYPE_MAX
|
||||||
&& m_choiceSecAxisNumbering->GetSelection() < NUMBERING_TYPE_Max;
|
&& m_choiceSecAxisNumbering->GetSelection() <= NUMBERING_TYPE_MAX;
|
||||||
|
|
||||||
// mind undefined casts to enums (should not be able to happen)
|
// mind undefined casts to enums (should not be able to happen)
|
||||||
if( ok )
|
if( ok )
|
||||||
|
@ -264,7 +248,7 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event )
|
||||||
m_entryGridSecNumberingOffset->GetValue().ToStdString(),
|
m_entryGridSecNumberingOffset->GetValue().ToStdString(),
|
||||||
newGrid->m_secAxisNumType, newGrid->m_numberingOffsetY );
|
newGrid->m_secAxisNumType, newGrid->m_numberingOffsetY );
|
||||||
|
|
||||||
newGrid->m_shouldRenumber = m_checkBoxGridRestartNumbering->GetValue();
|
newGrid->m_shouldRenumber = m_rbGridStartNumberingOpt->GetSelection() == 1;
|
||||||
|
|
||||||
// Only use settings if all values are good
|
// Only use settings if all values are good
|
||||||
if( ok )
|
if( ok )
|
||||||
|
@ -284,16 +268,8 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event )
|
||||||
ok = ok && m_entryCircCount->GetValue().ToLong( &newCirc->m_nPts );
|
ok = ok && m_entryCircCount->GetValue().ToLong( &newCirc->m_nPts );
|
||||||
|
|
||||||
newCirc->m_rotateItems = m_entryRotateItemsCb->GetValue();
|
newCirc->m_rotateItems = m_entryRotateItemsCb->GetValue();
|
||||||
|
newCirc->m_shouldRenumber = m_rbCircStartNumberingOpt->GetSelection() == 1;
|
||||||
newCirc->m_shouldRenumber = m_checkBoxCircRestartNumbering->GetValue();
|
newCirc->m_numberingType = NUMBERING_NUMERIC;
|
||||||
|
|
||||||
// This is only correct if you set the choice up according to the enum size and order
|
|
||||||
ok = ok && m_choiceCircNumberingType->GetSelection() < NUMBERING_TYPE_Max;
|
|
||||||
|
|
||||||
// Mind undefined casts to enums (should not be able to happen)
|
|
||||||
if( ok )
|
|
||||||
newCirc->m_numberingType =
|
|
||||||
(ARRAY_NUMBERING_TYPE_T) m_choiceCircNumberingType->GetSelection();
|
|
||||||
|
|
||||||
ok = ok && m_entryCircNumberingStart->GetValue().ToLong( &newCirc->m_numberingOffset );
|
ok = ok && m_entryCircNumberingStart->GetValue().ToLong( &newCirc->m_numberingOffset );
|
||||||
|
|
||||||
|
@ -311,17 +287,19 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event )
|
||||||
|
|
||||||
// assign pointer and ownership here
|
// assign pointer and ownership here
|
||||||
*m_settings = newSettings;
|
*m_settings = newSettings;
|
||||||
|
|
||||||
ReadConfigFromControls();
|
ReadConfigFromControls();
|
||||||
|
|
||||||
EndModal( wxID_OK );
|
EndModal( wxID_OK );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
wxMessageBox( _(" Bad parameters" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_CREATE_ARRAY::setControlEnablement()
|
void DIALOG_CREATE_ARRAY::setControlEnablement()
|
||||||
{
|
{
|
||||||
const bool renumber = m_checkBoxGridRestartNumbering->GetValue();
|
const bool renumber = m_rbGridStartNumberingOpt->GetSelection() == 1;
|
||||||
|
|
||||||
// If we're not renumbering, we can't set the numbering scheme
|
// If we're not renumbering, we can't set the numbering scheme
|
||||||
// or axis numbering types
|
// or axis numbering types
|
||||||
|
@ -341,10 +319,7 @@ void DIALOG_CREATE_ARRAY::setControlEnablement()
|
||||||
m_entryGridPriNumberingOffset->Enable( renumber );
|
m_entryGridPriNumberingOffset->Enable( renumber );
|
||||||
m_entryGridSecNumberingOffset->Enable( renumber && num2d );
|
m_entryGridSecNumberingOffset->Enable( renumber && num2d );
|
||||||
|
|
||||||
|
m_entryCircNumberingStart->Enable( m_rbCircStartNumberingOpt->GetSelection() == 1 );
|
||||||
// Circular array options
|
|
||||||
const bool circRenumber = m_checkBoxCircRestartNumbering->GetValue();
|
|
||||||
m_choiceCircNumberingType->Enable( circRenumber );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -371,8 +346,6 @@ std::string DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber( int n,
|
||||||
std::string itemNum;
|
std::string itemNum;
|
||||||
const std::string& alphabet = alphabetFromNumberingScheme( type );
|
const std::string& alphabet = alphabetFromNumberingScheme( type );
|
||||||
|
|
||||||
if( !alphabet.empty() )
|
|
||||||
{
|
|
||||||
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( type );
|
const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( type );
|
||||||
|
|
||||||
bool firstRound = true;
|
bool firstRound = true;
|
||||||
|
@ -389,7 +362,6 @@ std::string DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber( int n,
|
||||||
n /= radix;
|
n /= radix;
|
||||||
firstRound = false;
|
firstRound = false;
|
||||||
} while( n );
|
} while( n );
|
||||||
}
|
|
||||||
|
|
||||||
return itemNum;
|
return itemNum;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +465,7 @@ void DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem( int n, BOARD_IT
|
||||||
|
|
||||||
if( m_angle == 0 )
|
if( m_angle == 0 )
|
||||||
// angle is zero, divide evenly into m_nPts
|
// angle is zero, divide evenly into m_nPts
|
||||||
angle = 3600.0 * n / float(m_nPts);
|
angle = 3600.0 * n / double( m_nPts );
|
||||||
else
|
else
|
||||||
// n'th step
|
// n'th step
|
||||||
angle = m_angle * n;
|
angle = m_angle * n;
|
||||||
|
@ -508,5 +480,9 @@ void DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::TransformItem( int n, BOARD_IT
|
||||||
|
|
||||||
wxString DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetItemNumber( int aN ) const
|
wxString DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS::GetItemNumber( int aN ) const
|
||||||
{
|
{
|
||||||
|
// The first new pad has aN number == 1, not 0
|
||||||
|
if( m_shouldRenumber ) // numbering pad from initial user value
|
||||||
|
return getCoordinateNumber( aN - 1 + m_numberingOffset, m_numberingType );
|
||||||
|
else // numbering pad from inital pad number
|
||||||
return getCoordinateNumber( aN + m_numberingOffset, m_numberingType );
|
return getCoordinateNumber( aN + m_numberingOffset, m_numberingType );
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,9 +190,10 @@ public:
|
||||||
* for pin numbering on BGAs, etc
|
* for pin numbering on BGAs, etc
|
||||||
*/
|
*/
|
||||||
NUMBERING_ALPHA_FULL, ///< Full 26-character alphabet
|
NUMBERING_ALPHA_FULL, ///< Full 26-character alphabet
|
||||||
NUMBERING_TYPE_Max ///< Invalid maximum value, insert above here
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define NUMBERING_TYPE_MAX NUMBERING_ALPHA_FULL
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Persistent dialog options
|
* Persistent dialog options
|
||||||
*/
|
*/
|
||||||
|
@ -342,8 +343,9 @@ private:
|
||||||
std::string m_circCentreX, m_circCentreY,
|
std::string m_circCentreX, m_circCentreY,
|
||||||
m_circAngle, m_circCount, m_circNumberingOffset;
|
m_circAngle, m_circCount, m_circNumberingOffset;
|
||||||
bool m_circRotate;
|
bool m_circRotate;
|
||||||
|
|
||||||
int m_arrayTypeTab;
|
int m_arrayTypeTab;
|
||||||
|
int m_gridNumberingScheme;
|
||||||
|
int m_circNumberingScheme;
|
||||||
};
|
};
|
||||||
|
|
||||||
static CREATE_ARRAY_DIALOG_ENTRIES m_options;
|
static CREATE_ARRAY_DIALOG_ENTRIES m_options;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
// C++ code generated with wxFormBuilder (version Jan 1 2016)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -105,20 +105,22 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
||||||
|
|
||||||
wxString m_radioBoxGridNumberingAxisChoices[] = { _("Horizontal, then vertical"), _("Vertical, then horizontal") };
|
wxString m_radioBoxGridNumberingAxisChoices[] = { _("Horizontal, then vertical"), _("Vertical, then horizontal") };
|
||||||
int m_radioBoxGridNumberingAxisNChoices = sizeof( m_radioBoxGridNumberingAxisChoices ) / sizeof( wxString );
|
int m_radioBoxGridNumberingAxisNChoices = sizeof( m_radioBoxGridNumberingAxisChoices ) / sizeof( wxString );
|
||||||
m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering Direction"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS );
|
m_radioBoxGridNumberingAxis = new wxRadioBox( m_gridPanel, wxID_ANY, _("Pad Numbering Direction"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingAxisNChoices, m_radioBoxGridNumberingAxisChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_radioBoxGridNumberingAxis->SetSelection( 0 );
|
m_radioBoxGridNumberingAxis->SetSelection( 0 );
|
||||||
bSizer3->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 );
|
bSizer3->Add( m_radioBoxGridNumberingAxis, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse numbering on alternate rows or columns"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_checkBoxGridReverseNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Reverse pad numbering on alternate rows or columns"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizer3->Add( m_checkBoxGridReverseNumbering, 0, wxALL, 5 );
|
bSizer3->Add( m_checkBoxGridReverseNumbering, 0, wxALL, 5 );
|
||||||
|
|
||||||
m_checkBoxGridRestartNumbering = new wxCheckBox( m_gridPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 );
|
wxString m_rbGridStartNumberingOptChoices[] = { _("Use first free number"), _("From start value") };
|
||||||
m_checkBoxGridRestartNumbering->SetValue(true);
|
int m_rbGridStartNumberingOptNChoices = sizeof( m_rbGridStartNumberingOptChoices ) / sizeof( wxString );
|
||||||
bSizer3->Add( m_checkBoxGridRestartNumbering, 0, wxALL, 5 );
|
m_rbGridStartNumberingOpt = new wxRadioBox( m_gridPanel, wxID_ANY, _("Initial pad number"), wxDefaultPosition, wxDefaultSize, m_rbGridStartNumberingOptNChoices, m_rbGridStartNumberingOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_rbGridStartNumberingOpt->SetSelection( 1 );
|
||||||
|
bSizer3->Add( m_rbGridStartNumberingOpt, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Coordinate (A1, A2, ... B1, ...)") };
|
wxString m_radioBoxGridNumberingSchemeChoices[] = { _("Continuous (1, 2, 3...)"), _("Coordinate (A1, A2, ... B1, ...)") };
|
||||||
int m_radioBoxGridNumberingSchemeNChoices = sizeof( m_radioBoxGridNumberingSchemeChoices ) / sizeof( wxString );
|
int m_radioBoxGridNumberingSchemeNChoices = sizeof( m_radioBoxGridNumberingSchemeChoices ) / sizeof( wxString );
|
||||||
m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Numbering Scheme"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS );
|
m_radioBoxGridNumberingScheme = new wxRadioBox( m_gridPanel, wxID_ANY, _("Pad Numbering Scheme"), wxDefaultPosition, wxDefaultSize, m_radioBoxGridNumberingSchemeNChoices, m_radioBoxGridNumberingSchemeChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
m_radioBoxGridNumberingScheme->SetSelection( 1 );
|
m_radioBoxGridNumberingScheme->SetSelection( 1 );
|
||||||
bSizer3->Add( m_radioBoxGridNumberingScheme, 0, wxALL|wxEXPAND, 5 );
|
bSizer3->Add( m_radioBoxGridNumberingScheme, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
@ -147,7 +149,7 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
||||||
wxBoxSizer* bSizer5;
|
wxBoxSizer* bSizer5;
|
||||||
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
|
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Numbering start:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_labelGridNumberingOffset = new wxStaticText( m_gridPanel, wxID_ANY, _("Pad numbering start:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_labelGridNumberingOffset->Wrap( -1 );
|
m_labelGridNumberingOffset->Wrap( -1 );
|
||||||
bSizer5->Add( m_labelGridNumberingOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
bSizer5->Add( m_labelGridNumberingOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
|
@ -242,37 +244,30 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
||||||
|
|
||||||
bSizer4->Add( gbSizer2, 0, wxALL|wxEXPAND, 5 );
|
bSizer4->Add( gbSizer2, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
wxBoxSizer* bSizer6;
|
wxStaticBoxSizer* sbcircPadNumberingSizer;
|
||||||
bSizer6 = new wxBoxSizer( wxVERTICAL );
|
sbcircPadNumberingSizer = new wxStaticBoxSizer( new wxStaticBox( m_circularPanel, wxID_ANY, _("Pad Numbering Options") ), wxVERTICAL );
|
||||||
|
|
||||||
m_checkBoxCircRestartNumbering = new wxCheckBox( m_circularPanel, wxID_ANY, _("Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 );
|
wxString m_rbCircStartNumberingOptChoices[] = { _("Use first free number"), _("From start value") };
|
||||||
m_checkBoxCircRestartNumbering->SetValue(true);
|
int m_rbCircStartNumberingOptNChoices = sizeof( m_rbCircStartNumberingOptChoices ) / sizeof( wxString );
|
||||||
bSizer6->Add( m_checkBoxCircRestartNumbering, 0, wxALL, 5 );
|
m_rbCircStartNumberingOpt = new wxRadioBox( sbcircPadNumberingSizer->GetStaticBox(), wxID_ANY, _("Initial pad number"), wxDefaultPosition, wxDefaultSize, m_rbCircStartNumberingOptNChoices, m_rbCircStartNumberingOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||||
|
m_rbCircStartNumberingOpt->SetSelection( 0 );
|
||||||
m_labelCircNumbering = new wxStaticText( m_circularPanel, wxID_ANY, _("Numbering type:"), wxDefaultPosition, wxDefaultSize, 0 );
|
sbcircPadNumberingSizer->Add( m_rbCircStartNumberingOpt, 0, wxALL|wxEXPAND, 5 );
|
||||||
m_labelCircNumbering->Wrap( -1 );
|
|
||||||
bSizer6->Add( m_labelCircNumbering, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
|
||||||
|
|
||||||
wxArrayString m_choiceCircNumberingTypeChoices;
|
|
||||||
m_choiceCircNumberingType = new wxChoice( m_circularPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceCircNumberingTypeChoices, 0 );
|
|
||||||
m_choiceCircNumberingType->SetSelection( 0 );
|
|
||||||
bSizer6->Add( m_choiceCircNumberingType, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bSizer7;
|
wxBoxSizer* bSizer7;
|
||||||
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
|
bSizer7 = new wxBoxSizer( wxHORIZONTAL );
|
||||||
|
|
||||||
m_labelCircNumStart = new wxStaticText( m_circularPanel, wxID_ANY, _("Numbering start:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_labelCircNumStart = new wxStaticText( sbcircPadNumberingSizer->GetStaticBox(), wxID_ANY, _("Pad numbering start value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_labelCircNumStart->Wrap( -1 );
|
m_labelCircNumStart->Wrap( -1 );
|
||||||
bSizer7->Add( m_labelCircNumStart, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
bSizer7->Add( m_labelCircNumStart, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
m_entryCircNumberingStart = new wxTextCtrl( m_circularPanel, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_entryCircNumberingStart = new wxTextCtrl( sbcircPadNumberingSizer->GetStaticBox(), wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bSizer7->Add( m_entryCircNumberingStart, 0, wxALL, 5 );
|
bSizer7->Add( m_entryCircNumberingStart, 1, wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizer6->Add( bSizer7, 0, wxEXPAND, 5 );
|
sbcircPadNumberingSizer->Add( bSizer7, 0, wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bSizer4->Add( bSizer6, 1, wxALL|wxEXPAND, 5 );
|
bSizer4->Add( sbcircPadNumberingSizer, 1, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
m_circularPanel->SetSizer( bSizer4 );
|
m_circularPanel->SetSizer( bSizer4 );
|
||||||
|
@ -294,7 +289,6 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
||||||
|
|
||||||
this->SetSizer( bMainSizer );
|
this->SetSizer( bMainSizer );
|
||||||
this->Layout();
|
this->Layout();
|
||||||
bMainSizer->Fit( this );
|
|
||||||
|
|
||||||
// Connect Events
|
// Connect Events
|
||||||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) );
|
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CREATE_ARRAY_BASE::OnClose ) );
|
||||||
|
@ -305,12 +299,13 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
|
||||||
m_entryOffsetX->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryOffsetX->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryOffsetY->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryOffsetY->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryStagger->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryStagger->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_checkBoxGridRestartNumbering->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_rbGridStartNumberingOpt->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_radioBoxGridNumberingScheme->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_radioBoxGridNumberingScheme->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCentreX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCentreX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
|
m_rbCircStartNumberingOpt->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
|
m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,12 +320,13 @@ DIALOG_CREATE_ARRAY_BASE::~DIALOG_CREATE_ARRAY_BASE()
|
||||||
m_entryOffsetX->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryOffsetX->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryOffsetY->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryOffsetY->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryStagger->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryStagger->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_checkBoxGridRestartNumbering->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_rbGridStartNumberingOpt->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_radioBoxGridNumberingScheme->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_radioBoxGridNumberingScheme->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCentreX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCentreX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
|
m_rbCircStartNumberingOpt->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
|
||||||
m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
|
m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<property name="minimum_size">-1,-1</property>
|
<property name="minimum_size">-1,-1</property>
|
||||||
<property name="name">DIALOG_CREATE_ARRAY_BASE</property>
|
<property name="name">DIALOG_CREATE_ARRAY_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">652,473</property>
|
||||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||||
<property name="title">Create Array</property>
|
<property name="title">Create Array</property>
|
||||||
|
@ -258,11 +258,11 @@
|
||||||
<property name="name">bSizer2</property>
|
<property name="name">bSizer2</property>
|
||||||
<property name="orient">wxHORIZONTAL</property>
|
<property name="orient">wxHORIZONTAL</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxEXPAND</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxGridBagSizer" expanded="0">
|
<object class="wxGridBagSizer" expanded="1">
|
||||||
<property name="empty_cell_size"></property>
|
<property name="empty_cell_size"></property>
|
||||||
<property name="flexible_direction">wxBOTH</property>
|
<property name="flexible_direction">wxBOTH</property>
|
||||||
<property name="growablecols"></property>
|
<property name="growablecols"></property>
|
||||||
|
@ -397,7 +397,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -577,7 +577,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -757,7 +757,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -1023,7 +1023,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -1289,7 +1289,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -1555,7 +1555,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -1821,7 +1821,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -2014,7 +2014,7 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Numbering Direction</property>
|
<property name="label">Pad Numbering Direction</property>
|
||||||
<property name="majorDimension">1</property>
|
<property name="majorDimension">1</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
|
@ -2104,7 +2104,7 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Reverse numbering on alternate rows or columns</property>
|
<property name="label">Reverse pad numbering on alternate rows or columns</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -2159,11 +2159,11 @@
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxCheckBox" expanded="0">
|
<object class="wxRadioBox" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
<property name="RightDockable">1</property>
|
<property name="RightDockable">1</property>
|
||||||
|
@ -2177,7 +2177,7 @@
|
||||||
<property name="caption"></property>
|
<property name="caption"></property>
|
||||||
<property name="caption_visible">1</property>
|
<property name="caption_visible">1</property>
|
||||||
<property name="center_pane">0</property>
|
<property name="center_pane">0</property>
|
||||||
<property name="checked">1</property>
|
<property name="choices">"Use first free number" "From start value"</property>
|
||||||
<property name="close_button">1</property>
|
<property name="close_button">1</property>
|
||||||
<property name="context_help"></property>
|
<property name="context_help"></property>
|
||||||
<property name="context_menu">1</property>
|
<property name="context_menu">1</property>
|
||||||
|
@ -2192,7 +2192,8 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Restart numbering</property>
|
<property name="label">Initial pad number</property>
|
||||||
|
<property name="majorDimension">1</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -2200,7 +2201,7 @@
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="moveable">1</property>
|
<property name="moveable">1</property>
|
||||||
<property name="name">m_checkBoxGridRestartNumbering</property>
|
<property name="name">m_rbGridStartNumberingOpt</property>
|
||||||
<property name="pane_border">1</property>
|
<property name="pane_border">1</property>
|
||||||
<property name="pane_position"></property>
|
<property name="pane_position"></property>
|
||||||
<property name="pane_size"></property>
|
<property name="pane_size"></property>
|
||||||
|
@ -2208,9 +2209,10 @@
|
||||||
<property name="pin_button">1</property>
|
<property name="pin_button">1</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="resize">Resizable</property>
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="selection">1</property>
|
||||||
<property name="show">1</property>
|
<property name="show">1</property>
|
||||||
<property name="size"></property>
|
<property name="size"></property>
|
||||||
<property name="style"></property>
|
<property name="style">wxRA_SPECIFY_COLS</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
|
@ -2222,7 +2224,6 @@
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
<event name="OnChar"></event>
|
<event name="OnChar"></event>
|
||||||
<event name="OnCheckBox">OnParameterChanged</event>
|
|
||||||
<event name="OnEnterWindow"></event>
|
<event name="OnEnterWindow"></event>
|
||||||
<event name="OnEraseBackground"></event>
|
<event name="OnEraseBackground"></event>
|
||||||
<event name="OnKeyDown"></event>
|
<event name="OnKeyDown"></event>
|
||||||
|
@ -2239,6 +2240,7 @@
|
||||||
<event name="OnMouseEvents"></event>
|
<event name="OnMouseEvents"></event>
|
||||||
<event name="OnMouseWheel"></event>
|
<event name="OnMouseWheel"></event>
|
||||||
<event name="OnPaint"></event>
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRadioBox">OnParameterChanged</event>
|
||||||
<event name="OnRightDClick"></event>
|
<event name="OnRightDClick"></event>
|
||||||
<event name="OnRightDown"></event>
|
<event name="OnRightDown"></event>
|
||||||
<event name="OnRightUp"></event>
|
<event name="OnRightUp"></event>
|
||||||
|
@ -2280,7 +2282,7 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Numbering Scheme</property>
|
<property name="label">Pad Numbering Scheme</property>
|
||||||
<property name="majorDimension">1</property>
|
<property name="majorDimension">1</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
|
@ -2720,7 +2722,7 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Numbering start:</property>
|
<property name="label">Pad numbering start:</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -2806,7 +2808,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -2897,7 +2899,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -3182,7 +3184,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -3448,7 +3450,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -3886,7 +3888,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -4152,7 +4154,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
@ -4389,106 +4391,22 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL|wxEXPAND</property>
|
<property name="flag">wxEXPAND|wxALL</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxBoxSizer" expanded="1">
|
<object class="wxStaticBoxSizer" expanded="1">
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">Pad Numbering Options</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">bSizer6</property>
|
<property name="name">sbcircPadNumberingSizer</property>
|
||||||
<property name="orient">wxVERTICAL</property>
|
<property name="orient">wxVERTICAL</property>
|
||||||
|
<property name="parent">1</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="0">
|
|
||||||
<property name="border">5</property>
|
|
||||||
<property name="flag">wxALL</property>
|
|
||||||
<property name="proportion">0</property>
|
|
||||||
<object class="wxCheckBox" expanded="0">
|
|
||||||
<property name="BottomDockable">1</property>
|
|
||||||
<property name="LeftDockable">1</property>
|
|
||||||
<property name="RightDockable">1</property>
|
|
||||||
<property name="TopDockable">1</property>
|
|
||||||
<property name="aui_layer"></property>
|
|
||||||
<property name="aui_name"></property>
|
|
||||||
<property name="aui_position"></property>
|
|
||||||
<property name="aui_row"></property>
|
|
||||||
<property name="best_size"></property>
|
|
||||||
<property name="bg"></property>
|
|
||||||
<property name="caption"></property>
|
|
||||||
<property name="caption_visible">1</property>
|
|
||||||
<property name="center_pane">0</property>
|
|
||||||
<property name="checked">1</property>
|
|
||||||
<property name="close_button">1</property>
|
|
||||||
<property name="context_help"></property>
|
|
||||||
<property name="context_menu">1</property>
|
|
||||||
<property name="default_pane">0</property>
|
|
||||||
<property name="dock">Dock</property>
|
|
||||||
<property name="dock_fixed">0</property>
|
|
||||||
<property name="docking">Left</property>
|
|
||||||
<property name="enabled">1</property>
|
|
||||||
<property name="fg"></property>
|
|
||||||
<property name="floatable">1</property>
|
|
||||||
<property name="font"></property>
|
|
||||||
<property name="gripper">0</property>
|
|
||||||
<property name="hidden">0</property>
|
|
||||||
<property name="id">wxID_ANY</property>
|
|
||||||
<property name="label">Restart numbering</property>
|
|
||||||
<property name="max_size"></property>
|
|
||||||
<property name="maximize_button">0</property>
|
|
||||||
<property name="maximum_size"></property>
|
|
||||||
<property name="min_size"></property>
|
|
||||||
<property name="minimize_button">0</property>
|
|
||||||
<property name="minimum_size"></property>
|
|
||||||
<property name="moveable">1</property>
|
|
||||||
<property name="name">m_checkBoxCircRestartNumbering</property>
|
|
||||||
<property name="pane_border">1</property>
|
|
||||||
<property name="pane_position"></property>
|
|
||||||
<property name="pane_size"></property>
|
|
||||||
<property name="permission">protected</property>
|
|
||||||
<property name="pin_button">1</property>
|
|
||||||
<property name="pos"></property>
|
|
||||||
<property name="resize">Resizable</property>
|
|
||||||
<property name="show">1</property>
|
|
||||||
<property name="size"></property>
|
|
||||||
<property name="style"></property>
|
|
||||||
<property name="subclass"></property>
|
|
||||||
<property name="toolbar_pane">0</property>
|
|
||||||
<property name="tooltip"></property>
|
|
||||||
<property name="validator_data_type"></property>
|
|
||||||
<property name="validator_style">wxFILTER_NONE</property>
|
|
||||||
<property name="validator_type">wxDefaultValidator</property>
|
|
||||||
<property name="validator_variable"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
|
||||||
<property name="window_name"></property>
|
|
||||||
<property name="window_style"></property>
|
|
||||||
<event name="OnChar"></event>
|
|
||||||
<event name="OnCheckBox"></event>
|
|
||||||
<event name="OnEnterWindow"></event>
|
|
||||||
<event name="OnEraseBackground"></event>
|
|
||||||
<event name="OnKeyDown"></event>
|
|
||||||
<event name="OnKeyUp"></event>
|
|
||||||
<event name="OnKillFocus"></event>
|
|
||||||
<event name="OnLeaveWindow"></event>
|
|
||||||
<event name="OnLeftDClick"></event>
|
|
||||||
<event name="OnLeftDown"></event>
|
|
||||||
<event name="OnLeftUp"></event>
|
|
||||||
<event name="OnMiddleDClick"></event>
|
|
||||||
<event name="OnMiddleDown"></event>
|
|
||||||
<event name="OnMiddleUp"></event>
|
|
||||||
<event name="OnMotion"></event>
|
|
||||||
<event name="OnMouseEvents"></event>
|
|
||||||
<event name="OnMouseWheel"></event>
|
|
||||||
<event name="OnPaint"></event>
|
|
||||||
<event name="OnRightDClick"></event>
|
|
||||||
<event name="OnRightDown"></event>
|
|
||||||
<event name="OnRightUp"></event>
|
|
||||||
<event name="OnSetFocus"></event>
|
|
||||||
<event name="OnSize"></event>
|
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
</object>
|
<object class="sizeritem" expanded="1">
|
||||||
</object>
|
|
||||||
<object class="sizeritem" expanded="0">
|
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="0">
|
<object class="wxRadioBox" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
<property name="RightDockable">1</property>
|
<property name="RightDockable">1</property>
|
||||||
|
@ -4502,6 +4420,7 @@
|
||||||
<property name="caption"></property>
|
<property name="caption"></property>
|
||||||
<property name="caption_visible">1</property>
|
<property name="caption_visible">1</property>
|
||||||
<property name="center_pane">0</property>
|
<property name="center_pane">0</property>
|
||||||
|
<property name="choices">"Use first free number" "From start value"</property>
|
||||||
<property name="close_button">1</property>
|
<property name="close_button">1</property>
|
||||||
<property name="context_help"></property>
|
<property name="context_help"></property>
|
||||||
<property name="context_menu">1</property>
|
<property name="context_menu">1</property>
|
||||||
|
@ -4516,7 +4435,8 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Numbering type:</property>
|
<property name="label">Initial pad number</property>
|
||||||
|
<property name="majorDimension">1</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -4524,90 +4444,7 @@
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="moveable">1</property>
|
<property name="moveable">1</property>
|
||||||
<property name="name">m_labelCircNumbering</property>
|
<property name="name">m_rbCircStartNumberingOpt</property>
|
||||||
<property name="pane_border">1</property>
|
|
||||||
<property name="pane_position"></property>
|
|
||||||
<property name="pane_size"></property>
|
|
||||||
<property name="permission">protected</property>
|
|
||||||
<property name="pin_button">1</property>
|
|
||||||
<property name="pos"></property>
|
|
||||||
<property name="resize">Resizable</property>
|
|
||||||
<property name="show">1</property>
|
|
||||||
<property name="size"></property>
|
|
||||||
<property name="style"></property>
|
|
||||||
<property name="subclass"></property>
|
|
||||||
<property name="toolbar_pane">0</property>
|
|
||||||
<property name="tooltip"></property>
|
|
||||||
<property name="window_extra_style"></property>
|
|
||||||
<property name="window_name"></property>
|
|
||||||
<property name="window_style"></property>
|
|
||||||
<property name="wrap">-1</property>
|
|
||||||
<event name="OnChar"></event>
|
|
||||||
<event name="OnEnterWindow"></event>
|
|
||||||
<event name="OnEraseBackground"></event>
|
|
||||||
<event name="OnKeyDown"></event>
|
|
||||||
<event name="OnKeyUp"></event>
|
|
||||||
<event name="OnKillFocus"></event>
|
|
||||||
<event name="OnLeaveWindow"></event>
|
|
||||||
<event name="OnLeftDClick"></event>
|
|
||||||
<event name="OnLeftDown"></event>
|
|
||||||
<event name="OnLeftUp"></event>
|
|
||||||
<event name="OnMiddleDClick"></event>
|
|
||||||
<event name="OnMiddleDown"></event>
|
|
||||||
<event name="OnMiddleUp"></event>
|
|
||||||
<event name="OnMotion"></event>
|
|
||||||
<event name="OnMouseEvents"></event>
|
|
||||||
<event name="OnMouseWheel"></event>
|
|
||||||
<event name="OnPaint"></event>
|
|
||||||
<event name="OnRightDClick"></event>
|
|
||||||
<event name="OnRightDown"></event>
|
|
||||||
<event name="OnRightUp"></event>
|
|
||||||
<event name="OnSetFocus"></event>
|
|
||||||
<event name="OnSize"></event>
|
|
||||||
<event name="OnUpdateUI"></event>
|
|
||||||
</object>
|
|
||||||
</object>
|
|
||||||
<object class="sizeritem" expanded="0">
|
|
||||||
<property name="border">5</property>
|
|
||||||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
|
|
||||||
<property name="proportion">0</property>
|
|
||||||
<object class="wxChoice" expanded="0">
|
|
||||||
<property name="BottomDockable">1</property>
|
|
||||||
<property name="LeftDockable">1</property>
|
|
||||||
<property name="RightDockable">1</property>
|
|
||||||
<property name="TopDockable">1</property>
|
|
||||||
<property name="aui_layer"></property>
|
|
||||||
<property name="aui_name"></property>
|
|
||||||
<property name="aui_position"></property>
|
|
||||||
<property name="aui_row"></property>
|
|
||||||
<property name="best_size"></property>
|
|
||||||
<property name="bg"></property>
|
|
||||||
<property name="caption"></property>
|
|
||||||
<property name="caption_visible">1</property>
|
|
||||||
<property name="center_pane">0</property>
|
|
||||||
<property name="choices"></property>
|
|
||||||
<property name="close_button">1</property>
|
|
||||||
<property name="context_help"></property>
|
|
||||||
<property name="context_menu">1</property>
|
|
||||||
<property name="default_pane">0</property>
|
|
||||||
<property name="dock">Dock</property>
|
|
||||||
<property name="dock_fixed">0</property>
|
|
||||||
<property name="docking">Left</property>
|
|
||||||
<property name="enabled">1</property>
|
|
||||||
<property name="fg"></property>
|
|
||||||
<property name="floatable">1</property>
|
|
||||||
<property name="font"></property>
|
|
||||||
<property name="gripper">0</property>
|
|
||||||
<property name="hidden">0</property>
|
|
||||||
<property name="id">wxID_ANY</property>
|
|
||||||
<property name="max_size"></property>
|
|
||||||
<property name="maximize_button">0</property>
|
|
||||||
<property name="maximum_size"></property>
|
|
||||||
<property name="min_size"></property>
|
|
||||||
<property name="minimize_button">0</property>
|
|
||||||
<property name="minimum_size"></property>
|
|
||||||
<property name="moveable">1</property>
|
|
||||||
<property name="name">m_choiceCircNumberingType</property>
|
|
||||||
<property name="pane_border">1</property>
|
<property name="pane_border">1</property>
|
||||||
<property name="pane_position"></property>
|
<property name="pane_position"></property>
|
||||||
<property name="pane_size"></property>
|
<property name="pane_size"></property>
|
||||||
|
@ -4618,7 +4455,7 @@
|
||||||
<property name="selection">0</property>
|
<property name="selection">0</property>
|
||||||
<property name="show">1</property>
|
<property name="show">1</property>
|
||||||
<property name="size"></property>
|
<property name="size"></property>
|
||||||
<property name="style"></property>
|
<property name="style">wxRA_SPECIFY_COLS</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
|
@ -4630,7 +4467,6 @@
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
<event name="OnChar"></event>
|
<event name="OnChar"></event>
|
||||||
<event name="OnChoice"></event>
|
|
||||||
<event name="OnEnterWindow"></event>
|
<event name="OnEnterWindow"></event>
|
||||||
<event name="OnEraseBackground"></event>
|
<event name="OnEraseBackground"></event>
|
||||||
<event name="OnKeyDown"></event>
|
<event name="OnKeyDown"></event>
|
||||||
|
@ -4647,6 +4483,7 @@
|
||||||
<event name="OnMouseEvents"></event>
|
<event name="OnMouseEvents"></event>
|
||||||
<event name="OnMouseWheel"></event>
|
<event name="OnMouseWheel"></event>
|
||||||
<event name="OnPaint"></event>
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRadioBox">OnParameterChanged</event>
|
||||||
<event name="OnRightDClick"></event>
|
<event name="OnRightDClick"></event>
|
||||||
<event name="OnRightDown"></event>
|
<event name="OnRightDown"></event>
|
||||||
<event name="OnRightUp"></event>
|
<event name="OnRightUp"></event>
|
||||||
|
@ -4696,7 +4533,7 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Numbering start:</property>
|
<property name="label">Pad numbering start value:</property>
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -4750,7 +4587,7 @@
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="0">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL</property>
|
<property name="flag">wxALL</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">1</property>
|
||||||
<object class="wxTextCtrl" expanded="0">
|
<object class="wxTextCtrl" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
|
@ -4782,7 +4619,7 @@
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
<property name="maxlength"></property>
|
<property name="maxlength">0</property>
|
||||||
<property name="min_size"></property>
|
<property name="min_size"></property>
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
// C++ code generated with wxFormBuilder (version Jan 1 2016)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -30,6 +30,7 @@ class DIALOG_SHIM;
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
#include <wx/icon.h>
|
#include <wx/icon.h>
|
||||||
|
#include <wx/statbox.h>
|
||||||
#include <wx/notebook.h>
|
#include <wx/notebook.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
@ -69,7 +70,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM
|
||||||
wxRadioBox* m_radioBoxGridStaggerType;
|
wxRadioBox* m_radioBoxGridStaggerType;
|
||||||
wxRadioBox* m_radioBoxGridNumberingAxis;
|
wxRadioBox* m_radioBoxGridNumberingAxis;
|
||||||
wxCheckBox* m_checkBoxGridReverseNumbering;
|
wxCheckBox* m_checkBoxGridReverseNumbering;
|
||||||
wxCheckBox* m_checkBoxGridRestartNumbering;
|
wxRadioBox* m_rbGridStartNumberingOpt;
|
||||||
wxRadioBox* m_radioBoxGridNumberingScheme;
|
wxRadioBox* m_radioBoxGridNumberingScheme;
|
||||||
wxStaticText* m_labelPriAxisNumbering;
|
wxStaticText* m_labelPriAxisNumbering;
|
||||||
wxChoice* m_choicePriAxisNumbering;
|
wxChoice* m_choicePriAxisNumbering;
|
||||||
|
@ -94,9 +95,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM
|
||||||
wxTextCtrl* m_entryCircCount;
|
wxTextCtrl* m_entryCircCount;
|
||||||
wxStaticText* m_labelCircRotate;
|
wxStaticText* m_labelCircRotate;
|
||||||
wxCheckBox* m_entryRotateItemsCb;
|
wxCheckBox* m_entryRotateItemsCb;
|
||||||
wxCheckBox* m_checkBoxCircRestartNumbering;
|
wxRadioBox* m_rbCircStartNumberingOpt;
|
||||||
wxStaticText* m_labelCircNumbering;
|
|
||||||
wxChoice* m_choiceCircNumberingType;
|
|
||||||
wxStaticText* m_labelCircNumStart;
|
wxStaticText* m_labelCircNumStart;
|
||||||
wxTextCtrl* m_entryCircNumberingStart;
|
wxTextCtrl* m_entryCircNumberingStart;
|
||||||
wxStdDialogButtonSizer* m_stdButtons;
|
wxStdDialogButtonSizer* m_stdButtons;
|
||||||
|
@ -111,7 +110,7 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create Array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create Array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 652,473 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||||
~DIALOG_CREATE_ARRAY_BASE();
|
~DIALOG_CREATE_ARRAY_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -1605,10 +1605,14 @@ void PCB_BASE_EDIT_FRAME::createArray()
|
||||||
if( !item )
|
if( !item )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Note: original item is no more modified.
|
||||||
|
|
||||||
bool editingModule = NULL != dynamic_cast<FOOTPRINT_EDIT_FRAME*>( this );
|
bool editingModule = NULL != dynamic_cast<FOOTPRINT_EDIT_FRAME*>( this );
|
||||||
|
|
||||||
BOARD* board = GetBoard();
|
BOARD* board = GetBoard();
|
||||||
// Remember it is valid only in the module editor
|
|
||||||
|
// Remember this is valid and used only in the module editor.
|
||||||
|
// in board editor, the parent of items is usually the board.
|
||||||
MODULE* module = static_cast<MODULE*>( item->GetParent() );
|
MODULE* module = static_cast<MODULE*>( item->GetParent() );
|
||||||
|
|
||||||
DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL;
|
DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL;
|
||||||
|
@ -1633,77 +1637,35 @@ void PCB_BASE_EDIT_FRAME::createArray()
|
||||||
// modedit saves everything upfront
|
// modedit saves everything upfront
|
||||||
SaveCopyInUndoList( board->m_Modules, UR_MODEDIT );
|
SaveCopyInUndoList( board->m_Modules, UR_MODEDIT );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// We may also change the original item
|
|
||||||
SaveCopyInUndoList( item, UR_CHANGED );
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString cachedString;
|
#define INCREMENT_REF false
|
||||||
|
#define INCREMENT_PADNUMBER true
|
||||||
|
|
||||||
if( item->Type() == PCB_MODULE_T )
|
// The first item in list is the original item. We do not modify it
|
||||||
|
for( int ptN = 1; ptN < array_opts->GetArraySize(); ptN++ )
|
||||||
{
|
{
|
||||||
cachedString = static_cast<MODULE*>( item )->GetReferencePrefix();
|
BOARD_ITEM* new_item;
|
||||||
}
|
|
||||||
else if( EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( item ) )
|
|
||||||
{
|
|
||||||
// Copy the text (not just take a reference
|
|
||||||
cachedString = text->GetText();
|
|
||||||
}
|
|
||||||
|
|
||||||
for( int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ )
|
|
||||||
{
|
|
||||||
BOARD_ITEM* new_item = NULL;
|
|
||||||
|
|
||||||
if( ptN == 0 )
|
|
||||||
{
|
|
||||||
new_item = item;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( editingModule )
|
if( editingModule )
|
||||||
new_item = module->DuplicateAndAddItem( item, true );
|
new_item = module->DuplicateAndAddItem( item, INCREMENT_PADNUMBER );
|
||||||
else
|
else
|
||||||
new_item = board->DuplicateAndAddItem( item, true );
|
new_item = board->DuplicateAndAddItem( item, INCREMENT_REF );
|
||||||
|
|
||||||
if( new_item )
|
if( new_item )
|
||||||
{
|
{
|
||||||
array_opts->TransformItem( ptN, new_item, rotPoint );
|
array_opts->TransformItem( ptN, new_item, rotPoint );
|
||||||
newItemsList.PushItem( new_item );
|
newItemsList.PushItem( new_item ); // For undo list
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !new_item || !array_opts->ShouldRenumberItems() )
|
if( !new_item || !array_opts->ShouldRenumberItems() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Renumber items
|
// Renumber pads. Only new pad number renumbering has meaning,
|
||||||
switch( new_item->Type() )
|
// in the footprint editor.
|
||||||
{
|
if( new_item->Type() == PCB_PAD_T )
|
||||||
case PCB_MODULE_TEXT_T:
|
|
||||||
case PCB_TEXT_T:
|
|
||||||
{
|
|
||||||
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( new_item );
|
|
||||||
if( text )
|
|
||||||
text->SetText( array_opts->InterpolateNumberIntoString( ptN, cachedString ) );
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PCB_MODULE_T:
|
|
||||||
{
|
|
||||||
const wxString padName = array_opts->GetItemNumber( ptN );
|
|
||||||
static_cast<MODULE*>( new_item )->SetReference( cachedString + padName );
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PCB_PAD_T:
|
|
||||||
{
|
{
|
||||||
const wxString padName = array_opts->GetItemNumber( ptN );
|
const wxString padName = array_opts->GetItemNumber( ptN );
|
||||||
static_cast<D_PAD*>( new_item )->SetPadName( padName );
|
static_cast<D_PAD*>( new_item )->SetPadName( padName );
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -79,16 +79,6 @@ public:
|
||||||
|
|
||||||
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties = NULL );
|
BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties = NULL );
|
||||||
|
|
||||||
/* we let go of "save" support when the number of CU layers were expanded from 16 to 32.
|
|
||||||
void Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties = NULL );
|
|
||||||
|
|
||||||
void FootprintSave( const wxString& aLibraryPath, const MODULE* aFootprint,
|
|
||||||
const PROPERTIES* aProperties = NULL );
|
|
||||||
void FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, const PROPERTIES* aProperties = NULL );
|
|
||||||
|
|
||||||
void FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* aProperties = NULL );
|
|
||||||
*/
|
|
||||||
|
|
||||||
wxArrayString FootprintEnumerate( const wxString& aLibraryPath, const PROPERTIES* aProperties = NULL);
|
wxArrayString FootprintEnumerate( const wxString& aLibraryPath, const PROPERTIES* aProperties = NULL);
|
||||||
|
|
||||||
MODULE* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
|
MODULE* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
|
||||||
|
@ -125,7 +115,6 @@ protected:
|
||||||
|
|
||||||
LINE_READER* m_reader; ///< no ownership here.
|
LINE_READER* m_reader; ///< no ownership here.
|
||||||
FILE* m_fp; ///< no ownership here.
|
FILE* m_fp; ///< no ownership here.
|
||||||
wxString m_filename; ///< for saves only, name is in m_reader for loads
|
|
||||||
|
|
||||||
wxString m_field; ///< reused to stuff MODULE fields.
|
wxString m_field; ///< reused to stuff MODULE fields.
|
||||||
int m_loading_format_version; ///< which BOARD_FORMAT_VERSION am I Load()ing?
|
int m_loading_format_version; ///< which BOARD_FORMAT_VERSION am I Load()ing?
|
||||||
|
@ -222,76 +211,6 @@ protected:
|
||||||
|
|
||||||
//-----</ load/parse functions>---------------------------------------------
|
//-----</ load/parse functions>---------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
//-----<save functions>-----------------------------------------------------
|
|
||||||
#if 0
|
|
||||||
/**
|
|
||||||
* Function writeError
|
|
||||||
* returns an error message wxString containing the filename being
|
|
||||||
* currently written.
|
|
||||||
*/
|
|
||||||
wxString writeError() const;
|
|
||||||
|
|
||||||
/// encapsulate the BIU formatting tricks in one place.
|
|
||||||
int biuSprintf( char* buf, BIU aValue ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function fmtBIU
|
|
||||||
* converts a BIU to engineering units by scaling and formatting to ASCII.
|
|
||||||
* This function is the complement of biuParse(). One has to know what the
|
|
||||||
* other is doing.
|
|
||||||
*/
|
|
||||||
std::string fmtBIU( BIU aValue ) const;
|
|
||||||
|
|
||||||
std::string fmtBIUPair( BIU first, BIU second ) const;
|
|
||||||
|
|
||||||
std::string fmtBIUPoint( const wxPoint& aPoint ) const
|
|
||||||
{
|
|
||||||
return fmtBIUPair( aPoint.x, aPoint.y );
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string fmtBIUSize( const wxSize& aSize ) const
|
|
||||||
{
|
|
||||||
return fmtBIUPair( aSize.x, aSize.y );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function fmtDEG
|
|
||||||
* formats an angle in a way particular to a board file format. This function
|
|
||||||
* is the opposite or complement of degParse(). One has to know what the
|
|
||||||
* other is doing.
|
|
||||||
*/
|
|
||||||
std::string fmtDEG( double aAngle ) const;
|
|
||||||
|
|
||||||
void saveGENERAL( const BOARD* aBoard ) const;
|
|
||||||
void saveSHEET( const BOARD* aBoard ) const;
|
|
||||||
void saveSETUP( const BOARD* aBoard ) const;
|
|
||||||
void saveBOARD_ITEMS( const BOARD* aBoard ) const;
|
|
||||||
|
|
||||||
void saveMODULE_TEXT( const TEXTE_MODULE* aText ) const;
|
|
||||||
void saveMODULE_EDGE( const EDGE_MODULE* aGraphic ) const;
|
|
||||||
void savePAD( const D_PAD* aPad ) const;
|
|
||||||
|
|
||||||
void saveNETINFO_ITEM( const NETINFO_ITEM* aNet ) const;
|
|
||||||
void saveNETCLASSES( const NETCLASSES* aNetClasses ) const;
|
|
||||||
void saveNETCLASS( const boost::shared_ptr<NETCLASS> aNetclass ) const;
|
|
||||||
|
|
||||||
void savePCB_TEXT( const TEXTE_PCB* aText ) const;
|
|
||||||
void savePCB_TARGET( const PCB_TARGET* aTarget ) const;
|
|
||||||
void savePCB_LINE( const DRAWSEGMENT* aStroke ) const;
|
|
||||||
void saveDIMENSION( const DIMENSION* aDimension ) const;
|
|
||||||
void saveTRACK( const TRACK* aTrack ) const;
|
|
||||||
void saveBOARD( const BOARD* aBoard ) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function saveZONE_CONTAINER
|
|
||||||
* saves the new polygon zones.
|
|
||||||
*/
|
|
||||||
void saveZONE_CONTAINER( const ZONE_CONTAINER* aZone ) const;
|
|
||||||
|
|
||||||
//-----</save functions>----------------------------------------------------
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// we only cache one footprint library for now, this determines which one.
|
/// we only cache one footprint library for now, this determines which one.
|
||||||
void cacheLib( const wxString& aLibraryPath );
|
void cacheLib( const wxString& aLibraryPath );
|
||||||
};
|
};
|
||||||
|
|
|
@ -308,11 +308,6 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
|
||||||
AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_DUPLICATE_ITEM,
|
||||||
msg, KiBitmap( duplicate_target_xpm ) );
|
msg, KiBitmap( duplicate_target_xpm ) );
|
||||||
|
|
||||||
msg = AddHotkeyName( _("Create Target Array" ), g_Board_Editor_Hokeys_Descr,
|
|
||||||
HK_CREATE_ARRAY );
|
|
||||||
AddMenuItem( aPopMenu, ID_POPUP_PCB_CREATE_ARRAY,
|
|
||||||
msg, KiBitmap( array_target_xpm ) );
|
|
||||||
|
|
||||||
msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr,
|
msg = AddHotkeyName( _( "Edit Target" ), g_Board_Editor_Hokeys_Descr,
|
||||||
HK_EDIT_ITEM );
|
HK_EDIT_ITEM );
|
||||||
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) );
|
AddMenuItem( aPopMenu, ID_POPUP_PCB_EDIT_MIRE, msg, KiBitmap( edit_xpm ) );
|
||||||
|
|
|
@ -702,6 +702,8 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
|
int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
|
// Note: original items are no more modified.
|
||||||
|
|
||||||
bool increment = aEvent.IsAction( &COMMON_ACTIONS::duplicateIncrement );
|
bool increment = aEvent.IsAction( &COMMON_ACTIONS::duplicateIncrement );
|
||||||
|
|
||||||
// first, check if we have a selection, or try to get one
|
// first, check if we have a selection, or try to get one
|
||||||
|
@ -803,8 +805,6 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
|
||||||
if( !hoverSelection( selection ) )
|
if( !hoverSelection( selection ) )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bool originalItemsModified = false;
|
|
||||||
|
|
||||||
// we have a selection to work on now, so start the tool process
|
// we have a selection to work on now, so start the tool process
|
||||||
|
|
||||||
PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
|
PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
|
||||||
|
@ -815,11 +815,6 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
|
||||||
// Module editors do their undo point upfront for the whole module
|
// Module editors do their undo point upfront for the whole module
|
||||||
editFrame->SaveCopyInUndoList( editFrame->GetBoard()->m_Modules, UR_MODEDIT );
|
editFrame->SaveCopyInUndoList( editFrame->GetBoard()->m_Modules, UR_MODEDIT );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// We may also change the original item
|
|
||||||
editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED );
|
|
||||||
}
|
|
||||||
|
|
||||||
DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL;
|
DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL;
|
||||||
|
|
||||||
|
@ -840,39 +835,25 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
|
||||||
if( !item )
|
if( !item )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wxString cachedString;
|
|
||||||
|
|
||||||
if( item->Type() == PCB_MODULE_T )
|
|
||||||
{
|
|
||||||
cachedString = static_cast<MODULE*>( item )->GetReferencePrefix();
|
|
||||||
}
|
|
||||||
else if( EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( item ) )
|
|
||||||
{
|
|
||||||
// Copy the text (not just take a reference
|
|
||||||
cachedString = text->GetText();
|
|
||||||
}
|
|
||||||
|
|
||||||
// iterate across the array, laying out the item at the
|
// iterate across the array, laying out the item at the
|
||||||
// correct position
|
// correct position
|
||||||
const unsigned nPoints = array_opts->GetArraySize();
|
const unsigned nPoints = array_opts->GetArraySize();
|
||||||
|
|
||||||
for( unsigned ptN = 0; ptN < nPoints; ++ptN )
|
// The first item in list is the original item. We do not modify it
|
||||||
|
for( unsigned ptN = 1; ptN < nPoints; ++ptN )
|
||||||
{
|
{
|
||||||
BOARD_ITEM* newItem = NULL;
|
BOARD_ITEM* newItem = NULL;
|
||||||
|
|
||||||
if( ptN == 0 )
|
|
||||||
newItem = item;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// if renumbering, no need to increment
|
|
||||||
const bool increment = !array_opts->ShouldRenumberItems();
|
|
||||||
|
|
||||||
// Some items cannot be duplicated
|
// Some items cannot be duplicated
|
||||||
// i.e. the ref and value fields of a footprint or zones
|
// i.e. the ref and value fields of a footprint or zones
|
||||||
// therefore newItem can be null
|
// therefore newItem can be null
|
||||||
|
|
||||||
|
#define INCREMENT_REF false
|
||||||
|
#define INCREMENT_PADNUMBER true
|
||||||
|
|
||||||
if( m_editModules )
|
if( m_editModules )
|
||||||
newItem = editFrame->GetBoard()->m_Modules->DuplicateAndAddItem( item, increment );
|
newItem = editFrame->GetBoard()->m_Modules->DuplicateAndAddItem(
|
||||||
|
item, INCREMENT_PADNUMBER );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -883,7 +864,10 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
|
||||||
newItem = NULL;
|
newItem = NULL;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
newItem = editFrame->GetBoard()->DuplicateAndAddItem( item, increment );
|
newItem = editFrame->GetBoard()->DuplicateAndAddItem(
|
||||||
|
item, INCREMENT_REF );
|
||||||
|
// @TODO: we should merge zones. This is a bit tricky, because
|
||||||
|
// the undo command needs saving old area, if it is merged.
|
||||||
}
|
}
|
||||||
|
|
||||||
if( newItem )
|
if( newItem )
|
||||||
|
@ -903,43 +887,14 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
|
||||||
editFrame->GetGalCanvas()->GetView()->Add( newItem );
|
editFrame->GetGalCanvas()->GetView()->Add( newItem );
|
||||||
getModel<BOARD>()->GetRatsnest()->Update( newItem );
|
getModel<BOARD>()->GetRatsnest()->Update( newItem );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// set the number if needed:
|
// Only renumbering pads has meaning:
|
||||||
if( newItem && array_opts->ShouldRenumberItems() )
|
if( newItem && array_opts->ShouldRenumberItems() )
|
||||||
{
|
{
|
||||||
switch( newItem->Type() )
|
if( newItem->Type() == PCB_PAD_T )
|
||||||
{
|
|
||||||
case PCB_PAD_T:
|
|
||||||
{
|
{
|
||||||
const wxString padName = array_opts->GetItemNumber( ptN );
|
const wxString padName = array_opts->GetItemNumber( ptN );
|
||||||
static_cast<D_PAD*>( newItem )->SetPadName( padName );
|
static_cast<D_PAD*>( newItem )->SetPadName( padName );
|
||||||
|
|
||||||
originalItemsModified = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PCB_MODULE_T:
|
|
||||||
{
|
|
||||||
const wxString moduleName = array_opts->GetItemNumber( ptN );
|
|
||||||
MODULE* module = static_cast<MODULE*>( newItem );
|
|
||||||
module->SetReference( cachedString + moduleName );
|
|
||||||
|
|
||||||
originalItemsModified = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PCB_MODULE_TEXT_T:
|
|
||||||
case PCB_TEXT_T:
|
|
||||||
{
|
|
||||||
EDA_TEXT* text = dynamic_cast<EDA_TEXT*>( newItem );
|
|
||||||
if( text )
|
|
||||||
text->SetText( array_opts->InterpolateNumberIntoString( ptN, cachedString ) );
|
|
||||||
|
|
||||||
originalItemsModified = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
// no renumbering of other items
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -947,15 +902,7 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
if( !m_editModules )
|
if( !m_editModules )
|
||||||
{
|
{
|
||||||
if( originalItemsModified )
|
|
||||||
{
|
|
||||||
// Update the appearance of the original items
|
|
||||||
selection.group->ItemsViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add all items as a single undo point for PCB editors
|
// Add all items as a single undo point for PCB editors
|
||||||
// TODO: Can this be merged into the previous undo point (where
|
|
||||||
// we saved the original items)
|
|
||||||
editFrame->SaveCopyInUndoList( newItemList, UR_NEW );
|
editFrame->SaveCopyInUndoList( newItemList, UR_NEW );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue