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
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
......
......@@ -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();
}
......
......@@ -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;
......
......@@ -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:
......
......@@ -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
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -17,19 +17,20 @@
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/statline.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DialogPadPropertiesBase
/// Class DIALOG_PAD_PROPERTIES_BASE
///////////////////////////////////////////////////////////////////////////////
class DialogPadPropertiesBase : public wxDialog
class DIALOG_PAD_PROPERTIES_BASE : public wxDialog
{
private:
......@@ -49,19 +50,65 @@ class DialogPadPropertiesBase : public wxDialog
wxTextCtrl* m_PadNumCtrl;
wxStaticText* m_PadNameText;
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;
wxRadioBox* m_PadShape;
wxRadioBox* m_DrillShapeCtrl;
wxRadioBox* m_PadOrient;
wxStaticText* m_PadOrientText;
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;
wxButton* m_buttonOk;
wxButton* m_buttonCancel;
wxCheckBox* m_PadLayerCu;
wxCheckBox* m_PadLayerCmp;
......@@ -76,19 +123,22 @@ class DialogPadPropertiesBase : public wxDialog
wxCheckBox* m_PadLayerECO1;
wxCheckBox* m_PadLayerECO2;
wxCheckBox* m_PadLayerDraft;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnPadShapeSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnDrillShapeSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void PadOrientEvent( 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 PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); }
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 );
~DialogPadPropertiesBase();
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 );
~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