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

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

parent 1a8e4510
Loading
Loading
Loading
Loading
+17 −20
Original line number Diff line number Diff line
@@ -269,6 +269,18 @@ public:
     */
    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.
     *  ** Commands are case insensitive **
@@ -1044,17 +1056,16 @@ public:


    // netlist  handling:
    void         InstallNetlistFrame( wxDC* DC, const wxPoint& pos );
    void         InstallNetlistFrame( wxDC* DC );

    /**
     * Function ReadPcbNetlist
     * Update footprints (load missing footprints and delete on request extra
     * Update footprints (load missing footprints and delete on demand extra
     * footprints)
     * Update connectivity info ( Net Name list )
     * Update Reference, value and "TIME STAMP"
     * Update connectivity info, references, values and "TIME STAMP"
     * @param aNetlistFullFilename = netlist file name (*.net)
     * @param aCmpFullFileName = cmp/footprint list file name (*.cmp) if not found,
     * only the netlist will be used
     * @param aCmpFullFileName = cmp/footprint link file name (*.cmp).
      *                         if not found, only the netlist will be used
     * @param aMessageWindow = a reference to a wxTextCtrl where to display messages.
     *                  can be NULL
     * @param aChangeFootprint if true, footprints that have changed in netlist will be changed
@@ -1064,20 +1075,6 @@ public:
     *                             footprints from components (use after reannotation of the
     *                             schematic)
     * @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,
                         const wxString&  aCmpFullFileName,
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

; General Product Description Definitions
!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 SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME ""
+7 −15
Original line number Diff line number Diff line
@@ -291,22 +291,15 @@ void MODULE::Flip(const wxPoint& aCentre )

void MODULE::SetPosition( const wxPoint& newpos )
{
    int deltaX = newpos.x - m_Pos.x;
    int deltaY = newpos.y - m_Pos.y;
    wxPoint delta = newpos - m_Pos;

    m_Pos.x += deltaX;
    m_Pos.y += deltaY;

    m_Reference->m_Pos.x += deltaX;
    m_Reference->m_Pos.y += deltaY;

    m_Value->m_Pos.x += deltaX;
    m_Value->m_Pos.y += deltaY;
    m_Pos += delta;
    m_Reference->m_Pos += delta;
    m_Value->m_Pos += delta;

    for( D_PAD* pad = m_Pads;  pad;  pad = pad->Next() )
    {
        pad->m_Pos.x += deltaX;
        pad->m_Pos.y += deltaY;
        pad->m_Pos += delta;
    }

    EDA_ITEM* PtStruct = m_Drawings;
@@ -325,8 +318,7 @@ void MODULE::SetPosition( const wxPoint& newpos )
        case TYPE_TEXTE_MODULE:
        {
            TEXTE_MODULE* pt_texte = (TEXTE_MODULE*) PtStruct;
            pt_texte->m_Pos.x += deltaX;
            pt_texte->m_Pos.y += deltaY;
            pt_texte->m_Pos += delta;
            break;
        }

@@ -357,7 +349,7 @@ void MODULE::SetOrientation( int newangle )
        pad->m_Orient += newangle; /* change m_Orientation */
        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.y = m_Pos.y + py;
    }
+3 −11
Original line number Diff line number Diff line
@@ -14,13 +14,7 @@

#include "dialog_netlist.h"

extern void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow*       frame,
                                                            const wxString& NetlistFullFilename,
                                                            BOARD*          Pcb );



void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC )
{
    /* 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.
@@ -62,7 +56,6 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,

    Init();

    if( GetSizer() )
    GetSizer()->SetSizeHints( this );
}

@@ -117,8 +110,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )

void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event )
{
    TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(),
                                                    m_Parent->GetBoard() );
    m_Parent->Test_Duplicate_Missing_And_Extra_Footprints( m_NetlistFilenameCtrl->GetValue() );
}


+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
        break;

    case ID_GET_NETLIST:
        InstallNetlistFrame( &dc, wxPoint( -1, -1 ) );
        InstallNetlistFrame( &dc );
        break;

    case ID_GET_TOOLS:
Loading