Commit 077fff6f authored by charras's avatar charras
Browse files

Pcbnew: control of masks clearance: Pad Editor Dialog rewritten to handle...

Pcbnew: control of masks clearance: Pad Editor Dialog rewritten to handle local mask clearances and a local Net clearance
parent f65ae5cd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5,6 +5,12 @@ Please add newer entries at the top, list the date and your name with
email address.


2009-Nov-05 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
    control of masks clearance: Pad Editor Dialog rewritten to handle mask clearances
    and a locad Net clearance

2009-Nov-5 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++all
+7 −6
Original line number Diff line number Diff line
@@ -126,12 +126,12 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
    m_auimgr.AddPane(m_HToolBar,
        wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top());

    m_auimgr.AddPane(m_DialogWin,
        wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).Center());

    m_auimgr.AddPane(m_CommandWin,
        wxAuiPaneInfo().Name(wxT("m_CommandWin")).CentrePane());

    m_auimgr.AddPane(m_DialogWin,
        wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).CentrePane());

    m_auimgr.AddPane(m_LeftWin,
        wxAuiPaneInfo(horiz).Name(wxT("m_LeftWin")).Left().BestSize(clientsize.x/3,clientsize.y));
    m_auimgr.Update();
@@ -215,6 +215,10 @@ void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event )
void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
/************************************************/
{
#if defined(KICAD_AUIMANAGER)
   if(m_auimgr.GetManagedWindow())
       m_auimgr.Update();
#else
    if( m_CommandWin && m_BottomWin )
    {
        int    w, h, dy;
@@ -236,9 +240,6 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
    layout.LayoutFrame( this );
    if( m_CommandWin )
        m_CommandWin->Refresh( TRUE );
#if defined(KICAD_AUIMANAGER)
   if(m_auimgr.GetManagedWindow())
       m_auimgr.Update();
#endif
    event.Skip();
}
+0 −6
Original line number Diff line number Diff line
@@ -141,12 +141,6 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const
            wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL netclass") );
#endif
    }
    else
    {
#ifdef __WXDEBUG__
        wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL net") );
#endif
    }

    if( netclass )
        return netclass;
+33 −0
Original line number Diff line number Diff line
@@ -203,6 +203,7 @@ void D_PAD::Copy( D_PAD* source )
    m_PadShape = source->m_PadShape;                            // forme CERCLE, PAD_RECT PAD_OVAL PAD_TRAPEZOID ou libre
    m_Attribut = source->m_Attribut;                            // NORMAL, PAD_SMD, PAD_CONN, Bit 7 = STACK
    m_Orient   = source->m_Orient;                              // en 1/10 degres
    m_LocalClearance  = source->m_LocalClearance;
    m_LocalSolderMaskMargin  = source->m_LocalSolderMaskMargin;
    m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin;
    m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio;
@@ -213,6 +214,38 @@ void D_PAD::Copy( D_PAD* source )
    m_ShortNetname = source->m_ShortNetname;
}

/** Virtual function GetClearance
 * returns the clearance in 1/10000 inches.  If \a aItem is not NULL then the
 * returned clearance is the greater of this object's NETCLASS clearance and
 * aItem's NETCLASS clearance.  If \a aItem is NULL, then this objects clearance
 * is returned.
 * @param aItem is another BOARD_CONNECTED_ITEM or NULL
 * @return int - the clearance in 1/10000 inches.
*/
int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
{
    int clearance = m_LocalClearance;
    if ( clearance == 0 )
    {
        if( GetParent() && ((MODULE*)GetParent())->m_LocalClearance )
            clearance = ((MODULE*)GetParent())->m_LocalClearance;
    }

    if( clearance == 0 )
        return BOARD_CONNECTED_ITEM::GetClearance( aItem );

    if( aItem )
    {
        NETCLASS*   hisclass = aItem->GetNetClass();
        if( hisclass )
        {
            int hisClearance = hisclass->GetClearance();
            return max( hisClearance, clearance );
        }
    }

    return clearance;
}

// Mask margins handling:

+12 −1
Original line number Diff line number Diff line
@@ -143,6 +143,17 @@ public:
    }


     /**
     * Function GetClearance
     * returns the clearance in 1/10000 inches.  If \a aItem is not NULL then the
     * returned clearance is the greater of this object's NETCLASS clearance and
     * aItem's NETCLASS clearance.  If \a aItem is NULL, then this objects clearance
     * is returned.
     * @param aItem is another BOARD_CONNECTED_ITEM or NULL
     * @return int - the clearance in 1/10000 inches.
     */
    virtual int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const;

   // Mask margins handling:

    /** Function GetSolderMaskMargin
Loading