From 1f37ca437befea19e34b98abc6cef259e7bfd669 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 22 Nov 2012 21:33:52 +0100 Subject: [PATCH] BOM list code cleanup. --- eeschema/BOM_lister.h | 78 + eeschema/build_BOM.cpp | 203 +- eeschema/dialogs/dialog_build_BOM.cpp | 193 +- eeschema/dialogs/dialog_build_BOM.h | 41 +- eeschema/dialogs/dialog_build_BOM_base.cpp | 303 +- eeschema/dialogs/dialog_build_BOM_base.fbp | 3196 ++++++++++++-------- eeschema/dialogs/dialog_build_BOM_base.h | 150 +- 7 files changed, 2499 insertions(+), 1665 deletions(-) create mode 100644 eeschema/BOM_lister.h diff --git a/eeschema/BOM_lister.h b/eeschema/BOM_lister.h new file mode 100644 index 0000000000..72c516d362 --- /dev/null +++ b/eeschema/BOM_lister.h @@ -0,0 +1,78 @@ +/** + * @file BOM_lister.h + */ + +/* This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2012 Jean-Pierre Charras jp.charras at wanadoo.fr + * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _BOM_LISTER_H_ +#define _BOM_LISTER_H_ + +#include + + +// A helper class to build item lists for BOM, +// and write lists on files +class BOM_LISTER +{ + BOM_LABEL_LIST m_labelList; // a list of global and hierarchical labels + FILE * m_outFile; // the output file for BOM generation + char m_separatorSymbol; // the separator used for csv files ( usually \t ; or , ) + bool m_outputFmtCsv; // true to create Csv files, false to create text lists + bool m_includeSubComponents; // true to list each part + // of a multiple part per package component + // false to list only once this kind of component + std::vector m_fieldIDactive; // list of field IDs to print + +public: + BOM_LISTER() + { + m_outFile = NULL; + m_separatorSymbol = '\t'; + m_outputFmtCsv = false; + m_includeSubComponents = false; + } + + void SetIncludeSubCmp( bool aIncludeSubCmp ) + { m_includeSubComponents = aIncludeSubCmp; } + + void CreateCsvBOMList( char aSeparator, FILE * aFile ); + void PrintComponentsListByPart( SCH_REFERENCE_LIST& aList ); + void AddFieldIdToPrintList( int aFieldId ); + void ClearFieldIdPrintList() { m_fieldIDactive.clear(); } + + /** + * Function PrintGlobalAndHierarchicalLabelsList + * print the list of global and hierarchical labels bu sheet or by name + * @param aSortBySheet = true to print by sheet name order + * false to print by label name order + * @param aFile = the file to write to (will be NOT clesed) + */ + void PrintGlobalAndHierarchicalLabelsList( FILE * aFile, bool aSortBySheet ); + +private: + bool isFieldPrintable( int aFieldId ); + void buildGlobalAndHierarchicalLabelsList(); +}; + +#endif // _BOM_LISTER_H_ diff --git a/eeschema/build_BOM.cpp b/eeschema/build_BOM.cpp index e78fe8ae06..57bb5eef17 100644 --- a/eeschema/build_BOM.cpp +++ b/eeschema/build_BOM.cpp @@ -1,9 +1,9 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 2011 Wayne Stambaugh - * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2012 Wayne Stambaugh + * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,63 +33,97 @@ #include #include -#include - -#include #include #include #include -#include + +#include -/* Fill aList with labels - */ -void GenListeGLabels( BOM_LABEL_LIST& aList ) +void BOM_LISTER::CreateCsvBOMList( char aSeparator, FILE * aFile ) { - // Build the sheet list + m_outFile = aFile; + m_separatorSymbol = aSeparator; + + SCH_REFERENCE_LIST cmplist; SCH_SHEET_LIST sheetList; - BOM_LABEL label; - for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() ) + sheetList.GetComponents( cmplist, false ); + + // sort component list by ref and remove sub components + cmplist.RemoveSubComponentsFromList(); + + // sort component list by value + cmplist.SortByValueOnly( ); + PrintComponentsListByPart( cmplist ); + + fclose( m_outFile ); + m_outFile = NULL; +} + + +void BOM_LISTER::PrintComponentsListByPart( SCH_REFERENCE_LIST& aList ) +{ + unsigned int index = 0; + while( index < aList.GetCount() ) { - SCH_ITEM* schItem = (SCH_ITEM*) path->LastDrawList(); - - while( schItem ) + SCH_COMPONENT *component = aList[index].GetComponent(); + wxString referenceListStr; + int qty = 1; + referenceListStr.append( aList[index].GetRef() ); + for( unsigned int i = index+1; i < aList.GetCount(); ) { - switch( schItem->Type() ) + if( *(aList[i].GetComponent()) == *component ) { - case SCH_HIERARCHICAL_LABEL_T: - case SCH_GLOBAL_LABEL_T: - aList.push_back( BOM_LABEL( schItem->Type(), schItem, *path ) ); - break; - - case SCH_SHEET_T: - { - SCH_SHEET* sheet = (SCH_SHEET*) schItem; - - BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, sheet->GetPins() ) - { - aList.push_back( BOM_LABEL( SCH_SHEET_PIN_T, &sheetPin, *path ) ); - } + referenceListStr.append( wxT( " " ) + aList[i].GetRef() ); + aList.RemoveItem( i ); + qty++; } - break; - - default: - break; - } - - schItem = schItem->Next(); + else + i++; // Increment index only when current item is not removed from the list } + + // Write value, quantity and list of references + fprintf( m_outFile, "%s%c%d%c\"%s\"", TO_UTF8( component->GetField( VALUE )->GetText() ), + m_separatorSymbol, qty, + m_separatorSymbol, TO_UTF8( referenceListStr ) ); + + for( int i = FOOTPRINT; i < component->GetFieldCount(); i++ ) + { + if( isFieldPrintable( i ) ) + fprintf( m_outFile, "%c%s", m_separatorSymbol, + TO_UTF8( component->GetField( i )->GetText() ) ); + } + fprintf( m_outFile, "\n" ); + index++; } } +bool BOM_LISTER::isFieldPrintable( int aFieldId ) +{ + for( unsigned ii = 0; ii < m_fieldIDactive.size(); ii ++ ) + if( m_fieldIDactive[ii] == aFieldId ) + return true; + + return false; +} + +void BOM_LISTER::AddFieldIdToPrintList( int aFieldId ) +{ + for( unsigned ii = 0; ii < m_fieldIDactive.size(); ii ++ ) + if( m_fieldIDactive[ii] == aFieldId ) + return; + + m_fieldIDactive.push_back( aFieldId ); +} + /* compare function for sorting labels * sort by * value * if same value: by sheet */ -bool SortLabelsByValue( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ) +static bool SortLabelsByValue( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ) { int ii; @@ -108,7 +142,7 @@ bool SortLabelsByValue( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ) * by sheet * in a sheet, by alphabetic order */ -bool SortLabelsBySheet( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ) +static bool SortLabelsBySheet( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ) { int ii; @@ -122,41 +156,101 @@ bool SortLabelsBySheet( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ) return ii < 0; } - -int PrintListeGLabel( FILE* f, BOM_LABEL_LIST& aList ) +void BOM_LISTER::buildGlobalAndHierarchicalLabelsList() { + m_labelList.clear(); + + // Explore the flat sheet list + SCH_SHEET_LIST sheetList; + for( SCH_SHEET_PATH* path = sheetList.GetFirst(); path; path = sheetList.GetNext() ) + { + SCH_ITEM* schItem = (SCH_ITEM*) path->LastDrawList(); + for( ; schItem; schItem = schItem->Next() ) + { + switch( schItem->Type() ) + { + case SCH_HIERARCHICAL_LABEL_T: + case SCH_GLOBAL_LABEL_T: + m_labelList.push_back( BOM_LABEL( schItem->Type(), schItem, *path ) ); + break; + + case SCH_SHEET_T: + { + SCH_SHEET* sheet = (SCH_SHEET*) schItem; + + BOOST_FOREACH( SCH_SHEET_PIN& sheetPin, sheet->GetPins() ) + { + m_labelList.push_back( BOM_LABEL( SCH_SHEET_PIN_T, + &sheetPin, *path ) ); + } + } + break; + + default: + break; + } + } + } +} + +void BOM_LISTER::PrintGlobalAndHierarchicalLabelsList( FILE * aFile, bool aSortBySheet ) +{ + m_outFile = aFile; + + buildGlobalAndHierarchicalLabelsList(); + + wxString msg; + + if( aSortBySheet ) + { + sort( m_labelList.begin(), m_labelList.end(), SortLabelsBySheet ); + msg.Printf( _( "\n#Global, Hierarchical Labels and PinSheets \ +( order = Sheet Number ) count = %d\n" ), + m_labelList.size() ); + } + + else + { + sort( m_labelList.begin(), m_labelList.end(), SortLabelsByValue ); + msg.Printf( _( "\n#Global, Hierarchical Labels and PinSheets ( \ +order = Alphab. ) count = %d\n\n" ), + m_labelList.size() ); + + } + + fprintf( m_outFile, "%s", TO_UTF8( msg ) ); + SCH_LABEL* label; SCH_SHEET_PIN* pinsheet; - wxString msg, sheetpath; + wxString sheetpath; wxString labeltype; - for( unsigned ii = 0; ii < aList.size(); ii++ ) + for( unsigned ii = 0; ii < m_labelList.size(); ii++ ) { - switch( aList[ii].GetType() ) + switch( m_labelList[ii].GetType() ) { case SCH_HIERARCHICAL_LABEL_T: case SCH_GLOBAL_LABEL_T: - label = (SCH_LABEL*)(aList[ii].GetLabel()); + label = (SCH_LABEL*)(m_labelList[ii].GetLabel()); - if( aList[ii].GetType() == SCH_HIERARCHICAL_LABEL_T ) + if( m_labelList[ii].GetType() == SCH_HIERARCHICAL_LABEL_T ) labeltype = wxT( "Hierarchical" ); else labeltype = wxT( "Global " ); - sheetpath = aList[ii].GetSheetPath().PathHumanReadable(); + sheetpath = m_labelList[ii].GetSheetPath().PathHumanReadable(); msg.Printf( _( "> %-28.28s %s (Sheet %s) pos: %3.3f, %3.3f\n" ), GetChars( label->GetText() ), - GetChars( labeltype ), - GetChars( sheetpath ), + GetChars( labeltype ), GetChars( sheetpath ), (float) label->m_Pos.x / 1000, (float) label->m_Pos.y / 1000 ); - fputs( TO_UTF8( msg ), f ); + fputs( TO_UTF8( msg ), m_outFile ); break; case SCH_SHEET_PIN_T: { - pinsheet = (SCH_SHEET_PIN*) aList[ii].GetLabel(); + pinsheet = (SCH_SHEET_PIN*) m_labelList[ii].GetLabel(); int jj = pinsheet->GetShape(); if( jj < 0 ) @@ -170,11 +264,11 @@ int PrintListeGLabel( FILE* f, BOM_LABEL_LIST& aList ) msg.Printf( _( "> %-28.28s PinSheet %-7.7s (Sheet %s) pos: %3.3f, %3.3f\n" ), GetChars( pinsheet->GetText() ), GetChars( labtype ), - GetChars( aList[ii].GetSheetPath().PathHumanReadable() ), + GetChars( m_labelList[ii].GetSheetPath().PathHumanReadable() ), (float) pinsheet->m_Pos.x / 1000, (float) pinsheet->m_Pos.y / 1000 ); - fputs( TO_UTF8( msg ), f ); + fputs( TO_UTF8( msg ), m_outFile ); } break; @@ -185,6 +279,5 @@ int PrintListeGLabel( FILE* f, BOM_LABEL_LIST& aList ) } msg = _( "#End labels\n" ); - fputs( TO_UTF8( msg ), f ); - return 0; + fputs( TO_UTF8( msg ), m_outFile ); } diff --git a/eeschema/dialogs/dialog_build_BOM.cpp b/eeschema/dialogs/dialog_build_BOM.cpp index d67b64da44..c2746e275a 100644 --- a/eeschema/dialogs/dialog_build_BOM.cpp +++ b/eeschema/dialogs/dialog_build_BOM.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2008 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com + * Copyright (C) 2012 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -45,14 +44,7 @@ #include #include - -#include - - -extern void GenListeGLabels( std::vector & aList ); -extern bool SortLabelsByValue( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ); -extern bool SortLabelsBySheet( const BOM_LABEL& obj1, const BOM_LABEL& obj2 ); -extern int PrintListeGLabel( FILE* f, std::vector & aList ); +#include /* Local variables */ @@ -118,10 +110,10 @@ static char s_ExportSeparator[] = ("\t;,."); DIALOG_BUILD_BOM::DIALOG_BUILD_BOM( EDA_DRAW_FRAME* parent ) : DIALOG_BUILD_BOM_BASE( parent ) { - m_Config = wxGetApp().GetSettings(); - wxASSERT( m_Config != NULL ); + m_config = wxGetApp().GetSettings(); + wxASSERT( m_config != NULL ); - m_Parent = parent; + m_parent = parent; Init(); @@ -142,18 +134,18 @@ void DIALOG_BUILD_BOM::Init() SetFocus(); /* Get options */ - m_Config->Read( OPTION_BOM_LIST_REF, &s_ListByRef ); - m_Config->Read( OPTION_BOM_LIST_VALUE , &s_ListByValue ); - m_Config->Read( OPTION_BOM_LIST_HPINS, &s_ListHierarchicalPinByName ); - m_Config->Read( OPTION_BOM_LIST_HPINS_BY_SHEET, &s_ListWithSubCmponents ); - m_Config->Read( OPTION_BOM_LIST_HPINS_BY_NAME_, &s_ListWithSubCmponents ); - m_Config->Read( OPTION_BOM_LIST_SUB_CMP, &s_ListWithSubCmponents ); - m_Config->Read( OPTION_BOM_LIST_HPINS_BY_SHEET, &s_ListHierarchicalPinBySheet ); - m_Config->Read( OPTION_BOM_LIST_HPINS_BY_NAME_, &s_ListHierarchicalPinByName ); - s_OutputFormOpt = m_Config->Read( OPTION_BOM_FORMAT, (long) 0 ); - m_Config->Read( OPTION_BOM_LAUNCH_BROWSER, &s_BrowseCreatedList ); - s_OutputSeparatorOpt = m_Config->Read( OPTION_BOM_SEPARATOR, (long) 0 ); - long addfields = m_Config->Read( OPTION_BOM_ADD_FIELD, (long) 0 ); + m_config->Read( OPTION_BOM_LIST_REF, &s_ListByRef ); + m_config->Read( OPTION_BOM_LIST_VALUE , &s_ListByValue ); + m_config->Read( OPTION_BOM_LIST_HPINS, &s_ListHierarchicalPinByName ); + m_config->Read( OPTION_BOM_LIST_HPINS_BY_SHEET, &s_ListWithSubCmponents ); + m_config->Read( OPTION_BOM_LIST_HPINS_BY_NAME_, &s_ListWithSubCmponents ); + m_config->Read( OPTION_BOM_LIST_SUB_CMP, &s_ListWithSubCmponents ); + m_config->Read( OPTION_BOM_LIST_HPINS_BY_SHEET, &s_ListHierarchicalPinBySheet ); + m_config->Read( OPTION_BOM_LIST_HPINS_BY_NAME_, &s_ListHierarchicalPinByName ); + s_OutputFormOpt = m_config->Read( OPTION_BOM_FORMAT, 0l ); + m_config->Read( OPTION_BOM_LAUNCH_BROWSER, &s_BrowseCreatedList ); + s_OutputSeparatorOpt = m_config->Read( OPTION_BOM_SEPARATOR, 0l ); + long addfields = m_config->Read( OPTION_BOM_ADD_FIELD, 0l ); for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ ) { @@ -264,8 +256,6 @@ void DIALOG_BUILD_BOM::OnCancelClick( wxCommandEvent& event ) void DIALOG_BUILD_BOM::SavePreferences() { - wxASSERT( m_Config != NULL ); - // Determine current settings of "List items" and "Options" checkboxes s_ListByRef = m_ListCmpbyRefItems->GetValue(); s_ListWithSubCmponents = m_ListSubCmpItems->GetValue(); @@ -296,16 +286,16 @@ void DIALOG_BUILD_BOM::SavePreferences() s_Add_Alls_state = m_AddAllFields->GetValue(); // Now save current settings of both radiobutton groups - m_Config->Write( OPTION_BOM_LIST_REF, s_ListByRef ); - m_Config->Write( OPTION_BOM_LIST_VALUE , s_ListByValue ); - m_Config->Write( OPTION_BOM_LIST_HPINS, s_ListHierarchicalPinByName ); - m_Config->Write( OPTION_BOM_LIST_HPINS_BY_SHEET, s_ListHierarchicalPinBySheet ); - m_Config->Write( OPTION_BOM_LIST_HPINS_BY_NAME_, s_ListHierarchicalPinByName ); - m_Config->Write( OPTION_BOM_LIST_SUB_CMP, s_ListWithSubCmponents ); + m_config->Write( OPTION_BOM_LIST_REF, s_ListByRef ); + m_config->Write( OPTION_BOM_LIST_VALUE , s_ListByValue ); + m_config->Write( OPTION_BOM_LIST_HPINS, s_ListHierarchicalPinByName ); + m_config->Write( OPTION_BOM_LIST_HPINS_BY_SHEET, s_ListHierarchicalPinBySheet ); + m_config->Write( OPTION_BOM_LIST_HPINS_BY_NAME_, s_ListHierarchicalPinByName ); + m_config->Write( OPTION_BOM_LIST_SUB_CMP, s_ListWithSubCmponents ); - m_Config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt ); - m_Config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt ); - m_Config->Write( OPTION_BOM_LAUNCH_BROWSER, (long) s_BrowseCreatedList ); + m_config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt ); + m_config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt ); + m_config->Write( OPTION_BOM_LAUNCH_BROWSER, (long) s_BrowseCreatedList ); // Now save current settings of all "Fields to add" checkboxes long addfields = 0; @@ -318,7 +308,7 @@ void DIALOG_BUILD_BOM::SavePreferences() bitmask <<= 1; } - m_Config->Write( OPTION_BOM_ADD_FIELD, addfields ); + m_config->Write( OPTION_BOM_ADD_FIELD, addfields ); } @@ -371,7 +361,7 @@ void DIALOG_BUILD_BOM::Create_BOM_Lists( int aTypeFile, fn = dlg.GetPath(); // remember path+filename+ext for subsequent runs. - m_ListFileName = dlg.GetPath(); + m_listFileName = dlg.GetPath(); // Close dialog, then show the list (if so requested) @@ -395,7 +385,7 @@ void DIALOG_BUILD_BOM::Create_BOM_Lists( int aTypeFile, if( aRunBrowser ) { wxString editorname = wxGetApp().GetEditorName(); - wxString filename = m_ListFileName; + wxString filename = m_listFileName; AddDelimiterString( filename ); ExecuteFile( this, editorname, filename ); } @@ -448,30 +438,23 @@ bool DIALOG_BUILD_BOM::IsFieldChecked(int aFieldId) */ void DIALOG_BUILD_BOM::CreatePartsList( ) { - FILE* f; - wxString msg; + FILE* f; - if( ( f = wxFopen( m_ListFileName, wxT( "wt" ) ) ) == NULL ) + if( ( f = wxFopen( m_listFileName, wxT( "wt" ) ) ) == NULL ) { + wxString msg; msg = _( "Failed to open file " ); - msg << m_ListFileName; + msg << m_listFileName; DisplayError( this, msg ); return; } - SCH_REFERENCE_LIST cmplist; - SCH_SHEET_LIST sheetList; - - sheetList.GetComponents( cmplist, false ); - - // sort component list by ref and remove sub components - cmplist.RemoveSubComponentsFromList(); - - // sort component list by value - cmplist.SortByValueOnly( ); - PrintComponentsListByPart( f, cmplist, false ); - - fclose( f ); + BOM_LISTER bom_lister; + // Set the list of fields to add to list + for( int ii = FOOTPRINT, ii < FIELD8; ii++ ) + if IsFieldChecked( ii ) + bom_lister.AddFieldIdToPrintList( ii ); + bom_lister.CreateCsvBOMList( s_ExportSeparatorSymbol, f ); } @@ -486,10 +469,10 @@ void DIALOG_BUILD_BOM::CreateExportList( bool aIncludeSubComponents ) FILE* f; wxString msg; - if( ( f = wxFopen( m_ListFileName, wxT( "wt" ) ) ) == NULL ) + if( ( f = wxFopen( m_listFileName, wxT( "wt" ) ) ) == NULL ) { msg = _( "Failed to open file " ); - msg << m_ListFileName; + msg << m_listFileName; DisplayError( this, msg ); return; } @@ -515,7 +498,7 @@ void DIALOG_BUILD_BOM::CreateExportList( bool aIncludeSubComponents ) /* * GenereListeOfItems() * Main function to create the list of components and/or labels - * (global labels and pin sheets" ) + * (global labels, hierarchical labels and pin sheets ) */ void DIALOG_BUILD_BOM::GenereListeOfItems( bool aIncludeSubComponents ) { @@ -523,10 +506,10 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( bool aIncludeSubComponents ) int itemCount; wxString msg; - if( ( f = wxFopen( m_ListFileName, wxT( "wt" ) ) ) == NULL ) + if( ( f = wxFopen( m_listFileName, wxT( "wt" ) ) ) == NULL ) { msg = _( "Failed to open file " ); - msg << m_ListFileName; + msg << m_listFileName; DisplayError( this, msg ); return; } @@ -561,39 +544,14 @@ void DIALOG_BUILD_BOM::GenereListeOfItems( bool aIncludeSubComponents ) } } - /*************************************************/ - /* Create list of global labels and pins sheets */ - /*************************************************/ - std::vector listOfLabels; + // Create list of global labels, hierrachical labels and pins sheets + BOM_LISTER bom_lister; - GenListeGLabels( listOfLabels ); + if( m_GenListLabelsbySheet->GetValue() ) + bom_lister.PrintGlobalAndHierarchicalLabelsList( f, true ); - if( ( itemCount = listOfLabels.size() ) > 0 ) - { - if( m_GenListLabelsbySheet->GetValue() ) - { - sort( listOfLabels.begin(), listOfLabels.end(), SortLabelsBySheet ); - - msg.Printf( _( "\n#Global, Hierarchical Labels and PinSheets \ -( order = Sheet Number ) count = %d\n" ), - itemCount ); - - fprintf( f, "%s", TO_UTF8( msg ) ); - PrintListeGLabel( f, listOfLabels ); - } - - if( m_GenListLabelsbyVal->GetValue() ) - { - sort( listOfLabels.begin(), listOfLabels.end(), SortLabelsByValue ); - - msg.Printf( _( "\n#Global, Hierarchical Labels and PinSheets ( \ -order = Alphab. ) count = %d\n\n" ), - itemCount ); - - fprintf( f, "%s", TO_UTF8( msg ) ); - PrintListeGLabel( f, listOfLabels ); - } - } + if( m_GenListLabelsbyVal->GetValue() ) + bom_lister.PrintGlobalAndHierarchicalLabelsList( f, false ); msg = _( "\n#End List\n" ); fprintf( f, "%s", TO_UTF8( msg ) ); @@ -763,11 +721,11 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, { #if defined(KICAD_GOST) strCur.Printf( wxT( "%c%s" ), s_ExportSeparatorSymbol, GetChars( msg ) ); - msg = m_Parent->GetXYSheetReferences( comp->GetPosition() ); + msg = m_parent->GetXYSheetReferences( comp->GetPosition() ); strCur.Printf( wxT( "%c%s)" ), s_ExportSeparatorSymbol, GetChars( msg ) ); #else fprintf( f, "%c%s", s_ExportSeparatorSymbol, TO_UTF8( msg ) ); - msg = m_Parent->GetXYSheetReferences( comp->GetPosition() ); + msg = m_parent->GetXYSheetReferences( comp->GetPosition() ); fprintf( f, "%c%s)", s_ExportSeparatorSymbol, TO_UTF8( msg ) ); #endif @@ -775,7 +733,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, else { fprintf( f, " (Sheet %s)", TO_UTF8( msg ) ); - msg = m_Parent->GetXYSheetReferences( comp->GetPosition() ); + msg = m_parent->GetXYSheetReferences( comp->GetPosition() ); fprintf( f, " (loc %s)", TO_UTF8( msg ) ); } } @@ -865,49 +823,6 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef( FILE* f, } -int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST& aList, - bool aIncludeSubComponents ) -{ - unsigned int index = 0; - while( index < aList.GetCount() ) - { - SCH_COMPONENT *component = aList[index].GetComponent(); - wxString referenceListStr; - int qty = 1; - referenceListStr.append( aList[index].GetRef() ); - for( unsigned int i = index+1; i < aList.GetCount(); ) - { - if( *(aList[i].GetComponent()) == *component ) - { - referenceListStr.append( wxT( " " ) + aList[i].GetRef() ); - aList.RemoveItem( i ); - qty++; - } - else - i++; // Increment index only when current item is not removed from the list - } - - // Write value, quantity and list of references - fprintf( aFile, "%15s%c%3d%c\"%s\"", TO_UTF8( component->GetField( VALUE )->GetText() ), - s_ExportSeparatorSymbol, qty, - s_ExportSeparatorSymbol, TO_UTF8( referenceListStr ) ); - - // Write the rest of the fields if required -#if defined( KICAD_GOST ) - fprintf( aFile, "%c%20s", s_ExportSeparatorSymbol, - TO_UTF8( component->GetField( DATASHEET )->GetText() ) ); -#endif - for( int i = FOOTPRINT; i < component->GetFieldCount(); i++ ) - if( IsFieldChecked( i ) ) - fprintf( aFile, "%c%15s", s_ExportSeparatorSymbol, - TO_UTF8( component->GetField( i )->GetText() ) ); - fprintf( aFile, "\n" ); - index++; - } - return 0; -} - - int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f, SCH_REFERENCE_LIST& aList, bool aIncludeSubComponents ) @@ -968,7 +883,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal( FILE* f, { msg = aList[ii].GetSheetPath().PathHumanReadable(); fprintf( f, " (Sheet %s)", TO_UTF8( msg ) ); - msg = m_Parent->GetXYSheetReferences( DrawLibItem->GetPosition() ); + msg = m_parent->GetXYSheetReferences( DrawLibItem->GetPosition() ); fprintf( f, " (loc %s)", TO_UTF8( msg ) ); } } diff --git a/eeschema/dialogs/dialog_build_BOM.h b/eeschema/dialogs/dialog_build_BOM.h index ed88d4317e..eabc8e51ac 100644 --- a/eeschema/dialogs/dialog_build_BOM.h +++ b/eeschema/dialogs/dialog_build_BOM.h @@ -1,8 +1,29 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_build_BOM.h -// Copyright: GNU license -// Licence: -///////////////////////////////////////////////////////////////////////////// +/** + * @file dialog_build_BOM.h + */ + +/* This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + #ifndef _DIALOG_BUILD_BOM_H_ #define _DIALOG_BUILD_BOM_H_ @@ -14,13 +35,12 @@ class EDA_DRAW_FRAME; class SCH_COMPONENT; class wxConfig; - class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE { private: - EDA_DRAW_FRAME* m_Parent; - wxConfig* m_Config; - wxString m_ListFileName; // The full filename of the file report. + EDA_DRAW_FRAME* m_parent; + wxConfig* m_config; + wxString m_listFileName; // The full filename of the file report. private: void OnRadioboxSelectFormatSelected( wxCommandEvent& event ); @@ -62,9 +82,6 @@ private: int PrintComponentsListByVal( FILE* f, SCH_REFERENCE_LIST& aList, bool aIncludeSubComponents ); - int PrintComponentsListByPart( FILE* f, SCH_REFERENCE_LIST& aList, - bool aIncludeSubComponents ); - wxString PrintFieldData( SCH_COMPONENT* DrawLibItem, bool CompactForm = false ); bool IsFieldChecked( int aFieldId ); diff --git a/eeschema/dialogs/dialog_build_BOM_base.cpp b/eeschema/dialogs/dialog_build_BOM_base.cpp index 4af3b63697..518561c889 100644 --- a/eeschema/dialogs/dialog_build_BOM_base.cpp +++ b/eeschema/dialogs/dialog_build_BOM_base.cpp @@ -1,155 +1,148 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 21 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_build_BOM_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_BUILD_BOM_BASE::DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBoxSizer* sbOptionsSizer; - sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); - - wxStaticBoxSizer* sbListOptionsSizer; - sbListOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("List items:") ), wxVERTICAL ); - - m_ListCmpbyRefItems = new wxCheckBox( this, wxID_ANY, _("Components by reference"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbListOptionsSizer->Add( m_ListCmpbyRefItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_ListSubCmpItems = new wxCheckBox( this, wxID_ANY, _("Sub components (i.e. U2A, U2B ...)"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbListOptionsSizer->Add( m_ListSubCmpItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_ListCmpbyValItems = new wxCheckBox( this, wxID_ANY, _("Components by value"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbListOptionsSizer->Add( m_ListCmpbyValItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_GenListLabelsbyVal = new wxCheckBox( this, wxID_ANY, _("Hierarchy pins by name"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbListOptionsSizer->Add( m_GenListLabelsbyVal, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_GenListLabelsbySheet = new wxCheckBox( this, wxID_ANY, _("Hierarchy pins by sheets"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbListOptionsSizer->Add( m_GenListLabelsbySheet, 0, wxALL, 5 ); - - sbOptionsSizer->Add( sbListOptionsSizer, 0, wxEXPAND, 5 ); - - wxString m_OutputFormCtrlChoices[] = { _("List"), _("Text for spreadsheet import"), _("Single Part per line") }; - int m_OutputFormCtrlNChoices = sizeof( m_OutputFormCtrlChoices ) / sizeof( wxString ); - m_OutputFormCtrl = new wxRadioBox( this, ID_RADIOBOX_SELECT_FORMAT, _("Output format:"), wxDefaultPosition, wxDefaultSize, m_OutputFormCtrlNChoices, m_OutputFormCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_OutputFormCtrl->SetSelection( 2 ); - sbOptionsSizer->Add( m_OutputFormCtrl, 0, wxEXPAND|wxTOP, 5 ); - - wxString m_OutputSeparatorCtrlChoices[] = { _("Tab"), _(";"), _(",") }; - int m_OutputSeparatorCtrlNChoices = sizeof( m_OutputSeparatorCtrlChoices ) / sizeof( wxString ); - m_OutputSeparatorCtrl = new wxRadioBox( this, wxID_ANY, _("Field separator for spreadsheet import:"), wxDefaultPosition, wxDefaultSize, m_OutputSeparatorCtrlNChoices, m_OutputSeparatorCtrlChoices, 1, wxRA_SPECIFY_ROWS ); - m_OutputSeparatorCtrl->SetSelection( 0 ); - sbOptionsSizer->Add( m_OutputSeparatorCtrl, 0, wxEXPAND|wxTOP, 5 ); - - wxStaticBoxSizer* sbBrowseOptSizer; - sbBrowseOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); - - m_GetListBrowser = new wxCheckBox( this, wxID_ANY, _("Launch list browser"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbBrowseOptSizer->Add( m_GetListBrowser, 0, wxALL|wxEXPAND, 5 ); - - sbOptionsSizer->Add( sbBrowseOptSizer, 0, wxEXPAND|wxTOP, 5 ); - - bMainSizer->Add( sbOptionsSizer, 10, wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bRightSizer; - bRightSizer = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbFieldsSelectionSizer; - sbFieldsSelectionSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields to add:") ), wxVERTICAL ); - - wxStaticBoxSizer* sbFixedFieldsSizer; - sbFixedFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("System Fields:") ), wxVERTICAL ); - - m_AddFootprintField = new wxCheckBox( this, wxID_ANY, _("Footprint"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbFixedFieldsSizer->Add( m_AddFootprintField, 0, wxALL|wxEXPAND, 5 ); - - sbFieldsSelectionSizer->Add( sbFixedFieldsSizer, 0, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbUsersFiledsSizer; - sbUsersFiledsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Users Fields:") ), wxVERTICAL ); - - m_AddField1 = new wxCheckBox( this, wxID_ANY, _("Field 1"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField1, 0, wxEXPAND|wxALL, 5 ); - - m_AddField2 = new wxCheckBox( this, wxID_ANY, _("Field 2"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddField3 = new wxCheckBox( this, wxID_ANY, _("Field 3"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField3, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddField4 = new wxCheckBox( this, wxID_ANY, _("Field 4"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField4, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddField5 = new wxCheckBox( this, wxID_ANY, _("Field 5"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField5, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddField6 = new wxCheckBox( this, wxID_ANY, _("Field 6"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField6, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddField7 = new wxCheckBox( this, wxID_ANY, _("Field 7"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField7, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddField8 = new wxCheckBox( this, wxID_ANY, _("Field 8"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddField8, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_AddAllFields = new wxCheckBox( this, wxID_ANY, _("All existing users fields"), wxDefaultPosition, wxDefaultSize, 0 ); - - sbUsersFiledsSizer->Add( m_AddAllFields, 0, wxALL, 5 ); - - sbFieldsSelectionSizer->Add( sbUsersFiledsSizer, 0, wxEXPAND|wxTOP, 5 ); - - bRightSizer->Add( sbFieldsSelectionSizer, 1, wxEXPAND, 5 ); - - - bRightSizer->Add( 10, 10, 0, 0, 5 ); - - m_buttonOK = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOK->SetDefault(); - bRightSizer->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bRightSizer->Add( m_buttonCANCEL, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bMainSizer->Add( bRightSizer, 8, wxALL|wxEXPAND, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - - // Connect Events - m_OutputFormCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this ); - m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this ); -} - -DIALOG_BUILD_BOM_BASE::~DIALOG_BUILD_BOM_BASE() -{ - // Disconnect Events - m_OutputFormCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this ); - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this ); - m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this ); -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_build_BOM_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_BUILD_BOM_BASE::DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sbOptionsSizer; + sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); + + wxStaticBoxSizer* sbListOptionsSizer; + sbListOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("List items:") ), wxVERTICAL ); + + m_ListCmpbyRefItems = new wxCheckBox( this, wxID_ANY, _("Components by reference"), wxDefaultPosition, wxDefaultSize, 0 ); + sbListOptionsSizer->Add( m_ListCmpbyRefItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_ListSubCmpItems = new wxCheckBox( this, wxID_ANY, _("Sub components (i.e. U2A, U2B ...)"), wxDefaultPosition, wxDefaultSize, 0 ); + sbListOptionsSizer->Add( m_ListSubCmpItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_ListCmpbyValItems = new wxCheckBox( this, wxID_ANY, _("Components by value"), wxDefaultPosition, wxDefaultSize, 0 ); + sbListOptionsSizer->Add( m_ListCmpbyValItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_GenListLabelsbyVal = new wxCheckBox( this, wxID_ANY, _("Hierarchy pins by name"), wxDefaultPosition, wxDefaultSize, 0 ); + sbListOptionsSizer->Add( m_GenListLabelsbyVal, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_GenListLabelsbySheet = new wxCheckBox( this, wxID_ANY, _("Hierarchy pins by sheets"), wxDefaultPosition, wxDefaultSize, 0 ); + sbListOptionsSizer->Add( m_GenListLabelsbySheet, 0, wxALL, 5 ); + + + sbOptionsSizer->Add( sbListOptionsSizer, 0, wxEXPAND, 5 ); + + wxString m_OutputFormCtrlChoices[] = { _("List"), _("Text for spreadsheet import"), _("Single Part per line") }; + int m_OutputFormCtrlNChoices = sizeof( m_OutputFormCtrlChoices ) / sizeof( wxString ); + m_OutputFormCtrl = new wxRadioBox( this, ID_RADIOBOX_SELECT_FORMAT, _("Output format:"), wxDefaultPosition, wxDefaultSize, m_OutputFormCtrlNChoices, m_OutputFormCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_OutputFormCtrl->SetSelection( 2 ); + sbOptionsSizer->Add( m_OutputFormCtrl, 0, wxEXPAND|wxTOP, 5 ); + + wxString m_OutputSeparatorCtrlChoices[] = { _("Tab"), _(";"), _(",") }; + int m_OutputSeparatorCtrlNChoices = sizeof( m_OutputSeparatorCtrlChoices ) / sizeof( wxString ); + m_OutputSeparatorCtrl = new wxRadioBox( this, wxID_ANY, _("Field separator for spreadsheet import:"), wxDefaultPosition, wxDefaultSize, m_OutputSeparatorCtrlNChoices, m_OutputSeparatorCtrlChoices, 1, wxRA_SPECIFY_ROWS ); + m_OutputSeparatorCtrl->SetSelection( 0 ); + sbOptionsSizer->Add( m_OutputSeparatorCtrl, 0, wxEXPAND|wxTOP, 5 ); + + wxStaticBoxSizer* sbBrowseOptSizer; + sbBrowseOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL ); + + m_GetListBrowser = new wxCheckBox( this, wxID_ANY, _("Launch list browser"), wxDefaultPosition, wxDefaultSize, 0 ); + sbBrowseOptSizer->Add( m_GetListBrowser, 0, wxALL|wxEXPAND, 5 ); + + + sbOptionsSizer->Add( sbBrowseOptSizer, 0, wxEXPAND|wxTOP, 5 ); + + + bMainSizer->Add( sbOptionsSizer, 10, wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bRightSizer; + bRightSizer = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbFieldsSelectionSizer; + sbFieldsSelectionSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields to add:") ), wxVERTICAL ); + + wxStaticBoxSizer* sbFixedFieldsSizer; + sbFixedFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("System Fields:") ), wxVERTICAL ); + + m_AddFootprintField = new wxCheckBox( this, wxID_ANY, _("Footprint"), wxDefaultPosition, wxDefaultSize, 0 ); + sbFixedFieldsSizer->Add( m_AddFootprintField, 0, wxALL|wxEXPAND, 5 ); + + + sbFieldsSelectionSizer->Add( sbFixedFieldsSizer, 0, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbUsersFiledsSizer; + sbUsersFiledsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Users Fields:") ), wxVERTICAL ); + + m_AddField1 = new wxCheckBox( this, wxID_ANY, _("Field 1"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField1, 0, wxEXPAND|wxALL, 5 ); + + m_AddField2 = new wxCheckBox( this, wxID_ANY, _("Field 2"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddField3 = new wxCheckBox( this, wxID_ANY, _("Field 3"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField3, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddField4 = new wxCheckBox( this, wxID_ANY, _("Field 4"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField4, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddField5 = new wxCheckBox( this, wxID_ANY, _("Field 5"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField5, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddField6 = new wxCheckBox( this, wxID_ANY, _("Field 6"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField6, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddField7 = new wxCheckBox( this, wxID_ANY, _("Field 7"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField7, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddField8 = new wxCheckBox( this, wxID_ANY, _("Field 8"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddField8, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_AddAllFields = new wxCheckBox( this, wxID_ANY, _("All existing users fields"), wxDefaultPosition, wxDefaultSize, 0 ); + sbUsersFiledsSizer->Add( m_AddAllFields, 0, wxALL, 5 ); + + + sbFieldsSelectionSizer->Add( sbUsersFiledsSizer, 0, wxEXPAND|wxTOP, 5 ); + + + bRightSizer->Add( sbFieldsSelectionSizer, 1, wxEXPAND, 5 ); + + + bRightSizer->Add( 10, 10, 0, 0, 5 ); + + m_buttonOK = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonOK->SetDefault(); + bRightSizer->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bRightSizer->Add( m_buttonCANCEL, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bMainSizer->Add( bRightSizer, 8, wxALL|wxEXPAND, 5 ); + + + this->SetSizer( bMainSizer ); + this->Layout(); + + // Connect Events + m_OutputFormCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this ); + m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this ); +} + +DIALOG_BUILD_BOM_BASE::~DIALOG_BUILD_BOM_BASE() +{ + // Disconnect Events + m_OutputFormCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this ); + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this ); + m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this ); + +} diff --git a/eeschema/dialogs/dialog_build_BOM_base.fbp b/eeschema/dialogs/dialog_build_BOM_base.fbp index ec62a6dd58..2028be9cdd 100644 --- a/eeschema/dialogs/dialog_build_BOM_base.fbp +++ b/eeschema/dialogs/dialog_build_BOM_base.fbp @@ -1,1230 +1,1966 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_build_BOM_base - 1000 - none - 1 - dialog_build_BOM_base - - . - - 1 - 1 - 0 - - - - - 1 - - - - 0 - wxID_ANY - - - DIALOG_BUILD_BOM_BASE - - 415,382 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - List of Material - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 10 - - wxID_ANY - Options: - - sbOptionsSizer - wxVERTICAL - none - - - 5 - wxEXPAND - 0 - - wxID_ANY - List items: - - sbListOptionsSizer - wxVERTICAL - none - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Components by reference - - - m_ListCmpbyRefItems - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Sub components (i.e. U2A, U2B ...) - - - m_ListSubCmpItems - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Components by value - - - m_ListCmpbyValItems - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Hierarchy pins by name - - - m_GenListLabelsbyVal - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Hierarchy pins by sheets - - - m_GenListLabelsbySheet - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP - 0 - - - "List" "Text for spreadsheet import" "Single Part per line" - - 1 - - - 0 - ID_RADIOBOX_SELECT_FORMAT - Output format: - 1 - - - m_OutputFormCtrl - protected - - 2 - - wxRA_SPECIFY_COLS - - - - - - - - - - - - - - - - - - - - - - - OnRadioboxSelectFormatSelected - - - - - - - - - - 5 - wxEXPAND|wxTOP - 0 - - - "Tab" ";" "," - - 1 - - - 0 - wxID_ANY - Field separator for spreadsheet import: - 1 - - - m_OutputSeparatorCtrl - protected - - 0 - - wxRA_SPECIFY_ROWS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP - 0 - - wxID_ANY - Options: - - sbBrowseOptSizer - wxVERTICAL - none - - - 5 - wxALL|wxEXPAND - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Launch list browser - - - m_GetListBrowser - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 8 - - - bRightSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - wxID_ANY - Fields to add: - - sbFieldsSelectionSizer - wxVERTICAL - none - - - 5 - wxEXPAND - 0 - - wxID_ANY - System Fields: - - sbFixedFieldsSizer - wxVERTICAL - none - - - 5 - wxALL|wxEXPAND - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Footprint - - - m_AddFootprintField - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxTOP - 0 - - wxID_ANY - Users Fields: - - sbUsersFiledsSizer - wxVERTICAL - none - - - 5 - wxEXPAND|wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 1 - - - m_AddField1 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 2 - - - m_AddField2 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 3 - - - m_AddField3 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 4 - - - m_AddField4 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 5 - - - m_AddField5 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 6 - - - m_AddField6 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 7 - - - m_AddField7 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Field 8 - - - m_AddField8 - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - All existing users fields - - - m_AddAllFields - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - 10 - protected - 10 - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 1 - 1 - - - 0 - wxID_OK - Ok - - - m_buttonOK - protected - - - - - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Close - - - m_buttonCANCEL - protected - - - - - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_build_BOM_base + 1000 + none + 1 + dialog_build_BOM_base + + . + + 1 + 1 + 1 + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_BUILD_BOM_BASE + + 415,382 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + List of Material + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 10 + + wxID_ANY + Options: + + sbOptionsSizer + wxVERTICAL + none + + + 5 + wxEXPAND + 0 + + wxID_ANY + List items: + + sbListOptionsSizer + wxVERTICAL + none + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Components by reference + + 0 + + + 0 + + 1 + m_ListCmpbyRefItems + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Sub components (i.e. U2A, U2B ...) + + 0 + + + 0 + + 1 + m_ListSubCmpItems + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Components by value + + 0 + + + 0 + + 1 + m_ListCmpbyValItems + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hierarchy pins by name + + 0 + + + 0 + + 1 + m_GenListLabelsbyVal + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hierarchy pins by sheets + + 0 + + + 0 + + 1 + m_GenListLabelsbySheet + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "List" "Text for spreadsheet import" "Single Part per line" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_RADIOBOX_SELECT_FORMAT + Output format: + 1 + + 0 + + + 0 + + 1 + m_OutputFormCtrl + 1 + + + protected + 1 + + Resizable + 2 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + OnRadioboxSelectFormatSelected + + + + + + + + + + 5 + wxEXPAND|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Tab" ";" "," + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field separator for spreadsheet import: + 1 + + 0 + + + 0 + + 1 + m_OutputSeparatorCtrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_ROWS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP + 0 + + wxID_ANY + Options: + + sbBrowseOptSizer + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Launch list browser + + 0 + + + 0 + + 1 + m_GetListBrowser + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 8 + + + bRightSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + wxID_ANY + Fields to add: + + sbFieldsSelectionSizer + wxVERTICAL + none + + + 5 + wxEXPAND + 0 + + wxID_ANY + System Fields: + + sbFixedFieldsSizer + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Footprint + + 0 + + + 0 + + 1 + m_AddFootprintField + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxTOP + 0 + + wxID_ANY + Users Fields: + + sbUsersFiledsSizer + wxVERTICAL + none + + + 5 + wxEXPAND|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 1 + + 0 + + + 0 + + 1 + m_AddField1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 2 + + 0 + + + 0 + + 1 + m_AddField2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 3 + + 0 + + + 0 + + 1 + m_AddField3 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 4 + + 0 + + + 0 + + 1 + m_AddField4 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 5 + + 0 + + + 0 + + 1 + m_AddField5 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 6 + + 0 + + + 0 + + 1 + m_AddField6 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 7 + + 0 + + + 0 + + 1 + m_AddField7 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Field 8 + + 0 + + + 0 + + 1 + m_AddField8 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + All existing users fields + + 0 + + + 0 + + 1 + m_AddAllFields + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 10 + protected + 10 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_OK + Ok + + 0 + + + 0 + + 1 + m_buttonOK + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOkClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_CANCEL + Close + + 0 + + + 0 + + 1 + m_buttonCANCEL + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_build_BOM_base.h b/eeschema/dialogs/dialog_build_BOM_base.h index 3aac87e8fe..ff559cfd2d 100644 --- a/eeschema/dialogs/dialog_build_BOM_base.h +++ b/eeschema/dialogs/dialog_build_BOM_base.h @@ -1,74 +1,76 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 21 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_build_BOM_base__ -#define __dialog_build_BOM_base__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_BUILD_BOM_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_BUILD_BOM_BASE : public wxDialog -{ - private: - - protected: - enum - { - ID_RADIOBOX_SELECT_FORMAT = 1000, - }; - - wxCheckBox* m_ListCmpbyRefItems; - wxCheckBox* m_ListSubCmpItems; - wxCheckBox* m_ListCmpbyValItems; - wxCheckBox* m_GenListLabelsbyVal; - wxCheckBox* m_GenListLabelsbySheet; - wxRadioBox* m_OutputFormCtrl; - wxRadioBox* m_OutputSeparatorCtrl; - wxCheckBox* m_GetListBrowser; - wxCheckBox* m_AddFootprintField; - wxCheckBox* m_AddField1; - wxCheckBox* m_AddField2; - wxCheckBox* m_AddField3; - wxCheckBox* m_AddField4; - wxCheckBox* m_AddField5; - wxCheckBox* m_AddField6; - wxCheckBox* m_AddField7; - wxCheckBox* m_AddField8; - wxCheckBox* m_AddAllFields; - - wxButton* m_buttonOK; - wxButton* m_buttonCANCEL; - - // Virtual event handlers, overide them in your derived class - virtual void OnRadioboxSelectFormatSelected( wxCommandEvent& event ){ event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } - - - public: - DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("List of Material"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 415,382 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_BUILD_BOM_BASE(); - -}; - -#endif //__dialog_build_BOM_base__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_BUILD_BOM_BASE_H__ +#define __DIALOG_BUILD_BOM_BASE_H__ + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_BUILD_BOM_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_BUILD_BOM_BASE : public DIALOG_SHIM +{ + private: + + protected: + enum + { + ID_RADIOBOX_SELECT_FORMAT = 1000 + }; + + wxCheckBox* m_ListCmpbyRefItems; + wxCheckBox* m_ListSubCmpItems; + wxCheckBox* m_ListCmpbyValItems; + wxCheckBox* m_GenListLabelsbyVal; + wxCheckBox* m_GenListLabelsbySheet; + wxRadioBox* m_OutputFormCtrl; + wxRadioBox* m_OutputSeparatorCtrl; + wxCheckBox* m_GetListBrowser; + wxCheckBox* m_AddFootprintField; + wxCheckBox* m_AddField1; + wxCheckBox* m_AddField2; + wxCheckBox* m_AddField3; + wxCheckBox* m_AddField4; + wxCheckBox* m_AddField5; + wxCheckBox* m_AddField6; + wxCheckBox* m_AddField7; + wxCheckBox* m_AddField8; + wxCheckBox* m_AddAllFields; + wxButton* m_buttonOK; + wxButton* m_buttonCANCEL; + + // Virtual event handlers, overide them in your derived class + virtual void OnRadioboxSelectFormatSelected( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("List of Material"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 415,382 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_BUILD_BOM_BASE(); + +}; + +#endif //__DIALOG_BUILD_BOM_BASE_H__