Commit 75f332ae authored by jean-pierre charras's avatar jean-pierre charras

Cvpcb: code cleaning. Remove not used and useless files.

parent bdca3c5e
...@@ -12,11 +12,9 @@ ...@@ -12,11 +12,9 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
#define QUOTE '\'' #define QUOTE '\''
class FOOTPRINT_ALIAS class FOOTPRINT_ALIAS
...@@ -151,7 +149,7 @@ found in the default search paths." ), ...@@ -151,7 +149,7 @@ found in the default search paths." ),
if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 ) if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 )
continue; continue;
BOOST_FOREACH( FOOTPRINT& footprint, m_footprints ) BOOST_FOREACH( FOOTPRINT_INFO& footprint, m_footprints )
{ {
if( alias.m_FootprintName.CmpNoCase( footprint.m_Module ) == 0 ) if( alias.m_FootprintName.CmpNoCase( footprint.m_Module ) == 0 )
{ {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "gestfich.h" #include "gestfich.h"
#include "param_config.h" #include "param_config.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h" #include "cvpcb_id.h"
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "common.h" #include "common.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "footprint_info.h"
PIN::PIN() PIN::PIN()
...@@ -56,14 +57,3 @@ bool operator<( const COMPONENT& item1, const COMPONENT& item2 ) ...@@ -56,14 +57,3 @@ bool operator<( const COMPONENT& item1, const COMPONENT& item2 )
item2.m_Reference.GetData() ) < 0 ); item2.m_Reference.GetData() ) < 0 );
} }
FOOTPRINT::FOOTPRINT()
{
m_Num = 0;
}
bool operator<( const FOOTPRINT& item1, const FOOTPRINT& item2 )
{
return ( StrNumICmp( item1.m_Module.GetData(),
item2.m_Module.GetData() ) < 0 );
}
/*************************************************************************/ /**
/* listboxes.cpp: class for displaying footprint list and component list */ * @file class_footprints_listbox.cpp
/*************************************************************************/ * class to display the list fo available footprints
*/
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "common.h" #include "common.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
FOOTPRINT_INFO* GetModuleDescrByName( const wxString& FootprintName, FOOTPRINT_LIST& list )
{
BOOST_FOREACH( FOOTPRINT_INFO & footprint, list )
{
if( footprint.m_Module == FootprintName )
return &footprint;
}
return NULL;
}
/***************************************/ /***************************************/
/* ListBox handling the footprint list */ /* ListBox handling the footprint list */
/***************************************/ /***************************************/
...@@ -116,7 +127,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list ) ...@@ -116,7 +127,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list )
m_FullFootprintList.Clear(); m_FullFootprintList.Clear();
BOOST_FOREACH( FOOTPRINT & footprint, list ) { BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) {
msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1, msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1,
footprint.m_Module.GetData() ); footprint.m_Module.GetData() );
m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg );
...@@ -142,7 +153,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, ...@@ -142,7 +153,7 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component,
m_FilteredFootprintList.Clear(); m_FilteredFootprintList.Clear();
BOOST_FOREACH( FOOTPRINT & footprint, list ) { BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) {
/* Search for matching footprints */ /* Search for matching footprints */
for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ ) for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ )
{ {
...@@ -236,7 +247,7 @@ END_EVENT_TABLE() ...@@ -236,7 +247,7 @@ END_EVENT_TABLE()
void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event ) void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
/********************************************************/ /********************************************************/
{ {
FOOTPRINT* Module; FOOTPRINT_INFO* Module;
wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint();
Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints ); Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints );
...@@ -269,18 +280,6 @@ void FOOTPRINTS_LISTBOX::OnLeftDClick( wxListEvent& event ) ...@@ -269,18 +280,6 @@ void FOOTPRINTS_LISTBOX::OnLeftDClick( wxListEvent& event )
} }
FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName,
FOOTPRINT_LIST& list )
{
BOOST_FOREACH( FOOTPRINT & footprint, list ) {
if( footprint.m_Module == FootprintName )
return &footprint;
}
return NULL;
}
/** /**
* Function OnChar * Function OnChar
* called on a key pressed * called on a key pressed
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "dialog_cvpcb_config.h" #include "dialog_cvpcb_config.h"
...@@ -110,7 +109,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) : ...@@ -110,7 +109,6 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
DrawFrame = NULL; DrawFrame = NULL;
m_HToolBar = NULL; m_HToolBar = NULL;
m_modified = false; m_modified = false;
m_rightJustify = false;
m_isEESchemaNetlist = false; m_isEESchemaNetlist = false;
m_KeepCvpcbOpen = false; m_KeepCvpcbOpen = false;
m_undefinedComponentCnt = 0; m_undefinedComponentCnt = 0;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "cvpcb.h" #include "cvpcb.h"
#include "zones.h" #include "zones.h"
#include "bitmaps.h" #include "bitmaps.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "colors_selection.h" #include "colors_selection.h"
#include "cvpcb_id.h" #include "cvpcb_id.h"
......
...@@ -19,14 +19,6 @@ ...@@ -19,14 +19,6 @@
#define FILTERFOOTPRINTKEY "FilterFootprint" #define FILTERFOOTPRINTKEY "FilterFootprint"
/* Net list types. */
#define TYPE_NON_SPECIFIE 0
#define TYPE_ORCADPCB2 1
#define TYPE_PCAD 2
#define TYPE_VIEWLOGIC_WIR 3
#define TYPE_VIEWLOGIC_NET 4
class PIN class PIN
{ {
public: public:
...@@ -76,23 +68,6 @@ typedef boost::ptr_vector< COMPONENT > COMPONENT_LIST; ...@@ -76,23 +68,6 @@ typedef boost::ptr_vector< COMPONENT > COMPONENT_LIST;
extern bool operator<( const COMPONENT& item1, const COMPONENT& item2 ); extern bool operator<( const COMPONENT& item1, const COMPONENT& item2 );
class FOOTPRINT
{
public:
wxString m_Module; /* Module name. */
wxString m_LibName; /* Name of the library containing this module. */
int m_Num; /* Order number in the display list. */
wxString m_Doc; /* Footprint description. */
wxString m_KeyWord; /* Footprint key words. */
FOOTPRINT();
};
typedef boost::ptr_vector< FOOTPRINT > FOOTPRINT_LIST;
/* FOOTPRINT object list sort function. */
extern bool operator<( const FOOTPRINT& item1, const FOOTPRINT& item2 );
extern const wxString FootprintAliasFileExtension; extern const wxString FootprintAliasFileExtension;
extern const wxString RetroFileExtension; extern const wxString RetroFileExtension;
extern const wxString ComponentFileExtension; extern const wxString ComponentFileExtension;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <wx/filename.h> #include <wx/filename.h>
#include "param_config.h" #include "param_config.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "footprint_info.h"
/* Forward declarations of all top-level window classes. */ /* Forward declarations of all top-level window classes. */
class FOOTPRINTS_LISTBOX; class FOOTPRINTS_LISTBOX;
...@@ -41,7 +42,6 @@ public: ...@@ -41,7 +42,6 @@ public:
protected: protected:
int m_undefinedComponentCnt; int m_undefinedComponentCnt;
bool m_modified; bool m_modified;
bool m_rightJustify;
bool m_isEESchemaNetlist; bool m_isEESchemaNetlist;
PARAM_CFG_ARRAY m_projectFileParams; PARAM_CFG_ARRAY m_projectFileParams;
...@@ -90,7 +90,9 @@ public: ...@@ -90,7 +90,9 @@ public:
void SaveProjectFile( const wxString& fileName ); void SaveProjectFile( const wxString& fileName );
virtual void LoadSettings(); virtual void LoadSettings();
virtual void SaveSettings(); virtual void SaveSettings();
/** DisplayStatus()
/**
* Function DisplayStatus()
* Displays info to the status line at bottom of the main frame * Displays info to the status line at bottom of the main frame
*/ */
void DisplayStatus(); void DisplayStatus();
...@@ -108,6 +110,20 @@ public: ...@@ -108,6 +110,20 @@ public:
*/ */
bool LoadFootprintFiles( ); bool LoadFootprintFiles( );
/**
* function GenNetlistPcbnew
* writes the output netlist file
*
*/
int GenNetlistPcbnew( FILE* f, bool isEESchemaNetlist = true );
/**
* Function LoadComponentFile
* Loads the .cmp file that stores the component/footprint association.
* @param aCmpFileName = the full filename of .cmp file to load
*/
bool LoadComponentFile( const wxString& aCmpFileName );
PARAM_CFG_ARRAY& GetProjectFileParameters( void ); PARAM_CFG_ARRAY& GetProjectFileParameters( void );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
/* Forward declarations of all top-level window classes. */ /* Forward declarations of all top-level window classes. */
class CVPCB_MAINFRAME; class CVPCB_MAINFRAME;
/*********************************************************************/ /*********************************************************************/
/* ListBox (base class) to display lists of components or footprints */ /* ListBox (base class) to display lists of components or footprints */
/*********************************************************************/ /*********************************************************************/
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "cvpcb.h" #include "cvpcb.h"
//#include "protos.h" //#include "protos.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "footprint_info.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
......
/*
* @file footprint_info.h
*/
#ifndef _FOOTPRINT_INFO_H_
#define _FOOTPRINT_INFO_H_
#include "kicad_string.h"
/*
* class FOOTPRINT_INFO is a helper class to handle the list of footprints
* available in libraries
* It stores footprint names, doc and keywords
*/
class FOOTPRINT_INFO
{
public:
wxString m_Module; /* Module name. */
wxString m_LibName; /* Name of the library containing this module. */
int m_Num; /* Order number in the display list. */
wxString m_Doc; /* Footprint description. */
wxString m_KeyWord; /* Footprint key words. */
FOOTPRINT_INFO()
{
m_Num = 0;
}
};
typedef boost::ptr_vector< FOOTPRINT_INFO > FOOTPRINT_LIST;
/* FOOTPRINT object list sort function. */
inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 )
{
return ( StrNumICmp( item1.m_Module.GetData(),
item2.m_Module.GetData() ) < 0 );
}
#endif // _FOOTPRINT_INFO_H_
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "macros.h" #include "macros.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
......
/*****************/
/* genorcad.cpp */
/*****************/
/*
* Create the netlist (* NET) by placing the *.lib ref FORMAT ORCADPCB
* The value (share value) is truncated to 16 letters.
*/
#include "fctsys.h"
#include "common.h"
#include "cvpcb.h"
#include "protos.h"
#define MAX_LEN_NETNAME 16
static void TriPinsModule( COMPONENT* CurrentCmp );
static void ChangePinNet( wxString& PinNet, bool rightJustify );
int NetNumCode; /* Number of used for NetNames created during
* reallocation of NetNames. */
int genorcad( bool rightJustify )
{
char Line[1024];
PIN* Pin;
COMPONENT* CurrentCmp;
wxString Title = wxGetApp().GetAppName() + wxT( " " ) + GetBuildVersion();
NetNumCode = 1; DateAndTime( Line );
fprintf( dest, "( { Netlist by %s, date = %s }\n",
CONV_TO_UTF8( Title ), Line );
CurrentCmp = BaseListeCmp;
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
{
fprintf( dest, " ( %s ", CONV_TO_UTF8( CurrentCmp->m_TimeStamp ) );
if( !CurrentCmp->m_Module.IsEmpty() )
fprintf( dest, CONV_TO_UTF8( CurrentCmp->m_Module ) );
else
fprintf( dest, "$noname$" );
fprintf( dest, " %s ", CONV_TO_UTF8( CurrentCmp->m_Reference ) );
fprintf( dest, "%s\n", CONV_TO_UTF8( CurrentCmp->m_Value ) );
/* Sort pins. */
TriPinsModule( CurrentCmp );
Pin = CurrentCmp->m_Pins;
for( ; Pin != NULL; Pin = Pin->Pnext )
{
if( Pin->m_PinNet.Len() > MAX_LEN_NETNAME )
ChangePinNet( Pin->m_PinNet, rightJustify );
if( !Pin->m_PinNet.IsEmpty() )
fprintf( dest, " ( %s %s )\n",
CONV_TO_UTF8( Pin->m_PinNum ),
CONV_TO_UTF8( Pin->m_PinNet ) );
else
fprintf( dest, " ( %s ? )\n", CONV_TO_UTF8( Pin->m_PinNum ) );
}
fprintf( dest, " )\n" );
}
fprintf( dest, ")\n*\n" );
fclose( dest );
return 0;
}
/* Sort pins */
static void TriPinsModule( COMPONENT* CurrentCmp )
{
PIN* Pin, * NextPin, ** BasePin;
int nbpins = 0, ii;
Pin = CurrentCmp->m_Pins;
if( Pin == NULL )
return;
for( ; Pin != NULL; Pin = Pin->Pnext )
nbpins++;
BasePin = (PIN**) MyZMalloc( nbpins * sizeof(PIN*) );
Pin = CurrentCmp->m_Pins;
for( ii = 0; ii < nbpins; ii++, Pin = Pin->Pnext )
{
BasePin[ii] = Pin;
}
qsort( BasePin, nbpins, sizeof( COMPONENT*), PinCompare );
for( ii = 0; ii < nbpins - 1; ii++ )
{
BasePin[ii]->Pnext = BasePin[ii + 1];
}
BasePin[ii]->Pnext = NULL;
CurrentCmp->m_Pins = BasePin[0];
MyFree( BasePin );
/* Remove duplicate pins. */
Pin = CurrentCmp->m_Pins;
while( Pin != NULL )
{
NextPin = Pin->Pnext;
if( NextPin == NULL )
break;
if( Pin->m_PinNum != NextPin->m_PinNum )
{
Pin = Pin->Pnext; continue;
}
/* Successive 2 pins have the same number. */
if( Pin->m_PinNet != NextPin->m_PinNet )
{
wxString msg;
msg.Printf( _( "%s %s pin %s : Different Nets" ),
CurrentCmp->m_Reference.GetData(),
CurrentCmp->m_Value.GetData(),
Pin->m_PinNum.GetData() );
DisplayError( NULL, msg, 60 );
}
Pin->Pnext = NextPin->Pnext;
delete NextPin;
}
}
/* ???
*
* Change le NetName PinNet par un nom compose des 8 derniers codes de PinNet
* suivi de _Xnnnnn ou nnnnn est un nom de 0 a 99999
*/
static void ChangePinNet( wxString& PinNet, bool rightJustify )
{
PIN* Pin;
COMPONENT* CurrentCmp;
int ii;
wxString OldName;
wxString NewName;
OldName = PinNet;
ii = PinNet.Len();
if( rightJustify ) /* Retain the last 8 letters of the name. */
{
NewName = OldName.Right( 8 ); NewName << NetNumCode;
}
else /* Retains the 8 first letters of the name. */
{
NewName = OldName.Left( 8 ); NewName << NetNumCode;
}
NetNumCode++;
CurrentCmp = BaseListeCmp;
for( ; CurrentCmp != NULL; CurrentCmp = CurrentCmp->Pnext )
{
Pin = CurrentCmp->m_Pins;
for( ; Pin != NULL; Pin = Pin->Pnext )
{
if( Pin->m_PinNet != OldName )
continue;
Pin->m_PinNet = NewName;
}
}
}
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
...@@ -85,7 +84,7 @@ bool CVPCB_MAINFRAME::ReadNetList() ...@@ -85,7 +84,7 @@ bool CVPCB_MAINFRAME::ReadNetList()
return false; return false;
} }
LoadComponentFile( m_NetlistFileName.GetFullPath(), m_components ); LoadComponentFile( m_NetlistFileName.GetFullPath() );
if( m_ListCmp == NULL ) if( m_ListCmp == NULL )
return false; return false;
...@@ -155,8 +154,7 @@ int CVPCB_MAINFRAME::SaveNetList( const wxString& fileName ) ...@@ -155,8 +154,7 @@ int CVPCB_MAINFRAME::SaveNetList( const wxString& fileName )
return 0; return 0;
} }
GenNetlistPcbnew( netlist, m_components, m_isEESchemaNetlist, GenNetlistPcbnew( netlist, m_isEESchemaNetlist );
m_rightJustify );
return 1; return 1;
} }
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "common.h" #include "common.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "cvpcb_id.h" #include "cvpcb_id.h"
......
...@@ -18,11 +18,12 @@ ...@@ -18,11 +18,12 @@
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "richio.h" #include "richio.h"
#include "filter_reader.h" #include "filter_reader.h"
#include "footprint_info.h"
#include "dialog_load_error.h" #include "dialog_load_error.h"
/* /*
* Read the list of libraries (*.mod files) and generate a m_footprints of modules. * Read the list of libraries (*.mod files) and populates m_footprints ( list of availaible modules in libs ).
* for each module are stored * for each module are stored
* the module name * the module name
* documentation string * documentation string
...@@ -111,7 +112,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) ...@@ -111,7 +112,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( )
{ {
line += 7; line += 7;
FOOTPRINT* ItemLib = new FOOTPRINT(); FOOTPRINT_INFO* ItemLib = new FOOTPRINT_INFO();
ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( line ) ); ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( line ) );
ItemLib->m_LibName = libname; ItemLib->m_LibName = libname;
m_footprints.push_back( ItemLib ); m_footprints.push_back( ItemLib );
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
#include "richio.h" #include "richio.h"
......
/**************/
/** protos.h **/
/**************/
#ifndef PROTOS_H
#define PROTOS_H
extern int GenNetlistPcbnew( FILE* f, COMPONENT_LIST& list,
bool isEESchemaNetlist = true,
bool rightJustify = false );
extern bool LoadComponentFile( const wxString& fileName,
COMPONENT_LIST& list );
FOOTPRINT* GetModuleDescrByName( const wxString& FootprintName,
FOOTPRINT_LIST& list );
#endif // PROTOS_H
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
#include "macros.h" #include "macros.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "richio.h" #include "richio.h"
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "build_version.h" #include "build_version.h"
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
/* File header. */ /* File header. */
char EnteteCmpMod[] = { "Cmp-Mod V01" }; char EnteteCmpMod[] = { "Cmp-Mod V01" };
const wxString titleComponentLibErr( _( "Component Library Error" ) ); #define titleComponentLibErr _( "Component Library Error" )
/* /*
...@@ -70,7 +69,7 @@ int CVPCB_MAINFRAME::SaveComponentList( const wxString& NetlistFullFileName ) ...@@ -70,7 +69,7 @@ int CVPCB_MAINFRAME::SaveComponentList( const wxString& NetlistFullFileName )
/* /*
* Load list of associated components and footprints. * Load list of associated components and footprints.
*/ */
bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list ) bool CVPCB_MAINFRAME::LoadComponentFile( const wxString& fileName )
{ {
wxString timestamp, valeur, ilib, namecmp, msg; wxString timestamp, valeur, ilib, namecmp, msg;
bool read_cmp_data = FALSE, eof = FALSE; bool read_cmp_data = FALSE, eof = FALSE;
...@@ -173,7 +172,7 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list ) ...@@ -173,7 +172,7 @@ bool LoadComponentFile( const wxString& fileName, COMPONENT_LIST& list )
/* Search corresponding component and NetList /* Search corresponding component and NetList
* Update its parameters. */ * Update its parameters. */
BOOST_FOREACH( COMPONENT& component, list ) BOOST_FOREACH( COMPONENT& component, m_components )
{ {
if( namecmp != component.m_Reference ) if( namecmp != component.m_Reference )
continue; continue;
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvstruct.h" #include "cvstruct.h"
#include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h"
...@@ -21,6 +20,7 @@ ...@@ -21,6 +20,7 @@
#include "3d_viewer.h" #include "3d_viewer.h"
extern FOOTPRINT_INFO* GetModuleDescrByName( const wxString& FootprintName, FOOTPRINT_LIST& list );
/* /*
* Create or Update the frame showing the current highlighted footprint * Create or Update the frame showing the current highlighted footprint
...@@ -48,7 +48,7 @@ void CVPCB_MAINFRAME::CreateScreenCmp() ...@@ -48,7 +48,7 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
{ {
msg = _( "Footprint: " ) + FootprintName; msg = _( "Footprint: " ) + FootprintName;
DrawFrame->SetTitle( msg ); DrawFrame->SetTitle( msg );
FOOTPRINT* Module = GetModuleDescrByName( FootprintName, m_footprints ); FOOTPRINT_INFO* Module = GetModuleDescrByName( FootprintName, m_footprints );
msg = _( "Lib: " ); msg = _( "Lib: " );
if( Module ) if( Module )
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "bitmaps.h" #include "bitmaps.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h"
#include "cvpcb_mainframe.h" #include "cvpcb_mainframe.h"
#include "cvpcb_id.h" #include "cvpcb_id.h"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "cvpcb.h" #include "cvpcb.h"
#include "protos.h" #include "cvpcb_mainframe.h"
static void WriteFootprintFilterInfos( FILE* dest, COMPONENT_LIST& list ); static void WriteFootprintFilterInfos( FILE* dest, COMPONENT_LIST& list );
...@@ -64,8 +64,7 @@ static void RemoveDuplicatePins( COMPONENT& component ) ...@@ -64,8 +64,7 @@ static void RemoveDuplicatePins( COMPONENT& component )
* a value less than zero. Check all printf() return values and * a value less than zero. Check all printf() return values and
* return a true(pass) or false(fail) to the caller. * return a true(pass) or false(fail) to the caller.
*/ */
int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist, int CVPCB_MAINFRAME::GenNetlistPcbnew( FILE* file,bool isEESchemaNetlist )
bool rightJustify )
{ {
#define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1" #define NETLIST_HEAD_STRING "EESchema Netlist Version 1.1"
char Line[1024]; char Line[1024];
...@@ -78,7 +77,7 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist, ...@@ -78,7 +77,7 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
fprintf( file, "( { netlist created %s }\n", Line ); fprintf( file, "( { netlist created %s }\n", Line );
BOOST_FOREACH( COMPONENT& component, list ) BOOST_FOREACH( COMPONENT& component, m_components )
{ {
fprintf( file, " ( %s ", CONV_TO_UTF8( component.m_TimeStamp ) ); fprintf( file, " ( %s ", CONV_TO_UTF8( component.m_TimeStamp ) );
...@@ -111,7 +110,7 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist, ...@@ -111,7 +110,7 @@ int GenNetlistPcbnew( FILE* file, COMPONENT_LIST& list, bool isEESchemaNetlist,
fprintf( file, ")\n*\n" ); fprintf( file, ")\n*\n" );
if( isEESchemaNetlist ) if( isEESchemaNetlist )
WriteFootprintFilterInfos( file, list ); WriteFootprintFilterInfos( file, m_components );
fclose( file ); fclose( file );
return 0; return 0;
......
Cmp-Mod V01 Created by CvPCB (2011-02-04 BZR 2793)-testing date = 05/02/2011 15:42:18 Cmp-Mod V01 Created by CvPCB (2011-02-21 BZR 2827)-testing date = 21/02/2011 18:31:31
BeginCmp
TimeStamp = /322D3011;
Reference = BUS1;
ValeurCmp = BUSPC;
IdModule = BUS_PC;
EndCmp
BeginCmp
TimeStamp = /32307DE2;
Reference = C1;
ValeurCmp = 47uF;
IdModule = CP6;
EndCmp
BeginCmp
TimeStamp = /32307ECF;
Reference = C2;
ValeurCmp = 47pF;
IdModule = C1;
EndCmp
BeginCmp
TimeStamp = /32307ED4;
Reference = C3;
ValeurCmp = 47pF;
IdModule = C1;
EndCmp
BeginCmp
TimeStamp = /32307DCF;
Reference = C4;
ValeurCmp = 47uF;
IdModule = CP6;
EndCmp
BeginCmp
TimeStamp = /32307DCA;
Reference = C5;
ValeurCmp = 47uF;
IdModule = CP6;
EndCmp
BeginCmp
TimeStamp = /32307DC0;
Reference = C6;
ValeurCmp = 47uF;
IdModule = CP6;
EndCmp
BeginCmp
TimeStamp = /322D32AC;
Reference = D1;
ValeurCmp = LED;
IdModule = LEDV;
EndCmp
BeginCmp
TimeStamp = /322D32BE;
Reference = D2;
ValeurCmp = LED;
IdModule = LEDV;
EndCmp
BeginCmp
TimeStamp = /32568D1E;
Reference = JP1;
ValeurCmp = CONN_8X2;
IdModule = pin_array_8x2;
EndCmp
BeginCmp
TimeStamp = /3256759C;
Reference = P1;
ValeurCmp = DB25FEMELLE;
IdModule = DB25FC;
EndCmp
BeginCmp
TimeStamp = /32307EA1;
Reference = R1;
ValeurCmp = 100K;
IdModule = R3;
EndCmp
BeginCmp
TimeStamp = /32307EAA;
Reference = R2;
ValeurCmp = 1K;
IdModule = R3;
EndCmp
BeginCmp
TimeStamp = /324002E6;
Reference = R3;
ValeurCmp = 10K;
IdModule = R3;
EndCmp
BeginCmp
TimeStamp = /322D3295;
Reference = R4;
ValeurCmp = 330;
IdModule = R3;
EndCmp
BeginCmp
TimeStamp = /322D32A0;
Reference = R5;
ValeurCmp = 330;
IdModule = R3;
EndCmp
BeginCmp
TimeStamp = /325679C1;
Reference = RR1;
ValeurCmp = 9x1K;
IdModule = r_pack9;
EndCmp
BeginCmp
TimeStamp = /322D31F4;
Reference = U1;
ValeurCmp = 74LS245;
IdModule = 20dip300;
EndCmp
BeginCmp
TimeStamp = /322D35B4;
Reference = U2;
ValeurCmp = 74LS688;
IdModule = 20dip300;
EndCmp
BeginCmp
TimeStamp = /4A087146;
Reference = U3;
ValeurCmp = 74LS541;
IdModule = ;
EndCmp
BeginCmp
TimeStamp = /3240023F;
Reference = U5;
ValeurCmp = 628128;
IdModule = 32dip600;
EndCmp
BeginCmp
TimeStamp = /322D321C;
Reference = U8;
ValeurCmp = EP600;
IdModule = 24dip300;
EndCmp
BeginCmp
TimeStamp = /322D32FA;
Reference = U9;
ValeurCmp = 4003APG120;
IdModule = PGA120;
EndCmp
BeginCmp
TimeStamp = /32307EC0;
Reference = X1;
ValeurCmp = 8MHz;
IdModule = HC-18UH;
EndCmp
EndListe EndListe
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment