Commit 077fff6f authored by charras's avatar charras

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
...@@ -5,6 +5,12 @@ Please add newer entries at the top, list the date and your name with ...@@ -5,6 +5,12 @@ Please add newer entries at the top, list the date and your name with
email address. 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> 2009-Nov-5 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
++all ++all
......
...@@ -126,12 +126,12 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent, ...@@ -126,12 +126,12 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
m_auimgr.AddPane(m_HToolBar, m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top()); wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top());
m_auimgr.AddPane(m_DialogWin,
wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).Center());
m_auimgr.AddPane(m_CommandWin, m_auimgr.AddPane(m_CommandWin,
wxAuiPaneInfo().Name(wxT("m_CommandWin")).CentrePane()); wxAuiPaneInfo().Name(wxT("m_CommandWin")).CentrePane());
m_auimgr.AddPane(m_DialogWin,
wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).CentrePane());
m_auimgr.AddPane(m_LeftWin, m_auimgr.AddPane(m_LeftWin,
wxAuiPaneInfo(horiz).Name(wxT("m_LeftWin")).Left().BestSize(clientsize.x/3,clientsize.y)); wxAuiPaneInfo(horiz).Name(wxT("m_LeftWin")).Left().BestSize(clientsize.x/3,clientsize.y));
m_auimgr.Update(); m_auimgr.Update();
...@@ -215,6 +215,10 @@ void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event ) ...@@ -215,6 +215,10 @@ void WinEDA_MainFrame::OnSashDrag( wxSashEvent& event )
void WinEDA_MainFrame::OnSize( wxSizeEvent& event ) void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
/************************************************/ /************************************************/
{ {
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#else
if( m_CommandWin && m_BottomWin ) if( m_CommandWin && m_BottomWin )
{ {
int w, h, dy; int w, h, dy;
...@@ -236,9 +240,6 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event ) ...@@ -236,9 +240,6 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
layout.LayoutFrame( this ); layout.LayoutFrame( this );
if( m_CommandWin ) if( m_CommandWin )
m_CommandWin->Refresh( TRUE ); m_CommandWin->Refresh( TRUE );
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif #endif
event.Skip(); event.Skip();
} }
......
...@@ -141,12 +141,6 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const ...@@ -141,12 +141,6 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const
wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL netclass") ); wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL netclass") );
#endif #endif
} }
else
{
#ifdef __WXDEBUG__
wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetNetClass(): NULL net") );
#endif
}
if( netclass ) if( netclass )
return netclass; return netclass;
......
...@@ -203,6 +203,7 @@ void D_PAD::Copy( D_PAD* source ) ...@@ -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_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_Attribut = source->m_Attribut; // NORMAL, PAD_SMD, PAD_CONN, Bit 7 = STACK
m_Orient = source->m_Orient; // en 1/10 degres m_Orient = source->m_Orient; // en 1/10 degres
m_LocalClearance = source->m_LocalClearance;
m_LocalSolderMaskMargin = source->m_LocalSolderMaskMargin; m_LocalSolderMaskMargin = source->m_LocalSolderMaskMargin;
m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin; m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin;
m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio; m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio;
...@@ -213,6 +214,38 @@ void D_PAD::Copy( D_PAD* source ) ...@@ -213,6 +214,38 @@ void D_PAD::Copy( D_PAD* source )
m_ShortNetname = source->m_ShortNetname; 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: // Mask margins handling:
......
...@@ -143,7 +143,18 @@ public: ...@@ -143,7 +143,18 @@ public:
} }
// Mask margins handling: /**
* 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 /** Function GetSolderMaskMargin
* @return the margin for the solder mask layer * @return the margin for the solder mask layer
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -17,19 +17,20 @@ ...@@ -17,19 +17,20 @@
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/statline.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/statbox.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DialogPadPropertiesBase /// Class DIALOG_PAD_PROPERTIES_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DialogPadPropertiesBase : public wxDialog class DIALOG_PAD_PROPERTIES_BASE : public wxDialog
{ {
private: private:
...@@ -49,19 +50,65 @@ class DialogPadPropertiesBase : public wxDialog ...@@ -49,19 +50,65 @@ class DialogPadPropertiesBase : public wxDialog
wxTextCtrl* m_PadNumCtrl; wxTextCtrl* m_PadNumCtrl;
wxStaticText* m_PadNameText; wxStaticText* m_PadNameText;
wxTextCtrl* m_PadNetNameCtrl; wxTextCtrl* m_PadNetNameCtrl;
wxBoxSizer* m_PadPositionBoxSizer; wxStaticText* m_staticText4;
wxTextCtrl* m_PadPosition_X_Ctrl;
wxStaticText* m_PadPosX_Unit;
wxStaticText* m_staticText41;
wxTextCtrl* m_PadPosition_Y_Ctrl;
wxStaticText* m_PadPosY_Unit;
wxStaticLine* m_staticline7;
wxStaticLine* m_staticline8;
wxStaticLine* m_staticline9;
wxStaticText* m_textPadDrillX;
wxTextCtrl* m_PadDrill_X_Ctrl;
wxStaticText* m_PadDrill_X_Unit;
wxStaticText* m_textPadDrillY;
wxTextCtrl* m_PadDrill_Y_Ctrl;
wxStaticText* m_PadDrill_Y_Unit;
wxStaticLine* m_staticline4;
wxStaticLine* m_staticline5;
wxStaticLine* m_staticline6;
wxStaticText* m_staticText12;
wxTextCtrl* m_ShapeSize_X_Ctrl;
wxStaticText* m_PadShapeSizeX_Unit;
wxStaticText* m_staticText15;
wxTextCtrl* m_ShapeSize_Y_Ctrl;
wxStaticText* m_PadShapeSizeY_Unit;
wxStaticText* m_staticText17;
wxTextCtrl* m_ShapeOffset_X_Ctrl;
wxStaticText* m_PadShapeOffsetX_Unit;
wxStaticText* m_staticText19;
wxTextCtrl* m_ShapeOffset_Y_Ctrl;
wxStaticText* m_PadShapeOffsetY_Unit;
wxStaticText* m_staticText21;
wxTextCtrl* m_ShapeDelta_X_Ctrl;
wxStaticText* m_PadShapeDeltaX_Unit;
wxStaticText* m_staticText23;
wxTextCtrl* m_ShapeDelta_Y_Ctrl;
wxStaticText* m_PadShapeDeltaY_Unit;
wxBoxSizer* m_DrillShapeBoxSizer; wxBoxSizer* m_DrillShapeBoxSizer;
wxRadioBox* m_PadShape; wxRadioBox* m_PadShape;
wxRadioBox* m_DrillShapeCtrl; wxRadioBox* m_DrillShapeCtrl;
wxRadioBox* m_PadOrient; wxRadioBox* m_PadOrient;
wxStaticText* m_PadOrientText; wxStaticText* m_PadOrientText;
wxTextCtrl* m_PadOrientCtrl; wxTextCtrl* m_PadOrientCtrl;
wxStaticText* m_staticText20;
wxStaticText* m_staticTextNetClearance;
wxTextCtrl* m_NetClearanceValueCtrl;
wxStaticText* m_NetClearanceUnits;
wxStaticLine* m_staticline1;
wxStaticLine* m_staticline2;
wxStaticLine* m_staticline3;
wxStaticText* m_MaskClearanceTitle;
wxTextCtrl* m_SolderMaskMarginCtrl;
wxStaticText* m_SolderMaskMarginUnits;
wxStaticText* m_staticTextSolderPaste;
wxTextCtrl* m_SolderPasteMarginCtrl;
wxStaticText* m_SolderPasteMarginUnits;
wxStaticText* m_staticTextRatio;
wxTextCtrl* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits;
wxRadioBox* m_PadType; wxRadioBox* m_PadType;
wxButton* m_buttonOk;
wxButton* m_buttonCancel;
wxCheckBox* m_PadLayerCu; wxCheckBox* m_PadLayerCu;
wxCheckBox* m_PadLayerCmp; wxCheckBox* m_PadLayerCmp;
...@@ -76,19 +123,22 @@ class DialogPadPropertiesBase : public wxDialog ...@@ -76,19 +123,22 @@ class DialogPadPropertiesBase : public wxDialog
wxCheckBox* m_PadLayerECO1; wxCheckBox* m_PadLayerECO1;
wxCheckBox* m_PadLayerECO2; wxCheckBox* m_PadLayerECO2;
wxCheckBox* m_PadLayerDraft; wxCheckBox* m_PadLayerDraft;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnPadShapeSelection( wxCommandEvent& event ){ event.Skip(); } virtual void OnPadShapeSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnDrillShapeSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnDrillShapeSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void PadOrientEvent( wxCommandEvent& event ){ event.Skip(); } virtual void PadOrientEvent( wxCommandEvent& event ){ event.Skip(); }
virtual void PadTypeSelected( wxCommandEvent& event ){ event.Skip(); } virtual void PadTypeSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); }
public: public:
DialogPadPropertiesBase( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 520,396 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER ); DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 673,466 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER );
~DialogPadPropertiesBase(); ~DIALOG_PAD_PROPERTIES_BASE();
}; };
......
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