Commit 79b6e427 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: netlist.cpp: code cleaning. Comments added and updated

parent 1a8e4510
...@@ -269,6 +269,18 @@ public: ...@@ -269,6 +269,18 @@ public:
*/ */
void SetLastNetListRead( const wxString& aNetListFile ); void SetLastNetListRead( const wxString& aNetListFile );
/**
* Function Test_Duplicate_Missing_And_Extra_Footprints
* Build a list of duplicate, missing and extra footprints
* from the current board and a netlist netlist :
* Shows 3 lists:
* 1 - duplicate footprints on board
* 2 - missing footprints (found in netlist but not on board)
* 3 - footprints not in netlist but on board
* @param aNetlistFullFilename = the full filename netlist
*/
void Test_Duplicate_Missing_And_Extra_Footprints( const wxString& aNetlistFullFilename );
/** /**
* Function OnHotKey. * Function OnHotKey.
* ** Commands are case insensitive ** * ** Commands are case insensitive **
...@@ -1044,17 +1056,16 @@ public: ...@@ -1044,17 +1056,16 @@ public:
// netlist handling: // netlist handling:
void InstallNetlistFrame( wxDC* DC, const wxPoint& pos ); void InstallNetlistFrame( wxDC* DC );
/** /**
* Function ReadPcbNetlist * Function ReadPcbNetlist
* Update footprints (load missing footprints and delete on request extra * Update footprints (load missing footprints and delete on demand extra
* footprints) * footprints)
* Update connectivity info ( Net Name list ) * Update connectivity info, references, values and "TIME STAMP"
* Update Reference, value and "TIME STAMP"
* @param aNetlistFullFilename = netlist file name (*.net) * @param aNetlistFullFilename = netlist file name (*.net)
* @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found, * @param aCmpFullFileName = cmp/footprint link file name (*.cmp).
* only the netlist will be used * if not found, only the netlist will be used
* @param aMessageWindow = a reference to a wxTextCtrl where to display messages. * @param aMessageWindow = a reference to a wxTextCtrl where to display messages.
* can be NULL * can be NULL
* @param aChangeFootprint if true, footprints that have changed in netlist will be changed * @param aChangeFootprint if true, footprints that have changed in netlist will be changed
...@@ -1064,20 +1075,6 @@ public: ...@@ -1064,20 +1075,6 @@ public:
* footprints from components (use after reannotation of the * footprints from components (use after reannotation of the
* schematic) * schematic)
* @return true if Ok * @return true if Ok
*
* the format of the netlist is something like:
# EESchema Netlist Version 1.0 generee le 18/5/2005-12:30:22
* (
* ( 40C08647 $noname R20 4,7K {Lib=R}
* ( 1 VCC )
* ( 2 MODB_1 )
* )
* ( 40C0863F $noname R18 4,7_k {Lib=R}
* ( 1 VCC )
* ( 2 MODA_1 )
* )
* }
* #End
*/ */
bool ReadPcbNetlist( const wxString& aNetlistFullFilename, bool ReadPcbNetlist( const wxString& aNetlistFullFilename,
const wxString& aCmpFullFileName, const wxString& aCmpFullFileName,
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
; General Product Description Definitions ; General Product Description Definitions
!define PRODUCT_NAME "KiCad" !define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.04.28" !define PRODUCT_VERSION "2011.04.29"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/" !define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/" !define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME "" !define COMPANY_NAME ""
......
...@@ -291,22 +291,15 @@ void MODULE::Flip(const wxPoint& aCentre ) ...@@ -291,22 +291,15 @@ void MODULE::Flip(const wxPoint& aCentre )
void MODULE::SetPosition( const wxPoint& newpos ) void MODULE::SetPosition( const wxPoint& newpos )
{ {
int deltaX = newpos.x - m_Pos.x; wxPoint delta = newpos - m_Pos;
int deltaY = newpos.y - m_Pos.y;
m_Pos.x += deltaX; m_Pos += delta;
m_Pos.y += deltaY; m_Reference->m_Pos += delta;
m_Value->m_Pos += delta;
m_Reference->m_Pos.x += deltaX;
m_Reference->m_Pos.y += deltaY;
m_Value->m_Pos.x += deltaX;
m_Value->m_Pos.y += deltaY;
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() ) for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
{ {
pad->m_Pos.x += deltaX; pad->m_Pos += delta;
pad->m_Pos.y += deltaY;
} }
EDA_ITEM* PtStruct = m_Drawings; EDA_ITEM* PtStruct = m_Drawings;
...@@ -325,8 +318,7 @@ void MODULE::SetPosition( const wxPoint& newpos ) ...@@ -325,8 +318,7 @@ void MODULE::SetPosition( const wxPoint& newpos )
case TYPE_TEXTE_MODULE: case TYPE_TEXTE_MODULE:
{ {
TEXTE_MODULE* pt_texte = (TEXTE_MODULE*) PtStruct; TEXTE_MODULE* pt_texte = (TEXTE_MODULE*) PtStruct;
pt_texte->m_Pos.x += deltaX; pt_texte->m_Pos += delta;
pt_texte->m_Pos.y += deltaY;
break; break;
} }
...@@ -357,7 +349,7 @@ void MODULE::SetOrientation( int newangle ) ...@@ -357,7 +349,7 @@ void MODULE::SetOrientation( int newangle )
pad->m_Orient += newangle; /* change m_Orientation */ pad->m_Orient += newangle; /* change m_Orientation */
NORMALIZE_ANGLE_POS( pad->m_Orient ); NORMALIZE_ANGLE_POS( pad->m_Orient );
RotatePoint( &px, &py, (int) m_Orient ); RotatePoint( &px, &py, m_Orient );
pad->m_Pos.x = m_Pos.x + px; pad->m_Pos.x = m_Pos.x + px;
pad->m_Pos.y = m_Pos.y + py; pad->m_Pos.y = m_Pos.y + py;
} }
......
...@@ -14,13 +14,7 @@ ...@@ -14,13 +14,7 @@
#include "dialog_netlist.h" #include "dialog_netlist.h"
extern void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* frame, void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC )
const wxString& NetlistFullFilename,
BOARD* Pcb );
void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
{ {
/* Setup the netlist file name to the last net list file read or the board file /* Setup the netlist file name to the last net list file read or the board file
* name if no last file read is not set. * name if no last file read is not set.
...@@ -62,8 +56,7 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC, ...@@ -62,8 +56,7 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,
Init(); Init();
if( GetSizer() ) GetSizer()->SetSizeHints( this );
GetSizer()->SetSizeHints( this );
} }
...@@ -117,8 +110,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event ) ...@@ -117,8 +110,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event ) void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event )
{ {
TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(), m_Parent->Test_Duplicate_Missing_And_Extra_Footprints( m_NetlistFilenameCtrl->GetValue() );
m_Parent->GetBoard() );
} }
......
...@@ -217,7 +217,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -217,7 +217,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_GET_NETLIST: case ID_GET_NETLIST:
InstallNetlistFrame( &dc, wxPoint( -1, -1 ) ); InstallNetlistFrame( &dc );
break; break;
case ID_GET_TOOLS: case ID_GET_TOOLS:
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/** /**
* These strings are used in menus and tools, that do the same command * These strings are used in menus and tools, that do the same command
* But they are internatinalized, and therefore must be created * But they are internationalized, and therefore must be created
* at run time, on the fly. * at run time, on the fly.
* So they cannot be static. * So they cannot be static.
* *
......
This diff is collapsed.
release version: release version:
2011 apr 28 2011 apr 29
files (.zip,.tgz): files (.zip,.tgz):
kicad-2011-04-28 kicad-2011-04-29
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