eeschema: minors changes

This commit is contained in:
charras 2008-05-15 15:59:11 +00:00
parent 4999a844c0
commit 142565c3c6
7 changed files with 107 additions and 95 deletions

View File

@ -15,40 +15,51 @@
#include "dialog_backanno.cpp" #include "dialog_backanno.cpp"
/**************************************************************/ /**************************************************************/
SCH_COMPONENT * WinEDA_SchematicFrame::FindComponentByRef( SCH_COMPONENT* WinEDA_SchematicFrame::FindComponentByRef(
const wxString& reference ) const wxString& reference )
/**************************************************************/ /**************************************************************/
{ {
DrawSheetPath* sheet; DrawSheetPath* sheet;
SCH_ITEM* DrawList = NULL; SCH_ITEM* DrawList = NULL;
EDA_SheetList SheetList( NULL ); EDA_SheetList SheetList( NULL );
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() ) for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
{ {
DrawList = (SCH_ITEM*) sheet->LastDrawList(); DrawList = (SCH_ITEM*) sheet->LastDrawList();
for( ; (DrawList != NULL); DrawList = DrawList->Next() ) for( ; (DrawList != NULL); DrawList = DrawList->Next() )
{ {
if( DrawList->Type() == TYPE_SCH_COMPONENT ) if( DrawList->Type() == TYPE_SCH_COMPONENT )
{ {
SCH_COMPONENT* pSch; SCH_COMPONENT* pSch;
pSch = (SCH_COMPONENT*) DrawList; pSch = (SCH_COMPONENT*) DrawList;
if( reference.CmpNoCase( pSch->GetRef(sheet) ) == 0 ) if( reference.CmpNoCase( pSch->GetRef( sheet ) ) == 0 )
return pSch; return pSch;
} }
} }
} }
return NULL; return NULL;
} }
/**************************************************************/ /**************************************************************/
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile ) bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile )
/**************************************************************/ /**************************************************************/
/* Read a "stuff" file created by cvpcb.
* That file has lines like:
* comp = "C1" module = "CP6"
* comp = "C2" module = "C1"
* comp = "C3" module = "C1"
* "comp =" gives the component reference
* "module =" gives the footprint name
*
*/
{ {
int LineNum = 0; int LineNum = 0;
char* cp, Ref[256], FootPrint[256], Line[1024]; char* cp, Ref[256], FootPrint[256], Line[1024];
SCH_COMPONENT* Cmp; SCH_COMPONENT* Cmp;
PartTextStruct* TextField;
while( GetLine( StuffFile, Line, &LineNum, sizeof(Line) ) ) while( GetLine( StuffFile, Line, &LineNum, sizeof(Line) ) )
{ {
@ -62,18 +73,22 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile )
if( *cp == '"' ) if( *cp == '"' )
*cp = 0; *cp = 0;
wxString reference = CONV_FROM_UTF8( Ref ); wxString reference = CONV_FROM_UTF8( Ref );
Cmp = WinEDA_SchematicFrame::FindComponentByRef( reference ); Cmp = WinEDA_SchematicFrame::FindComponentByRef( reference );
if( Cmp == NULL ) if( Cmp == NULL )
continue; continue;
#if defined(DEBUG) /* Give a reasonnable value to the fied position, if
printf( " %s %s\n", CONV_TO_UTF8(Cmp->m_Field[REFERENCE].m_Text), * the text is empty at position 0, because it is probably not yet initialised
CONV_TO_UTF8(Cmp->m_Field[VALUE].m_Text) ); */
#endif if( Cmp->m_Field[FOOTPRINT].m_Text.IsEmpty() &&
TextField = &Cmp->m_Field[FOOTPRINT]; ( Cmp->m_Field[FOOTPRINT].m_Pos == wxPoint( 0, 0 ) ) )
TextField->m_Text = CONV_FROM_UTF8( FootPrint ); {
Cmp->m_Field[FOOTPRINT].m_Pos = Cmp->m_Field[VALUE].m_Pos;
Cmp->m_Field[FOOTPRINT].m_Pos.y -= 100;
}
Cmp->m_Field[FOOTPRINT].m_Text = CONV_FROM_UTF8( FootPrint );
} }
} }
@ -100,7 +115,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
this, this,
wxFD_OPEN, wxFD_OPEN,
FALSE FALSE
); );
if( filename.IsEmpty() ) if( filename.IsEmpty() )
return FALSE; return FALSE;

View File

@ -22,9 +22,11 @@
// Filename extension for BOM list // Filename extension for BOM list
#define EXT_LIST wxT( ".lst" ) #define EXT_LIST wxT( ".lst" )
// Exported functions
int BuildComponentsListFromSchematic( ListComponent* List );
/* fonctions locales */ /* fonctions locales */
static int GenListeGLabels( ListLabel* List ); static int GenListeGLabels( ListLabel* List );
int GenListeCmp( ListComponent* List );
static int ListTriComposantByRef( ListComponent* Objet1, static int ListTriComposantByRef( ListComponent* Objet1,
ListComponent* Objet2 ); ListComponent* Objet2 );
static int ListTriComposantByVal( ListComponent* Objet1, static int ListTriComposantByVal( ListComponent* Objet1,
@ -61,14 +63,14 @@ void WinEDA_Build_BOM_Frame::Create_BOM_Lists( bool aTypeFileIsExport,
mask += EXT_LIST; mask += EXT_LIST;
filename = EDA_FileSelector( _( "Bill of materials:" ), filename = EDA_FileSelector( _( "Bill of materials:" ),
wxEmptyString, /* Chemin par defaut (ici dir courante) */ wxEmptyString, /* Chemin par defaut (ici dir courante) */
m_ListFileName, /* nom fichier par defaut, et resultat */ m_ListFileName, /* nom fichier par defaut, et resultat */
EXT_LIST, /* extension par defaut */ EXT_LIST, /* extension par defaut */
mask, /* Masque d'affichage */ mask, /* Masque d'affichage */
this, this,
wxFD_SAVE, wxFD_SAVE,
TRUE TRUE
); );
if( filename.IsEmpty() ) if( filename.IsEmpty() )
return; return;
else else
@ -94,7 +96,7 @@ void WinEDA_Build_BOM_Frame::Create_BOM_Lists( bool aTypeFileIsExport,
/****************************************************************************/ /****************************************************************************/
void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& FullFileName, void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& FullFileName,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
/****************************************************************************/ /****************************************************************************/
/* /*
@ -117,7 +119,7 @@ void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& FullFileName,
return; return;
} }
NbItems = GenListeCmp( NULL ); NbItems = BuildComponentsListFromSchematic( NULL );
if( NbItems ) if( NbItems )
{ {
List = (ListComponent*) MyZMalloc( NbItems * sizeof(ListComponent) ); List = (ListComponent*) MyZMalloc( NbItems * sizeof(ListComponent) );
@ -127,18 +129,17 @@ void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& FullFileName,
return; return;
} }
GenListeCmp( List ); BuildComponentsListFromSchematic( List );
/* sort component list */ /* sort component list */
qsort( List, NbItems, sizeof( ListComponent ), qsort( List, NbItems, sizeof( ListComponent ),
( int( * ) ( const void*, const void* ) )ListTriComposantByRef ); ( int( * ) ( const void*, const void* ) )ListTriComposantByRef );
// if( ! s_ListWithSubCmponents )
if( !aIncludeSubComponents ) if( !aIncludeSubComponents )
DeleteSubCmp( List, NbItems ); DeleteSubCmp( List, NbItems );
/* create the file */ /* create the file */
PrintListeCmpByRef( f, List, NbItems, TRUE, aIncludeSubComponents ); PrintComponentsListByRef( f, List, NbItems, TRUE, aIncludeSubComponents );
MyFree( List ); MyFree( List );
} }
@ -149,7 +150,7 @@ void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& FullFileName,
/****************************************************************************/ /****************************************************************************/
void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName, void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
/****************************************************************************/ /****************************************************************************/
/* /*
@ -173,7 +174,7 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
return; return;
} }
NbItems = GenListeCmp( NULL ); NbItems = BuildComponentsListFromSchematic( NULL );
if( NbItems ) if( NbItems )
{ {
List = (ListComponent*) MyZMalloc( NbItems * sizeof(ListComponent) ); List = (ListComponent*) MyZMalloc( NbItems * sizeof(ListComponent) );
@ -183,7 +184,7 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
return; return;
} }
GenListeCmp( List ); BuildComponentsListFromSchematic( List );
/* generation du fichier listing */ /* generation du fichier listing */
DateAndTime( Line ); DateAndTime( Line );
@ -193,7 +194,7 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
/* Tri et impression de la liste des composants */ /* Tri et impression de la liste des composants */
qsort( List, NbItems, sizeof( ListComponent ), qsort( List, NbItems, sizeof( ListComponent ),
( int( * ) ( const void*, const void* ) )ListTriComposantByRef ); ( int( * ) ( const void*, const void* ) )ListTriComposantByRef );
if( !aIncludeSubComponents ) if( !aIncludeSubComponents )
DeleteSubCmp( List, NbItems ); DeleteSubCmp( List, NbItems );
@ -201,15 +202,15 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
// if( s_ListByRef ) // if( s_ListByRef )
if( m_ListCmpbyRefItems->GetValue() ) if( m_ListCmpbyRefItems->GetValue() )
{ {
PrintListeCmpByRef( f, List, NbItems, false, aIncludeSubComponents ); PrintComponentsListByRef( f, List, NbItems, false, aIncludeSubComponents );
} }
// if( s_ListByValue ) // if( s_ListByValue )
if( m_ListCmpbyValItems->GetValue() ) if( m_ListCmpbyValItems->GetValue() )
{ {
qsort( List, NbItems, sizeof( ListComponent ), qsort( List, NbItems, sizeof( ListComponent ),
( int( * ) ( const void*, const void* ) )ListTriComposantByVal ); ( int( * ) ( const void*, const void* ) )ListTriComposantByVal );
PrintListeCmpByVal( f, List, NbItems, aIncludeSubComponents ); PrintComponentsListByVal( f, List, NbItems, aIncludeSubComponents );
} }
MyFree( List ); MyFree( List );
} }
@ -235,11 +236,11 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
if( m_GenListLabelsbySheet->GetValue() ) if( m_GenListLabelsbySheet->GetValue() )
{ {
qsort( ListOfLabels, NbItems, sizeof( ListLabel ), qsort( ListOfLabels, NbItems, sizeof( ListLabel ),
( int( * ) ( const void*, const void* ) )ListTriGLabelBySheet ); ( int( * ) ( const void*, const void* ) )ListTriGLabelBySheet );
msg.Printf( _( msg.Printf( _(
"\n#Global, Hierarchical Labels and PinSheets ( order = Sheet Number ) count = %d\n" ), "\n#Global, Hierarchical Labels and PinSheets ( order = Sheet Number ) count = %d\n" ),
NbItems ); NbItems );
fprintf( f, "%s", CONV_TO_UTF8( msg ) ); fprintf( f, "%s", CONV_TO_UTF8( msg ) );
PrintListeGLabel( f, ListOfLabels, NbItems ); PrintListeGLabel( f, ListOfLabels, NbItems );
} }
@ -248,11 +249,11 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
if( m_GenListLabelsbyVal->GetValue() ) if( m_GenListLabelsbyVal->GetValue() )
{ {
qsort( ListOfLabels, NbItems, sizeof( ListLabel ), qsort( ListOfLabels, NbItems, sizeof( ListLabel ),
( int( * ) ( const void*, const void* ) )ListTriGLabelByVal ); ( int( * ) ( const void*, const void* ) )ListTriGLabelByVal );
msg.Printf( _( msg.Printf( _(
"\n#Global, Hierarchical Labels and PinSheets ( order = Alphab. ) count = %d\n\n" ), "\n#Global, Hierarchical Labels and PinSheets ( order = Alphab. ) count = %d\n\n" ),
NbItems ); NbItems );
fprintf( f, "%s", CONV_TO_UTF8( msg ) ); fprintf( f, "%s", CONV_TO_UTF8( msg ) );
PrintListeGLabel( f, ListOfLabels, NbItems ); PrintListeGLabel( f, ListOfLabels, NbItems );
} }
@ -265,13 +266,12 @@ void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& FullFileName,
} }
/****************************************/ /*********************************************************/
int GenListeCmp( ListComponent* List ) int BuildComponentsListFromSchematic( ListComponent* List )
/****************************************/ /*********************************************************/
/* Creates the list of components in the schematic /* Creates the list of components found in the whole schematic
* *
* routine for generating a list of the used components.
* if List == null, just returns the count. if not, fills the list. * if List == null, just returns the count. if not, fills the list.
* goes through the sheets, not the screens, so that we account for * goes through the sheets, not the screens, so that we account for
* multiple instances of a given screen. * multiple instances of a given screen.
@ -300,10 +300,10 @@ int GenListeCmp( ListComponent* List )
{ {
List->m_Comp = DrawLibItem; List->m_Comp = DrawLibItem;
List->m_SheetList = *sheet; List->m_SheetList = *sheet;
List->m_Unit = DrawLibItem->GetUnitSelection( sheet ); List->m_Unit = DrawLibItem->GetUnitSelection( sheet );
strncpy( List->m_Ref, strncpy( List->m_Ref,
CONV_TO_UTF8( DrawLibItem->GetRef( sheet ) ), CONV_TO_UTF8( DrawLibItem->GetRef( sheet ) ),
sizeof( List->m_Ref ) ); sizeof( List->m_Ref ) );
List++; List++;
} }
} }
@ -345,7 +345,7 @@ static int GenListeGLabels( ListLabel* List )
{ {
List->m_LabelType = DrawList->Type(); List->m_LabelType = DrawList->Type();
snprintf( List->m_SheetPath, sizeof(List->m_SheetPath), snprintf( List->m_SheetPath, sizeof(List->m_SheetPath),
"%s", CONV_TO_UTF8( path ) ); "%s", CONV_TO_UTF8( path ) );
List->m_Label = DrawList; List->m_Label = DrawList;
List++; List++;
} }
@ -361,7 +361,7 @@ static int GenListeGLabels( ListLabel* List )
{ {
List->m_LabelType = DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE; List->m_LabelType = DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE;
snprintf( List->m_SheetPath, sizeof(List->m_SheetPath), snprintf( List->m_SheetPath, sizeof(List->m_SheetPath),
"%s", CONV_TO_UTF8( path ) ); "%s", CONV_TO_UTF8( path ) );
List->m_Label = SheetLabel; List->m_Label = SheetLabel;
List++; List++;
} }
@ -581,7 +581,7 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem
bool CompactForm ) bool CompactForm )
/*******************************************************************************************/ /*******************************************************************************************/
{ {
wxCheckBox* FieldListCtrl[FIELD8 - FIELD1 + 1] = { wxCheckBox* FieldListCtrl[] = {
m_AddField1, m_AddField1,
m_AddField2, m_AddField2,
m_AddField3, m_AddField3,
@ -597,8 +597,10 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem
if( CompactForm ) if( CompactForm )
{ {
fprintf( f, "%c%s", s_ExportSeparatorSymbol, fprintf( f, "%c%s", s_ExportSeparatorSymbol,
CONV_TO_UTF8( DrawLibItem->m_Field[FOOTPRINT].m_Text ) ); CONV_TO_UTF8( DrawLibItem->m_Field[FOOTPRINT].m_Text ) );
} }
else if( m_AddFootprintField->IsChecked() )
fprintf( f, "; %-12s", CONV_TO_UTF8( DrawLibItem->m_Field[FOOTPRINT].m_Text ) );
for( ii = FIELD1; ii <= FIELD8; ii++ ) for( ii = FIELD1; ii <= FIELD8; ii++ )
{ {
@ -609,7 +611,7 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem
continue; continue;
if( CompactForm ) if( CompactForm )
fprintf( f, "%c%s", s_ExportSeparatorSymbol, fprintf( f, "%c%s", s_ExportSeparatorSymbol,
CONV_TO_UTF8( DrawLibItem->m_Field[ii].m_Text ) ); CONV_TO_UTF8( DrawLibItem->m_Field[ii].m_Text ) );
else else
fprintf( f, "; %-12s", CONV_TO_UTF8( DrawLibItem->m_Field[ii].m_Text ) ); fprintf( f, "; %-12s", CONV_TO_UTF8( DrawLibItem->m_Field[ii].m_Text ) );
} }
@ -617,8 +619,8 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem
/*********************************************************************************************/ /*********************************************************************************************/
int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, int NbItems, int WinEDA_Build_BOM_Frame::PrintComponentsListByRef( FILE* f, ListComponent* List, int NbItems,
bool CompactForm, bool aIncludeSubComponents ) bool CompactForm, bool aIncludeSubComponents )
/*********************************************************************************************/ /*********************************************************************************************/
/* Print the B.O.M sorted by reference /* Print the B.O.M sorted by reference
@ -703,10 +705,10 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
if( CompactForm ) if( CompactForm )
fprintf( f, "%s%c%s", CmpName, s_ExportSeparatorSymbol, fprintf( f, "%s%c%s", CmpName, s_ExportSeparatorSymbol,
CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ) ); CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ) );
else else
fprintf( f, "| %-10s %-12s", CmpName, fprintf( f, "| %-10s %-12s", CmpName,
CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ) ); CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ) );
if( aIncludeSubComponents ) if( aIncludeSubComponents )
{ {
@ -732,8 +734,8 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByRef( FILE* f, ListComponent* List, in
/*********************************************************************************************/ /*********************************************************************************************/
int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, int NbItems, int WinEDA_Build_BOM_Frame::PrintComponentsListByVal( FILE* f, ListComponent* List, int NbItems,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
/**********************************************************************************************/ /**********************************************************************************************/
{ {
int ii, Multi; int ii, Multi;
@ -776,7 +778,7 @@ int WinEDA_Build_BOM_Frame::PrintListeCmpByVal( FILE* f, ListComponent* List, in
} }
sprintf( CmpName, "%s%c", List[ii].m_Ref, Unit ); sprintf( CmpName, "%s%c", List[ii].m_Ref, Unit );
fprintf( f, "| %-12s %-10s",CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ), CmpName ); fprintf( f, "| %-12s %-10s", CONV_TO_UTF8( DrawLibItem->m_Field[VALUE].m_Text ), CmpName );
// print the sheet path // print the sheet path
if( aIncludeSubComponents ) if( aIncludeSubComponents )

View File

@ -507,7 +507,8 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
if( s_OutputSeparatorOpt < 0 ) if( s_OutputSeparatorOpt < 0 )
s_OutputSeparatorOpt = 0; s_OutputSeparatorOpt = 0;
// Determine current settings of all 8 "Fields to add" checkboxes // Determine current settings of all "Fields to add" checkboxes
s_Add_FpField_state = m_AddFootprintField->GetValue();
s_Add_F1_state = m_AddField1->GetValue(); s_Add_F1_state = m_AddField1->GetValue();
s_Add_F2_state = m_AddField2->GetValue(); s_Add_F2_state = m_AddField2->GetValue();
s_Add_F3_state = m_AddField3->GetValue(); s_Add_F3_state = m_AddField3->GetValue();
@ -521,7 +522,7 @@ void WinEDA_Build_BOM_Frame::SavePreferences()
m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt ); m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_FORMAT, (long) s_OutputFormOpt );
m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt ); m_Parent->m_Parent->m_EDA_Config->Write( OPTION_BOM_SEPARATOR, (long) s_OutputSeparatorOpt );
// Now save current settings of all 8 "Fields to add" checkboxes // Now save current settings of all "Fields to add" checkboxes
long addfields = 0; long addfields = 0;
for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ ) for( int ii = 0, bitmask = 1; s_AddFieldList[ii] != NULL; ii++ )
{ {

View File

@ -134,9 +134,9 @@ public:
bool aRunBrowser); bool aRunBrowser);
void GenereListeOfItems(const wxString & FullFileName, bool aIncludeSubComponents ); void GenereListeOfItems(const wxString & FullFileName, bool aIncludeSubComponents );
void CreateExportList(const wxString & FullFileName, bool aIncludeSubComponents); void CreateExportList(const wxString & FullFileName, bool aIncludeSubComponents);
int PrintListeCmpByRef( FILE * f, ListComponent * List, int NbItems, int PrintComponentsListByRef( FILE * f, ListComponent * List, int NbItems,
bool CompactForm, bool aIncludeSubComponents ); bool CompactForm, bool aIncludeSubComponents );
int PrintListeCmpByVal( FILE *f, ListComponent * List, int NbItems, int PrintComponentsListByVal( FILE *f, ListComponent * List, int NbItems,
bool aIncludeSubComponents); bool aIncludeSubComponents);
void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE); void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
void SavePreferences(); void SavePreferences();

View File

@ -14,13 +14,12 @@
#include "protos.h" #include "protos.h"
/* fonctions exportees */ /* Imported functions */
int BuildComponentsListFromSchematic( ListComponent* List );
/* fonctions locales */ /* Local functions*/
static int TriListEntry(EDA_LibComponentStruct **Objet1, static int TriListEntry(EDA_LibComponentStruct **Objet1, EDA_LibComponentStruct **Objet2);
EDA_LibComponentStruct **Objet2);
/* Variable locales */
/*******************************************************************/ /*******************************************************************/
@ -42,14 +41,14 @@ const wxChar * Text;
/* Creation de la liste des elements */ /* Creation de la liste des elements */
NbItems = GenListeCmp(NULL ); // Comptage des composants NbItems = BuildComponentsListFromSchematic(NULL ); // Comptage des composants
if ( NbItems == 0 ) return FALSE; if ( NbItems == 0 ) return FALSE;
List = (ListComponent *) MyZMalloc( NbItems * sizeof( ListComponent ) ); List = (ListComponent *) MyZMalloc( NbItems * sizeof( ListComponent ) );
if (List == NULL ) return FALSE; if (List == NULL ) return FALSE;
/* Calcul de la liste des composants */ /* Calcul de la liste des composants */
GenListeCmp(List); BuildComponentsListFromSchematic(List);
/* Calcul de la liste des Entrees de librairie /* Calcul de la liste des Entrees de librairie
et Remplacement des alias par les composants "Root" */ et Remplacement des alias par les composants "Root" */

View File

@ -376,12 +376,6 @@ int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib,
bool LibArchive(wxWindow * frame, const wxString & ArchFullFileName); bool LibArchive(wxWindow * frame, const wxString & ArchFullFileName);
/***************/
/* GENLISTE.CPP */
/***************/
struct ListComponent;
int GenListeCmp( ListComponent * List );
/**************/ /**************/
/* CLEANUP.CPP */ /* CLEANUP.CPP */
/**************/ /**************/

View File

@ -509,6 +509,7 @@ void WinEDA_SchematicFrame::OnLoadFile( wxCommandEvent& event )
void WinEDA_SchematicFrame::OnLoadStuffFile( wxCommandEvent& event ) void WinEDA_SchematicFrame::OnLoadStuffFile( wxCommandEvent& event )
{ {
ReadInputStuffFile( ); ReadInputStuffFile( );
DrawPanel->Refresh();
} }
void WinEDA_SchematicFrame::OnNewProject( wxCommandEvent& event ) void WinEDA_SchematicFrame::OnNewProject( wxCommandEvent& event )